* correct behavior of back button on Android

* removing of annoying debug logs on Android
This commit is contained in:
Dmitriy Karpushin 2023-03-14 16:49:06 +03:00
parent fe7c66cf1d
commit 20846c8eff
4 changed files with 15 additions and 15 deletions

View file

@ -196,7 +196,6 @@ class VPNServiceBinder(service: VPNService) : Binder() {
try {
mListener?.let {
if (it.isBinderAlive) {
Log.i(tag, "Dispatching event: binder alive")
val data = Parcel.obtain()
data.writeByteArray(payload?.toByteArray(charset("UTF-8")))
it.transact(code, data, Parcel.obtain(), 0)

View file

@ -99,8 +99,6 @@ class VPNActivity : org.qtproject.qt.android.bindings.QtActivity() {
if (!isBound) {
Log.d(TAG, "dispatchParcel: not bound")
return
} else {
Log.d(TAG, "dispatchParcel: bound")
}
val out: Parcel = Parcel.obtain()
@ -331,12 +329,4 @@ class VPNActivity : org.qtproject.qt.android.bindings.QtActivity() {
onActivityMessage(UI_EVENT_QR_CODE_RECEIVED, extra)
}
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK && event.repeatCount == 0) {
onBackPressed()
return true
}
return super.onKeyDown(keyCode, event)
}
}