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

Commit 2a041567 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Remove `persist_incomplete_restore_data` flag.

Flag: EXEMPT flag cleanup
Fixes: 409611463
Test: TH
Change-Id: I23fb42a96a818367434778cb7d541d845454feac
parent f8f213e1
Loading
Loading
Loading
Loading
+8 −15
Original line number Diff line number Diff line
@@ -354,11 +354,9 @@ public class PreferencesHelper implements RankingConfig {
            // when data is loaded from disk it's loaded as USER_ALL, but restored data that
            // is pending app install needs the user id that the data was restored to
            int fixedUserId = userId;
            if (Flags.persistIncompleteRestoreData()) {
            if (!forRestore && uid == UNKNOWN_UID) {
                fixedUserId = parser.getAttributeInt(null, ATT_USERID, USER_SYSTEM);
            }
            }
            PackagePreferences r = getOrCreatePackagePreferencesLocked(
                    name, fixedUserId, uid,
                    appImportance,
@@ -550,11 +548,9 @@ public class PreferencesHelper implements RankingConfig {
            r.visibility = visibility;
            r.showBadge = showBadge;
            r.bubblePreference = bubblePreference;
            if (Flags.persistIncompleteRestoreData()) {
            if (r.uid == UNKNOWN_UID) {
                r.creationTime = creationTime;
            }
            }

            try {
                createDefaultChannelIfNeededLocked(r);
@@ -563,17 +559,14 @@ public class PreferencesHelper implements RankingConfig {
            }

            if (r.uid == UNKNOWN_UID) {
                if (Flags.persistIncompleteRestoreData()) {
                r.userIdWhenUidUnknown = userId;
                }
                mRestoredWithoutUids.put(unrestoredPackageKey(pkg, userId), r);
            } else {
                mPackagePreferences.put(key, r);
            }
        }
        if (r.uid == UNKNOWN_UID) {
            if (Flags.persistIncompleteRestoreData()
                    && PREF_GRACE_PERIOD_MS < (mClock.millis() - r.creationTime)) {
            if (PREF_GRACE_PERIOD_MS < (mClock.millis() - r.creationTime)) {
                mRestoredWithoutUids.remove(unrestoredPackageKey(pkg, userId));
            }
        }
@@ -702,7 +695,7 @@ public class PreferencesHelper implements RankingConfig {
                writePackageXml(r, out, notifPermissions, forBackup);
            }

            if (Flags.persistIncompleteRestoreData() && !forBackup) {
            if (!forBackup) {
                final int M = mRestoredWithoutUids.size();
                for (int i = 0; i < M; i++) {
                    final PackagePreferences r = mRestoredWithoutUids.valueAt(i);
@@ -766,7 +759,7 @@ public class PreferencesHelper implements RankingConfig {
            }
        }

        if (Flags.persistIncompleteRestoreData() && r.uid == UNKNOWN_UID) {
        if (r.uid == UNKNOWN_UID) {
            out.attributeLong(null, ATT_CREATION_TIME, r.creationTime);
            out.attributeInt(null, ATT_USERID, r.userIdWhenUidUnknown);
        }
+0 −7
Original line number Diff line number Diff line
@@ -81,13 +81,6 @@ flag {
  bug: "270456865"
}

flag {
  name: "persist_incomplete_restore_data"
  namespace: "systemui"
  description: "Stores restore data for not-yet-installed pkgs for 48 hours"
  bug: "334999659"
}

flag {
  name: "trace_cancel_events"
  namespace: "systemui"
+0 −5
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ import static com.android.internal.config.sysui.SystemUiSystemPropertiesFlags.No
import static com.android.internal.util.FrameworkStatsLog.PACKAGE_NOTIFICATION_PREFERENCES__FSI_STATE__DENIED;
import static com.android.internal.util.FrameworkStatsLog.PACKAGE_NOTIFICATION_PREFERENCES__FSI_STATE__GRANTED;
import static com.android.internal.util.FrameworkStatsLog.PACKAGE_NOTIFICATION_PREFERENCES__FSI_STATE__NOT_REQUESTED;
import static com.android.server.notification.Flags.FLAG_PERSIST_INCOMPLETE_RESTORE_DATA;
import static com.android.server.notification.NotificationChannelLogger.NotificationChannelEvent.NOTIFICATION_CHANNEL_UPDATED_BY_USER;
import static com.android.server.notification.PreferencesHelper.DEFAULT_BUBBLE_PREFERENCE;
import static com.android.server.notification.PreferencesHelper.LockableAppFields.USER_LOCKED_PROMOTABLE;
@@ -202,7 +201,6 @@ import java.util.concurrent.ThreadLocalRandom;

@SmallTest
@RunWith(ParameterizedAndroidJunit4.class)
@EnableFlags(FLAG_PERSIST_INCOMPLETE_RESTORE_DATA)
public class PreferencesHelperTest extends UiServiceTestCase {
    private static final int UID_HEADLESS = 1000000;
    private static final UserHandle USER = UserHandle.of(0);
@@ -1573,7 +1571,6 @@ public class PreferencesHelperTest extends UiServiceTestCase {
    }

    @Test
    @EnableFlags(Flags.FLAG_PERSIST_INCOMPLETE_RESTORE_DATA)
    public void testRestoreXml_delayedRestore() throws Exception {
        // simulate package not installed
        when(mPm.getPackageUidAsUser(PKG_R, USER_SYSTEM)).thenReturn(UNKNOWN_UID);
@@ -1614,7 +1611,6 @@ public class PreferencesHelperTest extends UiServiceTestCase {
    }

    @Test
    @EnableFlags(Flags.FLAG_PERSIST_INCOMPLETE_RESTORE_DATA)
    public void testRestoreXml_delayedRestore_afterReboot() throws Exception {
        // load restore data
        ArrayMap<Pair<Integer, String>, Pair<Boolean, Boolean>> appPermissions = new ArrayMap<>();
@@ -1666,7 +1662,6 @@ public class PreferencesHelperTest extends UiServiceTestCase {
    }

    @Test
    @EnableFlags(Flags.FLAG_PERSIST_INCOMPLETE_RESTORE_DATA)
    public void testRestoreXml_delayedRestore_packageMissingAfterTwoDays() throws Exception {
        // load restore data
        ArrayMap<Pair<Integer, String>, Pair<Boolean, Boolean>> appPermissions = new ArrayMap<>();