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

Commit 540ad99d authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Fix work profile setting appearing too often

That is, when the user didn't have work profile

Test: robotests, manual
Fixes: 187520760
Change-Id: I9394359a6bc278d58ef13b30f8ce99cbaa595c25
parent f9ebf660
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
        }

+1 −1
Original line number Diff line number Diff line
@@ -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,