flutter_flutter/shell/java_service_provider.cc
Adam Barth e8b988e226 Expose Android sensors to via Mojo services
This CL adds a sensor_service to sky/services and wires it into SkyShell
The plan is to eventually use this data to implement shake-to-refresh.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962043002
2015-02-27 14:37:50 -08:00

26 lines
735 B
C++

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sky/shell/java_service_provider.h"
#include "base/android/jni_android.h"
#include "jni/JavaServiceProvider_jni.h"
namespace sky {
namespace shell {
bool RegisterJavaServiceProvider(JNIEnv* env) {
return RegisterNativesImpl(env);
}
mojo::ScopedMessagePipeHandle CreateJavaServiceProvider() {
JNIEnv* env = base::android::AttachCurrentThread();
return mojo::ScopedMessagePipeHandle(
mojo::MessagePipeHandle(Java_JavaServiceProvider_create(
env, base::android::GetApplicationContext())));
}
} // namespace shell
} // namespace sky