Add Work Challenge Notifications Setting
Bug: 26844582
Change-Id: Ib1eb28cfebcc0c8d23ec8669f2777ccb822d7bf3
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index c6af8fb..e719291 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -596,6 +596,23 @@
}
/**
+ * Retrieves the id for the given user's managed profile.
+ *
+ * @return the managed profile id or UserHandle.USER_NULL if there is none.
+ */
+ public static int getManagedProfileId(UserManager um, int parentUserId) {
+ List<UserInfo> profiles = um.getProfiles(parentUserId);
+ int numProfiles = profiles.size();
+ for (int i = 0; i < numProfiles; ++i) {
+ UserInfo profile = profiles.get(i);
+ if (profile.id != parentUserId) {
+ return profile.id;
+ }
+ }
+ return UserHandle.USER_NULL;
+ }
+
+ /**
* Returns true if the userId passed in is a managed profile.
*
* @throws IllegalArgumentException if userManager is null.