Loading src/com/android/server/telecom/SystemSettingsUtil.java +8 −42 Original line number Diff line number Diff line Loading @@ -65,52 +65,18 @@ public class SystemSettingsUtil { } public boolean enableRampingRingerFromDeviceConfig() { String enableRampingRinger = DeviceConfig.getProperty( DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_ENABLED); if (enableRampingRinger == null) { Log.i(this, "Telephony.RAMPING_RINGER_ENABLED is null"); return false; } try { return Boolean.valueOf(enableRampingRinger); } catch (Exception e) { Log.wtf(this, "Error parsing Telephony.RAMPING_RINGER_ENABLED: " + e); return false; } return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_ENABLED, false); } public int getRampingRingerDuration() { String rampingRingerDuration = DeviceConfig.getProperty( DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_DURATION_MILLIS); if (rampingRingerDuration == null) { Log.i(this, "Telephony.RAMPING_RINGER_DURATION is null"); return -1; } try { return Integer.parseInt(rampingRingerDuration); } catch (Exception e) { Log.wtf(this, "Error parsing Telephony.RAMPING_RINGER_DURATION: " + e); return -1; } return DeviceConfig.getInt(DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_DURATION_MILLIS, -1); } public int getRampingRingerVibrationDuration() { String rampingRingerVibrationDuration = DeviceConfig.getProperty( DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_VIBRATION_DURATION); if (rampingRingerVibrationDuration == null) { Log.i(this, "Telephony.RAMPING_RINGER_VIBRATION_DURATION is null"); return 0; } try { return Integer.parseInt(rampingRingerVibrationDuration); } catch (Exception e) { Log.wtf(this, "Error parsing Telephony.RAMPING_RINGER_VIBRATION_DURATION: " + e); return 0; } return DeviceConfig.getInt(DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_VIBRATION_DURATION, 0); } } Loading
src/com/android/server/telecom/SystemSettingsUtil.java +8 −42 Original line number Diff line number Diff line Loading @@ -65,52 +65,18 @@ public class SystemSettingsUtil { } public boolean enableRampingRingerFromDeviceConfig() { String enableRampingRinger = DeviceConfig.getProperty( DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_ENABLED); if (enableRampingRinger == null) { Log.i(this, "Telephony.RAMPING_RINGER_ENABLED is null"); return false; } try { return Boolean.valueOf(enableRampingRinger); } catch (Exception e) { Log.wtf(this, "Error parsing Telephony.RAMPING_RINGER_ENABLED: " + e); return false; } return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_ENABLED, false); } public int getRampingRingerDuration() { String rampingRingerDuration = DeviceConfig.getProperty( DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_DURATION_MILLIS); if (rampingRingerDuration == null) { Log.i(this, "Telephony.RAMPING_RINGER_DURATION is null"); return -1; } try { return Integer.parseInt(rampingRingerDuration); } catch (Exception e) { Log.wtf(this, "Error parsing Telephony.RAMPING_RINGER_DURATION: " + e); return -1; } return DeviceConfig.getInt(DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_DURATION_MILLIS, -1); } public int getRampingRingerVibrationDuration() { String rampingRingerVibrationDuration = DeviceConfig.getProperty( DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_VIBRATION_DURATION); if (rampingRingerVibrationDuration == null) { Log.i(this, "Telephony.RAMPING_RINGER_VIBRATION_DURATION is null"); return 0; } try { return Integer.parseInt(rampingRingerVibrationDuration); } catch (Exception e) { Log.wtf(this, "Error parsing Telephony.RAMPING_RINGER_VIBRATION_DURATION: " + e); return 0; } return DeviceConfig.getInt(DeviceConfig.NAMESPACE_TELEPHONY, RAMPING_RINGER_VIBRATION_DURATION, 0); } }