Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74d7d0f1 authored by Hall Liu's avatar Hall Liu
Browse files

Don't call pre- and post-handlers for state machine initialization

Add check to onPreHandleMessage and onPostHandleMessage so that they
don't process the SM_INIT_CMD messages that are used internally by the
state machine.

Change-Id: I4061ed098d5c394d311714bbe13b738cb7209317
parent f1cc31f6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -779,7 +779,7 @@ public class StateMachine {
        @Override
        public final void handleMessage(Message msg) {
            if (!mHasQuit) {
                if (mSm != null) {
                if (mSm != null && msg.what != SM_INIT_CMD && msg.what != SM_QUIT_CMD) {
                    mSm.onPreHandleMessage(msg);
                }

@@ -807,7 +807,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");

                if (mSm != null) {
                if (mSm != null && msg.what != SM_INIT_CMD && msg.what != SM_QUIT_CMD) {
                    mSm.onPostHandleMessage(msg);
                }
            }