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

Commit 516020a5 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Fix LauncherApps.isActivityEnalbed()

It should say false for disabled activities too.

Fix: 113135768
Test: manual test with "pm disable com.google.android.deskclock/com.android.deskclock.DeskClock"
and "pm enable"

Change-Id: Ib5d986178a1f37ef60268ff3cc58271b1e2808e7
parent e8d1eaa1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -781,6 +781,9 @@ public class LauncherApps {
    /**
     * Checks if the activity exists and it enabled for a profile.
     *
     * <p>The activity may still not be exported, in which case {@link #startMainActivity} will
     * throw a {@link SecurityException} unless the caller has the same UID as the target app's.
     *
     * @param component The activity to check.
     * @param user The UserHandle of the profile.
     *
+5 −1
Original line number Diff line number Diff line
@@ -837,7 +837,11 @@ public class LauncherAppsService extends SystemService {
                        PackageManager.MATCH_DIRECT_BOOT_AWARE
                                | PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
                        callingUid, user.getIdentifier());
                return info != null;
                // Note we don't check "exported" because if the caller has the same UID as the
                // callee's UID, it can still be launched.
                // (If an app doesn't export a front door activity and causes issues with the
                // launcher, that's just the app's bug.)
                return info != null && info.isEnabled();
            } finally {
                Binder.restoreCallingIdentity(ident);
            }