Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 688ec25c authored by Arc Wang's avatar Arc Wang Committed by Android (Google) Code Review
Browse files

Merge changes from topic...

Merge changes from topic "presubmit-am-93b3a992dd6c4622a633bca394ada8e5-rvc-qpr-dev" into rvc-qpr-dev

* changes:
  [DO NOT MERGE] Fix can't change notification sound for work profile.
  [DO NOT MERGE] Fix Settings crash when setting a null ringtone
parents 68667974 0eb3011f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -46,7 +46,12 @@ public class DefaultRingtonePreference extends RingtonePreference {

    @Override
    protected void onSaveRingtone(Uri ringtoneUri) {
        String mimeType = getContext().getContentResolver().getType(ringtoneUri);
        if (ringtoneUri == null) {
            setActualDefaultRingtoneUri(ringtoneUri);
            return;
        }

        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?)");
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ public class DefaultRingtonePreferenceTest {
        when(mDefaultRingtonePreference.getRingtoneType())
                .thenReturn(RingtoneManager.TYPE_RINGTONE);
        mDefaultRingtonePreference.setUserId(1);
        mDefaultRingtonePreference.mUserContext = context;
    }

    @Test