|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.devices.AbstractSensorDevice
de.unikassel.android.sdcframework.devices.SystemBroadcastReceivingDevice
public abstract class SystemBroadcastReceivingDevice
Abstract base class for sensor device which have to react on system state
changes signaled by broadcasts.
In general that are devices like Wifi and Bluetooth, which can become
disabled globally in the system while the device state change is broadcasted
to the system.
Extending classes have to define the related Intent and to implement the
handler for device state changes.
WifiDevice
,
BluetoothDevice
Field Summary | |
---|---|
protected BroadcastReceiver |
receiver
The broadcast receiver for device state changes |
Constructor Summary | |
---|---|
private |
SystemBroadcastReceivingDevice(SensorDeviceIdentifier deviceId)
Constructor |
|
SystemBroadcastReceivingDevice(SensorDeviceIdentifier deviceId,
Context applicationContext)
Constructor |
Method Summary | |
---|---|
protected abstract IntentFilter |
getIntentFilter()
Getter for intent filter used by the broadcast receiver |
protected BroadcastReceiver |
getReceiver()
Getter for the broadcast receiver |
protected void |
onConfigurationChanged()
Callback to signal configuration of device has changed |
void |
onDestroy(Context context)
Is called when the owner destroys this device |
protected abstract void |
onDeviceStateChange(Context context,
Intent intent)
Handler to react on broadcast intents for device changes |
private void |
registerReceiver(Context context)
Does register the broadcast receiver |
private void |
setReceiver(BroadcastReceiver receiver)
Setter for the receiver |
private void |
unregisterReceiver(Context context)
Does unregister the broadcast receiver |
Methods inherited from class de.unikassel.android.sdcframework.devices.AbstractSensorDevice |
---|
accept, doHandleDeviceDisabledBySystem, doHandleDeviceEnabledBySystem, doSignalDeviceNotEnabledInSystem, enableDeviceScanning, getConfiguration, getDeviceIdentifier, getScanner, isAirplaneModeOn, isDeviceScanningEnabled, onCreate, 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 |
Field Detail |
---|
protected BroadcastReceiver receiver
Constructor Detail |
---|
private SystemBroadcastReceivingDevice(SensorDeviceIdentifier deviceId)
deviceId
- the device identifierpublic SystemBroadcastReceivingDevice(SensorDeviceIdentifier deviceId, Context applicationContext) throws InvalidParameterException
deviceId
- the device identifierapplicationContext
- the application context
InvalidParameterException
- is thrown in case of invalid parametersMethod Detail |
---|
private final void setReceiver(BroadcastReceiver receiver)
receiver
- the receiver to setprotected final BroadcastReceiver getReceiver()
private void registerReceiver(Context context)
context
- the application contextprivate void unregisterReceiver(Context context)
context
- the application contextpublic final void onDestroy(Context context)
SensorDevice
onDestroy
in interface SensorDevice
onDestroy
in class AbstractSensorDevice
context
- the application contextprotected void onConfigurationChanged()
AbstractSensorDevice
onConfigurationChanged
in class AbstractSensorDevice
protected abstract void onDeviceStateChange(Context context, Intent intent)
context
- the contextintent
- the intentprotected abstract IntentFilter getIntentFilter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |