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

Commit f2cf7e29 authored by Varun Shah's avatar Varun Shah
Browse files

Remove flag for persisting restore-to-rare apps list.

This feature has been rolled out in A16.

Fixes: 410454106
Test: atest UsageStatsDatabaseTest
Test: atest AppIdleHistoryTests
Flag: EXEMPT removing com.android.server.usage.persist_restore_to_rare_apps_list
Change-Id: I641467b7d683cce1160b54f7aad5bedc3f24194f
parent 13ce26a9
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -7,14 +7,3 @@ flag {
    description: "Adjust the default bucket evaluation parameters"
    bug: "379909479"
}

flag {
    name: "persist_restore_to_rare_apps_list"
    namespace: "backstage_power"
    description: "Persist the list of apps which are put in the RARE bucket upon restore."
    is_fixed_read_only: true
    bug: "383766428"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+5 −12
Original line number Diff line number Diff line
@@ -1705,16 +1705,12 @@ public class AppStandbyController
        }
        // Clear out the list of restored apps that need to have their standby buckets adjusted
        // if they still haven't been installed two days after initial restore.
        final long delayMillis = Flags.persistRestoreToRareAppsList()
                ? AppIdleHistory.RESTORE_TO_RARE_APPS_LIST_EXPIRY : 8 * ONE_HOUR;
        mHandler.postDelayed(() -> mAppsToRestoreToRare.remove(userId), delayMillis);
        mHandler.postDelayed(() -> mAppsToRestoreToRare.remove(userId),
                AppIdleHistory.RESTORE_TO_RARE_APPS_LIST_EXPIRY);

        // Persist the file in case the device reboots within 2 days after the initial restore.
        if (Flags.persistRestoreToRareAppsList()) {
        synchronized (mAppIdleLock) {
                mAppIdleHistory.writeRestoreToRareAppsList(
                        userId, mAppsToRestoreToRare.get(userId));
            }
            mAppIdleHistory.writeRestoreToRareAppsList(userId, mAppsToRestoreToRare.get(userId));
        }
    }

@@ -2279,8 +2275,7 @@ public class AppStandbyController
                    clearAppIdleForPackage(pkgName, userId);
                } else {
                    // Do a lazy read of the persisted list, if necessary.
                    if (Flags.persistRestoreToRareAppsList()
                            && mAppsToRestoreToRare.get(userId) == null) {
                    if (mAppsToRestoreToRare.get(userId) == null) {
                        synchronized (mAppIdleLock) {
                            final ArraySet<String> restoredApps =
                                    mAppIdleHistory.readRestoreToRareAppsList(userId);
@@ -2464,8 +2459,6 @@ public class AppStandbyController
        pw.println("Flags: ");
        pw.println("    " + Flags.FLAG_ADJUST_DEFAULT_BUCKET_ELEVATION_PARAMS
                + ": " + Flags.adjustDefaultBucketElevationParams());
        pw.println("    " + Flags.FLAG_PERSIST_RESTORE_TO_RARE_APPS_LIST
                + ": " + Flags.persistRestoreToRareAppsList());
        pw.println();

        synchronized (mCarrierPrivilegedLock) {