Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e18c3ba5 authored by Bryce Lee's avatar Bryce Lee Committed by android-build-merger
Browse files

Merge "Disallow starting activities without new task from non-activity...

Merge "Disallow starting activities without new task from non-activity context." into oc-dev am: 3ebe54b3
am: b8bcdf50

Change-Id: Ib3a056213274cd3d7b86859be43893777f4230cb
parents 87a1ec2b b8bcdf50
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -845,7 +845,8 @@ class ContextImpl extends Context {
        // 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) {
                && (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."