Home
last modified time | relevance | path

Searched refs:Sensor (Results 1 – 25 of 105) sorted by relevance

12345

/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/utils/hardware/
DFakeSensorManager.java21 import android.hardware.Sensor;
63 Sensor proxSensor = context.getSystemService(SensorManager.class) in FakeSensorManager()
64 .getDefaultSensor(Sensor.TYPE_PROXIMITY); in FakeSensorManager()
67 proxSensor = createSensor(Sensor.TYPE_PROXIMITY, null); in FakeSensorManager()
72 mFakeLightSensor = new FakeGenericSensor(createSensor(Sensor.TYPE_LIGHT, null)), in FakeSensorManager()
90 public Sensor getDefaultSensor(int type) { in getDefaultSensor()
91 Sensor s = super.getDefaultSensor(type); in getDefaultSensor()
101 protected List<Sensor> getFullSensorList() { in getFullSensorList()
109 protected List<Sensor> getFullDynamicSensorList() { in getFullDynamicSensorList()
114 protected void unregisterListenerImpl(SensorEventListener listener, Sensor sensor) { in unregisterListenerImpl()
[all …]
/frameworks/native/libs/sensor/
DSensor.cpp36 Sensor::Sensor(const char * name) : in Sensor() function in android::Sensor
44 Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion) : in Sensor() function in android::Sensor
45 Sensor(*hwSensor, uuid_t(), halVersion) { in Sensor()
48 Sensor::Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersion) : in Sensor() function in android::Sensor
49 Sensor("") { in Sensor()
344 Sensor::~Sensor() { in ~Sensor()
347 const String8& Sensor::getName() const { in getName()
351 const String8& Sensor::getVendor() const { in getVendor()
355 int32_t Sensor::getHandle() const { in getHandle()
359 int32_t Sensor::getType() const { in getType()
[all …]
DISensorServer.cpp57 virtual Vector<Sensor> getSensorList(const String16& opPackageName) in getSensorList()
63 Sensor s; in getSensorList()
64 Vector<Sensor> v; in getSensorList()
75 virtual Vector<Sensor> getDynamicSensorList(const String16& opPackageName) in getDynamicSensorList()
81 Sensor s; in getDynamicSensorList()
82 Vector<Sensor> v; in getDynamicSensorList()
160 Vector<Sensor> v(getSensorList(opPackageName)); in onTransact()
187 Vector<Sensor> v(getDynamicSensorList(opPackageName)); in onTransact()
/frameworks/base/core/java/android/hardware/
DSensorManager.java90 private final SparseArray<List<Sensor>> mSensorListByType =
91 new SparseArray<List<Sensor>>();
380 protected abstract List<Sensor> getFullSensorList(); in getFullSensorList()
386 protected abstract List<Sensor> getFullDynamicSensorList(); in getFullDynamicSensorList()
418 public List<Sensor> getSensorList(int type) { in getSensorList()
420 List<Sensor> list; in getSensorList()
421 final List<Sensor> fullList = getFullSensorList(); in getSensorList()
425 if (type == Sensor.TYPE_ALL) { in getSensorList()
428 list = new ArrayList<Sensor>(); in getSensorList()
429 for (Sensor i : fullList) { in getSensorList()
[all …]
DSystemSensorManager.java60 Sensor sensor, int index); in nativeGetSensorAtIndex()
61 private static native void nativeGetDynamicSensors(long nativeInstance, List<Sensor> list); in nativeGetDynamicSensors()
80 private final ArrayList<Sensor> mFullSensorsList = new ArrayList<>();
81 private List<Sensor> mFullDynamicSensorsList = new ArrayList<>();
84 private final HashMap<Integer, Sensor> mHandleToSensor = new HashMap<>();
119 Sensor sensor = new Sensor(); in SystemSensorManager()
129 protected List<Sensor> getFullSensorList() { in getFullSensorList()
135 protected List<Sensor> getFullDynamicSensorList() { in getFullDynamicSensorList()
145 protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, in registerListenerImpl()
152 if (sensor.getReportingMode() == Sensor.REPORTING_MODE_ONE_SHOT) { in registerListenerImpl()
[all …]
DLegacySensorManager.java72 final List<Sensor> fullList = mSensorManager.getFullSensorList(); in getSensors()
73 for (Sensor i : fullList) { in getSensors()
75 case Sensor.TYPE_ACCELEROMETER: in getSensors()
78 case Sensor.TYPE_MAGNETIC_FIELD: in getSensors()
81 case Sensor.TYPE_ORIENTATION: in getSensors()
96 Sensor.TYPE_ACCELEROMETER, listener, sensors, rate) || result; in registerListener()
98 Sensor.TYPE_MAGNETIC_FIELD, listener, sensors, rate) || result; in registerListener()
100 Sensor.TYPE_ORIENTATION, listener, sensors, rate) || result; in registerListener()
102 Sensor.TYPE_ORIENTATION, listener, sensors, rate) || result; in registerListener()
104 Sensor.TYPE_TEMPERATURE, listener, sensors, rate) || result; in registerListener()
[all …]
/frameworks/base/native/android/
Dsensor.cpp35 using android::Sensor;
78 Sensor const* const* l; in ASensorManager_getSensorList()
93 Sensor const* const* sensorList; in ASensorManager_getDefaultSensorEx()
201 sensorHandle = static_cast<Sensor const *>(sensor)->getHandle(); in ASensorManager_configureDirectReport()
219 static_cast<Sensor const*>(sensor)->getHandle(), samplingPeriodUs, in ASensorEventQueue_registerSensor()
228 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_enableSensor()
236 static_cast<Sensor const*>(sensor)); in ASensorEventQueue_disableSensor()
249 static_cast<Sensor const*>(sensor), us2ns(usec)); in ASensorEventQueue_setEventRate()
297 return static_cast<Sensor const*>(sensor)->getName().string(); in ASensor_getName()
302 return static_cast<Sensor const*>(sensor)->getVendor().string(); in ASensor_getVendor()
[all …]
/frameworks/base/packages/SystemUI/plugin/src/com/android/systemui/plugins/
DSensorManagerPlugin.java38 void registerListener(Sensor sensor, SensorEventListener listener); in registerListener()
45 void unregisterListener(Sensor sensor, SensorEventListener listener); in unregisterListener()
57 class Sensor { class
65 public Sensor(int type) { in Sensor() method in SensorManagerPlugin.Sensor
80 Sensor mSensor;
90 public SensorEvent(Sensor sensor, int vendorType) { in SensorEvent()
101 public SensorEvent(Sensor sensor, int vendorType, float[] values) { in SensorEvent()
107 public Sensor getSensor() { in getSensor()
/frameworks/native/libs/sensor/include/sensor/
DSensor.h44 class Sensor : public ASensor, public LightFlattenable<Sensor>
64 Sensor(const Sensor&) = default;
65 Sensor& operator=(const Sensor&) = default;
67 explicit Sensor(const char * name = "");
68 explicit Sensor(struct sensor_t const* hwSensor, int halVersion = 0);
69 Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersion = 0);
70 ~Sensor();
DSensorManager.h49 class Sensor; variable
59 ssize_t getSensorList(Sensor const* const** list);
60 ssize_t getDynamicSensorList(Vector<Sensor>& list);
61 Sensor const* getDefaultSensor(int type);
83 Sensor const** mSensorList;
84 Vector<Sensor> mSensors;
DSensorEventQueue.h45 class Sensor; variable
82 status_t enableSensor(Sensor const* sensor) const;
83 status_t enableSensor(Sensor const* sensor, int32_t samplingPeriodUs) const;
84 status_t disableSensor(Sensor const* sensor) const;
85 status_t setEventRate(Sensor const* sensor, nsecs_t ns) const;
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
DTestUtils.java19 import android.hardware.Sensor;
29 public static SensorEvent createSensorEvent(Sensor sensor, int lux) throws Exception { in createSensorEvent()
41 public static void setSensorType(Sensor sensor, int type, String strType) throws Exception { in setSensorType()
42 Method setter = Sensor.class.getDeclaredMethod("setType", Integer.TYPE); in setSensorType()
52 public static Sensor createSensor(int type, String strType) throws Exception { in createSensor()
53 Constructor<Sensor> constr = Sensor.class.getDeclaredConstructor(); in createSensor()
55 Sensor sensor = constr.newInstance(); in createSensor()
/frameworks/base/packages/SystemUI/src/com/android/systemui/util/
DAsyncSensorManager.java21 import android.hardware.Sensor;
58 private final List<Sensor> mSensorCache;
73 mSensorCache = mInner.getSensorList(Sensor.TYPE_ALL); in AsyncSensorManager()
79 protected List<Sensor> getFullSensorList() { in getFullSensorList()
84 protected List<Sensor> getFullDynamicSensorList() { in getFullDynamicSensorList()
85 return mInner.getSensorList(Sensor.TYPE_ALL); in getFullDynamicSensorList()
90 Sensor sensor, int delayUs, Handler handler, int maxReportLatencyUs, in registerListenerImpl()
117 protected int configureDirectChannelImpl(SensorDirectChannel channel, Sensor s, int rate) { in configureDirectChannelImpl()
133 protected boolean requestTriggerSensorImpl(TriggerEventListener listener, Sensor sensor) { in requestTriggerSensorImpl()
143 protected boolean cancelTriggerSensorImpl(TriggerEventListener listener, Sensor sensor, in cancelTriggerSensorImpl()
[all …]
DProximitySensor.java21 import android.hardware.Sensor;
41 private final Sensor mSensor;
53 public void onAccuracyChanged(Sensor sensor, int accuracy) {
63 Sensor sensor = findCustomProxSensor(context, sensorManager); in ProximitySensor()
67 sensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); in ProximitySensor()
93 public static Sensor findCustomProxSensor(Context context, SensorManager sensorManager) { in findCustomProxSensor()
99 List<Sensor> sensorList = sensorManager.getSensorList(Sensor.TYPE_ALL); in findCustomProxSensor()
100 Sensor sensor = null; in findCustomProxSensor()
101 for (Sensor s : sensorList) { in findCustomProxSensor()
/frameworks/native/services/sensorservice/
DSensorList.cpp27 const Sensor SensorList::mNonSensor = Sensor("unknown");
69 const Vector<Sensor> SensorList::getUserSensors() const { in getUserSensors()
71 Vector<Sensor> sensors; in getUserSensors()
82 const Vector<Sensor> SensorList::getUserDebugSensors() const { in getUserDebugSensors()
84 Vector<Sensor> sensors; in getUserDebugSensors()
95 const Vector<Sensor> SensorList::getDynamicSensors() const { in getDynamicSensors()
97 Vector<Sensor> sensors; in getDynamicSensors()
108 const Vector<Sensor> SensorList::getVirtualSensors() const { in getVirtualSensors()
110 Vector<Sensor> sensors; in getVirtualSensors()
124 forEachSensor([&result] (const Sensor& s) -> bool { in dump()
DSensorList.h50 const Vector<Sensor> getUserSensors() const;
51 const Vector<Sensor> getUserDebugSensors() const;
52 const Vector<Sensor> getDynamicSensors() const;
53 const Vector<Sensor> getVirtualSensors() const;
70 const Sensor& getNonSensor() const { return mNonSensor;} in getNonSensor()
86 const static Sensor mNonSensor; //.getName() == "unknown",
DSensorService.h278 virtual Vector<Sensor> getSensorList(const String16& opPackageName);
279 virtual Vector<Sensor> getDynamicSensorList(const String16& opPackageName);
295 const Sensor& registerSensor(SensorInterface* sensor,
297 const Sensor& registerVirtualSensor(SensorInterface* sensor, bool isDebug = false);
298 const Sensor& registerDynamicSensorLocked(SensorInterface* sensor, bool isDebug = false);
304 static bool canAccessSensor(const Sensor& sensor, const char* operation,
306 static bool hasPermissionForSensor(const Sensor& sensor);
341 void makeUuidsIntoIdsForSensorList(Vector<Sensor> &sensorList) const;
343 int32_t getIdFromUuid(const Sensor::uuid_t &uuid) const;
/frameworks/base/packages/SystemUI/src/com/android/systemui/doze/
DDozeSensors.java19 import static com.android.systemui.plugins.SensorManagerPlugin.Sensor.TYPE_WAKE_DISPLAY;
20 import static com.android.systemui.plugins.SensorManagerPlugin.Sensor.TYPE_WAKE_LOCK_SCREEN;
28 import android.hardware.Sensor;
98 mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION), in DozeSensors()
104 mSensorManager.getDefaultSensor(Sensor.TYPE_PICK_UP_GESTURE), in DozeSensors()
134 new SensorManagerPlugin.Sensor(TYPE_WAKE_DISPLAY), in DozeSensors()
141 new SensorManagerPlugin.Sensor(TYPE_WAKE_LOCK_SCREEN), in DozeSensors()
161 private Sensor findSensorWithType(String type) { in findSensorWithType()
165 static Sensor findSensorWithType(SensorManager sensorManager, String type) { in findSensorWithType()
169 List<Sensor> sensorList = sensorManager.getSensorList(Sensor.TYPE_ALL); in findSensorWithType()
[all …]
/frameworks/base/core/java/com/android/internal/os/
DSensorPowerCalculator.java18 import android.hardware.Sensor;
28 private final List<Sensor> mSensors;
33 mSensors = sensorManager.getSensorList(Sensor.TYPE_ALL); in SensorPowerCalculator()
41 final SparseArray<? extends BatteryStats.Uid.Sensor> sensorStats = u.getSensorStats(); in calculateApp()
44 final BatteryStats.Uid.Sensor sensor = sensorStats.valueAt(ise); in calculateApp()
50 case BatteryStats.Uid.Sensor.GPS: in calculateApp()
57 final Sensor s = mSensors.get(i); in calculateApp()
/frameworks/base/services/tests/servicestests/src/com/android/server/display/whitebalance/
DAmbientSensorTest.java30 import android.hardware.Sensor;
62 private Sensor mLightSensor;
63 private Sensor mAmbientColorSensor;
72 mLightSensor = TestUtils.createSensor(Sensor.TYPE_LIGHT, null); in setUp()
81 when(mSensorManagerMock.getDefaultSensor(Sensor.TYPE_LIGHT)).thenReturn(mLightSensor); in testAmbientBrightnessSensorCallback_NoCallbacks()
89 verify(mSensorManagerMock).registerListener(captor.capture(), isA(Sensor.class), anyInt(), in testAmbientBrightnessSensorCallback_NoCallbacks()
101 when(mSensorManagerMock.getDefaultSensor(Sensor.TYPE_LIGHT)).thenReturn(mLightSensor); in testAmbientBrightnessSensorCallback_CallbacksCalled()
129 final List<Sensor> sensorList = ImmutableList.of(mLightSensor, mAmbientColorSensor); in testAmbientColorTemperatureSensorCallback_CallbacksCalled()
130 when(mSensorManagerMock.getSensorList(Sensor.TYPE_ALL)).thenReturn(sensorList); in testAmbientColorTemperatureSensorCallback_CallbacksCalled()
/frameworks/base/core/java/android/view/
DOrientationEventListener.java20 import android.hardware.Sensor;
38 private Sensor mSensor;
71 mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); in OrientationEventListener()
139 mOldListener.onSensorChanged(Sensor.TYPE_ACCELEROMETER, event.values); in onSensorChanged()
147 public void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged()
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/
DMotionSensor.java22 import android.hardware.Sensor;
37 private Sensor mSensor = null;
56 mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION); in onPrepare()
68 public final void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged()
/frameworks/native/services/sensorservice/tests/
Dsensorservicetest.cpp47 if (buffer[i].type == Sensor::TYPE_ACCELEROMETER) { in receiver()
67 Sensor const* const* list; in main()
74 Sensor const* accelerometer = mgr.getDefaultSensor(Sensor::TYPE_ACCELEROMETER); in main()
/frameworks/base/services/core/java/com/android/server/display/whitebalance/
DAmbientSensor.java21 import android.hardware.Sensor;
48 protected Sensor mSensor;
213 public void onAccuracyChanged(Sensor sensor, int accuracy) {
251 mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); in AmbientBrightnessSensor()
331 for (Sensor sensor : mSensorManager.getSensorList(Sensor.TYPE_ALL)) { in AmbientColorTemperatureSensor()
/frameworks/rs/tests/java_api/Balls/src/com/example/android/rs/balls/
DBalls.java41 import android.hardware.Sensor;
62 if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { in onSensorChanged()
70 public void onAccuracyChanged(Sensor sensor, int accuracy) { in onAccuracyChanged()
88 mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), in onResume()

12345