History log of /frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bf563b63e5d3672ec102ee191a301e49e472139b 04-May-2017 Makoto Onuki <omakoto@google.com> Show warning log when ShortcutInfo is re-published

Bug 37986391
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: Id9ca30068440915d2e86850fe2ed3684c0ce2af8
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
01ce92b8ac98da3887515e4aa85353ac6cbcbd01 28-Apr-2017 Makoto Onuki <omakoto@google.com> Move the last user save from onCleanupUser to onStopUser

Bug: 37780857

Test: manual test with work profile

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Change-Id: I8b053c6a55df374a89ab85d76b9d36abf639f649
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
92e3da2354484d1dce64413c97d4605addb7f64a 07-Apr-2017 Hyunyoung Song <hyunyoungs@google.com> Update API, add more documentation on AdaptiveIconDrawable

and fix multiple miscellaneous bugs.

Bug: 37079814
Bug: 37100106
Bug: 34829216

Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java
Test: $ runtest --path=frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/grpahics/drawable/AdaptiveIconDrawableTest.java

Change-Id: I0f5b2232853031bf3860ebea2736e894d17e4d2e
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
ef7dff2563ccbe74564ab3b417d810a04df556e7 03-Apr-2017 Makoto Onuki <omakoto@google.com> Merge "Revert "Push chooser targets to the shortcut manager."" into oc-dev
82fb2eb057032bb7f38f547fb3667c7bf2547517 01-Apr-2017 Makoto Onuki <omakoto@google.com> Handle disabled packages as removed.

Bug 36600272
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: I272334cef00337d5ba01ce4b878c799d9476432f
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
99302b55c6a960c9078ad2c84ae9be3296bd32f3 29-Mar-2017 Makoto Onuki <omakoto@google.com> Revert "Push chooser targets to the shortcut manager."

This reverts commit 58fc95dc578244b7beb687a48184045dcce788b8.

Bug 36186790
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 CtsShortcutHostTestCases
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

Also all unit tests, except for the known failrues.
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: I733ee7e12a419ee7ea17ca67c56afe7b039d189a
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
d0010c5ef12ccf0b5c20e7c12cf86def990b4feb 30-Mar-2017 Makoto Onuki <omakoto@google.com> Fix broken unit tests due to mockito upgrade.

Bug 36781317

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: Ie9abcd8bdf5353c96ebade0e8489f667ef9904ee
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
e4179e2c4e674b32390a9133bb9fbb3ef5df651b 01-Mar-2017 Hyunyoung Song <hyunyoungs@google.com> Change MaskableBitmap to AdaptiveBitmap
Test: $ make dist -j30
b/35399620

Change-Id: I96d6eaceaf7ce9dec7de21634a5fa2bd40b0deba
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
58fc95dc578244b7beb687a48184045dcce788b8 14-Dec-2016 Hakan Seyalioglu <hseya@google.com> Push chooser targets to the shortcut manager.

More info at go/direct-share-push

Test: Some basic testing currently in, more to be added.

Change-Id: I069f9779988c3eca2c4d8b83ec62501983854355
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
be8835e86bc39570994af32ead381875e3ee54d5 17-Feb-2017 Hyunyoung Song <hyunyoungs@google.com> Change MaskableIconDrawable to AdaptiveIconDrawable

Test: $ make -j31 dist

Bug: 35399620
Change-Id: I5e54f75b3df21ffe546e0e54dbd7ea29499d1789
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
f281e7afae14f61e1d031f55cc80c59d0b39b528 13-Feb-2017 Hyunyoung Song <hyunyoungs@google.com> ShortcutManager should support MaskableBitmap Icon type

Note: https://ag/1872683/ is where initial code review happened.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases -t 'android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest'
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.LauncherAppsProfileTest'


b/34196580

Change-Id: I3b983c29387e474c7a8c687a524105ceaceac81e
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
de3c16c8057b61bb3cc2e0c3d5603730f5841c51 26-Jan-2017 Makoto Onuki <omakoto@google.com> Do not allow work profile to see main other profiles

