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

Commit 1ab022b8 authored by Elliott Hughes's avatar Elliott Hughes Committed by Android (Google) Code Review
Browse files

Merge "Fix an off-by-one error."

parents 218c60ed b55dcc24
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -75,7 +75,7 @@ class WiredAccessoryObserver extends UEventObserver {
        // At any given time both headsets could be inserted
        // At any given time both headsets could be inserted
        // one on the board and one on the dock
        // one on the board and one on the dock
        // observe two UEVENTs
        // observe two UEVENTs
        for (int i = 0; i <= MAX_AUDIO_PORTS; i++) {
        for (int i = 0; i < MAX_AUDIO_PORTS; i++) {
            startObserving(uEventInfo[i][0]);
            startObserving(uEventInfo[i][0]);
        }
        }
        init();  // set initial status
        init();  // set initial status
@@ -120,7 +120,7 @@ class WiredAccessoryObserver extends UEventObserver {
        int newState = mHeadsetState;
        int newState = mHeadsetState;
        mPrevHeadsetState = mHeadsetState;
        mPrevHeadsetState = mHeadsetState;


        for (int i = 0; i <= MAX_AUDIO_PORTS; i++) {
        for (int i = 0; i < MAX_AUDIO_PORTS; i++) {
            try {
            try {
                FileReader file = new FileReader(uEventInfo[i][1]);
                FileReader file = new FileReader(uEventInfo[i][1]);
                int len = file.read(buffer, 0, 1024);
                int len = file.read(buffer, 0, 1024);