From a2bdffee5bef561e553cb31c999a45cda6f82a53 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Fri, 8 Feb 2013 15:41:56 +0100 Subject: [PATCH] Prevent SecurityException from crashing Recents Bug: 6787477 --- .../src/com/android/systemui/recent/RecentsPanelView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index 9a1e38dca230d..dc54eae2db674 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -682,8 +682,12 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener | Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_NEW_TASK); if (DEBUG) Log.v(TAG, "Starting activity " + intent); - context.startActivityAsUser(intent, opts, - new UserHandle(UserHandle.USER_CURRENT)); + try { + context.startActivityAsUser(intent, opts, + new UserHandle(UserHandle.USER_CURRENT)); + } catch (SecurityException e) { + Log.e(TAG, "Recents does not have the permission to launch " + intent, e); + } } if (usingDrawingCache) { holder.thumbnailViewImage.setDrawingCacheEnabled(false);