fix CC for work profiles

Bug: 22257554
Change-Id: I09f62956d01f91d3014d9fa250aaff68ab5e1a9b
This commit is contained in:
Andres Morales
2015-08-04 16:55:00 -07:00
parent 1adca55ffe
commit 7bdffd85eb
4 changed files with 49 additions and 22 deletions

View File

@@ -1235,4 +1235,15 @@ public final class Utils {
Spannable.SPAN_INCLUSIVE_INCLUSIVE);
return str;
}
}
public static int getEffectiveUserId(Context context) {
UserManager um = UserManager.get(context);
if (um != null) {
return um.getCredentialOwnerProfile(UserHandle.myUserId());
} else {
Log.e(TAG, "Unable to acquire UserManager");
return UserHandle.myUserId();
}
}
}