diff options
| author | Jani Suonpera <jasuonpe@gmail.com> | 2015-10-09 11:59:19 +0300 |
|---|---|---|
| committer | Ben Fennema <fennema@google.com> | 2015-11-30 21:24:48 -0800 |
| commit | ad75169628589a275fb869a813ea697336e0c0aa (patch) | |
| tree | 4474918f17ba98e63fbb0e70f3c0b754b96c8c58 /core/java/android | |
| parent | 52bdf11583366322ca14d69b895ac451a71245db (diff) | |
DO NOT MERGE ANYWHERE Add new interface for sensor physical data
This is special solution only for emerald branch.
Changes including new const char* value/interface for sensor physical data. Sensor service and manager does not take care of content, structure or other
details of string. Sensor HAL is taking care of parsing data from string and setting values to Sensor HW.
Change-Id: Id19226d7d3ac0628488a0f005f2b1c44bafcf9b6
Signed-off-by: Ben Fennema <fennema@google.com>
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/hardware/SensorManager.java | 23 | ||||
| -rw-r--r-- | core/java/android/hardware/SystemSensorManager.java | 8 |
2 files changed, 31 insertions, 0 deletions
diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index 5d405f92e380..506d710658e4 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -1684,4 +1684,27 @@ public abstract class SensorManager { } return delay; } + + /** + * Send configuration string to Sensor HAL. + * + * @param data String which includes sensor physical data. + * Sensor HAL is taking care of parsing data from string and + * setting values to Sensor HW. + * + * @return true if successfully send to HAL. + */ + /** + * @hide + */ + public boolean SetPhysicalData(String data) + { + //Log.d(TAG, "SensorManager.SetPhysicalData(" + data + ")"); + return SetPhysicalDataImpl(data); + } + + /** + * @hide + */ + protected abstract boolean SetPhysicalDataImpl(String data); } diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java index 2fe8fb6f71ce..bf9722e40134 100644 --- a/core/java/android/hardware/SystemSensorManager.java +++ b/core/java/android/hardware/SystemSensorManager.java @@ -45,6 +45,7 @@ public class SystemSensorManager extends SensorManager { private static native boolean nativeGetSensorAtIndex(long nativeInstance, Sensor sensor, int index); private static native boolean nativeIsDataInjectionEnabled(long nativeInstance); + private static native boolean nativeSetPhysicalData(long nativeInstance, String data); private static boolean sSensorModuleInitialized = false; private static InjectEventQueue mInjectEventQueue = null; @@ -274,6 +275,13 @@ public class SystemSensorManager extends SensorManager { } } + @Override + protected boolean SetPhysicalDataImpl(String data) + { + //Log.d(TAG, "SystemSensorManager.SetPhysicalDataImpl(" + data + ")"); + return nativeSetPhysicalData(mNativeInstance,data); + } + /* * BaseEventQueue is the communication channel with the sensor service, * SensorEventQueue, TriggerEventQueue are subclases and there is one-to-one mapping between |
