diff options
2 files changed, 4 insertions, 1 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt index 83600422bda4..e1589b6ad4bd 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt @@ -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) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java index f8eae3607f6a..a2b4e7b474a0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java @@ -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() |