org.android.activityminer.app.recording
Class GenericRecordingActivityForSensorObservations<T extends Enum<T> & Dimensions>

Package class diagram package GenericRecordingActivityForSensorObservations
java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.view.ContextThemeWrapper
              extended by android.app.Activity
                  extended by org.android.activityminer.app.util.SharedPreferenceChangeAwareActivity
                      extended by org.android.activityminer.app.recording.AbstractRecordingActivity<T>
                          extended by org.android.activityminer.app.recording.GenericRecordingActivityForSensorObservations<T>
Type Parameters:
T - the enumeration type for the dimensions
All Implemented Interfaces:
ComponentCallbacks, ComponentCallbacks2, KeyEvent.Callback, LayoutInflater.Factory, LayoutInflater.Factory2, View.OnCreateContextMenuListener, Window.Callback, EventObserver<SampleGapErrorEvent>, SharedPreferenceChangeNotificationReceiver, SharedPreferenceChangeObserver
Direct Known Subclasses:
RecordingActivityForAccelerometerSensorObservations, RecordingActivityForSensorObservations

public abstract class GenericRecordingActivityForSensorObservations<T extends Enum<T> & Dimensions>
extends AbstractRecordingActivity<T>
implements EventObserver<SampleGapErrorEvent>

The generic activity for sensor data recording.


Nested Class Summary
private  class GenericRecordingActivityForSensorObservations.CountDownTask
          Asynchronous task for the start count down.
private  class GenericRecordingActivityForSensorObservations.SaveTask
          The save task.
private  class GenericRecordingActivityForSensorObservations.SaveTimerTask
          The save timer task.
private  class GenericRecordingActivityForSensorObservations.StopTask
          The automatic stop task.
 
Field Summary
private  Button addLabel
          the button to add new labels.
private  TextView countDownField
          The text view for the count down.
private  AsyncTask<Void,Integer,Void> countDownTask
          The count-down task
private  int countDownTime
          The delay before recording is started and a count-down is displayed
private  AtomicLong countOfObservations
          The count of continuous observations
private  String currentRecordingLabel
          The label for continuous recordings
private  Queue<SensorObservationCutout<T,Double>> cutoutQueue
          Queue to store cut-outs in until saving is allowed
private  AtomicLong delayInTheEnd
          The final delay on milliseconds for the storage of recordings.
private  DeviceManager deviceManager
          The device manager.
private  boolean doNotifyRecordingResult
          Flag for recording result notification
private  AtomicLong duration
          The duration of all recordings
private  EditText editLabel
          The text field to edit new labels.
private  Runnable errorEventTask
          The error event task to be executed by the handler.
private  AtomicLong estimatedDuration
          The estimated duration for automatic stopss
private  Handler handler
          handler for error event updates notified by an asynchronous thread event.
private  AtomicBoolean isCountDownActive
          The count-down is active flag.
private  List<String> labels
          The cached labels.
private  String lastError
          Last error.
private  AtomicLong lastErrorTime
          The last error event time
private  LabelAdapter listAdapter
          The list adapter.
private  ListView listViewForLabels
          The list view with the labels.
private  int NOTIFICATION
          the notification identifier
private  MenuItem recordingConfigMenuItem
          The recording option menu entry.
private  GenericRecordingActivityForSensorObservations.SaveTask saveThread
          The save task
private  GenericRecordingActivityForSensorObservations.SaveTimerTask saveTimerTask
          The save timer task
private  ObservableSensorScanner<T,Double> scanner
          The observable sensor observation source (scanner).
private  int selectedLabelPos
          The list view with the labels.
private  AtomicLong sequenceId
          The sequence identifier of the continuous recording session
private  GenericRecordingActivityForSensorObservations.StopTask stopTask
          The task to stop recording automatically.
 
Fields inherited from class android.app.Activity
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
 
Constructor Summary
GenericRecordingActivityForSensorObservations()
          Constructor
 
Method Summary
protected  void addLabel(String activityLabel)
          Does add the text in the edit field as new label to the list.
protected abstract  ObservableSensorScanner<T,Double> createScannerInstance(long sampleRate)
          Getter for the observable sensor scanner instance
 void doSaveCutOut(SensorObservationCutout<T,Double> cutOut)
          Handler for the save timer task
protected  void doStartRecording()
          Method to start recording.
protected  AsyncTask<Void,Integer,Void> getCountDownTask()
          Getter for the countDownTask
protected  int getCountDownTime()
          Getter for the countDownTime
protected  String getCurrentRecordingLabel()
          Getter for the current recording label
protected  long getCutOutSize()
          Getter for the cut-out window size in milliseconds
