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

Commit 1f37df17 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Only check phoneStatusBarIcon if profile" into main

parents 3c02193d f09692bf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ class PhoneStatusBarPolicyTest : SysuiTestCase() {

    @Test
    fun testAppTransitionFinished_doesNotShowManagedProfileIcon() {
        whenever(userManager.isProfile(anyInt())).thenReturn(true)
        whenever(userManager.getUserStatusBarIconResId(anyInt())).thenReturn(0 /* ID_NULL */)
        whenever(keyguardStateController.isShowing).thenReturn(false)
        statusBarPolicy.appTransitionFinished(0)
@@ -232,6 +233,7 @@ class PhoneStatusBarPolicyTest : SysuiTestCase() {

    @Test
    fun testAppTransitionFinished_showsManagedProfileIcon() {
        whenever(userManager.isProfile(anyInt())).thenReturn(true)
        whenever(userManager.getUserStatusBarIconResId(anyInt())).thenReturn(100)
        whenever(keyguardStateController.isShowing).thenReturn(false)
        statusBarPolicy.appTransitionFinished(0)
+2 −1
Original line number Diff line number Diff line
@@ -617,7 +617,8 @@ public class PhoneStatusBarPolicy
        mUiBgExecutor.execute(() -> {
            try {
                final int userId = ActivityTaskManager.getService().getLastResumedActivityUserId();
                final int iconResId = mUserManager.getUserStatusBarIconResId(userId);
                final int iconResId = mUserManager.isProfile(userId) ?
                        mUserManager.getUserStatusBarIconResId(userId) : Resources.ID_NULL;
                mMainExecutor.execute(() -> {
                    final boolean showIcon;
                    if (iconResId != Resources.ID_NULL && (!mKeyguardStateController.isShowing()