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

Commit bde17ccd authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Use calling uid for metrics of starting from recents"

parents d5c4fe4b c15d695c
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -2566,13 +2566,13 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
                : null;
        boolean moveHomeTaskForward = true;
        synchronized (mService.mGlobalLock) {
            final boolean isCallerRecents = mRecentTasks.isCallerRecents(callingUid);
            int activityType = ACTIVITY_TYPE_UNDEFINED;
            if (activityOptions != null) {
                activityType = activityOptions.getLaunchActivityType();
                final int windowingMode = activityOptions.getLaunchWindowingMode();
                if (activityOptions.freezeRecentTasksReordering()
                        && mService.checkPermission(MANAGE_ACTIVITY_TASKS, callingPid, callingUid)
                                == PERMISSION_GRANTED) {
                if (activityOptions.freezeRecentTasksReordering() && (isCallerRecents
                        || ActivityTaskManagerService.checkPermission(MANAGE_ACTIVITY_TASKS,
                                callingPid, callingUid) == PERMISSION_GRANTED)) {
                    mRecentTasks.setFreezeTaskListReordering();
                }
                if (activityOptions.getLaunchRootTask() != null) {
@@ -2615,7 +2615,9 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
                    mRootWindowContainer.startPowerModeLaunchIfNeeded(
                            true /* forceSend */, targetActivity);
                    final LaunchingState launchingState =
                            mActivityMetricsLogger.notifyActivityLaunching(task.intent);
                            mActivityMetricsLogger.notifyActivityLaunching(task.intent,
                                    // Recents always has a new launching state (not combinable).
                                    null /* caller */, isCallerRecents ? INVALID_UID : callingUid);
                    try {
                        mService.moveTaskToFrontLocked(null /* appThread */,
                                null /* callingPackage */, task.mTaskId, 0, options);