Loading services/core/java/com/android/server/notification/PreferencesHelper.java +8 −15 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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); Loading @@ -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)); } } Loading Loading @@ -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); Loading Loading @@ -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); } Loading services/core/java/com/android/server/notification/flags.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -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" Loading services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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); Loading Loading @@ -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<>(); Loading Loading @@ -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<>(); Loading Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +8 −15 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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); Loading @@ -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)); } } Loading Loading @@ -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); Loading Loading @@ -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); } Loading
services/core/java/com/android/server/notification/flags.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -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" Loading
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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); Loading Loading @@ -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<>(); Loading Loading @@ -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<>(); Loading