It won't throw SecurityException, but it'll pretend there's
no apps on the other profile.

- Also log an error about it, in the client side process.

- Also still send WTF() about the reverse access.

Bug: 34650921
Bug: 34340531

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases -t 'android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest'
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.LauncherAppsProfileTest'
Change-Id: I6164014685009db3f34a176a3f12c517766b2b49
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
9fd9019cf1f2c69c9bd1b9ea635a2605b3d9208f 06-Jan-2017 Makoto Onuki <omakoto@google.com> Revert "ShortcutManager: Floating shortcuts shouldn't have target activities."

This reverts commit 106ff7a0a1bef974ff04e9e79a25eb5e84555893.

Test: All the unit tests (ShortcutManagerTest1*) CtsShortcutHostTestCases and CtsShortcutManagerTestCases

Change-Id: Iadce2b3785cbf728daa60c4e2ff103e516d85896
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
54365465897a0fbb2d61c3fb2460698384328ad4 02-Dec-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Floating shortcuts shouldn't have target activities."
106ff7a0a1bef974ff04e9e79a25eb5e84555893 01-Dec-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Floating shortcuts shouldn't have target activities.

Previously, even floating shortcuts (pinned but not dynamic nor
manifest) had target activities. Now we're going to allow headless
apps to have pinned shortcuts, in which cases shortcuts won't have
target activities, let's just always remove target activities
from floating shortcuts.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to Test8.

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases

Change-Id: I10e5b87338cafb90e6566b3526f892c5330c73e9
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
b36c45fe3069bff85585759f6fad82b64d1e1953 01-Dec-2016 Makoto Onuki <omakoto@google.com> Fix issue with apps restored to lower versions. am: fac592f64c
am: affadd52af

Change-Id: I159f53023179cb67b7225969f4c7220ddd0c03dc
fac592f64c55004e9048e30e03d6dc65bdb4f00a 21-Nov-2016 Makoto Onuki <omakoto@google.com> Fix issue with apps restored to lower versions.

When restoring to a new device, if a restored app is not compatible
with the old version (e.g. lower version or different signature),
then we won't restore shortcuts, which is working as expected.

However when it happens, the shortcut manager forgot to "un-shadow"
the package information, causing the app to not have shortcuts at all.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests

Bug 32999759

Change-Id: I89832360114de0ce1c57d763bcaccab4fdb87b6d
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
248a0ef3aa119f92858a2bb95d20595824b8d07b 03-Nov-2016 Makoto Onuki <omakoto@google.com> Always scan all apps after each OTA for manifest shortcuts

(W/ reverting Ia05363b30a5eeb989dc4c44cf5dbd71cde96de96)

Test: FrameworksServicesTests

Bug 32590013

Change-Id: I8f45c330d0b102a6a112e774205e6611c1c61af3
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
c8c3329dd918b8ea16d6317d19ddee12325800f3 13-Sep-2016 Makoto Onuki <omakoto@google.com> Don't update publisher version code without scanning manifest

- It was (theoretically) possible for shortcut manager to update
the version code for a publisher package without rescanning manifest
shortcuts, if backup happens right after unlocking a user before
SM searches for updated packages. If it happens, then SM will not
scan the manifest for this package until it's updated next time.

So don't refresh the version code during backup, which we only
have to do for launchers but not publishers.

- Also fix the owner-user-id for launchers. (Luckily it's not causing
any issues.)

Bug 31402152

Change-Id: I5d898eb3882b74edaca8b2d5f960849370ffc23b
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
fc4cf2da34335fd7e84c020f51eea1a341d3f134 24-Aug-2016 Makoto Onuki <omakoto@google.com> Shortcut: Improve backup & restore

* Catch RuntimeException from restore, in case restoring from a
partner device with an incompatible file format.

