Merge "[Settings] Fix inconsistent ringtone keyword search" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
8ff5f0cfc5
@@ -18,6 +18,7 @@ package com.android.settings.notification;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.RingtoneManager;
|
||||
import android.media.audio.Flags;
|
||||
|
||||
import com.android.settings.Utils;
|
||||
|
||||
@@ -36,6 +37,9 @@ public class PhoneRingtonePreferenceController extends RingtonePreferenceControl
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
if (isRingtoneVibrationEnabled()) {
|
||||
return false;
|
||||
}
|
||||
return Utils.isVoiceCapable(mContext);
|
||||
}
|
||||
|
||||
@@ -43,4 +47,9 @@ public class PhoneRingtonePreferenceController extends RingtonePreferenceControl
|
||||
public int getRingtoneType() {
|
||||
return RingtoneManager.TYPE_RINGTONE;
|
||||
}
|
||||
|
||||
private boolean isRingtoneVibrationEnabled() {
|
||||
return Flags.enableRingtoneHapticsCustomization() && mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_ringtoneVibrationSettingsSupported);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user