Commit a7d29c97 authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

Fix NewApi warnings for Looper.myLooper().getQueue()

Uses an equivalent call available from API level 1.

Bug: 762550
Change-Id: I06bb2dc42f7126cbe235cf4745fd35b29300abfa
Reviewed-on: https://chromium-review.googlesource.com/652594Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499981}
parent 5f959578
......@@ -56,7 +56,7 @@ public class JavaHandlerThread {
@CalledByNative
private void stopOnThread(final long nativeThread) {
nativeStopThread(nativeThread);
MessageQueue queue = mThread.getLooper().getQueue();
MessageQueue queue = Looper.myQueue();
// Add an idle handler so that the thread cleanup code can run after the message loop has
// detected an idle state and quit properly.
// This matches the behavior of base::Thread in that it will keep running non-delayed posted
......
......@@ -41,7 +41,7 @@ class SystemMessageHandler extends Handler {
protected SystemMessageHandler(long messagePumpDelegateNative, long messagePumpNative) {
mMessagePumpDelegateNative = messagePumpDelegateNative;
mMessagePumpNative = messagePumpNative;
Looper.myLooper().getQueue().addIdleHandler(mIdleHandler);
Looper.myQueue().addIdleHandler(mIdleHandler);
}
@Override
......@@ -74,7 +74,7 @@ class SystemMessageHandler extends Handler {
private void removeAllPendingMessages() {
removeMessages(SCHEDULED_WORK);
removeMessages(DELAYED_SCHEDULED_WORK);
Looper.myLooper().getQueue().removeIdleHandler(mIdleHandler);
Looper.myQueue().removeIdleHandler(mIdleHandler);
}
private Message obtainAsyncMessage(int what) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment