Commit Graph

2040 Commits

Author SHA1 Message Date
Henning Gruendl
590e19acb7 QmlDesigner: Enable environment variable usage
Change-Id: I91ada6d7dfa5e8376333c5ef27fbd72a5484e4f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-11-22 15:38:42 +00:00
Christian Kandeler
8f611286f7 Fix some compiler warnings
Change-Id: I9128afcf56bd47cb6627012bb6b0d13395b432ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-22 13:39:08 +00:00
hjk
0030836f96 Android: Fix compilation
Amends 35e6991772.

Change-Id: Iba3dcf86b7b1ca7963a0b99798dafec85d19bd65
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-11-16 11:45:17 +00:00
Piotr Mikolajczyk
35e6991772 Fix bad activity if designviewer built with qt6
Changed the activity name run, so only the Qt6 version
of Qt Design Viewer is launched.

Change-Id: I79efc2a4ab37e9015b2feabda08ce274c6fca553
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-16 09:36:22 +00:00
Jonathan Mouchou
6efcd09063 Android: Fix AndroidManifest wizard invalid package source dir
Fix the wizard from inserting the filename for the file path leading to
an invalid directory.

Example invalid path: /projectpath/projectname/projectname.pro/android
With fixed path: /projectpath/projectname/android

Fixes: QTCREATORBUG-26580
Change-Id: If82a6f795ca400beddc26b959e65ea066ad79433
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-15 18:41:58 +00:00
Alessandro Portale
1e693bcc67 Android: Skip device list update no Android Kit is active
This adds workaround to reduce the load added by the update of the
Android device list, which currently happens in a polling style. Skip
an update if (*):
- The current open project is configured with a non-Android kit
- No project is open
- the current project target is null

To summarize the timeline of the timer used here:
- AndroidDeviceManager::setupDevicesWatcher() is called when Creator
is started or when settings are changed. The setup makes the connections
for the timeout and for AVD list future watcher. This will be done once.
If the timer is active it won't be done again, so no duplicate
connections.
- In the setup, the list of devices in updated once.
- On timer timeout, we attempt to update the list, however with
conditions listed in (*) as well as only when an Android adb path is
found.

Fixes: QTCREATORBUG-26547
Change-Id: I13312c4b507ce4e4064adb1c1342f4648f915394
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-11 22:31:46 +00:00
Piotr Mikolajczyk
f45e68d28d Fix to qmlpreview failing to upload files
Return to correct function call order when preparing
and uploading data to the device.
(Manual pick from master)

Change-Id: I0a78b6614765bfae5c3accd99c1c150540871aac
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-10 09:51:14 +00:00
Assam Boudjelthia
072d658166 Android: fix missing argument in UI string
Change-Id: I9a02be25429b444704eb6864d59b2f4311ae75ea
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-09 13:33:46 +00:00
Assam Boudjelthia
0079b64b69 Android: don't recreate a new AvdManger
Change-Id: Icc4f2bb2df34aa3497441d6fbd64c6c8fe1394b3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-09 13:16:48 +00:00
Christian Stenger
eab5315904 Android: Register Lldb if it is present
Change-Id: I46a544c0541ca4f0a969064faf055c1e99b9c5ad
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-09 07:19:35 +00:00
Assam Boudjelthia
bcc5c9a344 Android: since jpg is allowd, add jpeg to icon/splash file dialog
Change-Id: I018650a33d681f4ea75c9333eb875a197ce96e3d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-08 09:19:09 +00:00
Assam Boudjelthia
d80f3f4d8a Android: remove unused function that couldn't be removed in 5.0 branch
... because of binary compatibility.

Comes after a2b6dba0bc.

Change-Id: I18866de39a05c6690b47632cc5503f8555e006da
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-08 09:18:29 +00:00
Assam Boudjelthia
12ccd9ec54 Andriod: declare QLatin1String as char[] instead in AndroidManger
Change-Id: I4f11950dcdfa0caddf02bf2b123ff78a9c01c062
Reviewed-by: hjk <hjk@qt.io>
2021-11-05 14:16:03 +00:00
hjk
a7c8c97a68 Android: FilePathify part of debugger abi detection
Change-Id: I3abbc780c1e1301db4c6d367dcdf1dcf8cbf556d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-05 10:26:52 +00:00
Alessandro Portale
fd1b41af9d Android: Enable locating NDK's lldb-server on Windows hosts
For Windows, lldb-server on the local file system is not a
QDir::Executable, but just a QDir::Files.

