63 Commits
Author SHA1 Message Date
Bartlomiej MoskalandQt Cherry-pick Bot 50a164e15a Android-Keyboard: Remove redundant code in isKeyboardHidden()
The m_keyboardIsVisible variable already reflects the current
keyboard visibility state. This commit simplifies the
isKeyboardHidden() method by using it directly, removing
unnecessary logic.

Task-number: QTBUG-98984
Change-Id: I6bba90e6fbfb1191415e7ee812517ca15ac1c937
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit acbcf992ee5b9978f22a76e03384b4d9ea34a76f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1e844fbf239669283d70e4d0ecf7678c381abfb4)
(cherry picked from commit ebf3269cfca7d132ca6cd91cb49cc25db93726f3)
2025-06-25 01:37:30 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot cfdd46a90c Android-Keyboard: Improve keyboard visibility tracking
Starting with API level 30, keyboard visibility can be easly checked
using [0]WindowInsets.isVisible(int). This eliminates the need for
relying on callbacks to detect when the keyboard opens or closes.

This commit updates the logic to track keyboard visibility by
observing changes via OnApplyWindowInsetsListener and checking for
visibility changes using the new API.  From now on, for API 30 and
above, the internal keyboard visibility property should no longer be
updated manually.

[0] https://developer.android.com/reference/android/view/WindowInsets#isVisible(int)

Task-number: QTBUG-98984
Change-Id: I40f3ccc4e652f1ae0c6c0ebd154d690d1a9d7ca8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 33cf82c13d6e3e9fc6d15b725f7ebe15be3d4631)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3f72e55bca1a368d6432c516b5048b4f6f8fc1b9)
(cherry picked from commit b62e1c47949b5893fcbbdd40c6576823f646f06c)
2025-06-25 01:37:26 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 0da0ae1eb3 Android-Keyboard: Avoid manual keyboard visibility updates on API 30+
Keyboard visibility is now tracked via OnApplyWindowInsetsListener,
which provides reliable visibility state changes starting from API
level 30. In this setup, manually updating the visibility property
is unnecessary and may lead to inconsistencies.

Task-number: QTBUG-98984
Change-Id: Ife80898e20d4038efeae3438fb89b593bdaa056a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 21616e1447fb8583d81cb46b34ad25de4bd29d18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit af519f5d8a93a13b267b0561dac038021d1fc1d5)
(cherry picked from commit 17228c1edbf22202eb7b0a665fb3430102ffeb3e)
2025-06-24 19:38:50 +00:00
Bartlomiej Moskal eafbac7e26 Android-Keyboard: Use new show() / hide() methods for keyboard control
Starting with API level 30, Android introduced new
[0]WindowInsetsController.show(int) and [1]hide(int) methods for
controlling the keyboard visibility. This commit updates the code to use
these methods on devices running API 30 and above.

[0]https://developer.android.com/reference/android/view/WindowInsetsController#show(int)
[1]https://developer.android.com/reference/android/view/WindowInsetsController#hide(int)

Task-number: QTBUG-98984
Change-Id: Icfcad3430cd269353572f66f72114238045f7756
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3823d99a688813d2692eb0d4b99939a65bb6ee6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 75e575e18f0fbfa8571d9044beea3cf3939881ab)
(cherry picked from commit 2aae64c041e81f7c982b3d3a72fc78ea7ce00a5a)
2025-06-24 15:23:29 +02:00
Bartlomiej MoskalandQt Cherry-pick Bot 10c8cdb349 Android: Avoid restarting InputMethodManager during IME batch edits
beginBatchEdit() means the start of a batch of related input operations
from the Input Method Editor. We should not restart input until
endBatchEdit() is called. Restarting it before may cause issue with
inactive InputConnection.

This commit fixes an issue where calling
InputMethodManager.restartInput() during a batch edit (e.g., between
beginBatchEdit and endBatchEdit).

Fixes: QTBUG-136229
Change-Id: I408e6dfd8a91f2d0f1dd8c18dc0dcc2d13cc3e38
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit a4850d0e0f42229afe2af10cee5794d0de70416c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ddd53192d348d2c2751ca3b492bead42619f8200)
(cherry picked from commit 9b85022d56f32af7922a0538415ffb325438f749)
2025-06-05 08:22:33 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 79c7e65a10 Android: Fix text update issues with fullscreen virtual keyboard
In commit 1f6d7cbb34, we introduced
support for the full-screen software keyboard.

However, this revealed issues with text not updating correctly in the
view, particularly with composing text.

This commit addresses the problem by adding calls of [0]restartInput()
in three methods: setComposingText, deleteSurroundingText and
setSelection.

These calls help synchronize the editable state with the input method
and ensure the displayed text remains consistent and up-to-date.

There is one more issue that needs to be solved: QTBUG-136229

[0]https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#restartInput(android.view.View)

Fixes: QTBUG-135376
Fixes: QTBUG-128745
Fixes: QTBUG-130058
Change-Id: I3f905dd02cb3bfe5046b01164412f328160b7a8b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ab98013efc16766bb7a538f86b0b9de8db6634ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 066d99bb2b2a5d7fd3ea541d488d5db30c00c2e9)
2025-06-01 23:18:18 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot d0b32607d3 Android: Avoid lazy initialization of QAndroidPlatformServices
In commit ff51ea5418d131248b07e327513b41dad1231f37, lazy initialization
was introduced for QPlatformServices, including
QAndroidPlatformServices. However, this approach causes a regression.
When QAndroidPlatformServices is lazily initialized, the intent listener
registration is delayed. As a result, handling custom URL schemes is
affected - especially those coming from external applications.

