History log of /frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/core/java/com/android/server/pm/ShortcutPackageItem.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/core/java/com/android/server/pm/ShortcutPackageItem.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/core/java/com/android/server/pm/ShortcutPackageItem.java
76269928e677725e2d9b28e2e3aa79961a60a1d0 15-Jul-2016 Makoto Onuki <omakoto@google.com> Implement dumpsys --checkin for shortcut manager

Dump the very basic stuff for now.

We need to update GMS-core to actually collect the information.

Bug 28535604

Change-Id: I6ce17ee2014786a0ef97f3dc973b8a01c2d2a814
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.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/core/java/com/android/server/pm/ShortcutPackageItem.java
7001a6154088c87a31d56641762ff0c2a48f1d57 27-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Implement max # of shortcuts

- Each activity (launcher icon) can have at most 5 dynamic +
manifest shortcuts.

Bug 28536066

Change-Id: Id34371d51c4a1c5e3df7debe3b71b535eb157b6c
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java
22fcc68e6be0edaa98f3dacf79d580a5e5d50005 17-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Support manifest shortcuts

- Now apps can publish shortcuts via AndroidManifest.xml
(Sample: I5b127150)

- Rename some APIs per API council feedback

- Publishers can now "disable" shortcuts.
(https://docs.google.com/presentation/d/1raUn1QBURDb1yrd6mSmVxII9ezNh3MWukODdtufJ29U/edit#slide=id.g13ef592464_7_39)

Bug 28785283
Bug 28536066

Change-Id: I4a126841e43e40139bb4baa6d0f98ad7b3a75ac1
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java
c51b2876ec5c0af449469a0f76bb38c51cfcff04 05-May-2016 Makoto Onuki <omakoto@google.com> Refactoring ShortcutManager + bug fixes.

- Don't pass the ShortcutService instance as an argument. This tiny
optimization is no longer meaningful now that PackageShortcut and
PackageLauncher have reference to ShortcutUser.

- Rename mLauncherComponent to mDefaultLauncherComponent for clarity.

- Don't instantiate ShortcutPackage instances when not needed.

- Don't allow intents with a null action.

- Also improve javadoc.

Bug 28592642
Bug 28474517
Bug 28557169

Change-Id: I8790d3494bf3b92c143c02824b0ed0e514504baa
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java
4d36b3a8c5ba1289d851ef337e46709bba333100 27-Apr-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: finishing touches

- Change back the throttling quota to 10 calls / day
- Foreground apps are no longer throttled, and when an app comes to
foreground the call counter will be reset.
- When the system locale changes, reset throttling for all packages
for all users.
See LocalService.onSystemLocaleChangedNoLock() for how it's performed.
Because the reset must happen before any other apps have a chance to
publish shortcuts, the logic is not straightforward.

- Added an internal API to reset the throttling upon inline-reply
from a notification.

- Stop supporting icons from "content:" URIs
- Improved javadoc on several APIs.

Also internal refactor needed to this:
- ShortcutUser.getAllPackages()/getAllLaunchers() are no longer
accessible to outer code to prevent accidentally adding/removing the
content. Outer code should use forAllPackages() / forAllLaunchers().

Bug 27923857

Change-Id: I002511193d1d33718163bb1dabe77610bde58198
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java
2e210c4d0f766e52ea4c087a1d54213c36a4e0ea 30-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: implement backup & restore

Also:
- Fix cross profile pinning. Now ShortcutLauncher correctly keeps
track of target package user IDs.

- Add performance stats for package manager calls and show them on
dumpsys.

Bug 27548047

Change-Id: I2472980b2955b6c70947aaaa9b76f75d0616db6e
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java
9da23fc6ac565b38129d52f4f8f174c833a9bd01 29-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: proper work profile support

Bug 27548047

Change-Id: I8acea3355f8974a551f53814624dec30732f7b2f
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java
0acbb14574d859b5f1cc0b7c6bbdfbeba38f3e55 23-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Handle package broadcasts.

- Do a cleanup when an app is gone.
- Record the app version and signatures.
- Also make saveToXml() capable of saving for backup.

Bug 27548047

Change-Id: I7eb2bbec7665b4d625630e7312c0f2a8b03c5ffa
/frameworks/base/services/core/java/com/android/server/pm/ShortcutPackageItem.java