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

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

Merge "Ignore instead of throw errors in QuittingState and reorder some parameters."

parents eb3035cb f0f566ec
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -550,7 +550,8 @@ public class HierarchicalStateMachine {
        private class QuittingState extends HierarchicalState {
            @Override
            public boolean processMessage(Message msg) {
                throw new RuntimeException("QuitingState: processMessage called should not happen");
                // Ignore
                return false;
            }
        }

@@ -960,7 +961,7 @@ public class HierarchicalStateMachine {
     * @param looper for this state machine
     * @param name of the state machine
     */
    private void initStateMachine(Looper looper, String name) {
    private void initStateMachine(String name, Looper looper) {
        mName = name;
        mHsmHandler = new HsmHandler(looper, this);
    }
@@ -975,7 +976,7 @@ public class HierarchicalStateMachine {
        mHsmThread.start();
        Looper looper = mHsmThread.getLooper();

        initStateMachine(looper, name);
        initStateMachine(name, looper);
    }

    /**
@@ -983,8 +984,8 @@ public class HierarchicalStateMachine {
     *
     * @param name of the state machine
     */
    protected HierarchicalStateMachine(Looper looper, String name) {
        initStateMachine(looper, name);
    protected HierarchicalStateMachine(String name, Looper looper) {
        initStateMachine(name, looper);
    }

    /**
+3 −3
Original line number Diff line number Diff line
@@ -1204,8 +1204,8 @@ public class HierarchicalStateMachineTest extends TestCase {
     * complete.
     */
    class StateMachineSharedThread extends HierarchicalStateMachine {
        StateMachineSharedThread(Looper looper, String name, int maxCount) {
            super(looper, name);
        StateMachineSharedThread(String name, Looper looper, int maxCount) {
            super(name, looper);
            mMaxCount = maxCount;
            setDbg(DBG);

@@ -1254,7 +1254,7 @@ public class HierarchicalStateMachineTest extends TestCase {
        // Create the state machines
        StateMachineSharedThread sms[] = new StateMachineSharedThread[10];
        for (int i = 0; i < sms.length; i++) {
            sms[i] = new StateMachineSharedThread(smThread.getLooper(), "sm", sms.length);
            sms[i] = new StateMachineSharedThread("sm", smThread.getLooper(), sms.length);
            sms[i].start();
        }