Android: Make the device watcher process terminate on shutdown

Terminate on IPlugin::aboutToShutdown instead of
QCoreApplication::aboutToQuit. If needed synchronously.

Added "ADB device watcher started" logging.

Fixes: QTCREATORBUG-27118
Change-Id: I483659b018c74d179b64a5a4f17cc2c27c9598a8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Alessandro Portale
2022-02-25 21:49:11 +01:00
parent 68d30df703
commit e45e16d904
4 changed files with 51 additions and 10 deletions

View File

@@ -160,6 +160,19 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa
return true;
}
AndroidPlugin::ShutdownFlag AndroidPlugin::aboutToShutdown()
{
AndroidDeviceManager *dm = AndroidDeviceManager::instance();
const IPlugin::ShutdownFlag sf = dm->devicesShutdownFlag();
if (sf == AsynchronousShutdown)
connect(dm, &AndroidDeviceManager::devicesWatcherShutdownFinished,
this, &ExtensionSystem::IPlugin::asynchronousShutdownFinished);
dm->shutdownDevicesWatcher();
return sf;
}
void AndroidPlugin::kitsRestored()
{
const bool qtForAndroidInstalled