Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97e634c7 authored by Matt Pape's avatar Matt Pape
Browse files

Remove interface for Telephony from DeviceConfig.

Per API council feedback, we are making changes to include only the
namespace in the system API defined in DeviceConfig.java. Strings which
define property names should be defined in code local to the feature
instead.

Bug: 126411407
Test: atest FrameworksCoreTests:DeviceConfigTest
Change-Id: I5961a060201214841f5f0414abc00c33c0c2cbac
parent 4ea6fe79
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -29,6 +29,16 @@ import com.android.internal.annotations.VisibleForTesting;
@VisibleForTesting
public class SystemSettingsUtil {

    /** Flag for ringer ramping time in milliseconds. */
    private static final String RAMPING_RINGER_DURATION_MILLIS = "ramping_ringer_duration";

    /** Flag for vibration time in milliseconds before ramping ringer starts. */
    private static final String RAMPING_RINGER_VIBRATION_DURATION =
            "ramping_ringer_vibration_duration";

    /** Flag for whether or not to apply ramping ringer on incoming phone calls. */
    private static final String RAMPING_RINGER_ENABLED = "ramping_ringer_enabled";

    public boolean isTheaterModeOn(Context context) {
        return Settings.Global.getInt(context.getContentResolver(), Settings.Global.THEATER_MODE_ON,
                0) == 1;
@@ -56,8 +66,7 @@ public class SystemSettingsUtil {

    public boolean enableRampingRingerFromDeviceConfig() {
        String enableRampingRinger = DeviceConfig.getProperty(
            DeviceConfig.Telephony.NAMESPACE,
            DeviceConfig.Telephony.RAMPING_RINGER_ENABLED);
            DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_ENABLED);
        if (enableRampingRinger == null) {
            Log.i(this, "Telephony.RAMPING_RINGER_ENABLED is null");
            return false;
@@ -73,8 +82,7 @@ public class SystemSettingsUtil {

    public int getRampingRingerDuration() {
        String rampingRingerDuration = DeviceConfig.getProperty(
            DeviceConfig.Telephony.NAMESPACE,
            DeviceConfig.Telephony.RAMPING_RINGER_DURATION);
                DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_DURATION_MILLIS);
        if (rampingRingerDuration == null) {
            Log.i(this, "Telephony.RAMPING_RINGER_DURATION is null");
            return -1;
@@ -90,8 +98,7 @@ public class SystemSettingsUtil {

    public int getRampingRingerVibrationDuration() {
        String rampingRingerVibrationDuration = DeviceConfig.getProperty(
            DeviceConfig.Telephony.NAMESPACE,
            DeviceConfig.Telephony.RAMPING_RINGER_VIBRATION_DURATION);
                DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_VIBRATION_DURATION);
        if (rampingRingerVibrationDuration == null) {
            Log.i(this,
                "Telephony.RAMPING_RINGER_VIBRATION_DURATION is null");