Task-number: QTCREATORBUG-26281
Change-Id: I4eb91ad9bce62401a945c46a1d2f94b654f9eaa2
Reviewed-by: hjk <hjk@qt.io>
2021-11-05 08:05:45 +00:00
Alessandro Portale
d4efd4a369 Android: Improve prior commit
Actually use the version variable that was defined prior to the line.

Amends: 0de09fe3a3

Change-Id: Ie05e1a4e1be0fa0729dd1de38fc6b5351d02d380
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-04 14:53:26 +00:00
Alessandro Portale
0de09fe3a3 Android: Enable manual adding of NDKs v22+
Don't enforce the presence of a "platforms" subdirectory if the NDK is
of version 22 or higher. The last NDK version with that directory is 21.

Change-Id: Ib431e7db4521533206304d252dcf93b7ea6169e5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-03 14:33:02 +00:00
Jarek Kobus
c13d828c99 Remove unneeded includes of QProcess
Change-Id: I017e020c8b2a53d6f4a2422a0a0856044e768247
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-03 08:13:18 +00:00
Jarek Kobus
3562c5e96e Remove unneeded includes of QProcess from cpp files
QProcess wasn't used in these files.

Change-Id: I24900bcf312eb6ea1ca3bc0c753cebb505ec552b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-01 12:04:41 +00:00
Assam Boudjelthia
4e3658cfa4 Android: report am start errors in case process returns success
Somehow "am start" command can output to stderr even if the process
reports success, this can cause the activity launch to fail silently.

For example calling "am start -n package/activity --user 2" can fail
if the device has no user 2, however the process result will be success,
and the stderr will contain something like:
 Error type 3
 Error: Activity class {org.qtproject.example.scroll_example/
org.qtproject.qt.android.bindings.QtActivity} does not exist.

And the app won't start.

This concerns mostly extra am start args provided by the user, but not
sure if it might happen in other cases, so make sure to report the
stderr nonetheless.

Change-Id: I9317e118fcf4fe0c3ed83dcc53c1c00564c5148e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 15:08:24 +00:00
Eike Ziller
1a00bb50d4 Android: Fix lupdate issues
Change-Id: I08bdc81eabb082a091f27d2dea44369573946c49
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-10-28 09:41:08 +00:00
Assam Boudjelthia
d5a3435798 Android: drop const from AndroidConfigurations::currentConfig()
Since the config can be expected to modify configuration values
(e.g. setEmulatorArgs()) it shouldn't be const, but can be set
to const whenever creating a reference that is not meant for
modifying the config.

Change-Id: I8c816a5422d4d57afa158c723d908e3a9a9a0db8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-26 18:34:58 +00:00
Assam Boudjelthia
5ab9d45c5f Android: Add and organize error cases for different steps
Add error messages for cases in the different steps (e.g. build, deploy,
etc.) for user. This makes it easier for the user to know what's wrong
instead of just failing with no explanation.

Change-Id: I96ea65f5c73edf14c2214b699503211b740d029c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-26 14:50:46 +00:00
Eike Ziller
e8ba5b75cf Merge remote-tracking branch 'origin/5.0' into 6.0
Conflicts:
	src/plugins/android/androidpackageinstallationstep.cpp
	src/plugins/cppeditor/cppmodelmanager.cpp

Change-Id: I3bad38e1cfe717e98209d49461c9813a8e555eff
2021-10-26 09:13:24 +02:00
Leena Miettinen
354c6405c3 Android: Fix UI text
Task-number: QTCREATORBUG-26458
Change-Id: Ibc407db46a605c6bde8f994af63f678a5a102b0e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-10-25 15:18:00 +00:00
Assam Boudjelthia
f4db436a7b Android: remove Virtual from the AndroidDeviceFactory
Keep it only Android Device since this title is used in many places
around Qt Creator in different contexts it is better to make it
"Android Device" to not give any unintentional hint that only virtual
devices are covered. Such cases are the project creation wizard and the
kit target device settings.

