summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-06-22 15:29:06 -0700
committerDianne Hackborn <hackbod@google.com>2015-06-22 15:29:06 -0700
commita825c084f81d9cfca353514ca6a11221e84a7c8a (patch)
tree2fc799fb7831f2205105d9135db6e2542144468f
parent9622c0cc900da84c903f0395053dd4d9a9e4f53d (diff)
downloadframeworks_base-a825c084f81d9cfca353514ca6a11221e84a7c8a.zip
frameworks_base-a825c084f81d9cfca353514ca6a11221e84a7c8a.tar.gz
frameworks_base-a825c084f81d9cfca353514ca6a11221e84a7c8a.tar.bz2
Fix issue #21753257: Stability: startActivity asks to run as user 0...
...but is calling from user 10 Change-Id: Ia4b8ace6ad140c1727fe944882e0d5b5c650260b
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java22
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);
}
}