Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 362e7bee authored by Joël Stemmer's avatar Joël Stemmer Committed by Android (Google) Code Review
Browse files

Merge "Cleanup use new backup eligibility rules feature flag" into main

parents 09da6e0a d8601bc7
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -44,9 +44,6 @@ public class FeatureFlagUtils {
    public static final String SETTINGS_DO_NOT_RESTORE_PRESERVED =
            "settings_do_not_restore_preserved";
    /** @hide */
    public static final String SETTINGS_USE_NEW_BACKUP_ELIGIBILITY_RULES
            = "settings_use_new_backup_eligibility_rules";
    /** @hide */
    public static final String SETTINGS_ENABLE_SECURITY_HUB = "settings_enable_security_hub";
    /** @hide */
    public static final String SETTINGS_SUPPORT_LARGE_SCREEN = "settings_support_large_screen";
@@ -193,7 +190,6 @@ public class FeatureFlagUtils {

        DEFAULT_FLAGS.put("settings_tether_all_in_one", "false");
        DEFAULT_FLAGS.put("settings_contextual_home", "false");
        DEFAULT_FLAGS.put(SETTINGS_USE_NEW_BACKUP_ELIGIBILITY_RULES, "true");
        DEFAULT_FLAGS.put(SETTINGS_ENABLE_SECURITY_HUB, "true");
        DEFAULT_FLAGS.put(SETTINGS_SUPPORT_LARGE_SCREEN, "true");
        DEFAULT_FLAGS.put("settings_search_always_expand", "true");
+0 −12
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ import android.text.TextUtils;
import android.util.ArraySet;
import android.util.AtomicFile;
import android.util.EventLog;
import android.util.FeatureFlagUtils;
import android.util.Pair;
import android.util.Slog;
import android.util.SparseArray;
@@ -3977,11 +3976,6 @@ public class UserBackupManagerService {
    @BackupDestination
    int getBackupDestinationFromTransport(TransportConnection transportConnection)
            throws TransportNotAvailableException, RemoteException {
        if (!shouldUseNewBackupEligibilityRules()) {
            // Return the default to stick to the legacy behaviour.
            return BackupDestination.CLOUD;
        }

        final long oldCallingId = Binder.clearCallingIdentity();
        try {
            BackupTransportClient transport =
@@ -4002,12 +3996,6 @@ public class UserBackupManagerService {
        }
    }

    @VisibleForTesting
    boolean shouldUseNewBackupEligibilityRules() {
        return FeatureFlagUtils.isEnabled(
                mContext, FeatureFlagUtils.SETTINGS_USE_NEW_BACKUP_ELIGIBILITY_RULES);
    }

    public IBackupManager getBackupManagerBinder() {
        return mBackupManagerBinder;
    }
+0 −10
Original line number Diff line number Diff line
@@ -254,10 +254,6 @@ public class UserBackupManagerServiceTest {
    @Test
    public void testGetBackupDestinationFromTransport_returnsDeviceTransferForD2dTransport()
            throws Exception {
        // This is a temporary flag to control the new behaviour until it's ready to be fully
        // rolled out.
        mService.shouldUseNewBackupEligibilityRules = true;

        when(mTransportConnection.connectOrThrow(any())).thenReturn(mBackupTransport);
        when(mBackupTransport.getTransportFlags()).thenReturn(
                BackupAgent.FLAG_DEVICE_TO_DEVICE_TRANSFER);
@@ -295,7 +291,6 @@ public class UserBackupManagerServiceTest {

    private class TestBackupService extends UserBackupManagerService {
        boolean isEnabledStatePersisted = false;
        boolean shouldUseNewBackupEligibilityRules = false;

        TestBackupService() {
            super(mUserId, mContext, mPackageManager, mOperationStorage, mTransportManager,
@@ -326,11 +321,6 @@ public class UserBackupManagerServiceTest {
        @Override
        void updateStateOnBackupEnabled(boolean wasEnabled, boolean enable) {}

        @Override
        boolean shouldUseNewBackupEligibilityRules() {
            return shouldUseNewBackupEligibilityRules;
        }

        @Override
        BackupManagerMonitorEventSender getBMMEventSender(IBackupManagerMonitor monitor) {
            return mBackupManagerMonitorEventSender;