Merge "Fix 4 broken work profile tests"
This commit is contained in:
@@ -42,6 +42,10 @@ public class AudioHelper {
|
||||
return Utils.getManagedProfileId(um, UserHandle.myUserId());
|
||||
}
|
||||
|
||||
public boolean isUserUnlocked(UserManager um, @UserIdInt int userId) {
|
||||
return um.isUserUnlocked(userId);
|
||||
}
|
||||
|
||||
public Context createPackageContextAsUser(@UserIdInt int profileId) {
|
||||
return Utils.createPackageContextAsUser(mContext, profileId);
|
||||
}
|
||||
|
@@ -160,8 +160,8 @@ public class WorkSoundPreferenceController extends PreferenceController implemen
|
||||
}
|
||||
|
||||
private CharSequence updateRingtoneName(Context context, int type) {
|
||||
if (context == null || !UserManager.get(context).isUserUnlocked(context.getUserId())) {
|
||||
return context.getString(R.string.managed_profile_not_available_label);
|
||||
if (context == null || !mHelper.isUserUnlocked(mUserManager, context.getUserId())) {
|
||||
return mContext.getString(R.string.managed_profile_not_available_label);
|
||||
}
|
||||
Uri ringtoneUri = RingtoneManager.getActualDefaultRingtoneUri(context, type);
|
||||
return Ringtone.getTitle(context, ringtoneUri, false /* followSettingsUri */,
|
||||
|
Reference in New Issue
Block a user