Commit Graph

621 Commits (b0056f052d842150305d59a3ced280e1885a8619)

Author SHA1 Message Date
Assam Boudjelthia ff6a6d3285 Android: fix style extraction when set to none
If extract_android_style meta data is set to none currently the app
still tries to extract full stlye and crashes. If this option is set
no style data should be extracted after this patch.

Pick-to: 6.7
Fixes: QTBUG-121667
Change-Id: I764e1eb6a582073196f991ca930d245d17a1f7e5
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-02-06 17:23:42 +02:00
Tinja Paavoseppä bd5ae42cf8 Android: Set up style also when using QtEmbeddedLoader
Embedded loader was missing style set up, leading to a crash
when platform theme style data was loaded. As a drive by, change
the style set up to use Context instead of Activity, since it doesn't
require Activity.

Fixes: QTBUG-119532
Pick-to: 6.7
Change-Id: I434233e173cc2c90d981bbf2aa0044117a20b17f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-31 17:55:34 +02:00
Tinja Paavoseppä 702c420f51 Android: Add classes to embed QML into native Android
Add classes that make it possible to add QML as a View into
a native Android app:

QtView: Base class for QtQuickView, handles non-Quick dependent
operations. In essence a Java ViewGroup class which loads a
QWindow and embeds it into itself.

QtEmbeddedLoader: Extends QtLoader for embedded case, creates the
embedded version of QtActivityDelegate and provides an embedded-specific
path to loading Qt libraries (Mostly just allows users to set the name
of the main lib)

QtAndroidWindowEmbedding namespace: Deals with calls from
QtEmbeddedDelegate to create/destroy QWindow and from QtView to
show the window.

Take the QtEmbeddedDelegate introduced in an earlier commit
into use, and add functionality for loading QWindows for
QtViews and managing QtViews into it.

Add a factory for creating instances of QtEmbeddedDelegate.
The factory holds a map of QtEmbeddedDelegate objects and
creates them, with the Activity as the key. This is to make
it so that the same delegate can be used by multiple views
which share the same Context.

Known issues left:
* keyboard focus not working, as with other child windows

Pick-to: 6.7
Task-number: QTBUG-118872
Change-Id: I94a5f9b4f904c05cc6368cf20f273fcf10d31f17
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-30 20:01:29 +02:00
Tinja Paavoseppä 8df46c8890 Android: Create QtWindow layout and set parent in the calling thread
In the QtWindow constructor, creation of the layout and setting
the parent window were posted on the Android UI thread, leading
to them being called at a later point. If QAndroidPlatformWindow
did not have a parent at the point it was created in, but
setParent() was called shortly after, the QtWindow.setParent()
call with the actual intended parent got invoked before the
Runnable posted in the constructor got ran, leading to the
parent being overwritten with the null one passed to the
constructor, essentially leaving the QtWindow as a top level
one, while the QAndroidPlatformWindow was a child window.

The above would happen more often with foreign child windows,
sometimes causing hang ups when the parent of the foreign
child window was shown.

Creating the QtLayout outside of the Android UI thread seems
to be safe, as long as we only modify its view hierarchy inside
it.

Pick-to: 6.7
Task-number: QTBUG-116187
Change-Id: If1ed1983f5d6ba56e625148ee6a61771234a2aa1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-30 17:41:48 +00:00
Tinja Paavoseppä 24a0d958a7 Android: Let QtLoader handle different Contexts when initializing
QtLoader now calls the correct methods when initializing static classes
and retrieving ContextInfo based on the type of the Context (Activity
or Service). This is done to avoid the need for code duplication when
introducing other QtLoader sub classes that deal with the same Context
types, such as the loader for the use case where Qt is used from a
native Android app.
Abstract methods and their implementations in subclasses
aimed at handling this removed as a result.

