Sensors: Use a native_handle for the data channel instead of a single file descriptor.

This eliminates the requirement that all sensors share a single file descriptor.
This, along with concurrent changes in other projects, fixes bugs b/1614524 and b/1614481

Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2009-05-22 10:02:14 -04:00
parent fea1a459aa
commit 270e87f71a
5 changed files with 147 additions and 49 deletions

View File

@@ -19,7 +19,7 @@ package com.android.server;
import android.content.Context;
import android.hardware.ISensorService;
import android.os.Binder;
import android.os.ParcelFileDescriptor;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.IBinder;
import android.util.Config;
@@ -101,7 +101,7 @@ class SensorService extends ISensorService.Stub {
_sensors_control_init();
}
public ParcelFileDescriptor getDataChanel() throws RemoteException {
public Bundle getDataChannel() throws RemoteException {
return _sensors_control_open();
}
@@ -190,7 +190,7 @@ class SensorService extends ISensorService.Stub {
ArrayList<Listener> mListeners = new ArrayList<Listener>();
private static native int _sensors_control_init();
private static native ParcelFileDescriptor _sensors_control_open();
private static native Bundle _sensors_control_open();
private static native boolean _sensors_control_activate(int sensor, boolean activate);
private static native int _sensors_control_set_delay(int ms);
private static native int _sensors_control_wake();