de.unikassel.android.sdcframework.devices
Class ScannerStateAwareSensorDevice

Package class diagram package ScannerStateAwareSensorDevice
java.lang.Object
  extended by de.unikassel.android.sdcframework.devices.AbstractSensorDevice
      extended by de.unikassel.android.sdcframework.devices.ScannerStateAwareSensorDevice
All Implemented Interfaces:
SensorDevice, VisitableDevice
Direct Known Subclasses:
AbstractAndroidSensorDevice, AbstractLocationDevice, GSMDevice

public abstract class ScannerStateAwareSensorDevice
extends AbstractSensorDevice

This class is an extension of the abstract sensor device for such devices, which have to be aware of the scanner running state. In most cases these are devices implementing the SampleProvidingSensorDevice interface.

See Also:
AbstractAndroidSensorDevice, GSMDevice, GPSDevice

Constructor Summary
ScannerStateAwareSensorDevice(SensorDeviceIdentifier deviceId)
          Constructor
 
Method Summary
 boolean enableDeviceScanning(boolean enabled, Context context)
          Setter for device scanning enabled state
protected  void onConfigurationChanged()
          Callback to signal configuration of device has changed
protected abstract  void onScannerRunningStateChange(boolean isRunning, Context context)
          Handler to react on scanner state changes.
 
Methods inherited from class de.unikassel.android.sdcframework.devices.AbstractSensorDevice
accept, doHandleDeviceDisabledBySystem, doHandleDeviceEnabledBySystem, doSignalDeviceNotEnabledInSystem, getConfiguration, getDeviceIdentifier, getScanner, isAirplaneModeOn, isDeviceScanningEnabled, onCreate, onDestroy, setDeviceIdentifier, setScanner, updateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.unikassel.android.sdcframework.devices.facade.SensorDevice
isDeviceInSystemEnabled
 

Constructor Detail

ScannerStateAwareSensorDevice

public ScannerStateAwareSensorDevice(SensorDeviceIdentifier deviceId)
Constructor

Parameters:
deviceId - the device identifier
Method Detail

onConfigurationChanged

protected void onConfigurationChanged()
Description copied from class: AbstractSensorDevice
Callback to signal configuration of device has changed

Specified by:
onConfigurationChanged in class AbstractSensorDevice

enableDeviceScanning

public final boolean enableDeviceScanning(boolean enabled,
                                          Context context)
Description copied from interface: SensorDevice
Setter for device scanning enabled state

Specified by:
enableDeviceScanning in interface SensorDevice
Overrides:
enableDeviceScanning in class AbstractSensorDevice
Parameters:
enabled - true to enable device scanning, false to disable it
context - the application context
Returns:
true if successful enabled, false otherwise

onScannerRunningStateChange

protected abstract void onScannerRunningStateChange(boolean isRunning,
                                                    Context context)
Handler to react on scanner state changes. It is called after each state change and signals the new running state

Parameters:
isRunning - the current scanner state after state change
context - the context