summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-05-07 10:49:07 -0700
committerSvetoslav <svetoslavganov@google.com>2015-05-07 12:56:48 -0700
commitcbb56a8f4e8a47fad95db9b1ae6c343055b07acd (patch)
treedfcd6faaeeb078c7a68d8fc4e898b79cf598119e /native
parente91768d4b5c5e185b884a25bcf60457fb2ba8a5c (diff)
downloadframeworks_base-cbb56a8f4e8a47fad95db9b1ae6c343055b07acd.zip
frameworks_base-cbb56a8f4e8a47fad95db9b1ae6c343055b07acd.tar.gz
frameworks_base-cbb56a8f4e8a47fad95db9b1ae6c343055b07acd.tar.bz2
Fix broke NDK sensor manager API
Change-Id: I0f4e2a3ce20ce20e0aa5a7d38d1f988497c033c0
Diffstat (limited to 'native')
-rw-r--r--native/android/sensor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/native/android/sensor.cpp b/native/android/sensor.cpp
index 4e7c6be..26b41e8 100644
--- a/native/android/sensor.cpp
+++ b/native/android/sensor.cpp
@@ -35,9 +35,27 @@ using android::Sensor;
using android::SensorManager;
using android::SensorEventQueue;
using android::String8;
+using android::String16;
/*****************************************************************************/
+android::Mutex android::SensorManager::sLock;
+std::map<String16, SensorManager*> android::SensorManager::sPackageInstances;
+
+ASensorManager* ASensorManager_getInstance()
+{
+ return ASensorManager_getInstanceForPackage(NULL);
+}
+
+ASensorManager* ASensorManager_getInstanceForPackage(const char* packageName)
+{
+ if (packageName) {
+ return &SensorManager::getInstanceForPackage(String16(packageName));
+ } else {
+ return &SensorManager::getInstanceForPackage(String16());
+ }
+}
+
int ASensorManager_getSensorList(ASensorManager* manager,
ASensorList* list)
{