Decoupling launcher/workspace package cleanup from the application list (Bug 6602756)
- Fixes issues where shortcuts created by wallpaper/widget-only apps are uninstalled. Change-Id: I94c9d1d71fc34aa2fb7f0660534e616a82ac6f36
This commit is contained in:
@@ -326,19 +326,17 @@ public class DragController {
|
||||
}
|
||||
endDrag();
|
||||
}
|
||||
public void onAppsRemoved(ArrayList<ApplicationInfo> apps, Context context) {
|
||||
public void onAppsRemoved(ArrayList<String> packageNames, Context context) {
|
||||
// Cancel the current drag if we are removing an app that we are dragging
|
||||
if (mDragObject != null) {
|
||||
Object rawDragInfo = mDragObject.dragInfo;
|
||||
if (rawDragInfo instanceof ShortcutInfo) {
|
||||
ShortcutInfo dragInfo = (ShortcutInfo) rawDragInfo;
|
||||
for (ApplicationInfo info : apps) {
|
||||
for (String pn : packageNames) {
|
||||
// Added null checks to prevent NPE we've seen in the wild
|
||||
if (dragInfo != null &&
|
||||
dragInfo.intent != null &&
|
||||
info.intent != null) {
|
||||
boolean isSamePackage = dragInfo.getPackageName().equals(
|
||||
info.getPackageName());
|
||||
dragInfo.intent != null) {
|
||||
boolean isSamePackage = dragInfo.getPackageName().equals(pn);
|
||||
if (isSamePackage) {
|
||||
cancelDrag();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user