From 959ff6ae8e233144a234c9e11e6cc0e6fe355de5 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 19 May 2021 11:43:23 +0200 Subject: [PATCH] Android: Reset m_usePrimaryClip when clearing the clip data The variable needs to be set to false when we clear the clip data as there is no primary clip anymore so we should not try to access it when setting new data. Fixes: QTBUG-93831 Change-Id: I309270dc075fcb0457607561ee23e12f7eb6397f Reviewed-by: Assam Boudjelthia (cherry picked from commit 96982bab0c5ff855100c1dcde23d090348be53db) Reviewed-by: Qt Cherry-pick Bot --- src/android/jar/src/org/qtproject/qt/android/QtNative.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/android/jar/src/org/qtproject/qt/android/QtNative.java b/src/android/jar/src/org/qtproject/qt/android/QtNative.java index 81799a751ef..45cdd6e941a 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtNative.java @@ -1006,6 +1006,7 @@ public class QtNative { if (Build.VERSION.SDK_INT >= 28 && m_clipboardManager != null) m_clipboardManager.clearPrimaryClip(); + m_usePrimaryClip = false; } private static void setClipboardText(String text) {