Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:SDK-2025 -- [Android] Remove unused code #1085

Merged
merged 11 commits into from
Jul 31, 2023
44 changes: 0 additions & 44 deletions .gitlab-ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@
<item>INITIATE_PURCHASE</item>
<item>ADD_PAYMENT_INFO</item>
<item>PURCHASE</item>
<item>SPEND_CREDITS</item>
<item>SEARCH</item>
<item>VIEW_ITEM</item>
<item>VIEW_ITEMS</item>
Expand Down
5 changes: 0 additions & 5 deletions Branch-SDK-TestBed/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ plugins {
dependencies {
implementation(project(":Branch-SDK"))
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")

/* Add chrome custom tabs for guaranteed matching */
implementation("androidx.browser:browser:1.0.0") {
exclude(module = "support-v4")
}
implementation("com.android.billingclient:billing:6.0.1")

androidTestImplementation("androidx.test.ext:junit:1.1.5")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
package io.branch.referral.test.mock;

import static io.branch.referral.Defines.RequestPath.GetCPID;
import static io.branch.referral.Defines.RequestPath.GetURL;
import static io.branch.referral.Defines.RequestPath.IdentifyUser;
import static io.branch.referral.Defines.RequestPath.QRCode;
import static io.branch.referral.Defines.RequestPath.RegisterInstall;
import static io.branch.referral.Defines.RequestPath.RegisterOpen;

import org.json.JSONObject;

import java.util.UUID;

import io.branch.referral.Branch;
import io.branch.referral.BranchTest;
import io.branch.referral.PrefHelper;
import io.branch.referral.network.BranchRemoteInterface;

import static io.branch.referral.Defines.RequestPath.GetCPID;
import static io.branch.referral.Defines.RequestPath.QRCode;
import static io.branch.referral.Defines.RequestPath.GetCreditHistory;
import static io.branch.referral.Defines.RequestPath.GetCredits;
import static io.branch.referral.Defines.RequestPath.GetURL;
import static io.branch.referral.Defines.RequestPath.IdentifyUser;
import static io.branch.referral.Defines.RequestPath.RegisterInstall;
import static io.branch.referral.Defines.RequestPath.RegisterOpen;

public class MockRemoteInterface extends BranchRemoteInterface {
private final static String TAG = "MockRemoteInterface";

Expand Down
181 changes: 2 additions & 179 deletions Branch-SDK/src/main/java/io/branch/referral/Branch.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,61 +86,7 @@ public class Branch implements BranchViewHandler.IBranchViewEvents, SystemObserv
* are shared with others directly as a user action, via social media for instance.
*/
public static final String FEATURE_TAG_SHARE = "share";

/**
* Hard-coded {@link String} that denotes a 'referral' tag; applies to links that are associated
* with a referral program, incentivized or not.
*/
public static final String FEATURE_TAG_REFERRAL = "referral";

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final String FEATURE_TAG_INVITE = "invite";

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final String FEATURE_TAG_DEAL = "deal";

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final String FEATURE_TAG_GIFT = "gift";

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final String REDEEM_CODE = "$redeem_code";

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final String REFERRAL_BUCKET_DEFAULT = "default";

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final String REFERRAL_CODE_TYPE = "credit";

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final int REFERRAL_CREATION_SOURCE_SDK = 2;

/**
* @deprecated Referral feature has been deprecated.
*/
@Deprecated
public static final String REFERRAL_CODE = "referral_code";

/**
* The redirect URL provided when the link is handled by a desktop client.
*/
Expand Down Expand Up @@ -233,37 +179,7 @@ public class Branch implements BranchViewHandler.IBranchViewEvents, SystemObserv
* Possible values are "true" or "false"
*/
public static final String ALWAYS_DEEPLINK = "$always_deeplink";

/**
* An {@link Integer} value indicating the user to reward for applying a referral code. In this
* case, the user applying the referral code receives credit.
*/
public static final int REFERRAL_CODE_LOCATION_REFERREE = 0;

/**
* An {@link Integer} value indicating the user to reward for applying a referral code. In this
* case, the user who created the referral code receives credit.
*/
public static final int REFERRAL_CODE_LOCATION_REFERRING_USER = 2;

/**
* An {@link Integer} value indicating the user to reward for applying a referral code. In this
* case, both the creator and applicant receive credit
*/
public static final int REFERRAL_CODE_LOCATION_BOTH = 3;

/**
* An {@link Integer} value indicating the calculation type of the referral code. In this case,
* the referral code can be applied continually.
*/
public static final int REFERRAL_CODE_AWARD_UNLIMITED = 1;

/**
* An {@link Integer} value indicating the calculation type of the referral code. In this case,
* a user can only apply a specific referral code once.
*/
public static final int REFERRAL_CODE_AWARD_UNIQUE = 0;


/**
* An {@link Integer} value indicating the link type. In this case, the link can be used an
* unlimited number of times.
Expand Down Expand Up @@ -920,6 +836,7 @@ public static void setIsUserAgentSync(boolean sync){
void closeSessionInternal() {
clearPartnerParameters();
executeClose();
prefHelper_.setSessionParams(PrefHelper.NO_STRING_VALUE);
prefHelper_.setExternalIntentUri(null);
trackingController.updateTrackingState(context_); // Update the tracking state for next cold start
}
Expand All @@ -937,15 +854,8 @@ void clearPendingRequests() {
*/
private void executeClose() {
if (initState_ != SESSION_STATE.UNINITIALISED) {
ServerRequest req = new ServerRequestRegisterClose(context_);
if (closeRequestNeeded) {
handleNewRequest(req);
} else {
req.onRequestSucceeded(null, null);
}
setInitState(SESSION_STATE.UNINITIALISED);
}
closeRequestNeeded = false;
}

public static void registerPlugin(String name, String version) {
Expand Down Expand Up @@ -1238,82 +1148,6 @@ public void logout(LogoutStatusListener callback) {
}
}

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void loadRewards() { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void loadRewards(BranchReferralStateChangedListener callback) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public int getCredits() { /* no-op */ return 0; }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public int getCreditsForBucket(String bucket) { /* no-op */ return 0; }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void redeemRewards(int count) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void redeemRewards(int count, BranchReferralStateChangedListener callback) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void redeemRewards(@NonNull final String bucket, final int count) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void redeemRewards(@NonNull final String bucket,
final int count, BranchReferralStateChangedListener callback) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void getCreditHistory(BranchListResponseListener callback) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void getCreditHistory(@NonNull final String bucket, BranchListResponseListener
callback) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void getCreditHistory(@NonNull final String afterId, final int length,
@NonNull final CreditHistoryOrder order, BranchListResponseListener callback) { /* no-op */ }

/**
* @deprecated Referral feature has been deprecated. This is no-op.
*/
@Deprecated
public void getCreditHistory(final String bucket, final String afterId, final int length,
@NonNull final CreditHistoryOrder order, BranchListResponseListener callback) { /* no-op */ }

/**
* <p>A void call to indicate that the user has performed a specific action and for that to be
* reported to the Branch API, with additional app-defined meta data to go along with that action.</p>
Expand Down Expand Up @@ -2051,10 +1885,6 @@ public void handleNewRequest(ServerRequest req) {
PrefHelper.Debug("Branch is not initialized, cannot logout");
return;
}
if ((req instanceof ServerRequestRegisterClose)) {
PrefHelper.Debug("Branch is not initialized, cannot close session");
return;
}
if (requestNeedsSession(req)) {
req.addProcessWaitLock(ServerRequest.PROCESS_WAIT_LOCK.SDK_INIT_WAIT_LOCK);
}
Expand Down Expand Up @@ -2271,13 +2101,6 @@ public interface LogoutStatusListener {
void onLogoutFinished(boolean loggedOut, BranchError error);
}

/**
* <p>enum containing the sort options for return of credit history.</p>
*/
public enum CreditHistoryOrder {
kMostRecentFirst, kLeastRecentFirst
}

/**
* Async Task to create a short link for synchronous methods
*/
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions Branch-SDK/src/main/java/io/branch/referral/BranchError.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ public class BranchError {
public static final int ERR_NO_SESSION = -101;
/* Error processing request since app doesn't have internet permission. */
public static final int ERR_NO_INTERNET_PERMISSION = -102;
/* Error processing request since referral code provided is invalid. */
@Deprecated public static final int ERR_INVALID_REFERRAL_CODE = -103;
/* Error processing request since Branch is not initialised. */
public static final int ERR_BRANCH_INIT_FAILED = -104;
/* Error processing request since alias is already used. */
public static final int ERR_BRANCH_DUPLICATE_URL = -105;
@Deprecated public static final int ERR_BRANCH_DUPLICATE_REFERRAL_CODE = -106;
@Deprecated public static final int ERR_BRANCH_REDEEM_REWARD = -107;
/* Error with API level below 14. */
public static final int ERR_API_LVL_14_NEEDED = -108;
/* Error Branch is not instantiated. */
Expand Down
Loading