To address this issue, this commit removes lazy initialization for
QAndroidPlatformServices.

Fixes: QTBUG-135489
Pick-to: 6.5
Change-Id: I24becdf4ac573e7a2ca101cfbc27560d1eb4adef
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 393c294e102bcd733141539552fda2f148e8b51b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4019fca886db6dc739735d4c595ac10905cb77b0)
2025-06-01 23:18:16 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 622bb6c65a Android: Set correct initial selection values in EditorInfo
Previously, when a TextInput field was pre-filled with text,
focusing the input would cause the keyboard to behave incorrectly.
Typing any character would duplicate the last word. This appeared
to be caused by the keyboard reapplying a composition segment
(e.g., the last word), without a proper pre-edit region
defined—resulting in the word being appended again.

This issue is resolved by correctly setting
EditorInfo.initialSelStart and EditorInfo.initialSelEnd when the
InputConnection is created. Properly initializing these values
ensures the IME (input method editor) can synchronize with the text
field correctly. It can be found in [0]documentation:

  "Also, take good care to fill in the EditorInfo object correctly and
   in its entirety, so that the connected IME can rely on its values.
   For example, EditorInfo.initialSelStart and EditorInfo.initialSelEnd
   members must be filled in with the correct cursor position for IMEs
   to work correctly with your application."

[0]https://developer.android.com/reference/android/view/View#onCreateInputConnection(android.view.inputmethod.EditorInfo)

Pick-to: 6.5
Fixes: QTBUG-135481
Change-Id: I5ae5a2fb22f285154ba3857033506d367bfd7642
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 6de8ce2af383c8d164c65ffca7dc845c52e4f2d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit eb3291f32d011e1aa5dc24259a90dc640da53d16)
2025-05-26 09:14:43 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 952ae094ba Mark androidjnimenu.cpp as security sensitive
QtAndroidMenu trying to parse the String by removeAmpersandEscapes
function.

Task-number: QTBUG-136817
Task-number: QTBUG-135178
Change-Id: I840607666f72d7a5813520c2aa183f1bf7082470
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 604231deafcaa31856fb442a9a2a416aaa06907a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d27c0bc0a30083275bd83974f37a3c350f7d827e)
2025-05-26 09:14:39 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot ae2b30bda0 Android tests: Fix for moving file in content URI test
In Android's manual URI content test, there is a test case for moving a
file to another directory. While the function works and the file is
moved correctly, the URI is no longer usable after this operation. The
file must be reopened with a new URI.

This commit updates fileOperations test case to use the new URL after
moving file to another directory

Fixes: QTBUG-134881
Change-Id: I114d76d6851815e7ee3d94ddc28d677d7c1ccea9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1a35a560ddcaf03d9e2f5f91cd6bcd006c6d0951)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 95ea70197f967286b151028bf33263e23af8118c)
2025-04-15 03:16:02 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 90e76ade6b Android: Do not modify Touch Event position in JAVA code
In QtWindow class, the Touch Event coordinates were increased by Layout
position. That allows to move to global coordinates.
In the same time, in 15674f4ce9ea455b47f68d8871d5676d7a731630 commit, we
started mapping coordinates of Touch Event to Global position. That
cause the issue with incorrectly handled touches for example with
QDialogs.

To avoid this issue, we will stop modify Touch Event position in JAVA
code. We will send only localPosition to not make transformation twice.

With this change, all events received from JAVA have local position of
their window.

Fixes: QTBUG-130576
Fixes: QTBUG-127925
Change-Id: I6b58e0369959840f869e31a3d96425c64507b39d
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 23fd2cfb015226d6894b9cbe5fa50b43f0134e99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 141f0611301f1f5443f62dabe52f8cc758a0da91)
2025-03-27 17:39:37 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot e9943b145c Android: Fix touchDown event coordinates
In the touchAdd method, the mapped touch point is divided by the
platform integration screen size.
In order not to mix different coordinate systems, we should use
platformWindow to correctly calculate global position of touch event.

Task-number: QTBUG-130576
Task-number: QTBUG-127925
Change-Id: Ic7653a60fb3def181f29a3e28b963878dc54a99e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 01d25533b4f3c63c0484930e06664ad61ce24748)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1bf44cc71f8454a93d2593404887c5672dd5f5ca)
2025-03-27 17:39:36 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot d5a2fbc881 Android: Fix for opening Url with authority
It seems that even we correctly get Uri from FileProvider, we still do
not used it. This patch started to use Uri received from FileProvider.

Additionally, to avoid the issue of case insensitivity, we started using
QString directly instead of QUrl for the openURL method.

Fixes: QTBUG-133702
Pick-to: 6.8.3
Change-Id: Ia3b5b6f1562194af4211b9d5bf6a0d56b43c1b05
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7ca68d0e2eb130f7d9f6c4d8cc8cbb0bbb068746)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2054b002160b91c2e017574571559c62412efbf1)
2025-03-16 19:53:27 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 5debb05089 Android: Update qtprovider_paths.xml file
The qtprovider_paths.xml is used by FileProvider[0]
The file defines the different file locations that can be used for
sharing content (with other apps). Previously it used only the
files-path type (for private files inside internal storage).

