diff options
| author | 2017-05-23 19:56:04 +0000 | |
|---|---|---|
| committer | 2017-05-23 19:56:04 +0000 | |
| commit | 272b3903efa3afa6ac7584d4e7445bea2cdd5c8b (patch) | |
| tree | 19f375ca30f49997b409a2d738b75573b8317708 | |
| parent | e9f414237a2d63a00e89a1fcb9d321afd1f200a2 (diff) | |
| parent | 367b880c028ac7bec7399e992b7378231da7fd61 (diff) | |
Merge "Revert "Disallow starting activities without new task from non-activity context."" into oc-dev
am: 367b880c02
Change-Id: I0a0d96048c0b3dd504d0c90dbf80a8299c4b96a4
| -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." |