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

Commit 3a74a678 authored by Rhed Jao's avatar Rhed Jao Committed by Android (Google) Code Review
Browse files

Merge "Enforce package visibility to the api shouldHideFromSuggestions"

parents 04bdda92 63cfbfcc
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -407,11 +407,16 @@ public class LauncherAppsService extends SystemService {

        @Override
        public boolean shouldHideFromSuggestions(String packageName, UserHandle user) {
            if (!canAccessProfile(user.getIdentifier(), "cannot get shouldHideFromSuggestions")) {
            final int userId = user.getIdentifier();
            if (!canAccessProfile(userId, "cannot get shouldHideFromSuggestions")) {
                return false;
            }
            final int flags = mPackageManagerInternal.getDistractingPackageRestrictions(packageName,
                    user.getIdentifier());
            if (mPackageManagerInternal.filterAppAccess(
                    packageName, Binder.getCallingUid(), userId)) {
                return false;
            }
            final int flags = mPackageManagerInternal.getDistractingPackageRestrictions(
                    packageName, userId);
            return (flags & PackageManager.RESTRICTION_HIDE_FROM_SUGGESTIONS) != 0;
        }