diff options
author | Fred Fettinger <fred.fettinger@motorola.com> | 2010-01-04 15:38:13 -0600 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-03-07 09:29:15 -0500 |
commit | 3c8fbdf5dd19fad0b3006557716ee1026d7d5899 (patch) | |
tree | d80caab324d5b8addf49e6ee9ee6ecdd1e03fecc /location/java/com/android/internal | |
parent | 83835359e51ddb8be37cea9bf4bb32f9390d82b7 (diff) | |
download | frameworks_base-3c8fbdf5dd19fad0b3006557716ee1026d7d5899.zip frameworks_base-3c8fbdf5dd19fad0b3006557716ee1026d7d5899.tar.gz frameworks_base-3c8fbdf5dd19fad0b3006557716ee1026d7d5899.tar.bz2 |
location: dump LocationProvider internal state
For each location provider, call getInternalState() to see if it has any
state information to include in a bugreport. If the returned string is not
null, then print a header with the provided name followed by the returned
string.
Change-Id: I0a388d7fba14ac8cadcb80eda0a0ceb95032410b
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location/java/com/android/internal')
4 files changed, 26 insertions, 2 deletions
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java index 90b50cc..44a5a6b 100755 --- a/location/java/com/android/internal/location/GpsLocationProvider.java +++ b/location/java/com/android/internal/location/GpsLocationProvider.java @@ -633,6 +633,10 @@ public class GpsLocationProvider implements LocationProviderInterface { } } + public String getInternalState() { + return native_get_internal_state(); + } + private final class Listener implements IBinder.DeathRecipient { final IGpsStatusListener mListener; @@ -1391,12 +1395,15 @@ public class GpsLocationProvider implements LocationProviderInterface { private native int native_read_nmea(int index, byte[] buffer, int bufferSize); private native void native_inject_location(double latitude, double longitude, float accuracy); - // XTRA Support + // XTRA Support private native void native_inject_time(long time, long timeReference, int uncertainty); private native boolean native_supports_xtra(); private native void native_inject_xtra_data(byte[] data, int length); - // AGPS Support + // DEBUG Support + private native String native_get_internal_state(); + + // AGPS Support private native void native_agps_data_conn_open(String apn); private native void native_agps_data_conn_closed(); private native void native_agps_data_conn_failed(); diff --git a/location/java/com/android/internal/location/LocationProviderProxy.java b/location/java/com/android/internal/location/LocationProviderProxy.java index abb90b7..31ec09a 100644 --- a/location/java/com/android/internal/location/LocationProviderProxy.java +++ b/location/java/com/android/internal/location/LocationProviderProxy.java @@ -266,6 +266,15 @@ public class LocationProviderProxy implements LocationProviderInterface { return 0; } + public String getInternalState() { + try { + return mProvider.getInternalState(); + } catch (RemoteException e) { + Log.e(TAG, "getInternalState failed", e); + return null; + } + } + public boolean isLocationTracking() { return mLocationTracking; } diff --git a/location/java/com/android/internal/location/MockProvider.java b/location/java/com/android/internal/location/MockProvider.java index bc1893e..d912740 100644 --- a/location/java/com/android/internal/location/MockProvider.java +++ b/location/java/com/android/internal/location/MockProvider.java @@ -168,6 +168,10 @@ public class MockProvider implements LocationProviderInterface { mStatusUpdateTime = 0; } + public String getInternalState() { + return null; + } + public void enableLocationTracking(boolean enable) { } diff --git a/location/java/com/android/internal/location/PassiveProvider.java b/location/java/com/android/internal/location/PassiveProvider.java index 7eb711d..ab90937 100644 --- a/location/java/com/android/internal/location/PassiveProvider.java +++ b/location/java/com/android/internal/location/PassiveProvider.java @@ -106,6 +106,10 @@ public class PassiveProvider implements LocationProviderInterface { return -1; } + public String getInternalState() { + return null; + } + public void enableLocationTracking(boolean enable) { mTracking = enable; } |