summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2015-04-29 16:50:41 -0700
committerSvetoslav <svetoslavganov@google.com>2015-05-01 13:51:45 -0700
commitb412f6e203b38f8047f760261a5e3dc6d0722f08 (patch)
treef4e06f90090581c0efcff50602145ff11d0ea753 /include
parent61a3c8dec90acebef15ef56cae14efea69279f69 (diff)
downloadframeworks_native-b412f6e203b38f8047f760261a5e3dc6d0722f08.zip
frameworks_native-b412f6e203b38f8047f760261a5e3dc6d0722f08.tar.gz
frameworks_native-b412f6e203b38f8047f760261a5e3dc6d0722f08.tar.bz2
Add body sensors app op - framework native
Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
Diffstat (limited to 'include')
-rw-r--r--include/android/sensor.h11
-rw-r--r--include/binder/AppOpsManager.h7
-rw-r--r--include/binder/IAppOpsService.h2
-rw-r--r--include/binder/IPermissionController.h5
-rw-r--r--include/gui/ISensorServer.h4
-rw-r--r--include/gui/Sensor.h4
-rw-r--r--include/gui/SensorEventQueue.h3
-rw-r--r--include/gui/SensorManager.h6
8 files changed, 23 insertions, 19 deletions
diff --git a/include/android/sensor.h b/include/android/sensor.h
index d58c460..969677f 100644
--- a/include/android/sensor.h
+++ b/include/android/sensor.h
@@ -193,17 +193,6 @@ typedef ASensorRef const* ASensorList;
/*****************************************************************************/
/*
- * Get a reference to the sensor manager. ASensorManager is a singleton.
- *
- * Example:
- *
- * ASensorManager* sensorManager = ASensorManager_getInstance();
- *
- */
-ASensorManager* ASensorManager_getInstance();
-
-
-/*
* Returns the list of available sensors.
*/
int ASensorManager_getSensorList(ASensorManager* manager, ASensorList* list);
diff --git a/include/binder/AppOpsManager.h b/include/binder/AppOpsManager.h
index ea33952..042927c 100644
--- a/include/binder/AppOpsManager.h
+++ b/include/binder/AppOpsManager.h
@@ -87,7 +87,11 @@ public:
OP_ASSIST_STRUCTURE = 49,
OP_ASSIST_SCREENSHOT = 50,
OP_READ_PHONE_STATE = 51,
- OP_ADD_VOICEMAIL = 52
+ OP_ADD_VOICEMAIL = 52,
+ OP_USE_SIP = 53,
+ OP_PROCESS_OUTGOING_CALLS = 54,
+ OP_USE_FINGERPRINT = 55,
+ OP_BODY_SENSORS = 56
};
AppOpsManager();
@@ -99,6 +103,7 @@ public:
void startWatchingMode(int32_t op, const String16& packageName,
const sp<IAppOpsCallback>& callback);
void stopWatchingMode(const sp<IAppOpsCallback>& callback);
+ int32_t permissionToOpCode(const String16& permission);
private:
Mutex mLock;
diff --git a/include/binder/IAppOpsService.h b/include/binder/IAppOpsService.h
index 193e9cc..cd81efa 100644
--- a/include/binder/IAppOpsService.h
+++ b/include/binder/IAppOpsService.h
@@ -40,6 +40,7 @@ public:
const sp<IAppOpsCallback>& callback) = 0;
virtual void stopWatchingMode(const sp<IAppOpsCallback>& callback) = 0;
virtual sp<IBinder> getToken(const sp<IBinder>& clientToken) = 0;
+ virtual int32_t permissionToOpCode(const String16& permission) = 0;
enum {
CHECK_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
@@ -49,6 +50,7 @@ public:
START_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+4,
STOP_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+5,
GET_TOKEN_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+6,
+ PERMISSION_TO_OP_CODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+7,
};
enum {
diff --git a/include/binder/IPermissionController.h b/include/binder/IPermissionController.h
index f3f0a92..4e5fb34 100644
--- a/include/binder/IPermissionController.h
+++ b/include/binder/IPermissionController.h
@@ -34,9 +34,12 @@ public:
virtual void getPackagesForUid(const uid_t uid, Vector<String16> &packages) = 0;
+ virtual bool isRuntimePermission(const String16& permission) = 0;
+
enum {
CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
- GET_PACKAGES_FOR_UID_TRANSACTION = CHECK_PERMISSION_TRANSACTION + 1
+ GET_PACKAGES_FOR_UID_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION + 1,
+ IS_RUNTIME_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION + 2
};
};
diff --git a/include/gui/ISensorServer.h b/include/gui/ISensorServer.h
index ee3484c..4feb6db 100644
--- a/include/gui/ISensorServer.h
+++ b/include/gui/ISensorServer.h
@@ -37,9 +37,9 @@ class ISensorServer : public IInterface
public:
DECLARE_META_INTERFACE(SensorServer);
- virtual Vector<Sensor> getSensorList() = 0;
+ virtual Vector<Sensor> getSensorList(const String16& opPackageName) = 0;
virtual sp<ISensorEventConnection> createSensorEventConnection(const String8& packageName,
- int mode) = 0;
+ int mode, const String16& opPackageName) = 0;
virtual status_t enableDataInjection(int enable) = 0;
};
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
index 27a215e..8142be6 100644
--- a/include/gui/Sensor.h
+++ b/include/gui/Sensor.h
@@ -71,6 +71,8 @@ public:
uint32_t getFifoMaxEventCount() const;
const String8& getStringType() const;
const String8& getRequiredPermission() const;
+ bool isRequiredPermissionRuntime() const;
+ int32_t getRequiredAppOp() const;
int32_t getMaxDelay() const;
uint32_t getFlags() const;
bool isWakeUpSensor() const;
@@ -97,6 +99,8 @@ private:
uint32_t mFifoMaxEventCount;
String8 mStringType;
String8 mRequiredPermission;
+ bool mRequiredPermissionRuntime = false;
+ int32_t mRequiredAppOp;
int32_t mMaxDelay;
uint32_t mFlags;
static void flattenString8(void*& buffer, size_t& size, const String8& string8);
diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h
index b70957b..e5b9fc5 100644
--- a/include/gui/SensorEventQueue.h
+++ b/include/gui/SensorEventQueue.h
@@ -23,6 +23,7 @@
#include <utils/Errors.h>
#include <utils/RefBase.h>
#include <utils/Timers.h>
+#include <utils/String16.h>
#include <gui/BitTube.h>
@@ -52,7 +53,7 @@ public:
enum { MAX_RECEIVE_BUFFER_EVENT_COUNT = 256 };
- SensorEventQueue(const sp<ISensorEventConnection>& connection);
+ SensorEventQueue(const sp<ISensorEventConnection>& connection);
virtual ~SensorEventQueue();
virtual void onFirstRef();
diff --git a/include/gui/SensorManager.h b/include/gui/SensorManager.h
index 4cabf59..d0c63d4 100644
--- a/include/gui/SensorManager.h
+++ b/include/gui/SensorManager.h
@@ -44,11 +44,10 @@ class SensorEventQueue;
// ----------------------------------------------------------------------------
class SensorManager :
- public ASensorManager,
- public Singleton<SensorManager>
+ public ASensorManager
{
public:
- SensorManager();
+ SensorManager(const String16& opPackageName);
~SensorManager();
ssize_t getSensorList(Sensor const* const** list) const;
@@ -68,6 +67,7 @@ private:
mutable Sensor const** mSensorList;
mutable Vector<Sensor> mSensors;
mutable sp<IBinder::DeathRecipient> mDeathObserver;
+ const String16 mOpPackageName;
};
// ----------------------------------------------------------------------------