Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: sky/services/sensors/org/domokit/sensors/SensorServiceImpl.java

Issue 1093033002: Add sensors application to mojo (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Support both SkyDemo and mojo_shell Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.domokit.sensors;
6
7 import android.content.Context;
8
9 import org.chromium.mojo.system.Core;
10 import org.chromium.mojo.system.MessagePipeHandle;
11 import org.chromium.mojo.system.MojoException;
12 import org.chromium.mojom.sensors.SensorListener;
13 import org.chromium.mojom.sensors.SensorService;
14
15 /**
16 * Android implementation of Senors.
17 */
18 public class SensorServiceImpl implements SensorService {
19 private Context mContext;
20
21 public SensorServiceImpl(Context context, Core core, MessagePipeHandle pipe) {
22 mContext = context;
23
24 SensorService.MANAGER.bind(this, pipe);
25 }
26
27 @Override
28 public void close() {}
29
30 @Override
31 public void onConnectionError(MojoException e) {}
32
33 @Override
34 public void addListener(int sensorType, SensorListener listener) {
35 new SensorForwarder(mContext, sensorType, (SensorListener.Proxy) listene r);
36 }
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698