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

Commit 38b987ab authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android Git Automerger
Browse files

am 0155856a: Fix AudioService rotation helper thread

* commit '0155856a':
  Fix AudioService rotation helper thread
parents a186456f 0155856a
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -192,16 +192,18 @@ class RotationHelper {
        }

        public void run() {
            int newRotation;
            while (mWaitCounter < WAIT_TIMES_MS.length) {
                updateOrientation();
                int waitTimeMs;
                synchronized(mCounterLock) {
                    waitTimeMs = WAIT_TIMES_MS[mWaitCounter];
                    waitTimeMs = mWaitCounter < WAIT_TIMES_MS.length ?
                            WAIT_TIMES_MS[mWaitCounter] : 0;
                    mWaitCounter++;
                }
                try {
                    if (waitTimeMs > 0) {
                        sleep(waitTimeMs);
                        updateOrientation();
                    }
                } catch (InterruptedException e) { }
            }
        }