From 287b30920102b5466efa53a2f17ed69f2c776c16 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 27 Apr 2009 18:08:10 -0700 Subject: [PATCH] fix 1812272 SensorManager method returns hidden object --- core/java/android/hardware/SensorManager.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index 0c88a2e04072a..67df23b270a4b 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -43,7 +43,7 @@ import java.util.List; * class by calling {@link android.content.Context#getSystemService(java.lang.String) * Context.getSystemService()} with an argument of {@link android.content.Context#SENSOR_SERVICE}. */ -public class SensorManager extends IRotationWatcher.Stub +public class SensorManager { private static final String TAG = "SensorManager"; private static final float[] mTempMatrix = new float[16]; @@ -475,7 +475,13 @@ public class SensorManager extends IRotationWatcher.Stub // if it's null we're running in the system process // which won't get the rotated values try { - sRotation = sWindowManager.watchRotation(this); + sRotation = sWindowManager.watchRotation( + new IRotationWatcher.Stub() { + public void onRotationChanged(int rotation) { + SensorManager.this.onRotationChanged(rotation); + } + } + ); } catch (RemoteException e) { } } @@ -1386,7 +1392,7 @@ public class SensorManager extends IRotationWatcher.Stub } } } - + class LmsFilter { private static final int SENSORS_RATE_MS = 20; private static final int COUNT = 12; @@ -1454,7 +1460,7 @@ public class SensorManager extends IRotationWatcher.Stub } } - + private static native void nativeClassInit(); private static native int sensors_module_init();