Pick-to: 6.7
Change-Id: I6cda8e4733594a6a3963cf0fd8217de2fbd408f8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-24 13:20:18 +02:00
Tinja Paavoseppä 06d2aa91eb Android: Add a context delegate for embedding QML to native Android
When we are embedding a QML view to a non-Qt Android app, there are a lot
of functionalities that are shared with the refular Qt Android app, but
some are not. We should not, for example, try to control the hosting
Activity.
Create a base class that both the QtActivityDelegate, used for the
standard Qt for Android app, and the delegate for the embedding case
can extend.

In this commit, the QtEmbeddedDelegate is very simple, the
biggest difference to QtActivityDelegate being it does not create
a QtLayout or instantiate a QtAccessibilityDelegate.
It does start the Qt app, without waiting for a layout, and register
to listen for changes in the state of the Qt app.

Taking the embedded delegate into use, loading the embedded QML
views and their handling is added in a follow up commit.

Task-number: QTBUG-118872
Pick-to: 6.7
Change-Id: Id390a2b35c70b35880523886bf6fcf59d420cb42
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-21 15:46:30 +02:00
Tinja Paavoseppä 8e9918e476 Android: Add possibility to provide app main lib name without metadata
Normally, the app's main library's name is read from a metadata field
in the AndroidManifest.xml file, which is filled out by
androiddeployqt.
Add a protected variable in QtLoader for the app main library name
that can be set to provide the library name without the metadata field.
This is useful in cases where we don't have a manifest file filled
by androiddeployqt, for example when embedding QML to an existing
Android app.
As a side effect, change the name of existing variable for the main
library and the method to access it to make it more explicit they refer
to the library's absolute path.

Pick-to: 6.7
Change-Id: I869547818f4d0272668a1052d7bc6916b7bf5a98
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-16 17:55:29 +02:00
Tinja Paavoseppä 6102ee6dd8 Android: Add possibility to listen for changes in app states
This is useful for example the embedded QML case, where we want to
make sure everything from Qt side is ready before we start to create
Qt windows.

Pick-to: 6.7
Change-Id: I8148405e35cc8ebb89110f05e07cef06f8ff3709
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-01-16 17:55:29 +02:00
Assam Boudjelthia 91b0f269ba Revert "Bump androix dependency to 1.12.0"
This reverts commit 3bae65e7d6.

Reason for revert: This version requires API >= 34 but we have AGP
7.4.1 which was tested against API 33 max, and updating it to version
8.x is blocked by QTBUG-106907. So, this will be re-stated AGP update
is done.

Task-number: QTBUG-106907
Pick-to: 6.7
Change-Id: I1551ace76392a0532e1ecf431d03afbbd9d4a300
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-01-08 17:29:26 +00:00
Assam Boudjelthia ee4f91fa50 Android: set default style extraction to minimal
The default value in the default manifest has been for few
releases, set as minimal, and since Widgets Android style
is not fully supported anymore, we can set this to default
to minimal under the hood as well to avoid needing to always
explicitly needing to set it to minimal.

Pick-to: 6.7
Change-Id: Id0b2134c572694be1e190347ff75f51ade65f0c4
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2023-12-22 21:21:37 +02:00
Assam Boudjelthia 7996a3fc7f Android: save the service under QtNative with QtNative.setService()
Otheriwse Qt C++ code will not be able to find it.

Task-number: QTBUG-115016
Pick-to: 6.7
Change-Id: Id3a2efb1f33cb60a523359e1ad646a394e24397e
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-20 14:18:02 +02:00
Assam Boudjelthia 400e7d1a75 Android: return String regardless from QtLoader.getMetaData()
To avoid exceptions if the metadata is a non-string like boolean
or integer.

Task-number: QTBUG-115016
Pick-to: 6.7
Change-Id: I104e6b2954873e74bc100cb965ee8ea9b6d14568
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-20 14:18:02 +02:00
Assam Boudjelthia 84f0b483b5 Android: don't call QtLoader.finish() on null activity/service
Task-number: QTBUG-115016
Pick-to: 6.7
Change-Id: Ia7cf066261bd0bb17d67423b5edf7b72ec33d577
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2023-12-20 14:18:02 +02:00
Assam Boudjelthia fcc8b89ae0 Android: use m_context in QtServiceLoader.initContextInfo()
since m_service will not be yet set, m_context should be used here.