According: qstandardpaths_android.cpp file, we need much more here.

This commit adds more file types to qtprovider_paths.xml

[0]https://developer.android.com/reference/androidx/core/content/FileProvider

Task-number: QTBUG-133702
Pick-to: 6.8.3
Change-Id: I29c8eb3d00490e9127d0aa646b4c50643b5f51ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4a54c32e6bd149b7b5086fc69180b2b92c5f33fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6e0d7c4020f9fce2e14f80f3354ac99c218a3c52)
2025-03-16 19:53:26 +00:00
Bartlomiej Moskal 45cfaf16b3 AndroidTestRunner: allow to call additional/extra adb call
This commit adds a new parameter (--pre-test-adb-command) to
AndroidTestRunner. The new parameter allows to pass an extra adb command
which will be called by AndroidTestRunner after installation and before
running the test.

To set the mentioned argument the new parameter for qt_internal_add_test
was proposed: ANDROID_TESTRUNNER_PRE_TEST_ADB_COMMANDS.

The new parameter is needed especially for multimedia screen capture
tests. ScreenCapture feature needs an acceptation of Security Popup. It
can be automatically accepted with additional adb command.

Fixes: QTBUG-132249
Change-Id: Ib70cd05d60d4594961ca68b554c7aae11cf42240
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b4c82eba03388aa4f9e5b56f633e0e679a3b0123)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bc533b0fb2d50a8e124e5e54628ad847733a8de8)
Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@qt.io>
2025-02-12 09:59:42 +01:00
Bartlomiej MoskalandQt Cherry-pick Bot 154560df21 Android: Fix cursorHandle and EditPopup positions
After the commit 28df9a49776a88cb1a8e69348ae19a59b16a5b7e, a regression
occurred in the positioning of cursorHandle and EditPopup.

Previously, these positions were calculated using QtEditText
coordinates, which worked correctly because the QtEditText size matched
the QtWindow size. However, after the mentioned commit, the QtEditText
size no longer reflects the window size. In this case, we need to use
the parent View for calculations.

This adjustment was already made for the single cursorHandle.

This commit also updates the positioning of selection handles and the EditPopup.

Fixes: QTBUG-132589
Change-Id: I861292e363452d487284e3f603fe03a21a334aa4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5bd26fda7a3f0a509a64847b58b916830ebc2d0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 941434e81fe073d55607267ea839025282413900)
2025-02-10 21:26:32 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 161621312f Android: Unblacklist testQuickSelectionWithMouse test from tst_QLineEdit
Test was failing on Android because of three issues:
  1. Mouse selection does not work well with Android, especially when
     predictive text is enabled. After changes in
     de5ae6917c commit, mouse selection on
     Android needs ImhNoPredictiveText to be set for correct handling.
  2. Test sends mouse press events on center position of the QLineEdit.
     On some devices, the text would sometimes end before this center
     position. To avoid this situation the width is set directly.
  3. Android expects the mouse click to be released before the next
     click. If it doesn't, the next selection won't work properly

This commit fixes all those issues and unblacklists
testQuickSelectionWithMouse test

Fixes: QTBUG-87417
Fixes: QTQAINFRA-6896
Change-Id: Id19850446954196a077047e250ea24a91ae7255e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1b02900ffe02980cb3e69c60ca415fd694cd773a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b579f48790c3a77e26618c511ab305fda3599531)
2025-01-25 15:26:51 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 70417e5c89 Android: Unblacklist textMargin test from tst_QLineEdit
Older devices may have lower screen resolution. In this case, the
hardcoded width may not work as expected. For example, all text may
not fit in QLineEdit.
This was the reason why the tst_qlineedit::textMargin test failed on
some Android devices (especially x86 emulator with Android API 29).
When the left and right margins were set to 20, all tested text did
not fit in QLineEdit. When we clicked at the beginning of QLineEdit,
we clicked on the second character of the text. The cursor was moved
to position 1, which caused the test to fail.

This commit updates textMargin test to make sure that tested text will
fit in to the QLineEdit.

Task-number: QTBUG-87417
Fixes: QTQAINFRA-6897
Change-Id: I35352ac1e6f975e72d5c9638f8520f8ddd1d56ae
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 0a017308cca154b6f906c6e143fb33fe109316bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fdf4738be3a941a14a955aa6931ddfee2145ae58)
2025-01-17 21:55:03 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 7de701b1a3 Android: Unblacklist tst_QLineEdit selection tests
Using the left/right keyboard key will deselect the text but also
move the cursor. In this case, to be consistent with the test, the
cursor must return to the previous position. This allows to
unblacklist tests:
  - undo_keypressevents
  - leftKeyOnSelectedText

Task-number: QTBUG-87417
Fixes: QTQAINFRA-6890
Fixes: QTQAINFRA-6895
Change-Id: I8a6d7cca332fe365ca820a67c23d9cd3fc36fc43
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 43f2fdc25cfd356292636ea1f8160cf62bab4018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4ae1b626efaac7b4ae7fba62aacd2838b21ca311)
2025-01-17 21:55:03 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot e0e0854b05 Android: Fix for multi-ABI build in androiddeployqt
7499fd0229d63f969bf6ca58d3b764b96395bed2 commit cleans up the localLibs
to not add dependencies to the libs.xml file as they will not be
satisfied.

Mentioned change created a regression with multi-ABI build. It happens
because in qtDependencies[ARCH] container, some libs just have different
atchitecture prefix.

