mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
2aaf77dc2e
commit
7600714a6f
@ -20,7 +20,6 @@ import java.util.concurrent.Executors;
|
||||
* Android implementation of MediaService.
|
||||
*/
|
||||
public class MediaServiceImpl implements MediaService {
|
||||
private static final String TAG = "MediaServiceImpl";
|
||||
private final Core mCore;
|
||||
private final Context mContext;
|
||||
private static ExecutorService sThreadPool;
|
||||
|
||||
@ -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},
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user