Merge "Fix the issue pinned shortcuts went missing after reboot" into tm-dev am: b2aad08eb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18701697 Change-Id: Idca50a2a4a52a46c66a4bb224f0070b02c24669f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -706,7 +706,7 @@ class ShortcutPackage extends ShortcutPackageItem {
|
|||||||
}
|
}
|
||||||
pinnedShortcuts.addAll(pinned);
|
pinnedShortcuts.addAll(pinned);
|
||||||
});
|
});
|
||||||
// Then, update the pinned state if necessary.
|
// Secondly, update the pinned state if necessary.
|
||||||
final List<ShortcutInfo> pinned = findAll(pinnedShortcuts);
|
final List<ShortcutInfo> pinned = findAll(pinnedShortcuts);
|
||||||
if (pinned != null) {
|
if (pinned != null) {
|
||||||
pinned.forEach(si -> {
|
pinned.forEach(si -> {
|
||||||
@@ -720,6 +720,8 @@ class ShortcutPackage extends ShortcutPackageItem {
|
|||||||
si.clearFlags(ShortcutInfo.FLAG_PINNED);
|
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.
|
// Lastly, remove the ones that are no longer pinned, cached nor dynamic.
|
||||||
removeOrphans();
|
removeOrphans();
|
||||||
|
|||||||
Reference in New Issue
Block a user