This commit remove architecture prefix when checking libs in
qtDependencies container.

Fixes: QTBUG-131707
Change-Id: Iae54779bfa4bd143ec35353604724d8ec4e35ef2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e59308c5119caac5d4f1024c7d8147e9887cb246)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6e3d2ad44f5a2c0baae8124c828e8998a14e1c25)
2024-12-17 23:26:45 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 0a32e20b11 Android: move implementation for checking if keyboard is displayed
Move implementation for checking if keyboard is displayed on the screen
from QtInputConnection to QtInputDelegate.
The QtInputDelegate class is responsible for showing/hiding the keyboard
and handling its visibility. Moving mentioned implementation there seems
reasonable. Also, this implementation will be used internally by
QtInputDelegate in the future.

Task-number: QTBUG-130000
Change-Id: I47cf8e8fb2ee9bea535b9e009dd4b43b28f19b80
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 229cff37c0b6f822e9c22734e66d8ce117723d22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-25 10:13:21 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot e27e9d4a20 Android: use WindowInsets for 30 API and above
For Android above API 30 we can directly just check if the keyboard is
visible. We do not need to calculate it size. This is useful as
floating keyboard has wrong size.

Task-number: QTBUG-130000
Change-Id: Ia91d8b9ddefc97f8d65a657aa7e75bb146feb00e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit d97bfafa86e752cc3a739d8efb749ddea2120ca5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-25 10:13:21 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 0cb75c28af Android: Do not use hardcoded value for Keyboard check
This part of code seems to be really old.
Unfortunately in newer device the Navigation Bar is bigger than 100.
So when Navigation Bar is visible - we assumed that keyboard is visible.
That is why this part of code is "dead" for devices with higer resolution.

To make this solution more flexible, we need to rely on the screen size.

Task-number: QTBUG-130000
Change-Id: I387fe58b4c6d22de83394cc8f51c75e7a55e72a1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 34d184911eac07c97f44e87de27f7e37a4ebda81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-25 10:13:21 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot e2e20c19f6 AndroidDeployQt: Remove not satisfied dependencies
In 438837ce27 commit, we stopped to copy
all dependent libs that are kept in plugin directory. This change sounds
reasonable, as we do not want to deploy unused libs.

Due to the mentioned change, when dependencies.xml contains *.so
libraries, they are not copied at all now. They are added to localLibs
(later pasted into libs.xml), but are not shipped with the apk.
So at the end we have dependencies in libs.xml on some libraries that
were not delievered.

This commit cleans up the localLibs to not add dependencies to the
libs.xml file as they will not be satisfied

Fixes: QTBUG-129946
Change-Id: I7157e2e65cb928adbe9d7c077e50b2ebcac94490
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7499fd0229d63f969bf6ca58d3b764b96395bed2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-05 15:37:24 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot b60db83faa Android: Allow to open Keyboard without touch
After changes in f4050cc5ea commit, the
keyboard can be opened only when internal m_currentEditText is set (what
is happening only on touch). Because of that, the keyboard cannot be
opened just by setting focus on an item like it was before.

To allow open the keyboard not only after touch, QtWindow needs to be
informed about each focus change.

Fixes: QTBUG-124360
Change-Id: Ic3ca4451f53df55bfb1f3e300078fd1916e77155
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2971dbfe062de6b0be3ed9f251f9506bd45d5854)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-09 21:34:58 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 4cbef8822a Android: Ensure that Layout params are applied on editText
Make sure that the Layout parameters are applied to the editText
before opening the Popup (in openContextMenu method).
Without them, it may cause incorrect behavior.

Especially in the case of the error:
  "E BufferLayer: dimension too large 212x9957
   E SurfaceFlinger: createBufferLayer() failed (Invalid argument)
   E SurfaceComposerClinet: SurfaceComposerClien::createSurface error
       Invalid argument"

It may cause crash.

Fixes: QTBUG-129770
Change-Id: Ib9ef4b5b77fb1faf196e56431976c2a0e6e4a1e2
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0d4778497ee13f93ecaff9036ee7f5f6d24bb2a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-09 21:34:58 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 258d90222d Android: Catch nullPointerExcetion for parentLayout
Add exception handling for non-existent parent for m_editText in
EditPopupMenu

Pick-to: 6.7
Change-Id: Ie01e1346185b494c1ac646ccfa9ed4a96c4ed85e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e39ea199167270971f45ab6c4b9c2c6c66b4b2ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 20:21:29 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 5ee47a970a Android: Override new methods in InputConnection
InputConnection interface got new method like [0]replaceText and some
overloaded (setComposingText, setComposingRegion and commitText) that
need to be override by QtInputConnection

[0]https://developer.android.com/reference/android/view/inputmethod/InputConnection#replaceText(int,%20int,%20java.lang.CharSequence,%20int,%20android.view.inputmethod.TextAttribute)

Task-number: QTBUG-120238
Pick-to: 6.7
Change-Id: I72a35ff6bf8cdc10d782b24efb6c99b92b33926d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit dbd5af6231c9182ef370eca2e06c485591d715b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 20:21:25 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot e3bea87ee3 Android: When setting new parent for childView remove old one
A view cannot have two parents. If the view already has a parent, you
must first call removeView() on the child's parent.

