|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.devices.AbstractSensorDevice
public abstract class AbstractSensorDevice
Base class for any sensor device type.
Field Summary | |
---|---|
private SensorDeviceConfiguration |
configuration
The sensor device configuration |
private SensorDeviceIdentifier |
deviceIdentifier
The sensor device deviceIdentifier |
private SensorDeviceScanner |
scanner
The scanner for the sensor device |
Constructor Summary | |
---|---|
private |
AbstractSensorDevice()
Default constructor ( it's private with purpose ) |
|
AbstractSensorDevice(SensorDeviceIdentifier deviceId)
Constructor for devices with an Android sub type |
Method Summary | |
---|---|
boolean |
accept(SensorDeviceVisitor visitor)
Method to accept a visitor |
void |
doHandleDeviceDisabledBySystem(Context context)
Default handler for the fact, the system device state is changing from enabled to disabled. |
void |
doHandleDeviceEnabledBySystem(Context context)
Default handler for the fact, the system device state is changing from disabled to enabled. |
protected abstract void |
doSignalDeviceNotEnabledInSystem(Context applicationContext)
Method to signal the user that the device is disabled in the system and needed by this service. |
boolean |
enableDeviceScanning(boolean enabled,
Context context)
Setter for device scanning enabled state |
SensorDeviceConfiguration |
getConfiguration()
Getter for the sensor device configuration |
SensorDeviceIdentifier |
getDeviceIdentifier()
Getter for the sensors device identifier |
SensorDeviceScanner |
getScanner()
Getter for the scanner |
boolean |
isAirplaneModeOn(Context applicationContext)
Getter for the state of the airplaine mode |
boolean |
isDeviceScanningEnabled()
Getter for device scanning enabled state in the framework |
protected abstract void |
onConfigurationChanged()
Callback to signal configuration of device has changed |
void |
onCreate(Context context)
Is called when this device is created |
void |
onDestroy(Context context)
Is called when the owner destroys this device |
private void |
setConfiguration(SensorDeviceConfiguration configuration)
Setter for the configuration |
protected void |
setDeviceIdentifier(SensorDeviceIdentifier deviceIdentifier)
Setter for the device identifier |
void |
setScanner(SensorDeviceScanner scanner,
Context context)
Setter for the scanner |
void |
updateConfiguration(SensorDeviceConfiguration configuration,
Context context)
Update method for the device configuration settings |
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 |
Field Detail |
---|
private SensorDeviceIdentifier deviceIdentifier
private SensorDeviceConfiguration configuration
private SensorDeviceScanner scanner
Constructor Detail |
---|
private AbstractSensorDevice()
public AbstractSensorDevice(SensorDeviceIdentifier deviceId)
deviceId
- the device identifierMethod Detail |
---|
public final boolean accept(SensorDeviceVisitor visitor)
VisitableDevice
accept
in interface VisitableDevice
visitor
- the visitor to accept
public final SensorDeviceIdentifier getDeviceIdentifier()
SensorDevice
getDeviceIdentifier
in interface SensorDevice
protected final void setDeviceIdentifier(SensorDeviceIdentifier deviceIdentifier)
deviceIdentifier
- the device identifier to setpublic final boolean isDeviceScanningEnabled()
SensorDevice
isDeviceScanningEnabled
in interface SensorDevice
public boolean enableDeviceScanning(boolean enabled, Context context)
SensorDevice
enableDeviceScanning
in interface SensorDevice
enabled
- true to enable device scanning, false to disable itcontext
- the application context
private final void setConfiguration(SensorDeviceConfiguration configuration)
configuration
- the configuration to setpublic final SensorDeviceConfiguration getConfiguration()
SensorDevice
getConfiguration
in interface SensorDevice
public final void setScanner(SensorDeviceScanner scanner, Context context)
SensorDevice
setScanner
in interface SensorDevice
scanner
- the scanner to setcontext
- the application contextpublic final SensorDeviceScanner getScanner()
SensorDevice
getScanner
in interface SensorDevice
public final void updateConfiguration(SensorDeviceConfiguration configuration, Context context)
SensorDevice
updateConfiguration
in interface SensorDevice
configuration
- the device configurationcontext
- the application contextprotected abstract void onConfigurationChanged()
public void onCreate(Context context)
SensorDevice
onCreate
in interface SensorDevice
context
- the application contextpublic void onDestroy(Context context)
SensorDevice
onDestroy
in interface SensorDevice
context
- the application contextpublic boolean isAirplaneModeOn(Context applicationContext)
applicationContext
- the application contex
public final void doHandleDeviceDisabledBySystem(Context context)
SensorDevice
doHandleDeviceDisabledBySystem
in interface SensorDevice
context
- the application contextpublic final void doHandleDeviceEnabledBySystem(Context context)
SensorDevice
doHandleDeviceEnabledBySystem
in interface SensorDevice
context
- the application contextprotected abstract void doSignalDeviceNotEnabledInSystem(Context applicationContext)
applicationContext
- the application context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |