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

Commit a0a5e23d authored by Jeff DeCew's avatar Jeff DeCew Committed by Automerger Merge Worker
Browse files

Merge "Add more state to dump to debug missing work profile notifs." into sc-v2-dev am: 270657d9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16248586

Change-Id: I0bb6558c1256b20f8beeac0f58eaa98f5dd4b703
parents 67610ea4 270657d9
Loading
Loading
Loading
Loading
+25 −6
Original line number Diff line number Diff line
@@ -88,9 +88,11 @@ public class NotificationLockscreenUserManagerImpl implements

    private final DevicePolicyManager mDevicePolicyManager;
    private final SparseBooleanArray mLockscreenPublicMode = new SparseBooleanArray();
    private final SparseBooleanArray mUsersWithSeperateWorkChallenge = new SparseBooleanArray();
    private final SparseBooleanArray mUsersWithSeparateWorkChallenge = new SparseBooleanArray();
    private final SparseBooleanArray mUsersAllowingPrivateNotifications = new SparseBooleanArray();
    private final SparseBooleanArray mUsersAllowingNotifications = new SparseBooleanArray();
    private final SparseBooleanArray mUsersInLockdownLatestResult = new SparseBooleanArray();
    private final SparseBooleanArray mShouldHideNotifsLatestResult = new SparseBooleanArray();
    private final UserManager mUserManager;
    private final List<UserChangedListener> mListeners = new ArrayList<>();
    private final BroadcastDispatcher mBroadcastDispatcher;
@@ -318,7 +320,9 @@ public class NotificationLockscreenUserManagerImpl implements
        if (userId == UserHandle.USER_ALL) {
            userId = mCurrentUserId;
        }
        return Dependency.get(KeyguardUpdateMonitor.class).isUserInLockdown(userId);
        boolean inLockdown = Dependency.get(KeyguardUpdateMonitor.class).isUserInLockdown(userId);
        mUsersInLockdownLatestResult.put(userId, inLockdown);
        return inLockdown;
    }

    /**
@@ -326,9 +330,11 @@ public class NotificationLockscreenUserManagerImpl implements
     * If so, notifications should be hidden.
     */
    public boolean shouldHideNotifications(int userId) {
        return isLockscreenPublicMode(userId) && !userAllowsNotificationsInPublic(userId)
        boolean hide = isLockscreenPublicMode(userId) && !userAllowsNotificationsInPublic(userId)
                || (userId != mCurrentUserId && shouldHideNotifications(mCurrentUserId))
                || shouldTemporarilyHideNotifications(userId);
        mShouldHideNotifsLatestResult.put(userId, hide);
        return hide;
    }

    /**
@@ -469,7 +475,7 @@ public class NotificationLockscreenUserManagerImpl implements

    @Override
    public boolean needsSeparateWorkChallenge(int userId) {
        return mUsersWithSeperateWorkChallenge.get(userId, false);
        return mUsersWithSeparateWorkChallenge.get(userId, false);
    }

    /**
@@ -608,7 +614,7 @@ public class NotificationLockscreenUserManagerImpl implements
        //   - device keyguard is shown in secure mode;
        //   - profile is locked with a work challenge.
        SparseArray<UserInfo> currentProfiles = getCurrentProfiles();
        mUsersWithSeperateWorkChallenge.clear();
        mUsersWithSeparateWorkChallenge.clear();
        for (int i = currentProfiles.size() - 1; i >= 0; i--) {
            final int userId = currentProfiles.valueAt(i).id;
            boolean isProfilePublic = devicePublic;
@@ -622,7 +628,7 @@ public class NotificationLockscreenUserManagerImpl implements
                isProfilePublic = showingKeyguard || mKeyguardManager.isDeviceLocked(userId);
            }
            setLockscreenPublicMode(isProfilePublic, userId);
            mUsersWithSeperateWorkChallenge.put(userId, needsSeparateChallenge);
            mUsersWithSeparateWorkChallenge.put(userId, needsSeparateChallenge);
        }
        getEntryManager().updateNotifications("NotificationLockscreenUserManager.updatePublicMode");
    }
@@ -689,6 +695,7 @@ public class NotificationLockscreenUserManagerImpl implements
                pw.print("" + userId + " ");
            }
        }
        pw.println();
        pw.print("  mCurrentManagedProfiles=");
        synchronized (mLock) {
            for (int i = mCurrentManagedProfiles.size() - 1; i >= 0; i--) {
@@ -696,5 +703,17 @@ public class NotificationLockscreenUserManagerImpl implements
            }
        }
        pw.println();
        pw.print("  mLockscreenPublicMode=");
        pw.println(mLockscreenPublicMode);
        pw.print("  mUsersWithSeparateWorkChallenge=");
        pw.println(mUsersWithSeparateWorkChallenge);
        pw.print("  mUsersAllowingPrivateNotifications=");
        pw.println(mUsersAllowingPrivateNotifications);
        pw.print("  mUsersAllowingNotifications=");
        pw.println(mUsersAllowingNotifications);
        pw.print("  mUsersInLockdownLatestResult=");
        pw.println(mUsersInLockdownLatestResult);
        pw.print("  mShouldHideNotifsLatestResult=");
        pw.println(mShouldHideNotifsLatestResult);
    }
}