Fixes: QTBUG-129524
Pick-to: 6.7
Change-Id: I6a8340ed8db58a77626be17366d5c71bdfc8c762
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ecd4623f05abf419db6f0c3bdad406c1883b6509)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-04 16:01:43 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 5ee0a2124c Android: Change the touch points numbering
Start numbering Android touch points from 1 instead of 0.

The QPointingDevice was added in Qt6. This means we don't need to worry
about unique IDs for each touch point.
Different IDs are needed for multi touch. The touch point ID of each
physical finger must be unique and immutable as long as either finger is
still pressed.

Theoretically, it doesn't matter from what value we start the numbering
of touches.

The problem with numbering from 0 is that the touch point can be easy
overwritten. It is enough to create QSinglePointEvent (like QMouseEvent)
and by default touch point with 0 ID will be cleared and lose all
current data.

Because of that, Android's touch point numbering will start from 1
instead of 0.

Pick-to: 6.7 6.5
Fixes: QTBUG-112287
Change-Id: I83a4678a0751bdb7a5ff5353ec49866d4cca5f05
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit cb3b972bb128e0ee9e4e18a49119934eee4f7c6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:27:23 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 7b65e0395f Android: Fix keyboard inputType and imeOptions
There was a small mistake in:
d2ae5ef51e3339c11b1c0ed0b09f9d17b9708f53 commit, which caused a
regression in the input method.

While the function parameter name has been changed, the assignment name
has not. This resulted in the values never actually getting updated.

Fixes: QTBUG-125410
Pick-to: 6.7
Change-Id: I8e64e991d02546ddd078fd273f0b57491c63b55c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 79e00b0b25765b85b112b601fee70184b1efe3c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 15:53:34 +00:00
Bartlomiej Moskal 229cadb7a3 Android: Choose correct icon for QMessageBox
QMessageBox contains an icon that can be set using icon type. Before
this commit, android.R.attr.alertDialogIcon was used regardless of the
expected icon type. Only if setting failed, the icon from
android.R.drawable was set (depending on the expected icon type).

Previously, usage of android.R.attr.alertDialogIcon was the way to
consider Theme in choosing icon view. Since
31a0d99fa5 commit, getDrawable(id, theme)
is used with second parameter: Resources.Theme.

Because of that we can start to use only icons from android.R.drawable
and remove usage of android.R.attr.alertDialogIcon

Fixes: QTBUG-123334
Pick-to: 6.7 6.6 6.5
Change-Id: I6cfdaf30aea5d132e38ba5d78054089b51cf5f13
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-04-03 09:46:24 +02:00
Bartlomiej Moskal d10d76f9f2 Android: Hide text handle when it is out or covered
The text handle should not be visible in case when it is out of
the text-object, or when it is hidden by other object. That is why we
should call updateSelectionHandles() method after touch only in case
when cursor position fits to clipped input item rectangle.

Fixes: QTBUG-115005
Pick-to: 6.6 6.5
Change-Id: I35c083acd8fd4d5240e3bb15afa1afbec4ea0b26
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-02 10:16:32 +01:00
Bartlomiej Moskal 9c8651478b Android: Fix for hiding cursor handles
After c80f262258 commit (which fixed
selection for read-only texts), checking if m_handleMode is Hidden was
removed. Because of that hidding cursor handle stopped work correctly.

This commit brings back check if m_handleMode is Hidden.

Also when only one handle is visible, it should be hidden within the
next 5 seconds regardless for keyboard visibility. That is how it is
handled in pure Android apps.

Pick-to: 6.6 6.5
Fixes: QTBUG-117367
Change-Id: I0400f9604234bfad7fe17d74673ae9a93088bab4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2023-10-24 17:52:06 +00:00
Bartlomiej Moskal 0f0ab90cf6 Android: Handle ImhNoTextHandles flag from InputMethodHints
[0]Qt::InputMethodHints has a flag ImhNoTextHandles that was not
handled. This flag should be considered when QAndroidInputContext is
updating Text handles position.
What is more, this flag can be used to fix the problem with visible
text cursor out of the text object.

[0]https://doc.qt.io/qt-6/qt.html#InputMethodHint-enum

Task-number: QTBUG-115005
Pick-to: 6.6 6.5
Change-Id: Ie50b77d7afbadfebe73f10137f09da9560aea1ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2023-09-15 13:36:15 +00:00
Bartlomiej Moskal 51d331b13b Android: Fix wrong position of EditPopupMenu
When Edit Popup Menu was not shown, the size of EditContextView was
wrongly returned. That is why the popup appeared in the wrong position
and then "jumped" to the right one.

To get correct values even when Popup is invisible, size should be
calculated manually by getting height/width of all visible buttons (with
getMeasuredHeight/getMeasuredWidth[0]) and paddings of EditContextView.

[0]https://developer.android.com/reference/android/view/View#getMeasuredWidth()

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-115632
Change-Id: I5f6abffab1a1e836c59a922ffa727d893ca9820f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-08-18 10:07:34 +00:00
Bartlomiej Moskal fdccb66a4e Android: Fix for checking clipboard text mime type
Different mime types are widely used on mobile devices. For example all
text copied from gmail is copied as text/html type.

After 2937cf91c7 commit there is a
regression that makes it impossible to paste any text different than
"text/plain".

To fix it, any "text/*" mime type should be treat as it contains a text
(not only "text/plain"). That will allow to paste different text mime
types.

