From d1fdb3c761c61a19ce42d104c7b010418be3d058 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Fri, 8 Feb 2013 15:41:56 +0100 Subject: Prevent SecurityException from crashing Recents Bug: 6787477 Signed-off-by: Michael Jurka Tested-by: Moritz Bandemer --- .../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 3b4155c..c30b4a0 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -693,8 +693,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); -- cgit v1.1