* When a restore target app is already installed, and
- if it has allowBackup=true, we'll restore normally, so all
existing shortcuts will be replaced. (but manifest shortcuts
will be re-published anyway.) We log a warning on logcat.

- if it has allowBackup=false, we don't touch any of the
existing shortcuts.

Bug 31057974
Bug 30766177

Change-Id: Ic3f7e860e7ea0d086fc589d8cbed8c4cebdd4bc6
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
3366328245621fa6e8fd764a4d3c2f073774d096 23-Aug-2016 Makoto Onuki <omakoto@google.com> Do not scan system apps unless after OTA

Bug 30956231

Change-Id: I4af34cdd39cfaf0b8712b9ded1ef119efa3e04b0
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
085a05cd864252314bcf5c339017a16b68105204 19-Aug-2016 Makoto Onuki <omakoto@google.com> Off-load unlocking users onto a worker thread

Bug 29645168

(cherry picked from commit 3107ff78454d54c0494911bf69ca952152af7cf0)

Change-Id: I3f8e768f6afeb6386a08ba9ac48e0e206395da2b
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
1e1732399a48c9521eea7a117f1f0e87ca64d2ab 10-Aug-2016 Makoto Onuki <omakoto@google.com> Fix two shortcut manager issues

- isUserUnlocked check is still racy
We used a local copy of each user state in mUnlockedUsers, and updated
it in the service lifecycle events. However because
SystemService.onUnlockUser() is called on Handler, there was a brief
window between when the user was actually unlocked and the shortcut
manager thought the user was unlocked.
So now check with activity manager for the latest state too. We still
check with the local copy first, because we want to consider STOPPING
as "unlocked".

- Messenger loses all bitmap icons.
Because we delay-save the shortcuts.xml file, if the device shut down
before we save the XML file but after removing the bitmap files,
we'd lose the bitmaps.

(Apparently SystemService.onCleanupUser() may not be called even when
a device is cleanly shutting down.)

So don't remove bitmap files synchronously, ever, and instead after
saving the XML just run the dangling file cleanup.

Bug 30784267
Bug 30730471

Change-Id: Ie58656efba2dca2b00582e145613bc56266a091e
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
377b7970ad70e87f8137ea7d9e7a6b00de1826ae 09-Aug-2016 Makoto Onuki <omakoto@google.com> Rescan apps after restore and re-publish manifest shortcuts

Originally when I wrote backup & restore for ShortcutManager,
there was no manifest shortcuts, so there was no need to
handle preintalled apps specially.

However, now we have manifest shortcuts, which are published
when the user is unlocked, by the time restore happens preinstalled
apps may already have manifest shortcuts, which will be overwritten
by the restored shortcuts.

So we need to re-publish manifest shortcuts after restore.

Bug 30746028

Change-Id: I6afbae7790c9ed38483637f33c381ecb6f854677
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
64183d518813cc65efcaeaf0d4c28de092b32868 08-Aug-2016 Makoto Onuki <omakoto@google.com> ShortcutManager improve app udpate check

- Don't use lastUpdateTime for system apps since it's not reliable.

- Scan downgraded apps too.

Bug 30708050
Bug 30734178
Change-Id: I98253f4c635466197548385275ab08c5e3a1a10b
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
9c850012cacf0af4a392294566a8c7c897dc8771 27-Jul-2016 Makoto Onuki <omakoto@google.com> Prevent shortcut access when user is locked

Also add some test utility methods that'll be used by CTS.

Bug 30406401

Change-Id: I9396acebbdb3cbe64f6e85877ee62a2131cd6e61
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
7e5c3e85420a255bd79242dd97b90340c6e3a4df 22-Jul-2016 Makoto Onuki <omakoto@google.com> Fix intent flags

Bug 30307198