Task-number: QTBUG-115016
Pick-to: 6.7
Change-Id: Ie259e703da1d8aac23117f032b7d146f7060aac2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2023-12-20 14:18:02 +02:00
Assam Boudjelthia f292a66904 Android: fix order of calling setApplicationState() in QtServiceBase
In QtServiceBase setApplicationState() is being called before
the Qt libs are loaded and that call invokes a native method,
so that leads to a crash/exception for UnsatisfiedLinkError.

Pick-to: 6.7
Change-Id: I879d120f0cc2985ab49f7402a65f171950451914
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-20 14:18:02 +02:00
Assam Boudjelthia ec7b4d547d Android: fix Android Manifest docs table
The table had the wrong row span making it malfomatted.

Task-number: QTBUG-115020
Pick-to: 6.7
Change-Id: Icc35df3cd7dcdad2407d4c93d7a2a8d3d1701275
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2023-12-20 14:18:02 +02:00
Tinja Paavoseppä cca81a6636 Android: Use TextureView when multiple windows present
The SurfaceView class is not the best option for when we
have multiple windows, as the created Surface can only
either be below the window or on top of it, it is not a
part of the view hierarchy.

Replace the SurfaceView with TextureView when there are
more than one window. This way the surface will be a part
of the view hierarchy, and will respect z-ordering.

When there is only one window, keep using the SurfaceView
approach to limit the effect on existing apps, as well
as enable some of the benefits SurfaceView has for e.g.
game and multimedia apps, such as HDR ability.

Move touch handling from QtSurface to QtWindow, so
touches are handled also when using TextureView instead
of QtSurface aka SurfaceView.

Pick-to: 6.7
Task-number: QTBUG-118142
Change-Id: I37dcaf0fb656cfc1ff2eca0a3bfe7259f607411c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-14 00:26:55 +02:00
Tinja Paavoseppä 2bc7d38bd6 Android: Make QtWindow wrap the QtLayout instead of inherit it
The layout is a ViewGroup, and should be created in the Android UI
thread, while for ease of use on C++ side we should be able to
construct the Java object in the platform window constructor to
avoid later calls not having a valid object reference. Trying to
make a blocking call to Android thread from Qt thread can lead to
dead locks, so move only the creation of the layout itself into
Android thread, making the QtWindow a wrapper for it, which we can
immediately return to C++/Qt thread. Most of the calls made to
QtWindow are anyway already passed to the Android UI thread.

As a drive by, add a missing QtNative.runAction() to
bringChildToFront().

Change-Id: Ib2495ddda8267384656557cbe40be5da869f82c3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-08 15:53:37 +02:00
Tinja Paavoseppä 6ff88f97a6 Android: Add preliminary support for child windows
Update the manual test case for embedded windows to have
native window on Android.

There are still some sharp corners, for example:

* The windows are implemented with SurfaceViews, which makes
  z-ordering with multiple of them a bit tricky. The Surfaces
  they instantiate are basically z-ordered to either be below
  everything, with a hole punched in the window, or on top of
  everything, with the Surfaces created later on top of the
  ones created earlier. Also, with the foreign views it looks
  like the native view is on top of the Surface, because it
  is created later. And since the child windows create their
  Surfaces before the parent, they would be behind the parent
  window, currently circumventing this with letting the
  parent be z-ordered behind everything, and the children
  on top of everything. A follow up commit addresses this by
  changing the native view class to TextureView when multiple
  windows are present.
* Parent window always gets the touch events - fixed in
  a follow up commit
* If a child window has a text edit, it does not receive
  focus when clicking on it

