commit | 07db5f4362a657dd3a4ba3860ec1a960126c7a17 | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Fri May 27 15:36:13 2022 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Fri May 27 15:36:13 2022 +0000 |
tree | 6f26eaa2958ce43e38a79ad9c94dad68a149658f | |
parent | a67d5e25a3216441fcf8230f5aa09b65de8dab20 [diff] | |
parent | 40fbcf333f09a92d6499cf94d67c60c3a03c9a33 [diff] |
Merge "Fix can't change notification sound for work profile." into tm-dev
diff --git a/src/com/android/settings/DefaultRingtonePreference.java b/src/com/android/settings/DefaultRingtonePreference.java index 824a5a0..9bf626c 100644 --- a/src/com/android/settings/DefaultRingtonePreference.java +++ b/src/com/android/settings/DefaultRingtonePreference.java
@@ -51,7 +51,7 @@ return; } - String mimeType = getContext().getContentResolver().getType(ringtoneUri); + String mimeType = mUserContext.getContentResolver().getType(ringtoneUri); if (mimeType == null) { Log.e(TAG, "onSaveRingtone for URI:" + ringtoneUri + " ignored: failure to find mimeType (no access from this context?)");
diff --git a/tests/unit/src/com/android/settings/DefaultRingtonePreferenceTest.java b/tests/unit/src/com/android/settings/DefaultRingtonePreferenceTest.java index b9dea01..7877684 100644 --- a/tests/unit/src/com/android/settings/DefaultRingtonePreferenceTest.java +++ b/tests/unit/src/com/android/settings/DefaultRingtonePreferenceTest.java
@@ -59,6 +59,7 @@ when(mDefaultRingtonePreference.getRingtoneType()) .thenReturn(RingtoneManager.TYPE_RINGTONE); mDefaultRingtonePreference.setUserId(1); + mDefaultRingtonePreference.mUserContext = context; } @Test