Prevent SecurityException from crashing Recents

Bug: 6787477
This commit is contained in:
Michael Jurka
2013-02-08 15:41:56 +01:00
parent cd3b804e11
commit a2bdffee5b

View File

@@ -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);