protected  int getDelayInTheEnd()
          Does calculate the delay in the end in milliseconds to determine the time range to remove from a cut-out due to invalid observations in the end.
 DeviceManager getDeviceManager(long sampleRate)
          Getter for the device manager
protected  String getLabel()
          Getter for the recording label
 long getRemainingTimeForMinRecordingLength()
          Getter for the remaining time until the mininimal recording length requirement is fulfilled
private  void handleRemainingCutOuts(long latestObservationTs)
          Handler for the remaining tasks after a user has stopped recording
protected  void notifyNotEnoughSamplesTaken()
          Does notify for not enough samples taken
protected  void notifyRecordingResult(long cntObservations, long duration)
          Does notify about the recording result
protected  boolean onAboutToStartRecording()
          Call-back method for recording start preparation.
 void onBackPressed()
           
 void onConfigurationChanged(Configuration newConfig)
           
 void onCountDownTimeChange(long countDownTime)
          The handler for count-down time parameter changes.
protected  void onCreate(Bundle savedInstanceState)
           
 boolean onCreateOptionsMenu(Menu menu)
           
protected  void onDestroy()
           
 void onEvent(ObservableEventSource<? extends SampleGapErrorEvent> eventSource, SampleGapErrorEvent observedEvent)
           
 void onLocationDataUsageFlagChange(boolean locationDataUsageFlag)
          The handler for changes of location data usage flag
 void onMaximumRecordingTimeChange(int maximumRecordingTime)
          The handler for maximum recording time parameter changes.
protected  void onNewCutOut(SensorObservationCutout<T,Double> cutOut)
          Event handler for new extracted sensor observation cut-outs
 boolean onOptionsItemSelected(MenuItem item)
           
protected  ObservableSensorScanner<T,Double> onPrepare()
          Call-back method for load preparation.
protected  void onRecordingStopped(boolean wasStoppedByUser, long stopTime)
          Call-back method for recording stopped post processing.
protected  void onResume()
           
protected  void setCountDownTask(AsyncTask<Void,Integer,Void> countDownTask)
          Setter for the countDownTask
protected  void setCountDownTime(int countDownTime)
          Setter for the countDownTime
protected  void setCurrentRecordingLabel(String currentRecordingLabel)
          Setter for the current recording label
protected  boolean testForSelectedLabel()
          Test for a selected activity label
protected  void updateOptionMenu()
          Method to update the option menu enabled state.
 void updateSelection()
          Does update the selection state in the label list.
 
Methods inherited from class org.android.activityminer.app.recording.AbstractRecordingActivity
doStopRecording, enableRecordingButton, getActualObservationTime, getLastCutout, getMinRecordingTime, getSampleRate, isInterestedInLimitViolations, isRecording, isRecordingButtonEnabled, onDefaultRecordingTimeChange, onPause, postDelayed, removeCallbacks, setMinRecordingTime, startRecording
 
Methods inherited from class org.android.activityminer.app.util.SharedPreferenceChangeAwareActivity
getConfiguration, onBetaPreferenceChange, onBWCutOffPreferenceChanged, onBWFilterOrderPreferenceChanged, onClassSelectionChange, onCrossValidationParameterKChange, onEvaluationAccuracyThresholdChanged, onFeatureSelection, onGravitationCutOffPreferenceChanged, onKNNClassifierParameterKChange, onKNNClassifierParameterNormalizeChange, onLimitViolation, onMaximumSampleRateChange, onMinCutOffPreferenceChanged, onOverlapSizeChange, onOwnLinAccImplementationUsageFlagChange, onSampleRateChange, onSelectedAccFilterChanged, onSelectedClassifierChange, onWindowSizeChange
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isTaskRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityResult, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onChildTitleChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onNewIntent, onOptionsMenuClosed, onPanelClosed, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistData, onRestart, onRestoreInstanceState, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, recreate, registerForContextMenu, removeDialog, reportFullyDrawn, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, shouldUpRecreateTask, showDialog, showDialog, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
applyOverrideConfiguration, attachBaseContext, getResources, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTIFICATION

private int NOTIFICATION
the notification identifier


scanner

private ObservableSensorScanner<T extends Enum<T> & Dimensions,Double> scanner
The observable sensor observation source (scanner).


editLabel

private EditText editLabel
The text field to edit new labels.


addLabel

private Button addLabel
the button to add new labels.


listViewForLabels

private ListView listViewForLabels
The list view with the labels.


labels

private final List<String> labels
The cached labels.


selectedLabelPos

private int selectedLabelPos
The list view with the labels.


listAdapter

private LabelAdapter listAdapter
The list adapter.


countDownField

private TextView countDownField
The text view for the count down.


