Lines Matching refs:listener
541 * Registers a listener for given sensors.
547 * @param listener
548 * sensor listener object
557 public boolean registerListener(SensorListener listener, int sensors) {
558 return registerListener(listener, sensors, SENSOR_DELAY_NORMAL);
568 * @param listener
569 * sensor listener object
585 public boolean registerListener(SensorListener listener, int sensors, int rate) {
586 return getLegacySensorManager().registerListener(listener, sensors, rate);
590 * Unregisters a listener for all sensors.
596 * @param listener
600 public void unregisterListener(SensorListener listener) {
601 unregisterListener(listener, SENSOR_ALL | SENSOR_ORIENTATION_RAW);
605 * Unregisters a listener for the sensors with which it is registered.
611 * @param listener
618 public void unregisterListener(SensorListener listener, int sensors) {
619 getLegacySensorManager().unregisterListener(listener, sensors);
623 * Unregisters a listener for the sensors with which it is registered.
631 * @param listener
640 public void unregisterListener(SensorEventListener listener, Sensor sensor) {
641 if (listener == null || sensor == null) {
645 unregisterListenerImpl(listener, sensor);
649 * Unregisters a listener for all sensors.
651 * @param listener
658 public void unregisterListener(SensorEventListener listener) {
659 if (listener == null) {
663 unregisterListenerImpl(listener, null);
667 protected abstract void unregisterListenerImpl(SensorEventListener listener, Sensor sensor);
706 * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object.
721 public boolean registerListener(SensorEventListener listener, Sensor sensor,
723 return registerListener(listener, sensor, samplingPeriodUs, null);
757 * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object
778 public boolean registerListener(SensorEventListener listener, Sensor sensor,
781 return registerListenerImpl(listener, sensor, delay, null, maxReportLatencyUs, 0);
796 * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object.
813 public boolean registerListener(SensorEventListener listener, Sensor sensor,
816 return registerListenerImpl(listener, sensor, delay, handler, 0, 0);
823 * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object
844 public boolean registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs,
847 return registerListenerImpl(listener, sensor, delayUs, handler, maxReportLatencyUs, 0);
851 protected abstract boolean registerListenerImpl(SensorEventListener listener, Sensor sensor,
856 * Flushes the FIFO of all the sensors registered for this listener. If there are events
867 * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object
870 * registered for this listener, false if no sensor is previously registered for this
871 * listener or flush on one of the sensors fails.
873 * @throws IllegalArgumentException when listener is null.
875 public boolean flush(SensorEventListener listener) {
876 return flushImpl(listener);
880 protected abstract boolean flushImpl(SensorEventListener listener);
1654 * the case of the {@link Sensor#TYPE_SIGNIFICANT_MOTION}, the provided trigger listener
1660 * @param listener The listener on which the
1668 public boolean requestTriggerSensor(TriggerEventListener listener, Sensor sensor) {
1669 return requestTriggerSensorImpl(listener, sensor);
1675 protected abstract boolean requestTriggerSensorImpl(TriggerEventListener listener,
1688 * @param listener The listener on which the
1694 * with the listener.
1700 public boolean cancelTriggerSensor(TriggerEventListener listener, Sensor sensor) {
1701 return cancelTriggerSensorImpl(listener, sensor, true);
1707 protected abstract boolean cancelTriggerSensorImpl(TriggerEventListener listener,