Esempio n. 1
0
 @Override
 public void onPause(Activity activity) {
   super.onPause(activity);
   if (significantMotionEnabled && significantMotionRegistered) {
     sensorManager.cancelTriggerSensor(mTriggerEventListener, mSensor);
   }
 }
Esempio n. 2
0
 public void testCancelTriggerWithNonTriggerSensor() {
   Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
   boolean result;
   if (sensor != null) {
     result = mSensorManager.cancelTriggerSensor(mTriggerListener, sensor);
     assertFalse(result);
   }
 }