diff options
| author | Bryce Lee <brycelee@google.com> | 2017-05-23 19:50:21 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-05-23 19:50:24 +0000 |
| commit | 367b880c028ac7bec7399e992b7378231da7fd61 (patch) | |
| tree | a90849c38e39b1556deb749756446461277468a1 /core/java/android/app/ContextImpl.java | |
| parent | 07c832f40537e73fc468aae9b04f867d92c810e2 (diff) | |
| parent | 25ae100cb0cf4bb8e4bb0be59e1221b2ca42a372 (diff) | |
Merge "Revert "Disallow starting activities without new task from non-activity context."" into oc-dev
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index a155de369f12..268a105b7c6f 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -846,9 +846,8 @@ class ContextImpl extends Context { // Calling start activity from outside an activity without FLAG_ACTIVITY_NEW_TASK is // generally not allowed, except if the caller specifies the task id the activity should // be launched in. - if ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) == 0 - && (options == null - || ActivityOptions.fromBundle(options).getLaunchTaskId() == -1)) { + if ((intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) == 0 + && options != null && ActivityOptions.fromBundle(options).getLaunchTaskId() == -1) { throw new AndroidRuntimeException( "Calling startActivity() from outside of an Activity " + " context requires the FLAG_ACTIVITY_NEW_TASK flag." |
