Merge "Fix can't change notification sound for work profile." into tm-dev

This commit is contained in:
TreeHugger Robot
2022-05-27 15:36:13 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 1 deletions

View File

@@ -51,7 +51,7 @@ public class DefaultRingtonePreference extends RingtonePreference {
return; return;
} }
String mimeType = getContext().getContentResolver().getType(ringtoneUri); String mimeType = mUserContext.getContentResolver().getType(ringtoneUri);
if (mimeType == null) { if (mimeType == null) {
Log.e(TAG, "onSaveRingtone for URI:" + ringtoneUri Log.e(TAG, "onSaveRingtone for URI:" + ringtoneUri
+ " ignored: failure to find mimeType (no access from this context?)"); + " ignored: failure to find mimeType (no access from this context?)");

View File

@@ -59,6 +59,7 @@ public class DefaultRingtonePreferenceTest {
when(mDefaultRingtonePreference.getRingtoneType()) when(mDefaultRingtonePreference.getRingtoneType())
.thenReturn(RingtoneManager.TYPE_RINGTONE); .thenReturn(RingtoneManager.TYPE_RINGTONE);
mDefaultRingtonePreference.setUserId(1); mDefaultRingtonePreference.setUserId(1);
mDefaultRingtonePreference.mUserContext = context;
} }
@Test @Test