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

Commit 3a4398a7 authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 209fc1ae: AudioManager: do not mandate a looper

* commit '209fc1ae7abb6965cb4f18bf68ff8c350e9d40d9':
  AudioManager: do not mandate a looper
parents f3bbf2b8 ddc93ce3
Loading
Loading
Loading
Loading
+59 −55
Original line number Diff line number Diff line
@@ -49,9 +49,10 @@ class AudioPortEventHandler {
        // find the looper for our new event handler
        Looper looper = Looper.myLooper();
        if (looper == null) {
            throw new IllegalArgumentException("Calling thread not associated with a looper");
            looper = Looper.getMainLooper();
        }

        if (looper != null) {
            mHandler = new Handler(looper) {
                @Override
                public void handleMessage(Message msg) {
@@ -116,6 +117,9 @@ class AudioPortEventHandler {
                    }
                }
            };
        } else {
            mHandler = null;
        }

        native_setup(new WeakReference<AudioPortEventHandler>(this));
    }