Merge "Hide the Default Notification Sound if enabling customized vibration" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
2b9e976cbb
@@ -19,6 +19,7 @@ package com.android.settings.notification;
|
||||
import android.content.Context;
|
||||
import android.media.RingtoneManager;
|
||||
|
||||
import com.android.server.notification.Flags;
|
||||
import com.android.settings.R;
|
||||
|
||||
public class NotificationRingtonePreferenceController extends RingtonePreferenceControllerBase {
|
||||
@@ -31,6 +32,9 @@ public class NotificationRingtonePreferenceController extends RingtonePreference
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
if (isVibrationInSoundUriEnabled()) {
|
||||
return false;
|
||||
}
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_notification_ringtone);
|
||||
}
|
||||
|
||||
@@ -43,4 +47,9 @@ public class NotificationRingtonePreferenceController extends RingtonePreference
|
||||
public int getRingtoneType() {
|
||||
return RingtoneManager.TYPE_NOTIFICATION;
|
||||
}
|
||||
|
||||
private boolean isVibrationInSoundUriEnabled() {
|
||||
return Flags.notificationVibrationInSoundUri() && mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_ringtoneVibrationSettingsSupported);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user