if the user presses Back at the dialer without an established call, hang it up
This commit is contained in:
parent
52c569f58b
commit
8be55a4be1
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue