diff options
author | Wale Ogunwale <ogunwale@google.com> | 2015-08-03 15:56:49 -0700 |
---|---|---|
committer | Wale Ogunwale <ogunwale@google.com> | 2015-08-03 15:56:49 -0700 |
commit | f5ea12c2aa06bf7eb12cff714ece59e7c5ff4d83 (patch) | |
tree | cccb941da2039e13a582c877d57a024c72bf2b18 /core | |
parent | 405eceb20a3f3e7a22d922fc2d0fb8283be337fa (diff) | |
download | frameworks_base-f5ea12c2aa06bf7eb12cff714ece59e7c5ff4d83.zip frameworks_base-f5ea12c2aa06bf7eb12cff714ece59e7c5ff4d83.tar.gz frameworks_base-f5ea12c2aa06bf7eb12cff714ece59e7c5ff4d83.tar.bz2 |
Fail silently if a process trys to launch an acitvity for background user
Doing this so we don't break current apps. In the future we should
properly position the activity in the stack (i.e. behind all current
user activity/task) and not change the positioning of stacks.
Bug: 21801163
Bug: 13507605
Bug: 22929608
Change-Id: I979b6288e66f5b2ec2a6f22cb8d416e5c68109bd
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/Instrumentation.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index c2d901d..69b8b95 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -1810,9 +1810,14 @@ public class Instrumentation { throw new SecurityException( "Starting under voice control not allowed for: " + intent); case ActivityManager.START_NOT_CURRENT_USER_ACTIVITY: - throw new SecurityException( - "Not allowed to start background user activity that shouldn't be" - + " displayed for all users."); + // Fail silently for this case so we don't break current apps. + // TODO(b/22929608): Instead of failing silently or throwing an exception, + // we should properly position the activity in the stack (i.e. behind all current + // user activity/task) and not change the positioning of stacks. + Log.e(TAG, + "Not allowed to start background user activity that shouldn't be displayed" + + " for all users. Failing silently..."); + break; default: throw new AndroidRuntimeException("Unknown error code " + res + " when starting " + intent); |