Merge "Add support for directly opening ringtone picker"

This commit is contained in:
Ronish Kalia
2022-06-07 16:15:18 +00:00
committed by Android (Google) Code Review

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