OSDN Git Service

Avoid strict mode violation in shortcut manager on user-unlock
authorMakoto Onuki <omakoto@google.com>
Tue, 12 Dec 2017 00:38:11 +0000 (16:38 -0800)
committerMakoto Onuki <omakoto@google.com>
Tue, 12 Dec 2017 00:49:54 +0000 (16:49 -0800)
commit708703bf39801027b616bcc43c650889bf0ef571
tree92e3d4cefe0edaa9f96892a3a56f5641edb01334
parent454c831d1d66e19eb282d0f99c7a682db4a9ae9d
Avoid strict mode violation in shortcut manager on user-unlock

- The issue is the shortcut host information was stored in ShortcutUser, which
is per-user shortcut information that's persisted in the disk. Even though in
the onUnlockUser sequence we only need to "set" a package name, in order to
access the ShortcutUser instance for the target user, we'd need to load the
per-user information from the disk.

- Luckily the host packages don't need to be persisted, so let's just move
it to another structure which is just kept in memory.

Bug: 70526858
Test: Manual test (boot, unlock user, unlock secondary user)
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Change-Id: Ic4b842c4a3a08a7f0e678ce328e9d4ee08fd4069
services/core/java/com/android/server/pm/ShortcutNonPersistentUser.java [new file with mode: 0644]
services/core/java/com/android/server/pm/ShortcutService.java
services/core/java/com/android/server/pm/ShortcutUser.java