Merge "Fix work profile setting appearing too often" into sc-dev am: 9cb5ab3860

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14470515

Change-Id: I327dc293b5441ff010e931feaacc11125f28f780
This commit is contained in:
TreeHugger Robot
2021-05-10 13:43:42 +00:00
committed by Automerger Merge Worker
2 changed files with 2 additions and 2 deletions

View File

@@ -116,7 +116,7 @@ public class RedactNotificationPreferenceController extends TogglePreferenceCont
public int getAvailabilityStatus() {
// hide work profile setting if no work profile
if (KEY_LOCKSCREEN_WORK_PROFILE_REDACT.equals(getPreferenceKey())
&& mProfileUserId == UserHandle.USER_NULL) {
&& mProfileUserId == UserHandle.myUserId()) {
return CONDITIONALLY_UNAVAILABLE;
}

View File

@@ -137,7 +137,7 @@ public class RedactNotificationPreferenceControllerTest {
@Test
public void getAvailabilityStatus_noWorkProfile() {
// reset controllers with no work profile
when(mUm.getProfileIdsWithDisabled(anyInt())).thenReturn(new int[] {UserHandle.USER_NULL});
when(mUm.getProfileIdsWithDisabled(anyInt())).thenReturn(new int[] {UserHandle.myUserId()});
mWorkController = new RedactNotificationPreferenceController(mMockContext,
RedactNotificationPreferenceController.KEY_LOCKSCREEN_WORK_PROFILE_REDACT);
mController = new RedactNotificationPreferenceController(mMockContext,