Interface DynamicEventListener
- All Known Implementing Classes:
 DynamicEngine
public interface DynamicEventListener
Interface to listen various system events with the help of 
DynamicEngine.- 
Method Summary
Modifier and TypeMethodDescriptionvoidonAppChange(DynamicAppInfo dynamicAppInfo) This method will be called when the foreground app is changed.voidonCallStateChange(boolean call) This method will be called when the call state is changed.voidonChargingStateChange(boolean charging) This method will be called when the charging state is changed.voidonDockStateChange(boolean docked) This method will be called when the dock state is changed.voidonHeadsetStateChange(boolean connected) This method will be called when the headset state is changed.voidonHingeStateChange(int state) This method will be called when the hinge state is changed.voidonInitialize(boolean charging, boolean headset, boolean docked) This method will be called on initializing the service so that we can get the current charging, headset and dock state.voidonLockStateChange(boolean locked) This method will be called when the lock state is changed.voidonPackageRemoved(String packageName) This method will be called when an app package is removed.voidonPackageUpdated(DynamicAppInfo dynamicAppInfo, boolean newPackage) This method will be called when an app package is added or changed.voidonScreenStateChange(boolean screenOff) This method will be called when the screen state is changed. 
- 
Method Details
- 
onInitialize
void onInitialize(boolean charging, boolean headset, boolean docked) This method will be called on initializing the service so that we can get the current charging, headset and dock state.- Parameters:
 charging-trueif the device is charging or connected to a power source.headset-trueif the device is connected to a headset or a audio output device.docked-trueif the device is docked.
 - 
onHingeStateChange
void onHingeStateChange(int state) This method will be called when the hinge state is changed.- Parameters:
 state- The current hinge state.- See Also:
 
 - 
onCallStateChange
void onCallStateChange(boolean call) This method will be called when the call state is changed.Either on call or the device is idle.
- Parameters:
 call-trueif the device is on call.Either ringing or answered.
 - 
onScreenStateChange
void onScreenStateChange(boolean screenOff) This method will be called when the screen state is changed.Either the device screen is off or on.
- Parameters:
 screenOff-trueif the device screen is off.
 - 
onLockStateChange
void onLockStateChange(boolean locked) This method will be called when the lock state is changed.Either the device is in the locked or unlocked state independent of the PIN, password or any other security lock.
- Parameters:
 locked-trueif the device is in the locked state or the lock screen is shown.
 - 
onHeadsetStateChange
void onHeadsetStateChange(boolean connected) This method will be called when the headset state is changed.Either the device is connected to a audio output device or volume is routed through the internal speaker.
- Parameters:
 connected-trueif the device is connected to a headset or a audio output device.
 - 
onChargingStateChange
void onChargingStateChange(boolean charging) This method will be called when the charging state is changed.Either the device is connected to a power source using the battery.
- Parameters:
 charging-trueif the device is charging or connected to a power source.
 - 
onDockStateChange
void onDockStateChange(boolean docked) This method will be called when the dock state is changed.Either the device is docked or not.
- Parameters:
 docked-trueif the device is docked.
 - 
onPackageRemoved
This method will be called when an app package is removed.Useful to show some work when a package is removed.
- Parameters:
 packageName- The package which was removed.
 
 -