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

Commit c6f2d17a authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Merge "Add mHasQuit to fix an NPE in StateMachine." into jb-mr2-dev

parents 37f58dcc 03812c78
Loading
Loading
Loading
Loading
+28 −22
Original line number Diff line number Diff line
@@ -672,6 +672,9 @@ public class StateMachine {

    private static class SmHandler extends Handler {

        /** true if StateMachine has quit */
        private boolean mHasQuit = false;

        /** The debug flag */
        private boolean mDbg = false;

@@ -773,6 +776,7 @@ public class StateMachine {
         */
        @Override
        public final void handleMessage(Message msg) {
            if (!mHasQuit) {
                if (mDbg) mSm.log("handleMessage: E msg.what=" + msg.what);

                /** Save the current message */
@@ -797,6 +801,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");
            }
        }

        /**
         * Do any transitions
@@ -908,6 +913,7 @@ public class StateMachine {
            mInitialState = null;
            mDestState = null;
            mDeferredMessages.clear();
            mHasQuit = true;
        }

        /**