Change-Id: If127001320dcabdc53ee73860dbb9983cb25b611
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
3fa345b5c2cf5d7fd8c87e44d1887f011787c548 22-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Unit tests for "cmd shortcut"" into nyc-mr1-dev
440a1ea8e2204ecb171e0187318beb2f08f6012c 20-Jul-2016 Makoto Onuki <omakoto@google.com> Support multiple intents in ShortcutInfo

Also fix b/30230996.

TODO: Support the sourceBounds argument to LauncherApps.
startShortcut().

Bug 30218829
Bug 30230996

Change-Id: Ibb6c59d5b7c0a320c21d09436d016d0eac94644f
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
0b9d1db5c1aab9017daf05abd0ba0f4de2c7192d 18-Jul-2016 Makoto Onuki <omakoto@google.com> Unit tests for "cmd shortcut"

Also removed unnecessary commands.

Bug 29612099

Change-Id: Id554163c861fb144cb5140d7eb709178347f7868
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
6fa0e4d518a67380fada76bb78b4e7b697b4d7a4 16-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Don't accept resource references in string fields" into nyc-mr1-dev
1030520822c42cc7357b463d301c7e97e928ba22 15-Jul-2016 Makoto Onuki <omakoto@google.com> Cache the default launcher.

Originally we always checked with PM for the default launcher,
which would take ~2ms.

Now we cache the result, and clears the cache when (any) preferred
activities change.

Bug 30126557

Change-Id: Iceef288cd372c8bb9b119aa493e5173d894f2302
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
6771d73703d35f2b28b8602dcbbed88fdffb9a0b 14-Jul-2016 Makoto Onuki <omakoto@google.com> Don't accept resource references in string fields

Detect it when a developer accidentally uses @string/... in string fields
and log an error rather than publishing shortcuts with wrong values.

Bug 30140672

Change-Id: I98a60afd7f52282019a94a7a8c30a85ea4c7806b
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
4e6cef49ef11bbb5bfc0e9f0fb865188492d88b0 14-Jul-2016 Makoto Onuki <omakoto@google.com> Handle locale change and pacakge change in different way

- Stop using a custom callback from AM to detect locale changes
and use the LOCALE_CHANGED broadcast instead.

- This would open up a chance where a publisher app fetches
its won manifest shortcuts after a locale change but
ShortcutManager hasn't updated string resources.

- So instead, at every entry point from ShortcutManager, check
if the locale has changed, and if so, update all resources
(and reset throttling).

- Do the same for package change events too. At every entry point
from ShortcutManager, check if the caller package has been updated,
or any target activities have been disabled. If so, rescan the
caller package.

- We do *not* do the same check at the LauncherApps entry points,
because the launcher should use the callback to listen to
shortcut changes.

- Also stopped using PackageMonitor for now because we want to
set a higher priority and changing PackageMonitor at this point
seems too much for DR.

Bug 29895275
Bug 30123329

Change-Id: Ib4a2f626a936c7328e2cc032324f5c3d1c3b9122
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
f34c308dfd9cdda428b8ead8bf655de1608501a9 13-Jul-2016 Makoto Onuki <omakoto@google.com> Revert "Revert "Revert "Handle package broadcasts before apps do"""

This reverts commit 886ba78dfb105eb45416587b73b6c6b336448de5.

With the tests updated.