During this work also tst_qclipboard testset was turned on for Android
and new test (getTextFromHTMLMimeType) was added.

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-113461
Change-Id: I3ef9476b8facdc3b61f144bd55222898390127c9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-07-12 00:53:58 +02:00
Bartlomiej MoskalandAssam Boudjelthia beaaa0bf02 Android: Restore the default QSettings path to the .config directory
After 140ca89a3c commit, the path of the
QSettings default file location changed. That caused the problem with
updating the app (old settings file is not used anymore). That is why we
should still use old (.config) directory for QSettings file if the file
exists.

Pick-to: 6.2 6.5 6.6
Fixes: QTBUG-109405
Fixes: QTBUG-109369
Change-Id: I8ce53e0a80e4c2d16802b27b000ab3fbed198628
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-06-13 11:48:05 +00:00
Bartlomiej Moskal a273ea7f41 Android: fix problem with release package for cmake based builds
After 9efaf8bae9 commit there was no
possibility to create release package for cmake based builds.
The new cmake variable (QT_ANDROID_DEPLOY_RELEASE) was already added to
allow turning on release build manually

This commit sets the --release flag automatically for androiddeployqt
tool for Release, RelWithDebInfo and MinSizeRel build types.

The --release flag is not set automatically if QT_BUILD_TESTS variable
is set. This is the workaround for tests. Release package need to be
signed. Signing is currently not supported by CI. What is more, also
androidtestrunner is not working on release APKs.

Fixes: QTBUG-112921
Fixes: QTBUG-108132
Task-number: COIN-882
Pick-to: 6.5
Change-Id: Ia81465f4a0f0e5b8dfa50c44028658f7a2346c1a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-05-24 12:58:27 +02:00
Bartlomiej Moskal 64db65ae90 Android: fix problem with release package for cmake based builds
After 9efaf8bae9 commit there is no
possibility to create release package for cmake based builds.

Added a new cmake variable (QT_ANDROID_DEPLOY_RELEASE) to allow turning
on release build manually.

Task-number: QTBUG-112921
Task-number: QTBUG-108132
Task-number: COIN-882
Pick-to: 6.5
Change-Id: Idf015b4ad3f8cba792aab75a01e1c81225cad4f0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-05-11 12:47:52 +02:00
Bartlomiej Moskal 1bf8c1e23d Examples doc: Remove not needed android tag
There are two examples for Camera in Multimedia module. One of them is
using widgets, while the second one is QML based.
In such case the QML example is preferred for Android platform. That is
why only QML example should have android tag.

This commit remove android tag from qtMultimedia Widget Camera example.

Fixes: QTBUG-113238
Change-Id: I9d2c072fcc18e8e5a5a44a9a2da887a7b6660b46
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-05-02 11:01:03 +00:00
Bartlomiej Moskal c27d5eca6a Android-example: add missing properties in AndroidManifest.xml
After changing android target SDK version to 31, some missing values has
to be defined in AndroidManifest.xml.

AndroidManifest.xml template was updated in qtbase in:
56dee3de5e commit. In case when example
uses its own AndroidManifest.xml file, it need to be updated separately.

* android:exported="true": because the manifest sets an intent-filter,
and it then has to explicitly to avoid the warning [1].
* android:allowBackup="true": this has to be explicitly set, we set it
to the default value here [2].
* android:fullBackupOnly="false": SDK 23+ use this to deteremine to
user auto backup or not, we set it to the default value here [3].

[1] https://developer.android.com/guide/topics/manifest/activity-
element#exported
[2] https://developer.android.com/guide/topics/manifest/application-
element#allowbackup
[3] https://developer.android.com/guide/topics/manifest/application-
element#fullBackupOnly

Fixes: QTBUG-112816
Pick-to: 6.5 6.2 5.15
Change-Id: Ia48007a84009901be508d6cc087790d574227ad7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-04-26 13:47:43 +00:00
Bartlomiej Moskal f4d897f04e androiddeployqt: remove infinity loop in deleteMissingFiles
There was a possibility of infinite loop and eventually crash when
androiddeployqt was used for the second time. Everything because of
deleteMissingFiles function for clean up previous build.

When we find the same names and those are directories, we call
recursively deleteMissingFiles. The parameters we use are absoluteDir,
not absoluteFilePath. As we use parent of found dir, deleteMissingFiles
is called with the same values as before.

This commit removes possibility of infinite loop by using
absoluteFilePath. That allows to avoid calling deleteMissingFiles with
the same parameters.

There is still a possibility, that directory that was found is not the
same as we were looking for. That will cause not needed files removing,
but those file will be copied again later.

This regression was created by 7dc05252a0
commit

Pick-to: 6.5 6.2
Fixes: QTBUG-111027
Change-Id: I195b4c407068b14e2ef94800ad1945adc66408cb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-03-15 12:42:15 +00:00
Bartlomiej Moskal abe3bc1c43 Android: Do not close the keyboard for NO_ENTER_ACTION
After commit cc9144b4f3, virtual keyboard
is hiding after clicking the done button. This is expected behavior,
but not in case when imOption is set to IME_FLAG_NO_ENTER_ACTION[0]

This commit removes hiding keyboard in mentioned case.

[0]https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_ENTER_ACTION

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-107662
Change-Id: Id280c4a67e3940fce5045724f77284a77c886f06
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-12-21 18:56:28 +00:00
Bartlomiej Moskal 02f1e72d5a Android: Set EnterKeyNext as default type for QLineEdit
Behavior of EnterKey for virtual keyboard need to be changed for
QLineEdit. Before this commit, ImeOption was set to IME_ACTION_DONE.
Because of that, setting any text in QLineEdit automatically accept
QDialogs. That was annoying, when more than one QLineEdit need to be
set.

