Support private profile in spinner adapters

Screenshot - https://screenshot.googleplex.com/35czwQHeevX75pj
Video - https://drive.google.com/file/d/1LkYPJ3i8llArnQBE3ieLPYMctEOw3xdp/view?usp=sharing&resourcekey=0-j-3-VV4OyXJKBPXwAqJvKg

Bug: 328565911
Bug: 313610609
Bug: 302082696
Test: manual
Test: atest UserAdapterTest
Test: atest StylusDevicesControllerTest
Change-Id: If8395eba5cc73809ab4abc95bc13067451c38b8f
This commit is contained in:
Manish Singh
2024-03-08 17:04:23 +00:00
parent 7dee0538d6
commit d7ff6fe966
6 changed files with 197 additions and 32 deletions

View File

@@ -1364,6 +1364,16 @@ public final class Utils extends com.android.settingslib.Utils {
}
}
/**
* Returns true if the user should be hidden in Settings when it's in quiet mode.
*/
public static boolean shouldHideUser(
@NonNull UserHandle userHandle, @NonNull UserManager userManager) {
UserProperties userProperties = userManager.getUserProperties(userHandle);
return userProperties.getShowInQuietMode() == UserProperties.SHOW_IN_QUIET_MODE_HIDDEN
&& userManager.isQuietModeEnabled(userHandle);
}
private static FaceManager.RemovalCallback faceManagerRemovalCallback(int userId) {
return new FaceManager.RemovalCallback() {
@Override