Task-number: QTCREATORBUG-26477
Change-Id: I8c7224243aec6b8f5b5bf95db8d23b9aecbafca6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 10:31:18 +00:00
Assam Boudjelthia
43f759a6b0 Android: remove unauthorized field form AndroidDeviceInfo
This is not really needed anymore, it was mainly used for physical
devices to report whether they need user authorization to be used
via adb. This is now handled by IDevice::DeviceState, where a
Connected device is unauthorized, otherwise any physical device is
ReadyToUse if authorization is good.

Change-Id: If5c1e49b98063eabe4205cd8adb5b11515e1e1de
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 09:22:08 +00:00
Assam Boudjelthia
ec55b1a483 Android: remove AndroidDeviceType and State from AndroidDeviceInfo
No need to have these enums which are now only a duplication of
IDevice::MachineType and IDevice::DeviceState.

Change-Id: Icc3f112f2670c7354bb282b36fad0f0631b9e047
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 09:21:37 +00:00
Assam Boudjelthia
affe3ccf51 Android: Make refresh action device specific
Change-Id: I18386ad88e04696068f5f127cadb7ffcc6f25a56
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 09:21:22 +00:00
Assam Boudjelthia
fbcb45c105 Android: get build dir based on settings file path for qmake projects
Check Constants::AndroidDeploySettingsFile path first, and use
the buildTarget's workingDir only if that former value is empty.

Fixes: QTCREATORBUG-26357
Change-Id: I726a4b5cd60042845988b4428eea03ef0adb9920
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 09:20:23 +00:00
Assam Boudjelthia
f36ab58451 Android: Align api and revision columns to the right
Change-Id: Ib6e0d1e0b6922cfe5b90e320b25b2dce2dcaba14
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-15 06:47:14 +00:00
Assam Boudjelthia
336cee445e Android: Remove unnecessary parameters in AndroidConfigurations
No need to manually provide a parameter to adbToolPath inside
AndroidConfigurations itself, functions that needs it can just
get it directly.

Change-Id: Ie319e82e4ea3b7e3ad6588284168f6116bef2686
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 14:59:03 +00:00
Assam Boudjelthia
6e4d829a40 Android: handle return correct serialNumber for a running avd
AVDs don't get a serial number until they are started, and avdmanager
don't make it easy to get their serial either, so we need to check
the running devices with adb "emu avd name" command and compare.

Change-Id: I3253d25a3461a36eb9918b3c796062bf9e82e0c6
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 14:58:27 +00:00
Assam Boudjelthia
3619223cbe Move SDK Manager instal/uninstall checkbox to left of package name
This will makes it much easier selecting packages for install/uninstall
operations, and makes more space for the package name by removing the
operation column, as well as making changes more apparent by marking
pending changes in bold font.

Change-Id: Iec86c384195dd8c51fd8f00c1de56cdbb2bab62a
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 14:56:49 +00:00
Assam Boudjelthia
78da7e2922 Move sdkmanager's sdk level parsing to AndroidConfig
Both the sdkmanger and avdmanager (maybe more) need to parse the sdk
level for packages and devices which may contain letters, make them
use the same logic.

Change-Id: Iff7fef3a66e00fac11b833f73f2f334a4cf1a766
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-13 14:56:06 +00:00
Christian Kandeler
38b97b404a Fix various compiler warnings
Change-Id: I59db57e8501bbd0d0293ccce1b520df8acc07413
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-13 13:56:11 +00:00
Assam Boudjelthia
f49fbe7f58 Android: set the deploy step widget to expanded by default
The deploy step widget most useful aspect is the uninstall before
deploy checkbox, and having it expanded by default would improve the
UX a bit by avoiding one extra mouse click.

Change-Id: I23ebc90daf9290d229d93dca1b9b25629902e3f2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-12 10:59:13 +00:00
Assam Boudjelthia
9ccf355abe Android: put "am start" extra args at the end of the arguments list
Add "am start" extra arguments after all the params used by Creator's
deployment process are added. This in turn help tackle two issues:
1) Allowing users to use [-n] to start a different Activity than the
default one.
2) Won't fail deployment silently is a param is a non supported arg,
where adb would try to start an app but the return code is 0 even if
the that app is not found.