recordingConfigMenuItem

private MenuItem recordingConfigMenuItem
The recording option menu entry.


countDownTime

private int countDownTime
The delay before recording is started and a count-down is displayed


countDownTask

private AsyncTask<Void,Integer,Void> countDownTask
The count-down task


doNotifyRecordingResult

private boolean doNotifyRecordingResult
Flag for recording result notification


cutoutQueue

private final Queue<SensorObservationCutout<T extends Enum<T> & Dimensions,Double>> cutoutQueue
Queue to store cut-outs in until saving is allowed


currentRecordingLabel

private String currentRecordingLabel
The label for continuous recordings


delayInTheEnd

private final AtomicLong delayInTheEnd
The final delay on milliseconds for the storage of recordings. Any sensor observations younger than the stop time minus this delay will not be saved.


sequenceId

private final AtomicLong sequenceId
The sequence identifier of the continuous recording session


countOfObservations

private final AtomicLong countOfObservations
The count of continuous observations


duration

private final AtomicLong duration
The duration of all recordings


estimatedDuration

private final AtomicLong estimatedDuration
The estimated duration for automatic stopss


saveTimerTask

private final GenericRecordingActivityForSensorObservations.SaveTimerTask saveTimerTask
The save timer task


saveThread

private GenericRecordingActivityForSensorObservations.SaveTask saveThread
The save task


deviceManager

private DeviceManager deviceManager
The device manager.


stopTask

private GenericRecordingActivityForSensorObservations.StopTask stopTask
The task to stop recording automatically.


lastError

private String lastError
Last error.


lastErrorTime

private final AtomicLong lastErrorTime
The last error event time


handler

private final Handler handler
handler for error event updates notified by an asynchronous thread event.


errorEventTask

private final Runnable errorEventTask
The error event task to be executed by the handler.


isCountDownActive

private final AtomicBoolean isCountDownActive
The count-down is active flag.

Constructor Detail

GenericRecordingActivityForSensorObservations

public GenericRecordingActivityForSensorObservations()
Constructor

Method Detail

getDeviceManager

public final DeviceManager getDeviceManager(long sampleRate)
Getter for the device manager

Parameters:
sampleRate - the sample rate
Returns:
the device manager

setCountDownTask

protected void setCountDownTask(AsyncTask<Void,Integer,Void> countDownTask)
Setter for the countDownTask

Parameters:
countDownTask - the countDownTask to set

getCountDownTask

protected AsyncTask<Void,Integer,Void> getCountDownTask()
Getter for the countDownTask

Returns:
the countDownTask

setCountDownTime

protected final void setCountDownTime(int countDownTime)
Setter for the countDownTime

Parameters:
countDownTime - the countDownTime to set

getCountDownTime

protected final int getCountDownTime()
Getter for the countDownTime

Returns:
the countDownTime

setCurrentRecordingLabel

protected void setCurrentRecordingLabel(String currentRecordingLabel)
Setter for the current recording label

Parameters:
currentRecordingLabel - the current recording label to set

getCurrentRecordingLabel

protected String getCurrentRecordingLabel()
Getter for the current recording label

Returns:
the current recording label

onCreate

protected void onCreate(Bundle savedInstanceState)
Overrides:
onCreate in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>

onBackPressed

public void onBackPressed()
Overrides:
onBackPressed in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>

onCreateOptionsMenu

public final boolean onCreateOptionsMenu(Menu menu)
Overrides:
onCreateOptionsMenu in class Activity

updateOptionMenu

protected final void updateOptionMenu()
Method to update the option menu enabled state.


onOptionsItemSelected

public final boolean onOptionsItemSelected(MenuItem item)
Overrides:
onOptionsItemSelected in class Activity

onPrepare

protected ObservableSensorScanner<T,Double> onPrepare()
Description copied from class: AbstractRecordingActivity
Call-back method for load preparation. This Method is called every time the GUI is loaded, thus on creation and orientation changes.

Specified by:
onPrepare in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>
Returns:
the observable raw time series data source to use.

onConfigurationChanged

public void onConfigurationChanged(Configuration newConfig)
Specified by:
onConfigurationChanged in interface ComponentCallbacks
Overrides:
onConfigurationChanged in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>

createScannerInstance

protected abstract ObservableSensorScanner<T,Double> createScannerInstance(long sampleRate)
Getter for the observable sensor scanner instance

Parameters:
sampleRate - the sample rate
Returns:
the observable sensor scanner instance

updateSelection

public final void updateSelection()
Does update the selection state in the label list.


onResume

protected final void onResume()
Overrides:
onResume in class Activity

doStartRecording

protected final void doStartRecording()
Description copied from class: AbstractRecordingActivity
Method to start recording.

