mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
fix: backup file and sigfall when app start (#2732)
* fix: backup loading * fix: qt 6.11 sig fall
This commit is contained in:
@@ -792,6 +792,16 @@ class AmneziaActivity : QtActivity() {
|
|||||||
else -> type = "*/*"
|
else -> type = "*/*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Force system document picker to avoid third-party file managers
|
||||||
|
// that may lack storage permissions (common on Android TV devices)
|
||||||
|
val systemPickerPackage = listOf("com.google.android.documentsui", "com.android.documentsui")
|
||||||
|
.firstOrNull { pkg ->
|
||||||
|
try { packageManager.getPackageInfo(pkg, 0); true }
|
||||||
|
catch (_: PackageManager.NameNotFoundException) { false }
|
||||||
|
}
|
||||||
|
if (systemPickerPackage != null) {
|
||||||
|
`package` = systemPickerPackage
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Intent(this@AmneziaActivity, TvFilePicker::class.java)
|
Intent(this@AmneziaActivity, TvFilePicker::class.java)
|
||||||
@@ -1064,13 +1074,11 @@ class AmneziaActivity : QtActivity() {
|
|||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
fun sendTouch(x: Float, y: Float) {
|
fun sendTouch(x: Float, y: Float) {
|
||||||
Log.v(TAG, "Send touch: $x, $y")
|
Log.v(TAG, "Send touch: $x, $y")
|
||||||
blockingCall {
|
|
||||||
findQtWindow(window.decorView)?.let {
|
findQtWindow(window.decorView)?.let {
|
||||||
Log.v(TAG, "Send touch to $it")
|
Log.v(TAG, "Send touch to $it")
|
||||||
it.dispatchTouchEvent(createEvent(x, y, SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN))
|
it.dispatchTouchEvent(createEvent(x, y, SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN))
|
||||||
it.dispatchTouchEvent(createEvent(x, y, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP))
|
it.dispatchTouchEvent(createEvent(x, y, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findQtWindow(view: View): View? {
|
private fun findQtWindow(view: View): View? {
|
||||||
|
|||||||
Reference in New Issue
Block a user