diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-09-15 11:32:58 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-09-15 13:36:46 -0700 |
commit | 3dc7beea3c7f9a60070e767aa43f5877a467d3ed (patch) | |
tree | 7ebc623bdc036e1e8b4c10a62f3429291f93aa2f | |
parent | 4abaf133546b0c950edc82594985e9da50d9c1dd (diff) | |
download | android_packages_apps_Trebuchet-3dc7beea3c7f9a60070e767aa43f5877a467d3ed.tar.gz android_packages_apps_Trebuchet-3dc7beea3c7f9a60070e767aa43f5877a467d3ed.tar.bz2 android_packages_apps_Trebuchet-3dc7beea3c7f9a60070e767aa43f5877a467d3ed.zip |
Catching DeadObjectException and TransactionTooLarge
Bug: 23796965
Bug: 23796963
Change-Id: I4c6ed217b9925b2e6014adc374b8b21f1ba559bc
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index b5922c6a3..9817f3f61 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; @@ -3305,9 +3306,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); + } } } @@ -3359,7 +3365,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 |