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
(cherry picked from 76e319f015c2b43498ce3ce610a253d63e76cbf3)
Some additional internal only refactorings were done as well.
Bug: 32912773
Test: make checkbuild
Change-Id: I96e3da967fad731fc8f39bde9db95f50ab7353fb
Also now ShortcutManager tries to fill in the main activity as the target
activity if the caller has one.
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: Running: 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
Bug 34047091
Change-Id: I2bf2b20e94a2384cfa6e6b7d40d56cfe96a94fd9
Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test8
Bug 32908854
Change-Id: I30ba421e9730741776c1936e40ccf7b7431289da
Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test8
Bug 32908854
Change-Id: I11b81656959cccfb4efa83f08380b915e6eb84a6
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
Also fix b/30230996.
TODO: Support the sourceBounds argument to LauncherApps.
startShortcut().
Bug 30218829
Bug 30230996
Change-Id: Ibb6c59d5b7c0a320c21d09436d016d0eac94644f
- 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
- 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
- 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
- Print "Success" when it went well.
- Catch all exceptions and print error message, not just
RemoteExceptions
- Update the shortcut manger test utility to match the new behavior
Bug 29612099
Change-Id: If6a80241ea5e8ef0b2d3f961d1442e730b908764
- 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
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
The words "title" and "text" implies that "text" is a secondary label
that's shown with the title, but it turned out the launcher would show
only one of those depending on how much space it has.
So now we change them to "shortLabel" and "longLabel"
Note we're only changing the API surface -- in order to mimimize
the impact to the code, internally we'll keep using the old names.
- Also remove "shortcutRank" while I'm here -- it should be implied
from the order of the XML elements.
Bug 29057378
Change-Id: I3203f63b0318c7462c1c61fef43cf9755fa8c008
See https://goto.google.com/shortcutmanager-spec-dr for
the details.
This CL contains changes to ShortcutInfo and all the new API
entry points, but not the implementation of the new APIs.
- ShortcutInfo.activityComponent is now mandatory.
- Publishers can now disable shortcuts. ShortcutInfo can now have
"disabled message".
- ShortcutInfo now supports string resources for all the String
fields.
-> When launcher fetches shortcuts, ShortcutService will
automatically load resources and expose as strings.
- LauncherApps now supports getShortcutIconDrawable() and
getShortcutBadgedIconDrawable() to be consistent with
LauncherActivityInfo.
- ShortcutInfo.weight is replaced with "rank".
- Added ShortcutManager.reportShortcutUsed(), which will be used for
usage tracking / suggestion.
Bug 28536054
Bug 28536066
Bug 28564134
Bug 28594168
Change-Id: Ib8245b39bb1e753991a9de89c0b73accacd90355