Do not use android specific API in mojo/java.

R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1217573005.
This commit is contained in:
Benjamin Lerman 2015-07-06 14:56:14 +02:00
parent b5d6b9ae0d
commit 8def5ec089
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include "base/android/library_loader/library_loader_hooks.h"
#include "base/bind.h"
#include "base/logging.h"
#include "mojo/android/system/base_run_loop.h"
#include "mojo/android/system/core_impl.h"
#include "sky/shell/android/platform_service_provider_android.h"
#include "sky/shell/android/platform_view_android.h"
@ -19,6 +20,7 @@ namespace {
base::android::RegistrationMethod kSkyRegisteredMethods[] = {
{"CoreImpl", mojo::android::RegisterCoreImpl},
{"BaseRunLoop", mojo::android::RegisterBaseRunLoop},
{"PlatformServiceProvider", sky::shell::RegisterPlatformServiceProvider},
{"PlatformViewAndroid", sky::shell::PlatformViewAndroid::Register},
{"SkyMain", sky::shell::RegisterSkyMain},

View File

@ -8,6 +8,7 @@ import android.content.Context;
import android.util.Log;
import org.chromium.base.JNINamespace;
import org.chromium.mojo.system.impl.CoreImpl;
/**
* A class to intialize the native code.
@ -32,6 +33,8 @@ public class SkyMain {
SkyApplication app = (SkyApplication) applicationContext;
app.getResourceExtractor().waitForCompletion();
nativeInit(applicationContext);
// Create the mojo run loop.
CoreImpl.getInstance().createDefaultRunLoop();
sInitialized = true;
} catch (Exception e) {
Log.e(TAG, "SkyMain initialization failed.", e);