public abstract class WakeLockStateMachine extends StateMachine
handleSmsMessage(android.os.Message)
, which returns true to transition into waiting
state, or false to remain in idle state. The wakelock is acquired on exit from idle state,
and is released a few seconds after returning to idle state, or immediately upon calling
StateMachine.quit()
.StateMachine.LogRec
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DBG |
protected static int |
EVENT_BROADCAST_COMPLETE
Result receiver called for current cell broadcast.
|
static int |
EVENT_NEW_SMS_MESSAGE
New message to process.
|
protected Context |
mContext |
protected Phone |
mPhone |
protected BroadcastReceiver |
mReceiver
BroadcastReceiver to send message to return to idle state.
|
HANDLED, NOT_HANDLED
Modifier | Constructor and Description |
---|---|
protected |
WakeLockStateMachine(String debugTag,
Context context,
Phone phone) |
Modifier and Type | Method and Description |
---|---|
void |
dispatchSmsMessage(Object obj)
Send a message with the specified object for
handleSmsMessage(android.os.Message) . |
void |
dispose()
Tell the state machine to quit after processing all messages.
|
protected abstract boolean |
handleSmsMessage(Message message)
Implemented by subclass to handle messages in
IdleState . |
protected void |
log(String s)
Log with debug level.
|
protected void |
loge(String s)
Log with error level.
|
protected void |
loge(String s,
Throwable e)
Log with error level.
|
protected void |
onQuitting()
This will be called once after a quit message that was NOT handled by
the derived StateMachine.
|
void |
updatePhoneObject(Phone phone) |
addLogRec, addState, addState, copyLogRecs, deferMessage, dump, getCurrentMessage, getCurrentState, getHandler, getLogRec, getLogRecCount, getLogRecSize, getLogRecString, getName, getWhatToString, haltedProcessMessage, hasDeferredMessages, hasMessages, isDbg, isQuit, logAndAddLogRec, logd, logi, logv, logw, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, onHalting, onPostHandleMessage, onPreHandleMessage, quit, quitNow, recordLogRec, removeDeferredMessages, removeMessages, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtFrontOfQueue, sendMessageAtFrontOfQueue, sendMessageAtFrontOfQueue, sendMessageAtFrontOfQueue, sendMessageAtFrontOfQueue, sendMessageDelayed, sendMessageDelayed, sendMessageDelayed, sendMessageDelayed, sendMessageDelayed, sendMessageDelayed, setDbg, setInitialState, setLogOnlyTransitions, setLogRecSize, start, toString, transitionTo, transitionToHaltingState, unhandledMessage
protected static final boolean DBG
public static final int EVENT_NEW_SMS_MESSAGE
protected static final int EVENT_BROADCAST_COMPLETE
protected Phone mPhone
protected Context mContext
protected final BroadcastReceiver mReceiver
public void updatePhoneObject(Phone phone)
public final void dispose()
protected void onQuitting()
StateMachine
onQuitting
in class StateMachine
public final void dispatchSmsMessage(Object obj)
handleSmsMessage(android.os.Message)
.obj
- the object to pass in the msg.obj fieldprotected abstract boolean handleSmsMessage(Message message)
IdleState
.message
- the message to processWaitingState
; false to stay in IdleState
protected void log(String s)
log
in class StateMachine
s
- the string to logprotected void loge(String s)
loge
in class StateMachine
s
- the string to logprotected void loge(String s, Throwable e)
loge
in class StateMachine
s
- the string to loge
- is a Throwable which logs additional information.