diff options
author | Joe Onorato <joeo@android.com> | 2009-11-19 18:05:36 -0800 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-11-19 18:05:36 -0800 |
commit | 418928e9d0168609cc802e95c18930d131147e7a (patch) | |
tree | cbc03c6e2093888fbde0a7539906005c81a62023 | |
parent | cc19a53d6149491e58d2c2a749345a70b7492ec8 (diff) | |
download | packages_apps_trebuchet-418928e9d0168609cc802e95c18930d131147e7a.zip packages_apps_trebuchet-418928e9d0168609cc802e95c18930d131147e7a.tar.gz packages_apps_trebuchet-418928e9d0168609cc802e95c18930d131147e7a.tar.bz2 |
Fix bug 2223769 - Uninstalling app causes NPE.
The check for whether there is anything in these lists should be sufficient. The other
variables don't need to also be checked.
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 6b4d3f4..d9017da 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -278,8 +278,6 @@ public class LauncherModel extends BroadcastReceiver { ArrayList<ApplicationInfo> added = null; ArrayList<ApplicationInfo> removed = null; ArrayList<ApplicationInfo> modified = null; - boolean update = false; - boolean remove = false; synchronized (mLock) { if (mBeforeFirstLoad) { @@ -298,11 +296,9 @@ public class LauncherModel extends BroadcastReceiver { if (Intent.ACTION_PACKAGE_CHANGED.equals(action)) { mAllAppsList.updatePackage(context, packageName); - update = true; } else if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) { if (!replacing) { mAllAppsList.removePackage(packageName); - remove = true; } // else, we are replacing the package, so a PACKAGE_ADDED will be sent // later, we will update the package at this time @@ -311,7 +307,6 @@ public class LauncherModel extends BroadcastReceiver { mAllAppsList.addPackage(context, packageName); } else { mAllAppsList.updatePackage(context, packageName); - update = true; } } @@ -345,7 +340,7 @@ public class LauncherModel extends BroadcastReceiver { } }); } - if (update || modified != null) { + if (modified != null) { final ArrayList<ApplicationInfo> modifiedFinal = modified; mHandler.post(new Runnable() { public void run() { @@ -353,7 +348,7 @@ public class LauncherModel extends BroadcastReceiver { } }); } - if (remove || removed != null) { + if (removed != null) { final ArrayList<ApplicationInfo> removedFinal = removed; mHandler.post(new Runnable() { public void run() { |