Change-Id: I162e6ca23c667f90feddc1e9f42b554a416295cf
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
98802f6007eef7a36237087111c38a998a388903 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Revert "Revert "Handle package broadcasts before apps do""" into nyc-mr1-dev
886ba78dfb105eb45416587b73b6c6b336448de5 13-Jul-2016 Makoto Onuki <omakoto@google.com> Revert "Revert "Handle package broadcasts before apps do""

This reverts commit efbbe7ea9db8adab6bff407db1d7fc54bbaf31ee.

Change-Id: I3dbb080db5121307f533a7d411f4f5d47225500e
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
7f3187bb0d12d288bc7211549c08adeb5ff651aa 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Revert "Handle package broadcasts before apps do"" into nyc-mr1-dev
4885b274c1502b8e478e16d4418b7fd86ab6c865 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Don't backup & restore disabled shortcuts." into nyc-mr1-dev
efbbe7ea9db8adab6bff407db1d7fc54bbaf31ee 12-Jul-2016 Makoto Onuki <omakoto@google.com> Revert "Handle package broadcasts before apps do"

And fix b/29939691 (don't try to load locked users) in a different way

Bug 29939691
Bug 29895275

Change-Id: Ib55f9c5d5547c54daa4e05c1e50bf4bbceaf1991
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
f3ba2e04be20d33fee989e782ba1966322e7e263 12-Jul-2016 Makoto Onuki <omakoto@google.com> Don't backup & restore disabled shortcuts.

Also a backup & restore test where an app has manifest shortcuts.

Bug 30016960
Bug 29921267

Change-Id: I8c4c3ece50f26d778b2f8f42251c317eb25d1e14
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
83f6d2da372de339dc563d6a7786be3facc52e76 11-Jul-2016 Makoto Onuki <omakoto@google.com> Throw ActivityNotFoundException when failed to launch shortcut

Originally the code used IIntentSender, but I had to switch to calling
startActivitiesInPackage() directly, because sendIntentSender() does
not support returning errors.

Bug 30035853

Change-Id: I5d7669c96a2f1805373c71aebf45b97ac1d01ff6
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
a2241834a54dc91e2eef858741f1a56a743c27b2 06-Jul-2016 Makoto Onuki <omakoto@google.com> Handle package broadcasts before apps do

- Have PM to call the shortcut manager directly before sending a
pacakge broadcast.

- The shortcut manager will enqueue a task to handle a package
broadcast, which will be executed on Handler.

- At the entry points of all external facing methods, block until
all pending tasks are finished.

Bug 29895275

Change-Id: Ib29fa3c9c8d9b9e0ca5c8f1e9da2a390324960a4
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
7df9ce075fddc8f3b4e5f177b41bab864c759e8b 01-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Make sure re-published dynamic shortcuts are always enabled" into nyc-mr1-dev
ee6b6e4a1861336f8db52d8c93dbf32ee9615cfa 30-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Make sure persisted default launcher still exists.

- Also make sure to ignore unexported activities.
(e.g. unexported activities shouldn't have shortcuts.)

- Also add unit tests for package manager related operations.

- Also remove stale TODOs (per-activity shortcut count check is
implemented already.)

Bug 29699769
Bug 29516954

Change-Id: Ia18301baf6bec1ad71ae195d9ae3d10bd8386fc4
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
ff14f73152775f91fe211729e2cb16a5da6933ab 01-Jul-2016 Makoto Onuki <omakoto@google.com> Make sure re-published dynamic shortcuts are always enabled

- Originally there was explicit code to take over the disabled flag,
which was simply not necessary.

- Also fix the startShortcut() tests that have temporarily
been disabled.

(Also remove the stale TODOs to avoid conflict with Ia18301ba)

Bug 29633681

Change-Id: I58b12ad6918d7fef4b79059b0c2c7f2df6e32269
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
bc8e0052fdf92efd0471b97092ee6a7e1eb2320d 30-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Fix updateShortcuts() with icons" into nyc-mr1-dev
d6880797f72e1e397e18c6e709c0125f795c7d2e 29-Jun-2016 Makoto Onuki <omakoto@google.com> Address API council feedback (continued)

Got a second set of comments.

Bug 29757958

Change-Id: Ib3a3ffd28bc3e35eb0218b0819870eb5c6ebadb5
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
dd097812fa84b898a46cb5dd253422e78779a150 29-Jun-2016 Makoto Onuki <omakoto@google.com> Fix updateShortcuts() with icons

But 29822569

Change-Id: I72a0903ccc8acffc42f40d9df7b99ed6de26b66d
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
b08790c3b2f3bdb0c2e2f7ff46e4584fb1127769 23-Jun-2016 Makoto Onuki <omakoto@google.com> Shortcut: Only "main" activities can have shortcuts.

- Don't publish shortcuts when their target activities are not main.
- Only scan manifest shortcuts for main activities.
- When an app is updated, remove shortcuts that no longer belong to
valid main activities.

- Also re-publish manifest shortcuts after 'clear data'
- Also listen to PACKAGE_CHANGED and disable/re-publish shortcuts
properly.

Bug 29355786
Bug 29582255
Bug 29601844

Change-Id: I6c701ce669cf30a227bc2af4aa01de467ef73e3a
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
b5a012fd6f088629746057a3902b5926f9fe8e08 21-Jun-2016 Makoto Onuki <omakoto@google.com> Shortcut Manager: Address API council feedback and fix TODOs

Bug 29515722
Bug 29516909
Bug 29515090
Bug 29516954
Bug 29515088

Change-Id: Ibe1d27033cbd0fd50d37e3d9945b47551211c568
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
4d6b87ffdf06df3303239130ced685bc1a3fae50 17-Jun-2016 Makoto Onuki <omakoto@google.com> Launcher shortcut callback should deliver manifest shortcuts too

- Also include "activity" in the key fields, as this is now an
important field.

- Also optimize ShortcutInfo parceling for the "key field only" case.

Bug 29394043
Bug 29451629

Change-Id: I61b2bc2f61ad6ebdcbaf6d02f1bd88777c45a7f0
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
df6da040e00cba255cad64d2d231aae62928607a 16-Jun-2016 Makoto Onuki <omakoto@google.com> Update manifest shortcut XML schema

Use the standard <intent> tag instead of custom tags.

- Also fix setDynamicShortcuts(), which was broken in the previous CL.
- Also tolerate runtime exceptions while parsing XMLs
- Also fix b/29422018 while I'm at it

Bug 29390156
Bug 29077932
Bug 29422018

Change-Id: I2756c9d66c6d7b2962a982d9e57a7d84a5755b28
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
489bafbb4ba53fd104c898975cf48c8815a1cb59 16-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Shortcut: Reset throttling upon inline reply" into nyc-mr1-dev
9e1f5595bd7ffe3af6ca35b3235dfca0ecd07978 08-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManger: Auto-adjust ranks.

Spec: go/shortcutmanager-spec-ranks

Bug 28984376
Bug 28536066

Change-Id: Ibffb92233c62792af06eeadc5a9a6379d0506a3c
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
d6e1f3bec18167f726ccc20f9bcbc6526dfc78fe 14-Jun-2016 Makoto Onuki <omakoto@google.com> Shortcut: Reset throttling upon inline reply

When the user does an "inline reply", we consider the notification
publisher app is "activated" and reset the shortcut throttling.

Bug 28705275

Change-Id: Ic9ffa13635274ead7e9d1e832cd31dea997830aa
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
157b1628fd84dc3ef0355fddd8d281618f94d33e 03-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: deal with changing resource IDs on app update

- When an app is upgraded, all the resource IDs may change. So
if a shortcut is previously published with an icon for res ID 100
and the publisher is upgraded, resource #100 may refer to something
different.

- So now the service also remembers resource names for icon resources,
as wells as string resources. When an app is updated, the service
fetch the updated resource IDs by name.

- Also extract all string resources when a shortcut is published
and persist them, so that even when the original string resources are
removed from the app, the launcher can still show the extracted strings.

- When the system locale changes, re-extract all string resources.

- Also really hide the constants in ShortcutInfo that were
accidentally made public.

Change-Id: I23c29b45c1de5d76175229190a1533c9c62c5960
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
51ab2b3fd04e24e0ca98afd1c1832d84f3a9e62c 02-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Break down unit tests

The test file is getting too big and making the IDE very slow.
Now it's split into multiple files

Change-Id: I50ed89f19defd3809f327bc21e7d9ea790dcde4e
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java