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

Commit 317db73d authored by Heemin Seog's avatar Heemin Seog
Browse files

Query for home intent as foreground user

Bug: 160971249
Test: manual (log current user and resolved activity while switching
users)

Change-Id: Ie73617fcb56639e5acd86bd968b82ed93750e4c2
parent edbf3411
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -2519,13 +2519,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        if (isUserUnlocked(getCurrentUser())) {
            return false;
        }
        Intent homeIntent = new Intent(Intent.ACTION_MAIN)
                .addCategory(Intent.CATEGORY_HOME);
        ResolveInfo resolveInfo = mContext.getPackageManager().resolveActivity(homeIntent,
                0 /* flags */);
        Intent homeIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME);
        ResolveInfo resolveInfo = mContext.getPackageManager().resolveActivityAsUser(homeIntent,
                0 /* flags */, getCurrentUser());

        // TODO(b/160971249): Replace in the future by resolving activity as user.
        if (resolveInfo == null && mIsAutomotive) {
        if (resolveInfo == null) {
            Log.w(TAG, "resolveNeedsSlowUnlockTransition: returning false since activity "
                    + "could not be resolved.");
            return false;