summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/pm/ShortcutPackage.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
index fa0c6c393cdc..0c601bfde05a 100644
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
@@ -706,7 +706,7 @@ class ShortcutPackage extends ShortcutPackageItem {
}
pinnedShortcuts.addAll(pinned);
});
- // Then, update the pinned state if necessary.
+ // Secondly, update the pinned state if necessary.
final List<ShortcutInfo> pinned = findAll(pinnedShortcuts);
if (pinned != null) {
pinned.forEach(si -> {
@@ -720,6 +720,8 @@ class ShortcutPackage extends ShortcutPackageItem {
si.clearFlags(ShortcutInfo.FLAG_PINNED);
}
});
+ // Then, schedule a background job to persist the pinned states.
+ mShortcutUser.forAllLaunchers(ShortcutPackageItem::scheduleSave);
// Lastly, remove the ones that are no longer pinned, cached nor dynamic.
removeOrphans();