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

Commit a978e6f5 authored by Jackal Guo's avatar Jackal Guo
Browse files

Apply visibility to #getSuspendedPackageLauncherExtras

Callers shouldn't be able to get the launcher extras if the target
package isn't visible to them.

Bug: 202298672
Test: atest AppEnumerationTests
Test: atest SuspendPackagesTest
Test: manually using the PoC in the buganizer to ensure the symptom
      no longer exists.

Change-Id: Iad37765710b0b13f9c338bbacdd68be5d2574d22
parent 2417a8a4
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -746,11 +746,15 @@ public class LauncherAppsService extends SystemService {
        @Override
        public Bundle getSuspendedPackageLauncherExtras(String packageName,
                UserHandle user) {
            if (!canAccessProfile(user.getIdentifier(), "Cannot get launcher extras")) {
            final int callingUid = injectBinderCallingUid();
            final int userId = user.getIdentifier();
            if (!canAccessProfile(userId, "Cannot get launcher extras")) {
                return null;
            }
            return mPackageManagerInternal.getSuspendedPackageLauncherExtras(packageName,
                    user.getIdentifier());
            if (mPackageManagerInternal.filterAppAccess(packageName, callingUid, userId)) {
                return null;
            }
            return mPackageManagerInternal.getSuspendedPackageLauncherExtras(packageName, userId);
        }

        @Override