Remove volume_separate_notification flag

Fully enable the feature

Bug: b/255363741, b/38477228

Test: make DEBUG_ROBOLECTRIC=1 ROBOTEST_FILTER="NotificationVolumePreferenceControllerTest|SeparateRingVolumePreferenceControllerTest|RingerModeAffectedPreferenceControllerTest|SoundSettingsTest" RunSettingsRoboTests -j40
Change-Id: Iec490fc254f71b6461dbf9f9beb4a11645a4a497
This commit is contained in:
Behnam Heydarshahi
2023-05-15 15:15:33 +00:00
parent 0c57f69f60
commit f07e023302
10 changed files with 13 additions and 308 deletions

View File

@@ -21,14 +21,11 @@ import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
import android.media.AudioManager;
import android.os.Binder;
import android.os.ServiceManager;
import android.os.Vibrator;
import android.provider.DeviceConfig;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
import java.util.Objects;
@@ -48,11 +45,8 @@ public abstract class RingerModeAffectedVolumePreferenceController extends
protected Vibrator mVibrator;
protected int mRingerMode = AudioManager.RINGER_MODE_NORMAL;
protected ComponentName mSuppressor;
protected boolean mSeparateNotification;
protected INotificationManager mNoMan;
private static final boolean CONFIG_SEPARATE_NOTIFICATION_DEFAULT_VAL = false;
public RingerModeAffectedVolumePreferenceController(Context context, String key, String tag) {
super(context, key);
mTag = tag;
@@ -118,28 +112,6 @@ public abstract class RingerModeAffectedVolumePreferenceController extends
return mMuteIcon;
}
protected boolean isSeparateNotificationConfigEnabled() {
return Binder.withCleanCallingIdentity(()
-> DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
SystemUiDeviceConfigFlags.VOLUME_SEPARATE_NOTIFICATION,
CONFIG_SEPARATE_NOTIFICATION_DEFAULT_VAL));
}
/**
* side effect: updates the cached value of the config
* @return has the config changed?
*/
protected boolean readSeparateNotificationVolumeConfig() {
boolean newVal = isSeparateNotificationConfigEnabled();
boolean valueUpdated = newVal != mSeparateNotification;
if (valueUpdated) {
mSeparateNotification = newVal;
}
return valueUpdated;
}
/**
* Updates UI Icon in response to ringer mode changes.
* @return whether the ringer mode has changed.