Bug 1305271 - 2. Add and use jni::IsFennec() for Fennec-only code; r=snorp
Add jni::IsFennec() that returns whether we're in a Fennec environment (defined as the presence of the GeckoApp class). Then, add jni::IsFennec() checks to places where we use JNI for Fennec-only classes.
This commit is contained in:
@@ -374,16 +374,19 @@ nsAppShell::nsAppShell()
|
||||
AndroidBridge::ConstructBridge();
|
||||
GeckoAppShellSupport::Init();
|
||||
GeckoThreadSupport::Init();
|
||||
mozilla::ANRReporter::Init();
|
||||
mozilla::GeckoBatteryManager::Init();
|
||||
mozilla::GeckoNetworkManager::Init();
|
||||
mozilla::GeckoScreenOrientation::Init();
|
||||
mozilla::MemoryMonitor::Init();
|
||||
mozilla::PrefsHelper::Init();
|
||||
mozilla::widget::Telemetry::Init();
|
||||
mozilla::ThumbnailHelper::Init();
|
||||
nsWindow::InitNatives();
|
||||
|
||||
if (jni::IsFennec()) {
|
||||
mozilla::ANRReporter::Init();
|
||||
mozilla::MemoryMonitor::Init();
|
||||
mozilla::widget::Telemetry::Init();
|
||||
mozilla::ThumbnailHelper::Init();
|
||||
}
|
||||
|
||||
java::GeckoThread::SetState(java::GeckoThread::State::JNI_READY());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user