diff options
| author | Dianne Hackborn <hackbod@google.com> | 2015-06-22 23:55:10 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-22 23:55:12 +0000 |
| commit | 0b50e56c070878211d9003e072128716bee445ba (patch) | |
| tree | 86556590eecbab82ffc96b7b03d1b0440d55e59d | |
| parent | 58e706d754adaeb59ccea9b8d496d54240c37caf (diff) | |
| parent | a825c084f81d9cfca353514ca6a11221e84a7c8a (diff) | |
| download | frameworks_base-0b50e56c070878211d9003e072128716bee445ba.zip frameworks_base-0b50e56c070878211d9003e072128716bee445ba.tar.gz frameworks_base-0b50e56c070878211d9003e072128716bee445ba.tar.bz2 | |
Merge "Fix issue #21753257: Stability: startActivity asks to run as user 0..." into mnc-dev
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 0301638..1ef1375 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -10779,15 +10779,21 @@ public final class ActivityManagerService extends ActivityManagerNative return; } } - pae.intent.replaceExtras(pae.extras); - pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK - | Intent.FLAG_ACTIVITY_SINGLE_TOP - | Intent.FLAG_ACTIVITY_CLEAR_TOP); - closeSystemDialogs("assist"); + + long ident = Binder.clearCallingIdentity(); try { - mContext.startActivityAsUser(pae.intent, new UserHandle(pae.userHandle)); - } catch (ActivityNotFoundException e) { - Slog.w(TAG, "No activity to handle assist action.", e); + pae.intent.replaceExtras(pae.extras); + pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_SINGLE_TOP + | Intent.FLAG_ACTIVITY_CLEAR_TOP); + closeSystemDialogs("assist"); + try { + mContext.startActivityAsUser(pae.intent, new UserHandle(pae.userHandle)); + } catch (ActivityNotFoundException e) { + Slog.w(TAG, "No activity to handle assist action.", e); + } + } finally { + Binder.restoreCallingIdentity(ident); } } |
