2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2012-07-03 16:57:44 +03:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-07-03 16:57:44 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-07-03 16:57:44 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-07-03 16:57:44 +03:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-07-03 16:57:44 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-07-03 16:57:44 +03:00
|
|
|
|
|
|
|
#include "androiddevice.h"
|
|
|
|
#include "androidconstants.h"
|
2013-09-30 13:20:02 +02:00
|
|
|
#include "androidsignaloperation.h"
|
2018-02-09 17:20:22 +01:00
|
|
|
#include "androidconfigurations.h"
|
2018-06-18 13:40:02 +02:00
|
|
|
#include "androidmanager.h"
|
2012-07-03 16:57:44 +03:00
|
|
|
|
2016-06-03 19:11:29 +02:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
2017-10-25 16:18:58 +02:00
|
|
|
#include <utils/url.h>
|
|
|
|
|
2012-07-03 16:57:44 +03:00
|
|
|
#include <QCoreApplication>
|
|
|
|
|
2012-07-26 17:41:52 +02:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
2012-07-03 16:57:44 +03:00
|
|
|
namespace Android {
|
|
|
|
namespace Internal {
|
|
|
|
|
2012-07-26 17:41:52 +02:00
|
|
|
AndroidDevice::AndroidDevice()
|
|
|
|
: IDevice(Core::Id(Constants::ANDROID_DEVICE_TYPE),
|
2012-07-25 17:10:20 +02:00
|
|
|
IDevice::AutoDetected,
|
|
|
|
IDevice::Hardware,
|
2012-07-03 16:57:44 +03:00
|
|
|
Core::Id(Constants::ANDROID_DEVICE_ID))
|
|
|
|
{
|
2012-07-27 15:43:00 +02:00
|
|
|
setDisplayName(QCoreApplication::translate("Android::Internal::AndroidDevice", "Run on Android"));
|
2012-07-03 16:57:44 +03:00
|
|
|
setDeviceState(DeviceReadyToUse);
|
2018-06-18 13:40:02 +02:00
|
|
|
QString activityPath;
|
|
|
|
const AndroidConfig &config = AndroidConfigurations::currentConfig();
|
|
|
|
AndroidManager::apkInfo(config.qtLiveApkPath(), nullptr, nullptr, &activityPath);
|
|
|
|
setQmlsceneCommand(activityPath);
|
2012-07-03 16:57:44 +03:00
|
|
|
}
|
|
|
|
|
2012-07-26 17:41:52 +02:00
|
|
|
AndroidDevice::AndroidDevice(const AndroidDevice &other)
|
2012-08-09 01:56:51 +02:00
|
|
|
: IDevice(other)
|
2012-07-03 16:57:44 +03:00
|
|
|
{ }
|
|
|
|
|
|
|
|
|
2012-07-26 17:41:52 +02:00
|
|
|
IDevice::DeviceInfo AndroidDevice::deviceInformation() const
|
2012-07-03 16:57:44 +03:00
|
|
|
{
|
2012-07-26 17:41:52 +02:00
|
|
|
return IDevice::DeviceInfo();
|
2012-07-03 16:57:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QString AndroidDevice::displayType() const
|
|
|
|
{
|
2012-07-27 15:43:00 +02:00
|
|
|
return QCoreApplication::translate("Android::Internal::AndroidDevice", "Android");
|
2012-07-03 16:57:44 +03:00
|
|
|
}
|
|
|
|
|
2012-07-26 17:41:52 +02:00
|
|
|
IDeviceWidget *AndroidDevice::createWidget()
|
2012-07-03 16:57:44 +03:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<Core::Id> AndroidDevice::actionIds() const
|
|
|
|
{
|
2013-03-27 14:17:49 +01:00
|
|
|
return QList<Core::Id>();
|
2012-07-03 16:57:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QString AndroidDevice::displayNameForActionId(Core::Id actionId) const
|
|
|
|
{
|
|
|
|
Q_UNUSED(actionId)
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2013-09-16 11:12:31 +02:00
|
|
|
void AndroidDevice::executeAction(Core::Id actionId, QWidget *parent)
|
2012-07-03 16:57:44 +03:00
|
|
|
{
|
|
|
|
Q_UNUSED(actionId)
|
|
|
|
Q_UNUSED(parent)
|
|
|
|
}
|
|
|
|
|
2013-04-18 10:01:05 +02:00
|
|
|
bool AndroidDevice::canAutoDetectPorts() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-09-16 15:30:30 +02:00
|
|
|
DeviceProcessSignalOperation::Ptr AndroidDevice::signalOperation() const
|
|
|
|
{
|
2013-09-30 13:20:02 +02:00
|
|
|
return DeviceProcessSignalOperation::Ptr(new AndroidSignalOperation());
|
2013-09-16 15:30:30 +02:00
|
|
|
}
|
|
|
|
|
2017-06-28 17:16:07 +02:00
|
|
|
Utils::OsType AndroidDevice::osType() const
|
|
|
|
{
|
|
|
|
return Utils::OsTypeOtherUnix;
|
|
|
|
}
|
|
|
|
|
2012-07-26 17:41:52 +02:00
|
|
|
IDevice::Ptr AndroidDevice::clone() const
|
|
|
|
{
|
|
|
|
return IDevice::Ptr(new AndroidDevice(*this));
|
|
|
|
}
|
|
|
|
|
2017-06-29 18:32:01 +02:00
|
|
|
QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const
|
2013-10-11 12:58:24 +02:00
|
|
|
{
|
2017-06-29 18:32:01 +02:00
|
|
|
QUrl url;
|
2017-10-25 16:18:58 +02:00
|
|
|
url.setScheme(Utils::urlTcpScheme());
|
2017-06-29 18:32:01 +02:00
|
|
|
url.setHost("localhost");
|
|
|
|
return url;
|
2013-10-11 12:58:24 +02:00
|
|
|
}
|
|
|
|
|
2012-07-03 16:57:44 +03:00
|
|
|
} // namespace Internal
|
|
|
|
} // namespace Android
|