Then, we don't need the warning aspect anymore because after this
change, we would rely on "adb am start" to report an exception, but
the app would start anyway if the case 2 above occurs.

Change-Id: Ie609b748e76a068c66c8a9be1d08ccc050167ad1
Reviewed-by: hjk <hjk@qt.io>
2021-10-12 10:57:43 +00:00
Assam Boudjelthia
df904decd0 Android: correct label for build platform sdk in project settings
The current label could be confused with build-tools version, so make
it more explicit.

Change-Id: I96abe9af04e6a6e8518926578411f759b90fc9a0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-10-08 06:52:57 +00:00
Assam Boudjelthia
1e765e5963 Android: add environment to removeAvd()
Valid for windows hosts, otherwise, the command might fail.

Change-Id: I3e759c74ea0a785fd226cda08f301f0cce17c9b7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-06 18:50:55 +00:00
Assam Boudjelthia
c94d5a257b Android: few fixes for android kits aspects
Make some changes to make Android kits behave as, for example,
desktop kits:
* Set the build device of the kit to the default desktop device.
* Don't make the device and toolchain aspects sticky.

Change-Id: I41a40c6ed8dc3434fa4f3a09349b75b5fd379317
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-06 08:08:05 +00:00
Assam Boudjelthia
91117a1c36 Android: Clean up for extraData constants
clean, rename and delete unused constants, we well as unify the
usage between qmake, cmake, and qbs.

Change-Id: I8827ac2f2f7660e337694fef17f744e727bd776a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-06 08:07:42 +00:00
Assam Boudjelthia
2de32e3aa8 Android: make sure emulator device actions are emulator specific
Actions like start, erase, and avd arguments are specific to emulator
type devices, so make sure such actions are only in that case.

Task-number: QTCREATORBUG-23991
Change-Id: I9d5ffbd733c31540ab4e3d2a617cad54e70f8f8e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-04 12:19:22 +00:00
Assam Boudjelthia
480bdbd3af Add search field for Android Sdk Manager
The list of packages from the sdk manager can be too much to look at and
search manually, thus a search field is very convenient to have here.

The search is very simple, include any package that contains the search
word into the result.

Change-Id: Id222841162739d49562ad11bb0f3152041614ebc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-04 12:11:16 +00:00
Christian Stenger
416ea51494 Android: Fix compile
Amends b7c15d4d8d.

Change-Id: I613476daa551cf52ef3b5e905868d027156b6826
Reviewed-by: hjk <hjk@qt.io>
2021-09-30 10:26:47 +00:00
Assam Boudjelthia
b7c15d4d8d Android: Make fixes to androidqmlpreview
This amends 261a39cbbd with fixes
to issues noticed after merging the initial patch.

Change-Id: I5f859374cbba3a2e020e6ca0789cc2b387d2739a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-30 09:06:23 +00:00
Assam Boudjelthia
ba672d1334 Android: Do some refactoring for AvdDialog class
Move some logic for avd creation to the AvdDialog, and some
refactoring and simplification.

Change-Id: Id65e586ab1c0e9e898a04f07d7707371f20da649
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-29 10:27:32 +00:00
Alessandro Portale
c44478f0fe Android: Fix FilePath usage (string vs. userInput/Output)
Important on Windows

Change-Id: I0a3041e28ad60f28544ecdab2f6153b7931939f2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-29 08:25:09 +00:00
Alessandro Portale
ebc6e1fc62 Android: Use Android tools environment for avdmanager call
Otherwise AVD creation fails (on Windows).

Change-Id: Iff11c2cd96c214b40b714b6b1248adede54da343
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-28 10:14:59 +00:00
Assam Boudjelthia
e860871d2a Move AVD Manager from Android Settings to Device Settings
Move AVD management and creation to Qt Creator's DeviceManager
facilities. This allows AVDs to be created from the Devices settings
page and their details and control/action buttons for starting/stopping,
etc. are added there as well. This makes the process similar to other
device types that Qt Creator supports, to get a similar experience.

Task-number: QTCREATORBUG-23991
Change-Id: I16c52b3cc73035e0ee12fd54ae9dad4595c8cda5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-27 19:09:05 +00:00