public void setSensorSleepWindow(long millis) {
   try {
     sensorManager.setSensorConfig(
         sensorType, PullSensorConfig.POST_SENSE_SLEEP_LENGTH_MILLIS, millis);
   } catch (ESException e) {
     e.printStackTrace();
   }
 }
 public void setSensorSampleWindow(long millis) {
   try {
     sensorManager.setSensorConfig(
         sensorType, PullSensorConfig.SENSE_WINDOW_LENGTH_MILLIS, millis);
   } catch (ESException e) {
     e.printStackTrace();
   }
 }
 public int getSensorSleepWindow() {
   try {
     Long sampleWindow =
         (Long)
             sensorManager.getSensorConfigValue(
                 sensorType, PullSensorConfig.POST_SENSE_SLEEP_LENGTH_MILLIS);
     return (int) (sampleWindow / 1000);
   } catch (ESException e) {
     e.printStackTrace();
     return 0;
   }
 }