summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/internal/util/StateMachine.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/com/android/internal/util/StateMachine.java b/core/java/com/android/internal/util/StateMachine.java
index 554d367f6cea..8c4d078ecd78 100644
--- a/core/java/com/android/internal/util/StateMachine.java
+++ b/core/java/com/android/internal/util/StateMachine.java
@@ -778,6 +778,7 @@ public class StateMachine {
*/
@Override
public final void handleMessage(Message msg) {
+ mSm.onPreHandleMessage(msg);
if (!mHasQuit) {
if (mDbg) mSm.log("handleMessage: E msg.what=" + msg.what);
@@ -803,6 +804,7 @@ public class StateMachine {
// We need to check if mSm == null here as we could be quitting.
if (mDbg && mSm != null) mSm.log("handleMessage: X");
}
+ mSm.onPostHandleMessage(msg);
}
/**
@@ -1274,6 +1276,21 @@ public class StateMachine {
}
/**
+ * Notifies subclass that the StateMachine handler is about to process the Message msg
+ * @param msg The message that is being handled
+ */
+ protected void onPreHandleMessage(Message msg) {
+ }
+
+ /**
+ * Notifies subclass that the StateMachine handler has finished processing the Message msg and
+ * has possibly transitioned to a new state.
+ * @param msg The message that is being handled
+ */
+ protected void onPostHandleMessage(Message msg) {
+ }
+
+ /**
* Add a new state to the state machine
* @param state the state to add
* @param parent the parent of state