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

Commit 6256b363 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Allow to update usersensitive while user is locked

By default direct boot unaware apps are not resolved when user is
locked. Hence the code thought that almost no app had an launcher icon
and many apps became system services.

Test: Updated user sensitive
Fixes: 129885864
Change-Id: I31b325a0d06f11e989a6044e1d3296e1e038636c
parent daaa6b79
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ import static android.app.role.RoleManager.ROLE_ASSISTANT;
import static android.content.Context.MODE_PRIVATE;
import static android.content.pm.PackageManager.FLAG_PERMISSION_USER_SENSITIVE_WHEN_DENIED;
import static android.content.pm.PackageManager.FLAG_PERMISSION_USER_SENSITIVE_WHEN_GRANTED;
import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE;
import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
import static android.os.UserHandle.myUserId;

import static com.android.packageinstaller.Constants.ASSISTANT_RECORD_AUDIO_IS_USER_SENSITIVE_KEY;
@@ -490,8 +492,8 @@ public final class Utils {

    public static ArraySet<String> getLauncherPackages(Context context) {
        ArraySet<String> launcherPkgs = new ArraySet<>();
        for (ResolveInfo info :
            context.getPackageManager().queryIntentActivities(LAUNCHER_INTENT, 0)) {
        for (ResolveInfo info : context.getPackageManager().queryIntentActivities(LAUNCHER_INTENT,
                MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE)) {
            launcherPkgs.add(info.activityInfo.packageName);
        }