Bug 1189995 - Move GeckoAppShell.pumpMessageLoop to GeckoThread; r=esawin

This method is used by Gecko to pump the Android message loop, and it's
also more suited to GeckoThread than GeckoAppShell.
This commit is contained in:
Jim Chen
2015-08-13 00:53:39 -04:00
parent bb1366b29c
commit 3619ab253f
5 changed files with 64 additions and 46 deletions

View File

@@ -96,7 +96,6 @@ import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.MessageQueue;
import android.os.SystemClock;
import android.os.Vibrator;
@@ -2451,24 +2450,6 @@ public class GeckoAppShell
GeckoScreenOrientation.getInstance().unlock();
}
@WrapForJNI
public static boolean pumpMessageLoop(final Message msg) {
final Handler geckoHandler = ThreadUtils.sGeckoHandler;
if (msg.obj == geckoHandler && msg.getTarget() == geckoHandler) {
// Our "queue is empty" message; see runGecko()
return false;
}
if (msg.getTarget() == null) {
Looper.myLooper().quit();
} else {
msg.getTarget().dispatchMessage(msg);
}
return true;
}
@WrapForJNI
public static void notifyWakeLockChanged(String topic, String state) {
if (getGeckoInterface() != null)