Fixing shortcut intent getting cleared during backup/restore
Bug: 174570283 Bug: 156871815 Test: Verified on device Change-Id: Ie286ee783bfe96c5b2be28f0db5298caf3801e6d
This commit is contained in:
1 parent
2268d7a937
commit
4c23ca768f
8 files changed
+42
-20
No files matched your search
@@ -25,6 +25,7 @@ import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.shortcuts.ShortcutKey;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
import com.android.launcher3.util.PackageManagerHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@@ -66,6 +67,14 @@ public class ShortcutsChangedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
|
||||
if (!matchingWorkspaceItems.isEmpty()) {
|
||||
if (mShortcuts.isEmpty()) {
|
||||
// Verify that the app is indeed installed.
|
||||
if (!new PackageManagerHelper(app.getContext())
|
||||
.isAppInstalled(mPackageName, mUser)) {
|
||||
// App is not installed, ignoring package events
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Update the workspace to reflect the changes to updated shortcuts residing on it.
|
||||
List<String> allLauncherKnownIds = matchingWorkspaceItems.stream()
|
||||
.map(WorkspaceItemInfo::getDeepShortcutId)
|
||||
|
||||
Reference in new issue
Block a user