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

Commit a85883c8 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 udc-dev am: ba880062

parents ed706d06 ba880062
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(