Bug 1252650 - Send event response even if GeckoApp is not active; r=me

Enable sending event response when Gecko state is PROFILE_READY. This
happens when Gecko is loaded in the background and GeckoApp is not
active. This is safe because it's only a response to an event from
Gecko, so there is definitely a listener for the response on the Gecko
side already. r=me for a trivial change.
This commit is contained in:
Jim Chen 2016-04-20 15:06:13 -04:00
Родитель 4018bd63a8
Коммит 983f3c49d1
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -352,7 +352,8 @@ public final class EventDispatcher {
if (ThreadUtils.isOnGeckoThread()) {
GeckoAppShell.syncNotifyObservers(topic, wrapper.toString());
} else {
GeckoAppShell.notifyObservers(topic, wrapper.toString());
GeckoAppShell.notifyObservers(topic, wrapper.toString(),
GeckoThread.State.PROFILE_READY);
}
} catch (final JSONException e) {
Log.e(LOGTAG, "Unable to send response", e);
@ -397,7 +398,8 @@ public final class EventDispatcher {
if (ThreadUtils.isOnGeckoThread()) {
GeckoAppShell.syncNotifyObservers(topic, wrapper.toString());
} else {
GeckoAppShell.notifyObservers(topic, wrapper.toString());
GeckoAppShell.notifyObservers(topic, wrapper.toString(),
GeckoThread.State.PROFILE_READY);
}
} catch (final JSONException e) {
Log.e(LOGTAG, "Unable to send response for: " + type, e);