summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-09-15 21:19:40 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-15 21:19:40 +0000
commitf33b78b8500212bf0ecf3ff5dafaa5aefbae8913 (patch)
tree461723eef531a9843a42354580011e03fc4b46c8 /src/com/android
parent15f68dcdf238c58233d954fd0344223e85607c35 (diff)
parent3dc7beea3c7f9a60070e767aa43f5877a467d3ed (diff)
downloadandroid_packages_apps_Trebuchet-f33b78b8500212bf0ecf3ff5dafaa5aefbae8913.tar.gz
android_packages_apps_Trebuchet-f33b78b8500212bf0ecf3ff5dafaa5aefbae8913.tar.bz2
android_packages_apps_Trebuchet-f33b78b8500212bf0ecf3ff5dafaa5aefbae8913.zip
am 3dc7beea: Catching DeadObjectException and TransactionTooLarge
* commit '3dc7beea3c7f9a60070e767aa43f5877a467d3ed': Catching DeadObjectException and TransactionTooLarge
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/LauncherModel.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index ee5f9ca92..494ca8171 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -34,6 +34,7 @@ import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
+import android.os.DeadObjectException;
import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
@@ -3301,9 +3302,14 @@ public class LauncherModel extends BroadcastReceiver
// Refresh widget list, if there is any newly added widget
PackageManager pm = context.getPackageManager();
for (String pkg : mPackages) {
- needToRefresh |= !pm.queryBroadcastReceivers(
- new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE)
- .setPackage(pkg), 0).isEmpty();
+ try {
+ needToRefresh |= !pm.queryBroadcastReceivers(
+ new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE)
+ .setPackage(pkg), 0).isEmpty();
+ } catch (RuntimeException e) {
+ // Ignore the crash. We can live with a state widget list.
+ Log.e(TAG, "PM call failed for " + pkg, e);
+ }
}
}
@@ -3355,7 +3361,8 @@ public class LauncherModel extends BroadcastReceiver
return results;
}
} catch (Exception e) {
- if (e.getCause() instanceof TransactionTooLargeException) {
+ if (e.getCause() instanceof TransactionTooLargeException ||
+ e.getCause() instanceof DeadObjectException) {
// the returned value may be incomplete and will not be refreshed until the next
// time Launcher starts.
// TODO: after figuring out a repro step, introduce a dirty bit to check when