summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/doppelganger/appops.cpp50
-rw-r--r--src/doppelganger/appops.h29
-rw-r--r--src/doppelganger/doppelganger.pro6
-rw-r--r--src/doppelganger/main.cpp2
4 files changed, 85 insertions, 2 deletions
diff --git a/src/doppelganger/appops.cpp b/src/doppelganger/appops.cpp
new file mode 100644
index 0000000..adeddcc
--- /dev/null
+++ b/src/doppelganger/appops.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** 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
new file mode 100644
index 0000000..5e765a6
--- /dev/null
+++ b/src/doppelganger/appops.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+**
+** 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
index 40c7650..fa91169 100644
--- a/src/doppelganger/doppelganger.pro
+++ b/src/doppelganger/doppelganger.pro
@@ -10,11 +10,13 @@ TEMPLATE = app
SOURCES += main.cpp \
permissioncontroller.cpp \
schedulingpolicyservice.cpp \
- powermanager.cpp
+ powermanager.cpp \
+ appops.cpp
HEADERS += \
permissioncontroller.h \
schedulingpolicyservice.h \
- powermanager.h
+ powermanager.h \
+ appops.h
load(qt_tool)
diff --git a/src/doppelganger/main.cpp b/src/doppelganger/main.cpp
index 6d81991..0fe5338 100644
--- a/src/doppelganger/main.cpp
+++ b/src/doppelganger/main.cpp
@@ -21,6 +21,7 @@
#include "permissioncontroller.h"
#include "schedulingpolicyservice.h"
#include "powermanager.h"
+#include "appops.h"
using namespace android;
@@ -30,5 +31,6 @@ int main(int, char *[])
SchedulingPolicyService::instantiate();
PermissionController::instantiate();
PowerManager::instantiate();
+ AppOps::instantiate();
IPCThreadState::self()->joinThreadPool();
}