Task-number: QTBUG-116187
Change-Id: I32188ec5e3d3fce9fd8e3a931e317d1e081f691c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-08 15:53:37 +02:00
Tinja Paavoseppä 0a92d881bb Android: Make QtLayout per window instead of per screen
Each QAndroidPlatformWindow has its own QtLayout,
instead of one for the whole app/screen. This paves the
way for addition of child windows.

Task-number: QTBUG-116187
Change-Id: I36c68cea1a5f27ded3696bcfc2fbc04d9a8ce79e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-08 15:53:36 +02:00
Tinja Paavoseppä 2020ce5fd2 Android: Give raster windows their own surface, and flush via RHI
Refactored platform windows on Android so that all window
types, including raster windows, have their own surface to
draw on.

Raster windows now flush the backing-store via RHI/OpenGL.

As a drive by, update to newer JNI syntax where appropriate.

Task-number: QTBUG-116187
Change-Id: I3b764b7126abf53556750b0ccbb7d27efe007bc1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-07 10:56:43 +02:00
Assam Boudjelthia 7a9bc220c7 Android: fix and simplify the orientation change logic
Move the orientation change handling to the display manager
and call it from the relevant places to repeated and scattered
code for the same functionality.

Bring back part of 072387edec
which checks discard a resize event that's not valid that
reports not up to date layout size.

If DisplayManager.DisplayListener.onDisplay() initiates the
orientation change, handle it immediately if we don't expect
the size to change, i.e. if the orientation is changing from
portrait to inverted portrait and vise versa for landscape.
Otherwise, expect the change to be initiated again shortly
after from QtLayout.onSizeChanged().

Also, add improve the unit test of the orientation change,
and test for the widget size after such changes to make
sure QTBUG-94459 is not reached again.

Fixes: QTBUG-119430
Task-number: QTBUG-115019
Task-number: QTBUG-94459
Change-Id: I5f060d91531af677ddf891f2af360d5f399e26e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-12-05 16:28:12 +00:00
Assam Boudjelthia a2309116a8 Android: fix mis-use of AccessibilityNodeInfo.addAction()
The commit 41765ef3e2 tried to
fix a deprecation warning by using the wrong API replacement,
this fixes that. Check the Android docs for the replacement API.

https://developer.android.com/reference/android/view/accessibility/
AccessibilityNodeInfo#addAction(int)

Task-number: QTBUG-118077
Change-Id: I2621d47fa4425cc1056fc995ea458a798160a6a0
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia 8c167c62ca Android: fix usage of deprecated android.text.ClipboardManager
android.content.ClipboardManager is the replacement for the
deprecated android.text.ClipboardManager API.

Task-number: QTBUG-118077
Change-Id: I14038ee4b21150d8bcb9f5bfeb82369347d7f215
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia 3e35db6997 Android: guard against null objects
And minor warning fixes for unused imports.

Task-number: QTBUG-118077
Change-Id: I8296ae019da9d40692687e49ac926f96af901870
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia ee874e7ca8 Android: accept both spaces and tabs separators for env vars and args
The requirement for separating the app args by tabs only is not
justified, since the the args are passed as a string to C++ where
QProcess::splitCommand() is used to get a list of single args and
that knows how to handle the parsing properly anyway.

As for env vars, QtLoader currently expects env vars to be separated
by tabs only, however, to account for different use cases, it should
handle both tabs and spaces.

Task-number: QTBUG-115016
Task-number: QTBUG-106478
Task-number: QTQAINFRA-5703
Change-Id: I58258861477776b82294a4c2603b230f178f16a6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-30 17:26:26 +02:00
Rami Potinkara 7b84cd62b0 Android: bump Android target API level to 34
Bumped on network related .gradle files too.

