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

Commit e0c5ae7b authored by Kenny Root's avatar Kenny Root Committed by Android (Google) Code Review
Browse files

Merge "Eliminate MCS_GIVE_UP state" into gingerbread

parents e86a6b2a 480afe70
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -223,7 +223,6 @@ class MountService extends IMountService.Stub
    private static final int OBB_MCS_BOUND = 2;
    private static final int OBB_MCS_UNBIND = 3;
    private static final int OBB_MCS_RECONNECT = 4;
    private static final int OBB_MCS_GIVE_UP = 5;

    /*
     * Default Container Service information
@@ -1715,7 +1714,7 @@ class MountService extends IMountService.Stub

    private class ObbActionHandler extends Handler {
        private boolean mBound = false;
        private List<ObbAction> mActions = new LinkedList<ObbAction>();
        private final List<ObbAction> mActions = new LinkedList<ObbAction>();

        ObbActionHandler(Looper l) {
            super(l);
@@ -1725,7 +1724,7 @@ class MountService extends IMountService.Stub
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case OBB_RUN_ACTION: {
                    ObbAction action = (ObbAction) msg.obj;
                    final ObbAction action = (ObbAction) msg.obj;

                    if (DEBUG_OBB)
                        Slog.i(TAG, "OBB_RUN_ACTION: " + action.toString());
@@ -1761,7 +1760,7 @@ class MountService extends IMountService.Stub
                        }
                        mActions.clear();
                    } else if (mActions.size() > 0) {
                        ObbAction action = mActions.get(0);
                        final ObbAction action = mActions.get(0);
                        if (action != null) {
                            action.execute(this);
                        }
@@ -1809,13 +1808,6 @@ class MountService extends IMountService.Stub
                    }
                    break;
                }
                case OBB_MCS_GIVE_UP: {
                    if (DEBUG_OBB)
                        Slog.i(TAG, "OBB_MCS_GIVE_UP");
                    mActions.remove(0);
                    mObbActionHandler.sendEmptyMessage(OBB_MCS_BOUND);
                    break;
                }
            }
        }

@@ -1855,7 +1847,7 @@ class MountService extends IMountService.Stub
                mRetries++;
                if (mRetries > MAX_RETRIES) {
                    Slog.w(TAG, "Failed to invoke remote methods on default container service. Giving up");
                    mObbActionHandler.sendEmptyMessage(OBB_MCS_GIVE_UP);
                    mObbActionHandler.sendEmptyMessage(OBB_MCS_UNBIND);
                    handleError();
                    return;
                } else {