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