Merge "Prompt to start user before choosing a new ringtone"

This commit is contained in:
Robin Lee
2017-01-27 14:03:12 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 14 deletions

View File

@@ -160,9 +160,8 @@ public class WorkSoundPreferenceController extends PreferenceController implemen
}
private CharSequence updateRingtoneName(Context context, int type) {
if (context == null) {
Log.e(TAG, "Unable to update ringtone name, no context provided");
return null;
if (context == null || !UserManager.get(context).isUserUnlocked(context.getUserId())) {
return context.getString(R.string.managed_profile_not_available_label);
}
Uri ringtoneUri = RingtoneManager.getActualDefaultRingtoneUri(context, type);
return Ringtone.getTitle(context, ringtoneUri, false /* followSettingsUri */,