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

Commit e3683ad6 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Avoid home intent normalization if it is from trusted callers" into...

Merge "Avoid home intent normalization if it is from trusted callers" into udc-dev am: ba880062 am: a85883c8

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



Change-Id: If723f75613e8e345aeba2a762d345507627159be
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9621aca2 a85883c8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.Manifest.permission.MANAGE_ACTIVITY_TASKS;
import static android.app.ActivityManager.INTENT_SENDER_ACTIVITY;
import static android.app.ActivityOptions.ANIM_OPEN_CROSS_PROFILE_APPS;
import static android.app.PendingIntent.FLAG_CANCEL_CURRENT;
@@ -34,6 +35,7 @@ import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_TASK_ON_HOME;
import static android.content.pm.ApplicationInfo.FLAG_SUSPENDED;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;

import static com.android.server.pm.PackageManagerService.PLATFORM_PACKAGE_NAME;
import static com.android.server.wm.ActivityInterceptorCallback.MAINLINE_SDK_SANDBOX_ORDER_ID;
@@ -518,6 +520,14 @@ class ActivityStartInterceptor {
        }

        if (mComponentSpecified) {
            Slog.w(TAG, "Starting home with component specified, uid=" + mCallingUid);
            if (mService.isCallerRecents(mCallingUid)
                    || ActivityTaskManagerService.checkPermission(MANAGE_ACTIVITY_TASKS,
                            mCallingPid, mCallingUid) == PERMISSION_GRANTED) {
                // Allow home component specified from trusted callers.
                return false;
            }

            final ComponentName homeComponent = mIntent.getComponent();
            final Intent homeIntent = mService.getHomeIntent();
            final ActivityInfo aInfo = mService.mRootWindowContainer.resolveHomeActivity(