diff options
author | Eirik Aavitsland <eirik.aavitsland@theqtcompany.com> | 2015-07-07 12:48:39 +0200 |
---|---|---|
committer | aavit <eirik.aavitsland@theqtcompany.com> | 2015-07-10 11:52:02 +0000 |
commit | 6e4f410a95ce328a6bb9113ed1597c66f3f77177 (patch) | |
tree | de97c27deb7683e346102b11cb664faed7d24488 /src/doppelganger | |
parent | a91a5c6f36da6b7324d0a52ecf1ab3c7517c5375 (diff) |
Remove eAndroid specific modules
Change-Id: Ied9d920dfa6d12093b40d32d5f3a61c1c23b137d
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Diffstat (limited to 'src/doppelganger')
-rw-r--r-- | src/doppelganger/appops.cpp | 50 | ||||
-rw-r--r-- | src/doppelganger/appops.h | 29 | ||||
-rw-r--r-- | src/doppelganger/doppelganger.pro | 22 | ||||
-rw-r--r-- | src/doppelganger/main.cpp | 36 | ||||
-rw-r--r-- | src/doppelganger/permissioncontroller.cpp | 38 | ||||
-rw-r--r-- | src/doppelganger/permissioncontroller.h | 35 | ||||
-rw-r--r-- | src/doppelganger/powermanager.cpp | 88 | ||||
-rw-r--r-- | src/doppelganger/powermanager.h | 62 | ||||
-rw-r--r-- | src/doppelganger/schedulingpolicyservice.cpp | 88 | ||||
-rw-r--r-- | src/doppelganger/schedulingpolicyservice.h | 44 |
10 files changed, 0 insertions, 492 deletions
diff --git a/src/doppelganger/appops.cpp b/src/doppelganger/appops.cpp deleted file mode 100644 index adeddcc..0000000 --- a/src/doppelganger/appops.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://qt.digia.com/ -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://qt.digia.com/ -** -****************************************************************************/ - -#include "appops.h" - -#if Q_ANDROID_VERSION_MAJOR > 4 || (Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR >= 4) -#include <binder/IServiceManager.h> -#include <binder/IAppOpsCallback.h> - -class AppOpsPrivate : public android::BnAppOpsCallback -{ -public: - virtual void opChanged(int32_t, const android::String16&) - { - - } - - virtual android::status_t onTransact(uint32_t, - const android::Parcel&, - android::Parcel*, - uint32_t flags = 0) - { - (void)flags; - return android::OK; - } -}; -#endif - -void AppOps::instantiate() -{ -#if Q_ANDROID_VERSION_MAJOR > 4 || (Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR >= 4) - android::defaultServiceManager()->addService(android::String16("appops"), new AppOpsPrivate); -#endif -} diff --git a/src/doppelganger/appops.h b/src/doppelganger/appops.h deleted file mode 100644 index 5e765a6..0000000 --- a/src/doppelganger/appops.h +++ /dev/null @@ -1,29 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://qt.digia.com/ -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://qt.digia.com/ -** -****************************************************************************/ - -#ifndef APPOPS_H -#define APPOPS_H - -class AppOps -{ -public: - static void instantiate(); -}; - -#endif // APPOPS_H diff --git a/src/doppelganger/doppelganger.pro b/src/doppelganger/doppelganger.pro deleted file mode 100644 index fa91169..0000000 --- a/src/doppelganger/doppelganger.pro +++ /dev/null @@ -1,22 +0,0 @@ -QT -= core gui - -TARGET = doppelganger - -LIBS += -lutils -lbinder -lcutils \ - -L$${ANDROID_PRODUCT_OUT}/obj/STATIC_LIBRARIES/libscheduling_policy_intermediates -lscheduling_policy -lpowermanager - -TEMPLATE = app - -SOURCES += main.cpp \ - permissioncontroller.cpp \ - schedulingpolicyservice.cpp \ - powermanager.cpp \ - appops.cpp - -HEADERS += \ - permissioncontroller.h \ - schedulingpolicyservice.h \ - powermanager.h \ - appops.h - -load(qt_tool) diff --git a/src/doppelganger/main.cpp b/src/doppelganger/main.cpp deleted file mode 100644 index 3e86a66..0000000 --- a/src/doppelganger/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://www.qt.io -** -****************************************************************************/ -#include <binder/IPCThreadState.h> - -#include "permissioncontroller.h" -#include "schedulingpolicyservice.h" -#include "powermanager.h" -#include "appops.h" - -using namespace android; - -int main(int, char *[]) -{ - sp<ProcessState> proc(ProcessState::self()); - SchedulingPolicyService::instantiate(); - PermissionController::instantiate(); - PowerManager::instantiate(); - AppOps::instantiate(); - IPCThreadState::self()->joinThreadPool(); -} diff --git a/src/doppelganger/permissioncontroller.cpp b/src/doppelganger/permissioncontroller.cpp deleted file mode 100644 index 9538b1a..0000000 --- a/src/doppelganger/permissioncontroller.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://www.qt.io -** -****************************************************************************/ -#include "permissioncontroller.h" - -#include <binder/IServiceManager.h> - -using namespace android; - -PermissionController::PermissionController() -{ -} - -void PermissionController::instantiate() -{ - defaultServiceManager()->addService(String16("permission"), new PermissionController); -} - -bool PermissionController::checkPermission(const String16 &, int32_t, int32_t) -{ - // just bypass any permission - return true; -} diff --git a/src/doppelganger/permissioncontroller.h b/src/doppelganger/permissioncontroller.h deleted file mode 100644 index 211a346..0000000 --- a/src/doppelganger/permissioncontroller.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://www.qt.io -** -****************************************************************************/ -#ifndef PERMISSIONCONTROLLER_H -#define PERMISSIONCONTROLLER_H - -#include <binder/IPermissionController.h> - -class PermissionController : public android::BnPermissionController -{ -public: - static void instantiate(); - - bool checkPermission(const android::String16 &permission, int32_t pid, int32_t uid); - -private: - PermissionController(); -}; - -#endif // PERMISSIONCONTROLLER_H diff --git a/src/doppelganger/powermanager.cpp b/src/doppelganger/powermanager.cpp deleted file mode 100644 index 7f0da97..0000000 --- a/src/doppelganger/powermanager.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://www.qt.io -** -****************************************************************************/ - -#include "powermanager.h" - -#include <binder/IServiceManager.h> - -using namespace android; - -enum { - ACQUIRE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION, - ACQUIRE_WAKE_LOCK_UID = IBinder::FIRST_CALL_TRANSACTION + 1, - RELEASE_WAKE_LOCK = IBinder::FIRST_CALL_TRANSACTION + 2, - UPDATE_WAKE_LOCK_UIDS = IBinder::FIRST_CALL_TRANSACTION + 3, -}; - -void PowerManager::instantiate() -{ - defaultServiceManager()->addService(String16("power"), new PowerManager()); -} - -status_t PowerManager::onTransact(uint32_t code, - const Parcel &, - Parcel *, - uint32_t) -{ - switch (code) { - case ACQUIRE_WAKE_LOCK: - case ACQUIRE_WAKE_LOCK_UID: - case RELEASE_WAKE_LOCK: - case UPDATE_WAKE_LOCK_UIDS: - return NO_ERROR; - default: - break; - } -} - -#if Q_ANDROID_VERSION_MAJOR > 4 || (Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR >= 4) -status_t PowerManager::acquireWakeLock(int, - const sp<IBinder> &, - const String16 &, - const String16 &) -{ - return OK; -} - -status_t PowerManager::acquireWakeLockWithUid(int, - const sp<IBinder> &, - const String16 &, - const String16 &, - int) -{ - return OK; -} - -status_t PowerManager::updateWakeLockUids(const sp<IBinder> &, - int, - const int *) -{ - return OK; -} -#else // < 4.4 -status_t PowerManager::acquireWakeLock(int, const sp<android::IBinder> &, const String16 &) -{ - return OK; -} -#endif - -status_t PowerManager::releaseWakeLock(const sp<IBinder> &, int) -{ - return OK; -} diff --git a/src/doppelganger/powermanager.h b/src/doppelganger/powermanager.h deleted file mode 100644 index 23f2695..0000000 --- a/src/doppelganger/powermanager.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://www.qt.io -** -****************************************************************************/ - -#ifndef POWERMANAGER_H -#define POWERMANAGER_H - -#include <powermanager/IPowerManager.h> - -namespace android { - -typedef BnInterface<IPowerManager> BnPowerManagerService; - -} // namespace android - -class PowerManager : public android::BnPowerManagerService -{ -public: - static void instantiate(); - android::status_t onTransact(uint32_t code, - const android::Parcel &data, - android::Parcel *reply, - uint32_t flags); - -#if Q_ANDROID_VERSION_MAJOR > 4 || (Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR >= 4) - virtual android::status_t acquireWakeLock(int flags, - const android::sp<android::IBinder>& lock, - const android::String16& tag, - const android::String16& packageName); - virtual android::status_t acquireWakeLockWithUid(int flags, - const android::sp<android::IBinder>& lock, - const android::String16& tag, - const android::String16& packageName, - int uid); - virtual android::status_t updateWakeLockUids(const android::sp<android::IBinder>& lock, - int len, - const int *uids); -#else // < 4.4 - virtual android::status_t acquireWakeLock(int flags, - const android::sp<android::IBinder>& lock, - const android::String16& tag); -#endif - - virtual android::status_t releaseWakeLock(const android::sp<android::IBinder>& lock, int flags); -}; - -#endif // POWERMANAGER_H diff --git a/src/doppelganger/schedulingpolicyservice.cpp b/src/doppelganger/schedulingpolicyservice.cpp deleted file mode 100644 index 7113e6a..0000000 --- a/src/doppelganger/schedulingpolicyservice.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://www.qt.io -** -****************************************************************************/ -#include "schedulingpolicyservice.h" - -#include <binder/IServiceManager.h> -#include <binder/IPCThreadState.h> -#include <cutils/sched_policy.h> -#include <sched.h> - -using namespace android; - -enum { - REQUEST_PRIORITY_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION -}; - -#define PRIORITY_MIN 1 -#define PRIORITY_MAX 3 - -SchedulingPolicyService::SchedulingPolicyService() -{ -} - -void SchedulingPolicyService::instantiate() -{ - defaultServiceManager()->addService(String16("scheduling_policy"), new SchedulingPolicyService); -} - -status_t SchedulingPolicyService::onTransact(uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) -{ - switch (code) { - case REQUEST_PRIORITY_TRANSACTION: { - CHECK_INTERFACE(ISchedulingPolicyService, data, reply); - int32_t pid = data.readInt32(); - int32_t tid = data.readInt32(); - int32_t prio = data.readInt32(); - int res = requestPriority_helper(pid, tid, prio); - reply->writeNoException(); - reply->writeInt32(res); - return NO_ERROR; - } break; - default: - return BBinder::onTransact(code, data, reply, flags); - } -} - -#if Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR < 3 -int SchedulingPolicyService::requestPriority(int32_t pid, int32_t tid, int32_t prio) -#else -int SchedulingPolicyService::requestPriority(int32_t pid, int32_t tid, int32_t prio, bool) -#endif -{ - return requestPriority_helper(pid, tid, prio); -} - -int SchedulingPolicyService::requestPriority_helper(int32_t pid, int32_t tid, int32_t prio) -{ - if (prio < PRIORITY_MIN || prio > PRIORITY_MAX) - return PERMISSION_DENIED; - - int res = set_sched_policy(tid, IPCThreadState::self()->getCallingPid() == pid ? SP_AUDIO_SYS - : SP_AUDIO_APP); - if (res != NO_ERROR) - return PERMISSION_DENIED; - - struct sched_param param; - param.sched_priority = prio; - res = sched_setscheduler(tid, SCHED_FIFO, ¶m); - if (res) - return PERMISSION_DENIED; - - return OK; -} diff --git a/src/doppelganger/schedulingpolicyservice.h b/src/doppelganger/schedulingpolicyservice.h deleted file mode 100644 index 2dc1e42..0000000 --- a/src/doppelganger/schedulingpolicyservice.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of Qt Enterprise Embedded. -** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** the contact form at http://www.qt.io -** -****************************************************************************/ -#ifndef SCHEDULINGPOLICYSERVICE_H -#define SCHEDULINGPOLICYSERVICE_H - -#include <frameworks/av/services/audioflinger/ISchedulingPolicyService.h> -#include <binder/Parcel.h> - -class SchedulingPolicyService : public android::BnSchedulingPolicyService -{ -public: - static void instantiate(); - - android::status_t onTransact(uint32_t code, const android::Parcel &data, - android::Parcel *reply, uint32_t flags); - -#if Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR < 3 - int requestPriority(int32_t pid, int32_t tid, int32_t prio); -#else - int requestPriority(int32_t pid, int32_t tid, int32_t prio, bool); -#endif - -private: - SchedulingPolicyService(); - int requestPriority_helper(int32_t pid, int32_t tid, int32_t prio); -}; - -#endif // SCHEDULINGPOLICYSERVICE_H |