[ChangeLog][Widgets][Android] EnterKey type is now changed from
EnterKeyDefault to EnterKeyNext for virtual keyboard in QLineEdit. It is
done only if the focus can be moved to widget below.

Fixes: QTBUG-61652
Change-Id: I98a7686f9f675fccf0112b8d27d48ad8fd7a887f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2022-12-21 04:11:58 +01:00
Bartlomiej Moskal eda4049a01 Android: Fix for low contrast status bar
After we start to use THEME: Theme_DeviceDefault_DayNight, status bar
icons have low contrasts on some devices.

That is why we need to set APPEARANCE_LIGHT_STATUS_BARS[0] in case when
Status bar color is too bright.

[0]https://developer.android.com/reference/android/view/WindowInsetsController#APPEARANCE_LIGHT_STATUS_BARS

Fixes: QTBUG-108365
Pick-to: 6.5 6.4 6.2
Change-Id: I38a31cfb0a3a1b912b86ed1b302c567e14a7ffcc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-12-20 13:42:31 +01:00
Bartlomiej Moskal cc9144b4f3 Android: Close the keyboard after clicking Done
The keyboard was not hiding after clicking the done button.
This commit changes this behavior. If KeyCode is other than
IME_ACTION_PREVIOUS/IME_ACTION_NEXT the keyboard closes automatically.

Fixes: QTBUG-107662
Pick-to: 6.2 6.4
Change-Id: I3449aa6898b826bfa03104275c7224329f24ed9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2022-12-14 15:28:27 +01:00
Bartlomiej Moskal 4ceee3911a Android: fix Android assets handler not listing dirs with only sub dirs
It looks like AAssetDir_getNextFileName is not enough.
Directories that contain only other directories (no files)
were not listed.

On the other hand, AAssetManager_openDir() will always return a
pointer to initialized object (even if the specified directory does not
exists), so we can't just leave only it here.

Using FolderIterator as a last resort. This approach should not be too
time consuming.

As part of this fix, add some unit tests to cover/ensure assets
listing/iterating works as expected.

Fixes: QTBUG-107627
Pick-to: 6.4 6.2 5.15
Change-Id: Id375fe8f99f4ca3f8cad4756f783ffafe5c074df
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-12-13 12:04:40 +00:00
Bartlomiej Moskal 153a3245dc Android: Do not override app_pal by AndroidPlatformTheme
It may happen that other styles (especially QtQucik styles) apply
different palette for applications. In such case AndroidPlatformTheme
should not override it when Light/Dark mode is changed

Task-number: QTBUG-83185
Pick-to: 6.4 6.2
Change-Id: I6a3b7ee047fcd729be03271a7202cd260360f83b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-11-08 13:26:33 +00:00
Bartlomiej Moskal b4a9bb1f6a Android: Handle light/dark mode changes
Update Theme's style according to current UiMode.

New style.json file for dark mode was added (stored in separate
subdirectory 'darkUiMode/'). Theme_DeviceDefault_DayNight[0] is used for
extraction for API 29 or higher. Style is updated each time when UiMode
is changed.

[0]https://developer.android.com/reference/android/R.style#Theme_DeviceDefault_DayNight

Task-number: QTBUG-83185
Pick-to: 6.4 6.2
Change-Id: Id26059231f41761d822d494ac6c641bf3cba3322
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-26 17:13:44 +02:00
Bartlomiej Moskal 7ae9632929 Examples doc: Tags fix for QtQuick examples
Four examples in QtQuick module had wrong tag in qdocconf file:
-QQuickRenderControl D3D11 Example
-Scene Graph - Direct3D 11 Under QML
-Scene Graph - Metal Texture Import
-Scene Graph - Metal Under QML

The first two are specific to Windows. The other two are IOS specific.
They were all marked as "android".
This commit changed those tags to correct one.

Pick-to: 6.4 6.4.0 6.3
Fixes: QTBUG-106436
Fixes: QTBUG-106438
Fixes: QTBUG-106439
Fixes: QTBUG-106469
Change-Id: I3d8d3cb54e4e552d7574c7c2f1d59437374c6446
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2022-09-19 11:25:36 +00:00
Bartlomiej Moskal 76abdaafb5 Android: Light/dark modes detection
After commit: 2248487c6c light/dark mode
detection is supported by Windows and macOS. This commit add similar
implementation on the Android side.

Task-number: QTBUG-83185
Pick-to: 6.4 6.3 6.2
Change-Id: Id1ece98e91a31759b58d651ef62b3715ea25d85f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-09-05 18:29:09 +02:00
Bartlomiej Moskal 9efaf8bae9 Android: Do not set release flag for signed package
Before this change, signing package by androiddeployqt automatically
implied the --release option.
It is possible to create both debug and release packages when signing on
Android, so we shouldn't be enforcing this restriction on Qt app builds.

Commit removes setting releasePackage option, when processing the --sign
argument in androiddeployqt.

Task-number: QTBUG-103281
Change-Id: Id40a41255e51d6820b44f078667dc8318a90bbc5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-06-27 07:48:35 +02:00
Bartlomiej Moskal 5398eb55ed Android: Extend make_apk target with the sign option
Commit contains the new QT_ANDROID_SIGN_APK variable. It extends
*make_apk target by signing the package with the specified key.

