Commit Graph

60 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Christian Kandeler
49569574de Fix some warnings about unused variables and functions
Change-Id: I5f0acd9598bc7f3a79963cc4e1b255e2b6fb2e5d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-27 08:47:36 +00:00
Assam Boudjelthia
75854d57ef Add Android device details under Devices settings
Add an AndroidDeviceWidget to handle showing details of detected
Android devices, things like name, serial number, api level,
and more specific info for AVDs.

Task-number: QTCREATORBUG-23991
Change-Id: I97637aa0ced78ebd34c37f2b874802914ce44578
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-22 08:18:10 +00:00
Assam Boudjelthia
96255208a5 Change device selection mechanism on Android
Currently, on deploy/debug steps on Android, an AndroidDeviceDialog
is popped up each time a deployement is done to select a device. This
can be avoidable by using Qt Creator DeviceKitAspect to have the list
of devices easily selectable from the project mini-menu.

This is better than the current way because it:
* reduces the time from deployment to running the app
* reduces the number of clicks
* avoids having to select the same device each time or
* if a default device is selected, this avoids having to go to project
settings to reset the default device to be able to deploy to a new
device.
* it looks cleaner and more compatible with Creator.

Task-number: QTCREATORBUG-23991
Change-Id: Ida4ab7245c1a3b0ca26c5ccdc9a21a072edf0725
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-21 15:33:40 +00:00
hjk
d08c0f31c4 De-Q_OBJECT-ify most DeviceFactories
WinRt is the odd one out.

Some were using setObjectName, but only used for debug reasons,
not really needed.

Change-Id: I4a370e4694443bc1c455fda4337ef3acfb9259b8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-23 13:32:12 +00:00
Christian Stenger
52106ecfef Android: Remove unused variable and function
Change-Id: I435bbd35c65a099fc202869a674431c11c76b0b9
Reviewed-by: hjk <hjk@qt.io>
2019-12-19 10:12:45 +00:00
Alessandro Portale
b7acfc37b5 Android: Remove "qtlive" support
Productization of Qt Live preview for Android didn't happen.

Change-Id: Ie69d8193afec9b59d859bc65c45d36028247e2b9
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-12-18 05:46:53 +00:00
Alessandro Portale
b5499f0360 Android: Don't attempt to handle a non-existing qt_live_viewer.apk
This remove 4 failed adb calls if the qt_live_viewer.apk is missing
(which it always is).

