Merge "Prevent SecurityException from crashing Recents"

This commit is contained in:
Michael Jurka
2013-02-12 10:15:30 +00:00
committed by Android (Google) Code Review

View File

@@ -682,8 +682,12 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
| Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_TASK_ON_HOME
| Intent.FLAG_ACTIVITY_NEW_TASK); | Intent.FLAG_ACTIVITY_NEW_TASK);
if (DEBUG) Log.v(TAG, "Starting activity " + intent); if (DEBUG) Log.v(TAG, "Starting activity " + intent);
context.startActivityAsUser(intent, opts, try {
new UserHandle(UserHandle.USER_CURRENT)); 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) { if (usingDrawingCache) {
holder.thumbnailViewImage.setDrawingCacheEnabled(false); holder.thumbnailViewImage.setDrawingCacheEnabled(false);