| 
									
										
										
										
											2012-07-03 16:57:44 +03:00
										 |  |  | /**************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2014-01-07 13:27:11 +01:00
										 |  |  | ** Copyright (c) 2014 BogDan Vatra <bog_dan_ro@yahoo.com> | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Contact: http://www.qt-project.org/legal
 | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							|  |  |  | ** a written agreement between you and Digia.  For licensing terms and | 
					
						
							|  |  |  | ** conditions see http://qt.digia.com/licensing.  For further information
 | 
					
						
							|  |  |  | ** use the contact form at http://qt.digia.com/contact-us.
 | 
					
						
							| 
									
										
										
										
											2012-07-03 16:57:44 +03:00
										 |  |  | ** | 
					
						
							|  |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
					
						
							|  |  |  | ** General Public License version 2.1 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
					
						
							|  |  |  | ** packaging of this file.  Please review the following information to | 
					
						
							|  |  |  | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
					
						
							|  |  |  | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** In addition, as a special exception, Digia gives you certain additional | 
					
						
							|  |  |  | ** rights.  These rights are described in the Digia Qt LGPL Exception | 
					
						
							| 
									
										
										
										
											2012-07-03 16:57:44 +03:00
										 |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											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"
 | 
					
						
							| 
									
										
										
										
											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); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-26 17:41:52 +02:00
										 |  |  | IDevice::Ptr AndroidDevice::clone() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return IDevice::Ptr(new AndroidDevice(*this)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-11 12:58:24 +02:00
										 |  |  | QString AndroidDevice::qmlProfilerHost() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return QLatin1String("localhost"); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-03 16:57:44 +03:00
										 |  |  | } // namespace Internal
 | 
					
						
							|  |  |  | } // namespace Android
 |