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

Commit 4a981479 authored by Christophe Pinelli's avatar Christophe Pinelli Committed by Automerger Merge Worker
Browse files

Merge "Restrict activity launch when caller is running in the background" into...

Merge "Restrict activity launch when caller is running in the background" into udc-dev am: 82456ff9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/25116113



Change-Id: I74a88371535c924893be570d84d68a985c82f8b6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 44884157 82456ff9
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -1412,6 +1412,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {

            final long origId = Binder.clearCallingIdentity();
            // TODO(b/64750076): Check if calling pid should really be -1.
            try {
                if (options == null) {
                    options = new SafeActivityOptions(ActivityOptions.makeBasic());
                }
                options.getOptions(r).setAvoidMoveToFront();
                final int res = getActivityStartController()
                    .obtainStarter(intent, "startNextMatchingActivity")
                    .setCaller(r.app.getThread())
@@ -1428,13 +1433,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                    .setRealCallingUid(r.launchedFromUid)
                    .setActivityOptions(options)
                    .execute();
            Binder.restoreCallingIdentity(origId);

                r.finishing = wasFinishing;
            if (res != ActivityManager.START_SUCCESS) {
                return false;
                return res == ActivityManager.START_SUCCESS;
            } finally {
                Binder.restoreCallingIdentity(origId);
            }
            return true;
        }
    }