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

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

Merge changes from topics "presubmit-am-7e93fea7eeca4c76a2b33d5fe115ad40",...

Merge changes from topics "presubmit-am-7e93fea7eeca4c76a2b33d5fe115ad40", "presubmit-am-93b3a992dd6c4622a633bca394ada8e5-sc-dev" into sc-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 7d66c0ff 0d8d05a2
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