Search in sources :

Example 6 with DefaultRingtonePreference

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

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 7 with DefaultRingtonePreference

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

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 8 with DefaultRingtonePreference

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

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 9 with DefaultRingtonePreference

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

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 10 with DefaultRingtonePreference

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

the class PhoneRingtonePreferenceController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    DefaultRingtonePreference ringtonePreference = (DefaultRingtonePreference) screen.findPreference(getPreferenceKey());
    PhoneAccountHandle phoneAccountHandle = getCurrentPhoneAccountHandle();
    ringtonePreference.setPhoneAccountHandle(phoneAccountHandle);
    if (hasMultiPhoneAccountHandle()) {
        // For multi PhoneAccountHandle case, will show multi ringtone setting.
        // So shoud show "Phone ringtone - operator name" for each ringtone setting.
        CharSequence displayName = getDisplayNameForRingtonePreference(phoneAccountHandle);
        if (displayName != null) {
            ringtonePreference.setTitle(mContext.getString(R.string.ringtone_title) + RINGTONE_DELIMITER_FOR_PHONE_ACCOUNT_HANDLE + displayName);
        }
    }
}
Also used : DefaultRingtonePreference(com.android.settings.DefaultRingtonePreference) PhoneAccountHandle(android.telecom.PhoneAccountHandle)

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