For key setup these environment variables must be set:
    - QT_ANDROID_KEYSTORE_PATH
    - QT_ANDROID_KEYSTORE_STORE_PASS
    - QT_ANDROID_KEYSTORE_ALIAS
    - QT_ANDROID_KEYSTORE_KEY_PASS

Task-number: QTBUG-97107
Change-Id: If42c74298c1b385889b32517ab7f1f5b0628b487
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-30 16:27:38 +02:00
Bartlomiej Moskal 6dd6342864 androidtestrunner: make sure that system-user is used
It happens on Android Automotive emulator, that output file is in other
directory.

According android spec [1]:
"If a default user isn't specified, each adb subcommand has a different
user. The best practice is to retrieve the user ID with am
get-current-user and then explicitly use --user <userId> for any
command that supports it."

That is the reason why output file can be found in
/data/user/USER_ID/PACKAGE_NAME directory.

Checking path related to current user was added as backup solution.

[1]https://source.android.com/devices/tech/admin/multi-user-testing

Pick-to: 6.2
Change-Id: Id7e6ddef74f4f20b7469a07bba6a71d3622c4e20
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-21 08:23:22 +00:00
Bartlomiej Moskal 93038767b7 QWidgets: show SoftwareInputPanel for key release
Virtual keyboard should be shown when editable widget get focus by key
(like Tab or BackTab). Before this change SoftwareInputPanel was
handled only for mouseKeyRelease event

Task-number: QTBUG-61652
Pick-to: 5.15
Change-Id: I85f80422b596592a04c2f9af214f991c471485c8
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2021-05-05 16:07:17 +00:00
Bartlomiej Moskal e5686b35f0 Android: handle ImEnterKeyType flag
Replace KEYCODE_ENTER to KEYCODE_TAB if IME_ACTION_NEXT or
IME_ACTION_PREVIOUS flag is set.

Before this change any of imKeyEntryType [1] was handled as default
return key. After the fix, event is changed to Tab or Backtab (if any of
mentioned flag is set)

[1] https://doc.qt.io/qt-5/qt.html#EnterKeyType-enum

Fixes: QTBUG-61652
Pick-to: 5.15
Change-Id: Ia27aa308fdae75bc17d1e892d17048c5afa3e2cb
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-05 07:43:10 +00:00
Bartlomiej Moskal 96a1bfd06a Android: Remove NoSuchMethodException error
CleanUp NoSuchMethodException error appears on application start up.

Error appears after commit:
e402e1103b

Fixes: QTBUG-92885
Change-Id: Idd4d09e51c8c721ad18f9bd396c990b51cd730e7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-04-27 12:12:34 +00:00
Bartlomiej Moskal 06b0b2be16 Android: Fix Touch event position depending on Surface
Touch event position is counted from begin of Surface. Later method
QAndroidPlatformScreen::topLevelAt(..) is trying to return the top level
window at the touch event position.

In case when Surface is moved, we should also add this move to event
position. If it is not happening, touch event will not be assigned to
correct window.

Fixes: QTBUG-65927
Pick-to: 5.15
Change-Id: I549b9ec964cb09607153c60b9d9f6e0068a04cc2
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-30 12:01:02 +00:00
Bartlomiej Moskal 547228bf86 Android: fix wrong position of cursor hander in split screen
Use activity window position to fix position of cursor hander. In case
without splti sceen, position of activity window is equal (0, 0), so it
does not have any effect.

Fixes: QTBUG-91362
Pick-to: 5.15
Change-Id: Icae9f19308112a78bdddf168abe81ffe7b6e4fae
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-26 08:05:13 +00:00
Bartlomiej Moskal e402e1103b Android: fix for isSoftwareKeyboard method
isSoftwareKeyboard() method will rely on visibility flag from
activityDelegate. In such case it also need to consider that keyboard is
during the hiding.

Fix the regression related with commit:
e6ca200a3a

Before this change Software Keyboard is not showing after changing the
focus. It is happening when Keyboard is already visible and focus is
changed to widget that also need the keyboard. In such case keyboard is
hiding (and NOT showing again).

Pick-to: 5.15
Fixes: QTBUG-92051
Change-Id: I6a5d07b25442429fda6e715d09ea104432c5ef50
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-26 09:05:04 +01:00
Bartlomiej Moskal 0d5b43bed4 Android: Finish composing text before Key handling
If the sendKeyEvent was invoked, it means that the button not related
with composing text was used. In such case composing text (if it exists)
should be immediately finished.

Fixes: QTBUG-85715
Pick-to: 5.15 6.0
Change-Id: Ifbca067805b8d20f6a90f95b27210595abed964a
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-19 19:37:02 +01:00
Bartlomiej Moskal 2eb77139a2 Android: Pass pending state to ResumePauseListener
It can happen that updateApplicationState() is called before
m_androidPlatformIntegration is set. In such case, new applicationState
will be remembered and propagated later.

Before this change, pending application state was passed only to
QWindowSystemInterface.

ResumePauseListeners that are subscribed for changes to
ApplicationActive/ApplicationInactive state also should be informed
about new application state.

Fixes: QTBUG-84737
Pick-to: 6.0 5.15
Change-Id: I67e79860b340ee5de2d13d148a222e9f1c942b93
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-12-17 12:47:46 +00:00