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

Commit 985f6240 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge changes from topic "presubmit-am-b521fdc3415843d792ac3226b71ecb4a" into sc-qpr1-dev

* changes:
  [automerge] Backport missing permission check for querying main activity intent 2p: b3192809
  Backport missing permission check for querying main activity intent
parents efbc8f2b 50158b9e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -56,8 +56,8 @@ interface ILauncherApps {
    void startActivityAsUser(in IApplicationThread caller, String callingPackage,
    void startActivityAsUser(in IApplicationThread caller, String callingPackage,
            String callingFeatureId, in ComponentName component, in Rect sourceBounds,
            String callingFeatureId, in ComponentName component, in Rect sourceBounds,
            in Bundle opts, in UserHandle user);
            in Bundle opts, in UserHandle user);
    PendingIntent getActivityLaunchIntent(in ComponentName component, in Bundle opts,
    PendingIntent getActivityLaunchIntent(String callingPackage, in ComponentName component,
            in UserHandle user);
            in Bundle opts, in UserHandle user);
    void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage,
    void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage,
            String callingFeatureId, in ComponentName component, in Rect sourceBounds,
            String callingFeatureId, in ComponentName component, in Rect sourceBounds,
            in Bundle opts, in UserHandle user);
            in Bundle opts, in UserHandle user);
+2 −1
Original line number Original line Diff line number Diff line
@@ -752,7 +752,8 @@ public class LauncherApps {
        }
        }
        try {
        try {
            // due to b/209607104, startActivityOptions will be ignored
            // due to b/209607104, startActivityOptions will be ignored
            return mService.getActivityLaunchIntent(component, null /* opts */, user);
            return mService.getActivityLaunchIntent(mContext.getPackageName(), component,
                    null /* opts */, user);
        } catch (RemoteException re) {
        } catch (RemoteException re) {
            throw re.rethrowFromSystemServer();
            throw re.rethrowFromSystemServer();
        }
        }
+3 −2
Original line number Original line Diff line number Diff line
@@ -1098,8 +1098,9 @@ public class LauncherAppsService extends SystemService {
        }
        }


        @Override
        @Override
        public PendingIntent getActivityLaunchIntent(ComponentName component, Bundle opts,
        public PendingIntent getActivityLaunchIntent(String callingPackage, ComponentName component,
                UserHandle user) {
                Bundle opts, UserHandle user) {
            ensureShortcutPermission(callingPackage);
            if (!canAccessProfile(user.getIdentifier(), "Cannot start activity")) {
            if (!canAccessProfile(user.getIdentifier(), "Cannot start activity")) {
                throw new ActivityNotFoundException("Activity could not be found");
                throw new ActivityNotFoundException("Activity could not be found");
            }
            }