diff options
| author | 2015-08-04 14:53:33 +0000 | |
|---|---|---|
| committer | 2015-08-04 14:53:33 +0000 | |
| commit | c170d7ded3b59aaed080e2315868e60bbadb9669 (patch) | |
| tree | 8c068f42549019f5f6626e317829a527c94b7ff7 | |
| parent | 88d616c80c54aeb99abeb1534b14436780ede253 (diff) | |
| parent | ae351ec112dc5ad23585552af30a138aa29ed2f5 (diff) | |
am ae351ec1: am b2690f38: Merge "Fail silently if a process trys to launch an acitvity for background user" into mnc-dev
* commit 'ae351ec112dc5ad23585552af30a138aa29ed2f5':
Fail silently if a process trys to launch an acitvity for background user
| -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 c2d901dfa058..69b8b9510b3a 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); |