OSDN Git Service

Shortcut: Improve backup & restore
authorMakoto Onuki <omakoto@google.com>
Wed, 24 Aug 2016 18:10:26 +0000 (11:10 -0700)
committerMakoto Onuki <omakoto@google.com>
Wed, 24 Aug 2016 20:52:02 +0000 (13:52 -0700)
commitfc4cf2da34335fd7e84c020f51eea1a341d3f134
tree66db3d42726209852bbf7058c9b7d349c445056a
parent4d826638ab1ba3f90a67d0cf4d9256d4e88ee002
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
services/core/java/com/android/server/pm/ShortcutPackage.java
services/core/java/com/android/server/pm/ShortcutPackageItem.java
services/core/java/com/android/server/pm/ShortcutService.java
services/core/java/com/android/server/pm/ShortcutUser.java
services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java