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

24 lines
876 B
Dart

// 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.
import "/mojo/public/dart/application.dart";
import "dart:sky.internals" as internals;
import "mojo:core" as core;
import "package:mojo/public/interfaces/application/service_provider.mojom.dart";
ApplicationConnection _initConnection() {
int rawHandle = internals.takeServicesProvidedByEmbedder();
core.MojoHandle proxyHandle = new core.MojoHandle(rawHandle);
ServiceProviderProxy serviceProvider = null;
if (proxyHandle.isValid)
serviceProvider = new ServiceProviderProxy.fromHandle(proxyHandle);
return new ApplicationConnection(null, serviceProvider);
}
final ApplicationConnection _connection = _initConnection();
void requestService(Object proxy) {
_connection.requestService(proxy);
}