diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoEvent.java b/mobile/android/base/java/org/mozilla/gecko/GeckoEvent.java index d66e3ab8b2a0..d140c5e1176d 100644 --- a/mobile/android/base/java/org/mozilla/gecko/GeckoEvent.java +++ b/mobile/android/base/java/org/mozilla/gecko/GeckoEvent.java @@ -77,7 +77,6 @@ public class GeckoEvent { APP_FOREGROUNDING(10), LOAD_URI(12), NOOP(15), - BROADCAST(19), VIEWPORT(20), VISITED(21), NETWORK_CHANGED(22), @@ -461,14 +460,6 @@ public class GeckoEvent { return event; } - @RobocopTarget - public static GeckoEvent createBroadcastEvent(String subject, String data) { - GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.BROADCAST); - event.mCharacters = subject; - event.mCharactersExtra = data; - return event; - } - public static GeckoEvent createViewportEvent(ImmutableViewportMetrics metrics, DisplayPortMetrics displayPort) { GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.VIEWPORT); event.mCharacters = "Viewport:Change"; diff --git a/widget/android/AndroidJNI.cpp b/widget/android/AndroidJNI.cpp index 90ba665a2dc1..c2e1afdd317a 100644 --- a/widget/android/AndroidJNI.cpp +++ b/widget/android/AndroidJNI.cpp @@ -63,29 +63,6 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *jenv, jclass jc, nsAppShell::PostEvent(AndroidGeckoEvent::MakeFromJavaObject(jenv, event)); } -NS_EXPORT void JNICALL -Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoObservers(JNIEnv *aEnv, jclass, - jstring aTopic, jstring aData) -{ - if (!NS_IsMainThread()) { - jni::ThrowException(aEnv, - "java/lang/IllegalThreadStateException", "Not on Gecko main thread"); - return; - } - - nsCOMPtr obsServ = - mozilla::services::GetObserverService(); - if (!obsServ) { - jni::ThrowException(aEnv, - "java/lang/IllegalStateException", "No observer service"); - return; - } - - const nsJNICString topic(aTopic, aEnv); - const nsJNIString data(aData, aEnv); - obsServ->NotifyObservers(nullptr, topic.get(), data.get()); -} - NS_EXPORT jlong JNICALL Java_org_mozilla_gecko_GeckoAppShell_runUiThreadCallback(JNIEnv* env, jclass) { diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp index ddb850e809a2..5a7f2bde3338 100644 --- a/widget/android/AndroidJavaWrappers.cpp +++ b/widget/android/AndroidJavaWrappers.cpp @@ -390,8 +390,7 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj) break; } - case VIEWPORT: - case BROADCAST: { + case VIEWPORT: { ReadCharactersField(jenv); ReadCharactersExtraField(jenv); break; diff --git a/widget/android/AndroidJavaWrappers.h b/widget/android/AndroidJavaWrappers.h index 7970606baf35..f2da9b1df7fc 100644 --- a/widget/android/AndroidJavaWrappers.h +++ b/widget/android/AndroidJavaWrappers.h @@ -444,14 +444,6 @@ public: return event; } - static AndroidGeckoEvent* MakeBroadcastEvent(const nsCString& topic, const nsCString& data) { - AndroidGeckoEvent* event = new AndroidGeckoEvent(); - event->Init(BROADCAST); - CopyUTF8toUTF16(topic, event->mCharacters); - CopyUTF8toUTF16(data, event->mCharactersExtra); - return event; - } - static AndroidGeckoEvent* MakeAddObserver(const nsAString &key, nsIObserver *observer) { AndroidGeckoEvent *event = new AndroidGeckoEvent(); event->Init(ADD_OBSERVER); @@ -641,7 +633,6 @@ public: LOAD_URI = 12, NOOP = 15, APZ_INPUT_EVENT = 17, // used internally in AndroidJNI/nsAppShell/nsWindow - BROADCAST = 19, VIEWPORT = 20, VISITED = 21, NETWORK_CHANGED = 22, diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index 138d3ba16749..781ed3b85c3b 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -678,8 +678,7 @@ nsAppShell::LegacyGeckoEvent::Run() break; } - case AndroidGeckoEvent::VIEWPORT: - case AndroidGeckoEvent::BROADCAST: { + case AndroidGeckoEvent::VIEWPORT: { if (curEvent->Characters().Length() == 0) break;