From 0c507ead85cc603d0e4a2f5e58e9247a1fae262d Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 21 Feb 2024 18:16:40 +0000 Subject: [PATCH] PythonActivity.setSecureWindow: don't redraw after clearing FLAG_SECURE --- .../src/main/java/org/kivy/android/PythonActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/bootstraps/qt6/build/src/main/java/org/kivy/android/PythonActivity.java b/pythonforandroid/bootstraps/qt6/build/src/main/java/org/kivy/android/PythonActivity.java index decbb12825..a55be27dc8 100644 --- a/pythonforandroid/bootstraps/qt6/build/src/main/java/org/kivy/android/PythonActivity.java +++ b/pythonforandroid/bootstraps/qt6/build/src/main/java/org/kivy/android/PythonActivity.java @@ -130,11 +130,14 @@ public void run() { } else { Log.v(TAG, "UnSetting Secure Window"); window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE); - if (ViewCompat.isAttachedToWindow(window.getDecorView())) { + // The below forces a redraw of the window/view, which is needed on some phones + // to actually clear the flag. However on some other phones, it crashes the app... + // see https://github.com/spesmilo/electrum/issues/8522 + /*if (ViewCompat.isAttachedToWindow(window.getDecorView())) { WindowManager wm = this.mActivity.getWindowManager(); wm.removeViewImmediate(window.getDecorView()); wm.addView(window.getDecorView(), window.getAttributes()); - } + }*/ } } }._initialize(this, secure));