Search in sources :

Example 1 with DefaultRingtonePreference

use of com.android.settings.DefaultRingtonePreference in project android_packages_apps_Settings by crdroidandroid.

the class WorkSoundPreferenceController method initWorkPreference.

private DefaultRingtonePreference initWorkPreference(PreferenceGroup root, String key) {
    DefaultRingtonePreference pref = (DefaultRingtonePreference) root.findPreference(key);
    pref.setOnPreferenceChangeListener(this);
    // Required so that RingtonePickerActivity lists the work profile ringtones
    pref.setUserId(mManagedProfileId);
    return pref;
}
Also used : DefaultRingtonePreference(com.android.settings.DefaultRingtonePreference)

Example 2 with DefaultRingtonePreference

use of com.android.settings.DefaultRingtonePreference in project platform_packages_apps_Settings by BlissRoms.

the class WorkSoundPreferenceController method initWorkPreference.

private DefaultRingtonePreference initWorkPreference(PreferenceGroup root, String key) {
    DefaultRingtonePreference pref = (DefaultRingtonePreference) root.findPreference(key);
    pref.setOnPreferenceChangeListener(this);
    // Required so that RingtonePickerActivity lists the work profile ringtones
    pref.setUserId(mManagedProfileId);
    return pref;
}
Also used : DefaultRingtonePreference(com.android.settings.DefaultRingtonePreference)

Example 3 with DefaultRingtonePreference

use of com.android.settings.DefaultRingtonePreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class WorkSoundPreferenceController method initWorkPreference.

private DefaultRingtonePreference initWorkPreference(PreferenceGroup root, String key) {
    DefaultRingtonePreference pref = (DefaultRingtonePreference) root.findPreference(key);
    pref.setOnPreferenceChangeListener(this);
    // Required so that RingtonePickerActivity lists the work profile ringtones
    pref.setUserId(mManagedProfileId);
    return pref;
}
Also used : DefaultRingtonePreference(com.android.settings.DefaultRingtonePreference)

Example 4 with DefaultRingtonePreference

use of com.android.settings.DefaultRingtonePreference in project android_packages_apps_Settings by omnirom.

the class SoundWorkSettingsTest method onPreferenceTreeClick_isRingtonePreference_shouldStartActivity.

@Test
public void onPreferenceTreeClick_isRingtonePreference_shouldStartActivity() {
    final DefaultRingtonePreference ringtonePreference = mock(DefaultRingtonePreference.class);
    when(mMetricsFeatureProvider.logClickedPreference(any(Preference.class), anyInt())).thenReturn(true);
    mFragment.onPreferenceTreeClick(ringtonePreference);
    verify(mActivity).startActivityForResultAsUser(any(), anyInt(), any(), any(UserHandle.class));
}
Also used : DefaultRingtonePreference(com.android.settings.DefaultRingtonePreference) Preference(androidx.preference.Preference) DefaultRingtonePreference(com.android.settings.DefaultRingtonePreference) UserHandle(android.os.UserHandle) Test(org.junit.Test)

Example 5 with DefaultRingtonePreference

use of com.android.settings.DefaultRingtonePreference in project android_packages_apps_Settings by omnirom.

the class SoundWorkSettingsController method initWorkPreference.

private DefaultRingtonePreference initWorkPreference(PreferenceGroup root, String key) {
    final DefaultRingtonePreference pref = root.findPreference(key);
    pref.setOnPreferenceChangeListener(this);
    // Required so that RingtonePickerActivity lists the work profile ringtones
    pref.setUserId(mManagedProfileId);
    return pref;
}
Also used : DefaultRingtonePreference(com.android.settings.DefaultRingtonePreference)

Aggregations

DefaultRingtonePreference (com.android.settings.DefaultRingtonePreference)10 UserHandle (android.os.UserHandle)1 PhoneAccountHandle (android.telecom.PhoneAccountHandle)1 Preference (androidx.preference.Preference)1 Test (org.junit.Test)1