Fixes: QTBUG-119145
Change-Id: I95f70e6cda1aad7a6bd7246c623eb6f143a829cb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-30 08:57:55 +02:00
Assam Boudjelthia 523cf06628 Android: rectify the visibility of QtAndroid.jar class
Since we expect soon to support embedding of Qt from native
Android apps, and allowing native apps to access some Qt java
classes as API to enbale the embedding, it's needed now to
set the visibility to public only to classes that are meant
to be public.

Task-number: QTBUG-115017
Change-Id: Iec73f8d39bf9c5f7d303176b2b345d5928fb46c7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia a419d4fbf0 Android: unregister display manager on onPause or onStop
Unregister the display manager listener onPause or onStop
and register again when onResume is called.

Task-number: QTBUG-118077
Change-Id: Ic48defda019fb132ef22a8229c4b549b0414b100
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 576be5d047 Android: don't pass Activity to some QtDisplayManager methods
Since the display manager is mainly created by the Activity delegate
and lives with it, so pass the Actitivy and use it internally,
instead of passing it to every method.

Task-number: QTBUG-118077
Change-Id: I7761490ac8746cc6dad3bd59514a54da18519990
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 43102fb55f Android: start native app from QtActivityDelegate instead of QtLayout
Starting the native application is not the responsibility of QtLayout
instead it makes more sense to be done under QtActivityDelegate so
move that logic there and avoid keeping its runnable inside the
QtLayout.

Task-number: QTBUG-118077
Change-Id: I4869cb5aa741289ed0e9ccaa1cf2ae42c9dd4791
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 8ddb27a11d Android: restore SystemUiVisibility state
System UI visibility is saved under onSaveInstanceState()
but never restored under onRestoreInstanceState().

Task-number: QTBUG-118077
Change-Id: Ic9956a4aca9e0b9bb5fefa37d7229dd0d52c7344
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 57330a18ca Android: rename isPluginRunning to isNativePluginIntegrationReady
This has been used to notify that the platform integration is
setup and ready, now the name is more descriptive of what it does.

Task-number: QTBUG-118077
Change-Id: I9fab525f07433f9ec8057e2475a3b1e4658f84d9
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:56 +02:00
Assam Boudjelthia aea816b197 Android: rework app state tracking
Cleanup 'isStarted' and state management logic and move it
to QtNative. Currently, it's spread between QtActivityDelegate and
QtNative where multiple variables are used for overlapping use
cases.

Task-number: QTBUG-118077
Change-Id: I2c98b48be78809c30636bfdf6d6640317470cec6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:56 +02:00
Assam Boudjelthia b09168740b Android: don't return an unused result from QtNative.startApplication()
No one is using that return code, instead print an error when the
call to startQtAndroidPlugin() fails.

Task-number: QTBUG-118077
Change-Id: I98c8e4ca9af5f1c45af36044336d461bed6acdc9
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-24 03:48:39 +02:00
Assam Boudjelthia 41765ef3e2 Android: fix few deprecation and wrong code usage warnings
* Some more leftover unused imports.
* Deprecated API, especially reflection warnings.
* Some unused method parameters warnings.

Task-number: QTBUG-118077
Change-Id: Ic9b7d5b69ef64aaf640bc9f53a13428f1c49278c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-24 03:48:39 +02:00
Assam Boudjelthia 64fe6d836c Android: support lambda expressions in Java code
use -classpath instead of -bootclasspath param to allow
javac to use the default boot class path to support
building lambdas, pass the user Android class via -classpath.

Task-number: QTBUG-118077
Change-Id: I1ba8274d57e1bd528a1d5b7d779191e7f1412184
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-24 03:48:39 +02:00
Assam Boudjelthia 9d3b55b2a8 Android: use WeakReference for static activity/service objects
Wrap the activity and service static objects with
a WeakReference to fix a potential memory leak warning.

