commit | 9cb5ab3860b4aa2240e8135240e8828f3ec747f5 | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Mon May 10 13:26:31 2021 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Mon May 10 13:26:31 2021 +0000 |
tree | 70dca2ab4035983779d518c4c300beb5e824bd9e | |
parent | 021e6b131f819407fd8085be8b188dab101af200 [diff] | |
parent | 540ad99d88c902a5b5238dec7a3cf1eb9c9713af [diff] |
Merge "Fix work profile setting appearing too often" into sc-dev
diff --git a/src/com/android/settings/notification/RedactNotificationPreferenceController.java b/src/com/android/settings/notification/RedactNotificationPreferenceController.java index 622b366a..d0326bb 100644 --- a/src/com/android/settings/notification/RedactNotificationPreferenceController.java +++ b/src/com/android/settings/notification/RedactNotificationPreferenceController.java
@@ -116,7 +116,7 @@ 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; }
diff --git a/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java index febda10..ae25474 100644 --- a/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/RedactNotificationPreferenceControllerTest.java
@@ -137,7 +137,7 @@ @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,