Overrides:
doStartRecording in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>

onAboutToStartRecording

protected boolean onAboutToStartRecording()
Description copied from class: AbstractRecordingActivity
Call-back method for recording start preparation.

Overrides:
onAboutToStartRecording in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>
Returns:
if true recording will be started , otherwise you need to call AbstractRecordingActivity.startRecording() Method by your own as soon as you are ready.

getDelayInTheEnd

protected final int getDelayInTheEnd()
Does calculate the delay in the end in milliseconds to determine the time range to remove from a cut-out due to invalid observations in the end.

Returns:
the delay in the end, if recording is stopped manually

onRecordingStopped

protected void onRecordingStopped(boolean wasStoppedByUser,
                                  long stopTime)
Description copied from class: AbstractRecordingActivity
Call-back method for recording stopped post processing.

Specified by:
onRecordingStopped in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>
Parameters:
wasStoppedByUser - flag is recording was stopped manually by the user
stopTime - the time the recording was stopped in milliseconds

notifyNotEnoughSamplesTaken

protected void notifyNotEnoughSamplesTaken()
Does notify for not enough samples taken


notifyRecordingResult

protected void notifyRecordingResult(long cntObservations,
                                     long duration)
Does notify about the recording result

Parameters:
cntObservations - the observation count
duration - the recording duration

getLabel

protected final String getLabel()
Getter for the recording label

Returns:
the selected label

addLabel

protected final void addLabel(String activityLabel)
Does add the text in the edit field as new label to the list.

Parameters:
activityLabel - the new activity label

testForSelectedLabel

protected final boolean testForSelectedLabel()
Test for a selected activity label

Returns:
true if a label is selected, false otherwise

onCountDownTimeChange

public final void onCountDownTimeChange(long countDownTime)
Description copied from interface: SharedPreferenceChangeObserver
The handler for count-down time parameter changes.

Specified by:
onCountDownTimeChange in interface SharedPreferenceChangeObserver
Overrides:
onCountDownTimeChange in class SharedPreferenceChangeAwareActivity
Parameters:
countDownTime - the new count-down time size

onLocationDataUsageFlagChange

public final void onLocationDataUsageFlagChange(boolean locationDataUsageFlag)
Description copied from interface: SharedPreferenceChangeObserver
The handler for changes of location data usage flag

Specified by:
onLocationDataUsageFlagChange in interface SharedPreferenceChangeObserver
Overrides:
onLocationDataUsageFlagChange in class SharedPreferenceChangeAwareActivity
Parameters:
locationDataUsageFlag - the new location data usage flag

getCutOutSize

protected final long getCutOutSize()
Description copied from class: AbstractRecordingActivity
Getter for the cut-out window size in milliseconds

Specified by:
getCutOutSize in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>
Returns:
the cut out size

onNewCutOut

protected final void onNewCutOut(SensorObservationCutout<T,Double> cutOut)
Description copied from class: AbstractRecordingActivity
Event handler for new extracted sensor observation cut-outs

Specified by:
onNewCutOut in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>
Parameters:
cutOut - the new cut-out

doSaveCutOut

public final void doSaveCutOut(SensorObservationCutout<T,Double> cutOut)
Handler for the save timer task

Parameters:
cutOut - the cut-out to save

handleRemainingCutOuts

private final void handleRemainingCutOuts(long latestObservationTs)
Handler for the remaining tasks after a user has stopped recording

Parameters:
latestObservationTs - the time when recording was stopped by the user minus the delay offset

getRemainingTimeForMinRecordingLength

public long getRemainingTimeForMinRecordingLength()
Description copied from class: AbstractRecordingActivity
Getter for the remaining time until the mininimal recording length requirement is fulfilled

Overrides:
getRemainingTimeForMinRecordingLength in class AbstractRecordingActivity<T extends Enum<T> & Dimensions>
Returns:
the remaining time until the mininimal recording length requirement is fullfilled

onMaximumRecordingTimeChange

public void onMaximumRecordingTimeChange(int maximumRecordingTime)
Description copied from interface: SharedPreferenceChangeObserver
The handler for maximum recording time parameter changes.

Specified by:
onMaximumRecordingTimeChange in interface SharedPreferenceChangeObserver
Overrides:
onMaximumRecordingTimeChange in class SharedPreferenceChangeAwareActivity
Parameters:
maximumRecordingTime - the new default maximum time in seconds

onEvent

public void onEvent(ObservableEventSource<? extends SampleGapErrorEvent> eventSource,
                    SampleGapErrorEvent observedEvent)
Specified by:
onEvent in interface EventObserver<SampleGapErrorEvent>