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
This commit is contained in:
ronish
2022-05-31 15:51:56 +00:00
parent ca7f6bf933
commit bbb49f38c3

View File

@@ -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