Task-number: QTBUG-118077
Change-Id: Ifafd137cc49ec5ea23d8425b6bd58b43573970b9
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-23 19:58:21 +02:00
Assam Boudjelthia f6e5e52c84 Android: add note on usage of QtNative.runAction()
Task-number: QTBUG-118077
Change-Id: I2a743c1b65733e1ca0bf20d172d35c46d7ec8b08
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-23 19:58:21 +02:00
Assam Boudjelthia 5ab2b8b951 Android: don't directly access m_qtThread member
Task-number: QTBUG-118077
Change-Id: I2103483a2bfa8abe9be832790611b07a5d011f76
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-23 03:34:26 +02:00
Assam Boudjelthia c0eca51570 Android: rename m_quitApp to m_retainNonConfigurationInstance
Rename m_quitApp to m_retainNonConfigurationInstance and keep it
inside QtActivityBase since it's only used there based on whether
onRetainNonConfigurationInstance() is called, in wish case,
onDestroy() would skip the Qt specific app destruction/exit logic.

Task-number: QTBUG-118077
Change-Id: I1cf03bd6f5266a9283660db7943d053a9dba889c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-23 03:34:26 +02:00
Assam Boudjelthia fdc2036640 Android: use non index for loop syntax
Task-number: QTBUG-118077
Change-Id: Ifd09d0a2aeeee4e7dcb0c80391ba0e3c08f0fe13
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-22 22:15:38 +02:00
Assam Boudjelthia 869e9b927a Android: remove redundant assignement and type specifiers
that kind of code gives Android Java warnings.

Task-number: QTBUG-118077
Change-Id: I395c650aba209a84ff1b7548821444f3d1e461e3
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-22 08:18:08 +02:00
Assam Boudjelthia c8bf35f4e4 Android: use final keyword for Java class memebers when appropriate
Task-number: QTBUG-118077
Change-Id: Id63569fc59c5d16f41aad92181ae1794cbb6fbc5
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2023-11-22 08:18:08 +02:00
Assam Boudjelthia 833e7c1629 Android: add @UsedFromNativeCode annotation for java method used in c++
To get rid of unused method warnings in Java code for methods used only
from C++ code and make it more visible which methods are used by native
code.

This annotation would need to be added to the relevant methods in this
patch or future one.

Use this annotation for all methods called from native code. And along
the way remove few methods that are not used anywhere.

Task-number: QTBUG-118077
Change-Id: Ie493fb057f4a93aff513f85e0936bc65a9bb304c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-22 08:18:08 +02:00
Assam Boudjelthia fa15a465eb Android: cleanup unused java imports
Get rid of all unused java import calls.

Task-number: QTBUG-118077
Change-Id: I9755fafd7edce958187b7e8c9688f2f6b7b59645
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-18 00:00:10 +02:00
Assam Boudjelthia 50b56d015d Android: cleanup up warnings in QtNative code
few cosmetic changes, and warning fixes in QtNative code.

Task-number: QTBUG-118077
Change-Id: I0b064b59005f3cd50cf56221ce2287d72842a65c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-18 00:00:09 +02:00
Assam Boudjelthia e35d79d060 Android: fix visibility of some methods in QtActivityBase
Task-number: QTBUG-115017
Change-Id: I12181202b50c74ec079f872a7175aef41bcad998
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-18 00:00:09 +02:00
Assam Boudjelthia d6861926a1 Android: set displayManager listener after QtLayout is initialized
the QtDisplayManager listener uses m_layout but it can be called
before m_layout is actually initialized, so set the listener after
the layout has been initialized.

Task-number: QTBUG-118077
Fixes: QTBUG-119007
Fixes: QTBUG-119134
Change-Id: Icebc350f09210c12dbd011f86ce88a90b6f27d12
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-15 22:52:23 +02:00
André Klitzing 3bae65e7d6 Bump androix dependency to 1.12.0
This avoids linter warning like in 5dc9692e48ea15ab3da4283997547a2849f1944e:
       Obsolete Gradle Dependency

Pick-to: 6.6
Change-Id: I5850af3206f3eaf80850918a13705c59ac3fb4ea
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-13 19:14:59 +01:00