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

Commit bbb49f38 authored by ronish's avatar ronish
Browse files

Add support for directly opening ringtone picker

This is required for tiffin usecase wherein a tap on ringtone
icon should redirect the user to this phone ringtone picker

Bug: 216835089
Test: Tested manually
Change-Id: I9a070ab0d082c680885575478a56c43761d15c70
parent ca7f6bf9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
    private static final int REQUEST_CODE = 200;
    private static final int SAMPLE_CUTOFF = 2000;  // manually cap sample playback at 2 seconds

    private static final String EXTRA_OPEN_PHONE_RINGTONE_PICKER =
            "EXTRA_OPEN_PHONE_RINGTONE_PICKER";

    @VisibleForTesting
    static final int STOP_SAMPLE = 1;

@@ -102,6 +105,12 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
        replaceEnterpriseStringTitle("sound_work_settings",
                WORK_PROFILE_SOUND_SETTINGS_SECTION_HEADER,
                R.string.sound_work_settings);
        boolean openPhoneRingtonePicker = getIntent().getBooleanExtra(
                EXTRA_OPEN_PHONE_RINGTONE_PICKER, false);
        Preference phoneRingTonePreference = findPreference("phone_ringtone");
        if (phoneRingTonePreference != null && openPhoneRingtonePicker) {
            onPreferenceTreeClick(phoneRingTonePreference);
        }
    }

    @Override