if the user presses Back at the dialer without an established call, hang it up

This commit is contained in:
tibbi 2018-11-21 19:06:34 +01:00
parent 52c569f58b
commit 8be55a4be1

View file

@ -95,6 +95,13 @@ class DialerActivity : SimpleActivity(), SensorEventListener {
}
}
override fun onBackPressed() {
super.onBackPressed()
if (!isCallActive) {
hangUp()
}
}
private fun initProximityWakeLock() {
sensorManager = getSystemService(Context.SENSOR_SERVICE) as SensorManager
proximity = sensorManager!!.getDefaultSensor(Sensor.TYPE_PROXIMITY)