mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
fix: black screen resume / pause (#2400)
This commit is contained in:
@@ -343,12 +343,22 @@ class AmneziaActivity : QtActivity() {
|
||||
resumeHandler.removeCallbacksAndMessages(null)
|
||||
openFileDeliveryScheduled = false
|
||||
Log.d(TAG, "Pause Amnezia activity")
|
||||
// Notify Qt to stop rendering before the EGL surface is disconnected
|
||||
mainScope.launch {
|
||||
qtInitialized.await()
|
||||
QtAndroidController.onActivityPaused()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
isActivityResumed = true
|
||||
Log.d(TAG, "Resume Amnezia activity")
|
||||
// Notify Qt to resume rendering after surface reconnects
|
||||
mainScope.launch {
|
||||
qtInitialized.await()
|
||||
QtAndroidController.onActivityResumed()
|
||||
}
|
||||
|
||||
if (pendingOpenFileUri != null && !openFileDeliveryScheduled) {
|
||||
val uri = pendingOpenFileUri!!
|
||||
|
||||
@@ -31,4 +31,7 @@ object QtAndroidController {
|
||||
|
||||
external fun onImeInsetsChanged(heightDp: Int)
|
||||
external fun onSystemBarsInsetsChanged(navBarHeightDp: Int, statusBarHeightDp: Int)
|
||||
|
||||
external fun onActivityPaused()
|
||||
external fun onActivityResumed()
|
||||
}
|
||||
Reference in New Issue
Block a user