| OLD | NEW |
| (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 } | |
| OLD | NEW |