Task-number: QTCREATORBUG-23313
Change-Id: I8dbf833b35a9386d8d87f72c043dd019c62b4467
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-12-04 11:56:19 +00:00
hjk
36d98d4af7 ProjectExplorer: Base IDevice::osType on a data member
Change-Id: I969563e6e62895a51fb4692c8eb0bab278f0ecae
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 07:44:45 +00:00
Christian Kandeler
45f9c178e1 ProjectExplorer::IDevice: Add a default display name
Task-number: QTCREATORBUG-16281
Change-Id: Ieff929343b5dc3a84d9ecf5f4f0a032cb4ae4076
Reviewed-by: hjk <hjk@qt.io>
2019-08-02 12:23:12 +00:00
hjk
f420788465 ProjectExplorer: Make Device::displayType a data member
Change-Id: If650f660e3b10bc28d575ded07a854f59be26f87
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-19 13:44:30 +00:00
hjk
555360c1d4 ProjectExplorer: Use the fromMap(toMap()) pattern to clone devices
Change-Id: Ie6e73f5ef1019907dd311aac116d71f08b5a5202
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-10 12:35:59 +00:00
hjk
9e965409d1 Move IDeviceFactory closer to IDevice implementation
Except for the DesktopDevice, which is kind of special. Also try
a bit to make (and partially fail at doing so) naming and code
structure (#include, use of namespaces) more similar to each other.

Change-Id: I9fe266e706b72c14f59ff03ca1ae02dba3adcc71
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-21 13:20:16 +00:00
hjk
da4d395ff4 Android: Cosmetics for AndroidDevice interface
Change-Id: I291f51a3baeb3768428485c63914627c0d91037b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-17 16:27:59 +00:00
hjk
3f3eb40417 ProjectExplorer: Introduce a setter for IDevice origin and id
They are not completely orthogonal, so use one function for
now.

This is the step towards streamlining the IDevice::ctor/create
lines of functions.

Change-Id: I1fe9144c45c7da0c9dcbda3bf424e976e0519cd6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-15 13:02:28 +00:00
hjk
09c1c170d2 ProjectExplorer: Use setter for IDevice::type
Second step towards streamlining the IDevice::ctor/create lines
of functions.

Change-Id: I8b0f2270a9f6545ff9419ef8cf44b456c2233223
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 15:45:00 +00:00
hjk
75bce4332d ProjectExplorer: Use setter for IDevice::machineType
First step towards streamlining the IDevice::ctor/create lines
of functions.

Change-Id: I44226f8a05902cadd40c8820ab67752070d186c0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 15:10:51 +00:00
hjk
a3c6d30b75 ProjectExplorer: Simplify IDevice extra device action setup
Function objects are easy nowadays.

Change-Id: Iec2b770b99d8f11b7a090fb3bd51af8aa60f6fe0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 12:55:51 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Alessandro Portale
be5c228e5b Android: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: I6c9e567edf16cf436c0e0c1239b40f74574a1096
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-07-26 08:26:21 +00:00
Vikas Pachdha
b8da47af9c Android: Log Qt live apk path and few more code paths
Change-Id: Id743db4865b399c619c04fc393540758352c60e1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-07-19 14:47:58 +00:00
Vikas Pachdha
f10002e3f5 Android: Deploy Qt live apk for QML projects
Task-number: QDS-16
Change-Id: Iafb1f7ea5d354e73020ff3c5175efa82f99bdffe
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-10 11:51:44 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Ulf Hermann
8e9454010b Android: Make qmlscene command configurable
Change-Id: Ife1dd4ae9fa3bcc822c27d744c3ed626bae99b8f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-02-14 14:03:39 +00:00
Ulf Hermann
8b867e88f4 Support QML preview with qmlproject on android
Change-Id: I53a074d2064ddd2a20e745250d9620cd1969928b
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-02-14 14:03:33 +00:00
Eike Ziller
a3d845815a Fix build error after merge
Change-Id: Idc8bd0cece32fa2095598cef931a369f35d6be11
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-10-25 19:29:52 +00:00
Ulf Hermann
f846e488dd ProjectExplorer: Make sure toolControlChannel URLs come with a scheme
QML Profiler won't accept URLs without schemes anymore.

Change-Id: I54995ae7e9c1bcdb9f55fe5d56a45931f14cf890
Reviewed-by: hjk <hjk@qt.io>
2017-10-19 16:26:21 +00:00
hjk
f82bb1ec3a ProjectExplorer: Remove Connection as concept
It turns out that one "Connection" per RunControl doesn't map
well to the uses we have. Instead, RunWorkers need to know
individually how to connect to the place where they can work,
but they are already specific enough to be able to use a
standard class (like QUrl) as their way to specify the needed
entry point.

In theory one could see a RunControl's connection as an
aggregation of its workers connection bits, but that does
not really seem to be needed in code.

As consequence, replace UrlConnection by a plain QUrl, and also
the HostName connection by a QUrl with hostName set.

Change-Id: I40c97e37779314ac0a77041e864a18eadb78f987
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-07-07 06:23:52 +00:00
hjk
7bc88000d9 ProjectExplorer: Introduce a Utils::OsType IDevice::osType() function
E.g. for easier construction of command lines in situations like

    if (isLocal())
        runnable.commandLineArguments = argumentString(Utils::HostOsInfo::hostOs());
    else
        runnable.commandLineArguments = argumentString(Utils::OsTypeLinux);

Change-Id: I5a35304e5d1b5a042952201f39f4134a5cd0ce24
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-28 15:49:56 +00:00
Alessandro Portale
a00ee753fe ProjectExplorer: Introduce IDeviceFactory::iconForId()
This adds the possibility to have an icon for a device type. Now,
a Kit can have a proper icon if just the device type but not device
is selected.

Change-Id: I2a382ffd5b46cbbf74cdd0b934b3d450d300bfff
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-11-30 13:55:38 +00:00
Alessandro Portale
ee6b19cb39 Themable, HighDpi Android/iOS device icons
Also used as option category icons

Change-Id: I40916ff4683554a3e7de7126d737286eba4a525f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-09-27 14:18:04 +00:00
Alessandro Portale
59b7601c58 ProjectExplorer: default icons for IDevice
Enable devices to define their default themable icon.

Kit icons are now by default the Desktopdevice icon,
overridable by the device icon of the kit's device,
in turn overridable by an icon file path.

KitManagerConfigWidget: The browse button for the Kit
icon gets a "reset" action.

Change-Id: I6328ba7d640393aee2c324c592e76b4d5430586a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-26 11:52:00 +00:00
Eike Ziller
4f9016e03f Merge remote-tracking branch 'origin/4.0' into 4.1
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/android/android.qbs
	src/plugins/android/androiddevice.cpp
	src/plugins/autotest/testcodeparser.cpp
	src/plugins/debugger/analyzer/analyzerstartparameters.h
	src/plugins/projectexplorer/devicesupport/desktopdevice.cpp
	src/plugins/projectexplorer/devicesupport/idevice.cpp
	src/plugins/projectexplorer/runconfiguration.h

Change-Id: I2474d06f2309fa71210a8401846bc2ef85bebf1d
2016-06-22 11:09:32 +02:00
hjk
3f11ef9216 Avoid using dynamic_cast<>
dynamic_cast<> breaks in cross-library situations. In the past
the issue was witnessed on Mac, this time on FreeBSD in
various configurations.

The workaround deployed here is to manually create unique
type ids in form of (addresses of) global variables.

Task-id: QTCREATORBUG-16462
Change-Id: Ie28fbb3d31d06c1a722a3d9ea808831191298e71
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Ralf Nolden <nolden@kde.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-22 07:31:41 +00:00
hjk
db9437c2e8 Generalize IDevice::qmlProfilerHost
The idea is to have a way for tools to specify what kind of
control channel they would like to use to communicate with
a device without making the choice explicit dependent on
the exact kind of tool to further decouple device and tool
implementations.

The 'hint' values are there to help the device implementation
to decide on which channel to use exactly in case there are
multiple choices. In any case, the tool is responsible to
check that the returned channel is suitable for its operation.

Currently the only choice is "QmlControlChannel" yielding
a simple wrapper around the former IDevice::qmlProfilerHost()
return value.

Other enum values may potentially be {Tcp,LocalSocket}ControlChannel
(to specify a type of transport) AdbChannel (to specify some
generic helper mechanism). It might also turn out that something
more complex than an enum will be needed, e.g. to express
a set of values with priorities or such, but I'd rather
avoid overengineering for now.

Change-Id: Id386425eb3dd2bb395065f0bdb6f67217cd40a71
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-06-08 08:16:22 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
David Schulz
7243def78c Android: Add AndroidSignalOperation.
Allows to kill and interrupt remote processes with the pid.

Change-Id: I22befc04dafbe2a7f132bddb3e17a2b48579ef3c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-11-05 16:55:29 +01:00
hjk
a527fbe91c IDevice: Add a qmlProfilerHost function
This seems to be a better abstraction than the "pseudo dynamic cast"
in the QmlProfilerTool and the DebuggerPlugin itself.

Change-Id: If7dea70e1353852ebb6d3ce43220c0b03ccb4b00
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-10-11 13:40:53 +02:00
David Schulz
a06af35631 ProjectExplorer: Introduce DeviceProcessSignalOperation.
Every device can now return a DeviceProcessSignalOperation,
which allows to kill or interrupt processes running on the
device.

Change-Id: Idaa04ebc767e09ca167fa033ed93860b9b81479e
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-20 10:48:47 +02:00
Christian Kandeler
2a3ef09473 Device support: Make IDevice::executeAction non-const.
Presumably this function is currently const because no current
implementation actually changes device properties, but there
is no reason why that should not be allowed.

Change-Id: I80e4355be70e40bca9df5e1287a1d1d3f60c6534
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-17 13:36:08 +02:00
Aurindam Jana
e8c23e1d71 Android: Setup QML debugging
Change-Id: Ida96411f9710bd9a968d4b934fb50f69bf3666fc
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
2013-04-23 12:06:29 +02:00