OSDN Git Service

ShortcutManager: rescan all apps after next OTA
authorMakoto Onuki <omakoto@google.com>
Tue, 2 Aug 2016 18:39:19 +0000 (11:39 -0700)
committerMakoto Onuki <omakoto@google.com>
Tue, 2 Aug 2016 18:42:55 +0000 (11:42 -0700)
- Normally when a user is unlocked, SM scans all updated apps
since the last scan to see if their manifest shortcuts have changed.

- There was a known issue that's been fixed already that'd result
in all shortcuts being removed.

- To work around this issue, let's scan all packages after the next
user unlock.

- This can be done by just renaming the XML attribute name to persist
the last app scan time.

Bug 30591723

Change-Id: Ie9f723ef30a1c991990d981193841cb203c094ad

services/core/java/com/android/server/pm/ShortcutUser.java

index 21e4165..ce3ed9c 100644 (file)
@@ -57,7 +57,9 @@ class ShortcutUser {
 
     private static final String ATTR_VALUE = "value";
     private static final String ATTR_KNOWN_LOCALES = "locales";
-    private static final String ATTR_LAST_APP_SCAN_TIME = "last-app-scan-time";
+
+    // Suffix "2" was added to force rescan all packages after the next OTA.
+    private static final String ATTR_LAST_APP_SCAN_TIME = "last-app-scan-time2";
     private static final String KEY_USER_ID = "userId";
     private static final String KEY_LAUNCHERS = "launchers";
     private static final String KEY_PACKAGES = "packages";