All devices that support it use the same mechanism to gather ports
so this patch removes the individual implementations in favor
of a single one in IDevice.cpp.
This patch also removes:
* canAutodetectPorts() as it was not used.
* Port::parseFrom...Output as they are not used anymore.
Change-Id: I8ecedec2d71e60985402387982c64311c5a651e6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Since no working directory was explicitly set, the "bin/" directory of
QtC was chosen as working directory.
"adb track-devices" leaves the server process alive after terminating,
and that server process used QtC's working directory. On Windows, that
caused that directory to be undeletable/unmovable as long as the adb
server was alive.
This change sets the working directory of "adb track-devices" to the
parent dir of the adb binary.
Task-number: QTCREATORBUG-28932
Change-Id: I3adf52829c9f4bf456d05d2685c04314e1d25a40
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This re-organizes the buttons on the main device page a bit: The
topmost one still starts the wizard selection, below that are direct
individual buttons to add specific devices.
Change-Id: I52b2803febf658259dde9589544656fd4c8fc889
Reviewed-by: David Schulz <david.schulz@qt.io>
... out of SessionManager.
The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.
Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.
Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This is internal data, so to/fromVariant should do. However, the
device extra data is stored in settings, so stay on the safe side.
Change-Id: I2a673d4dc07b45d1b7b829796ad57540a5e49c20
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).
Change-Id: I159fb6928954240af742708efbd6776104c4631b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Mostly unused #include's, also sort them or reduce scope.
A few namespaces, ...
Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Replaced by the more harmless joinArgs in a compatibility settings
code path for now.
Change-Id: Id6d94faea26002f4a2641b5824d97e09a783b720
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Instead of connecting to errorOccurred() and finished() signals.
Make some cleanup in usages of Utils:: namespace.
Change-Id: I5d784d1938d6aac1dd760c663b60c23378318096
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Delete the AndroidDeviceManager instance on shutdown from inside
android plugin destructor.
Implement AndroidDeviceManager destructor and wait for
futures currently running to finish. Don't do any special
handling for possibly still running m_adbDeviceWatcherProcess,
as it will be deleted automatically by the std::unique_ptr
and this will automatically initiate a proper termination of the
process running.
Change-Id: I5aad6f4fcfca23a0a37c3709efcdffad43a88203
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Android's ADB allows connections over wifi, firstly, a port needs
to be opened from the device, then adb commands can be used to
connect the host to the device over an ip and port. Afer that,
a device can be disconnected from USB and the wifi connection
could be used to do all jobs that were done over USB.
The setup operation require the device to be connected via USB.
This can replace the manual process of dealing with ADB commands
to prepare the connection.
The "Setup Wifi" action is only added to Hardware USB devices,
and not AVDs nor physical devices that are already connected over
WiFi.
Change-Id: I37897a528b45cdeee2764071ec45ec1b3316cdbb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This reverts commit e45e16d904.
Reason for revert: This one should look different in master
Change-Id: I4fbf3a9d046e5fe5a6a45d5ba93b685f5967498c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Avoid calling getDeviceState() if the serial is empty, which
won't give any useful info for emulators. This will avoid
multiple state checks at QC start as well.
Also, set the default new AndroidDevice state as Disconnected,
which reflects better the state of an empty newsly constructed
device which we don't know the state of.
Change-Id: I854e95e28b150f09c3eff6b8a75b2df6bd4aa1ce
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The AVD specific fields don't need to be carried out by QtC settings,
these can be read from the AVD's config file when they are needed.
This also is good because those values can change at any time,
either manually or by some other IDE like Android Studio, and thus
we don't really need to manage them ourselves.
The fields in question are: skin name, target name, sdcard size,
openGL status.
Change-Id: I86163500ec2fed035e32ec02ed17e182778db4a7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
ADB allows connecting the same device via USB or WiFi, so we need
to make sure the name of the wifi which appears as a different device,
make sure it does mean something instead of "Name2" as proposed by
default by QC. So this adds the term wifi to the name to make it clear.
Change-Id: I5923ca2430c8b51ae2525744dcc1f803ab976b35
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
When updating translations with
cmake --build . --target ts_de
(or other language ID)
- Qualifying with unknown namespace/class ::PluginSpecPrivate
- <class> lacks Q_OBJECT macro
Change-Id: Ic42d8dffea935e6b10e59223bdedb9a8a4dcf446
Reviewed-by: hjk <hjk@qt.io>
m_adbDeviceWatcherProcess can be 0 if Android is not set up.
Amends: c43ba1ae32
Change-Id: I90aef197c098f279a6bd3adb0485df74b8be1961
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Use ADB's track-devices command to watch for device
events which would replace the current polling method
with a timer. For AVDs, a QFileSystemWatcher is used
to watch for changes in the AVDs home folder which
would allow updating the AVDs only when a change is done
like edition, deletion, start, stop, even from outside
Qt Creator.
This method would also make device updates faster,
instead of unexpected waits due to timer use.
Task-number: QTCREATORBUG-23991
Change-Id: I08a92252c99c02bc111e597d671f2350817458c7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
That's implicit now by using setCreator()
The Android case looks odd as this is (and was) effectively static
information at startup. This will be addressed in a follow-up patch,
for now keep it functionally equivalent.
Change-Id: I4e6082f88dcd21379186340189acb581caef172a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Somewhat slimmer interface on the user code side and follows
existing practice.
Change-Id: I20ed8f5a00591265d32ea9ce93e1f1bbc76d2437
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
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>
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>
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>
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>
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>
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>