am ba2ec2b4
: Merge "Enable framework GPS and location manager logging" into gingerbread
Merge commit 'ba2ec2b44f33f55ff8507199e4e8b108a4bec7b1' into gingerbread-plus-aosp * commit 'ba2ec2b44f33f55ff8507199e4e8b108a4bec7b1': Enable framework GPS and location manager logging
This commit is contained in:
@ -89,7 +89,7 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
public class LocationManagerService extends ILocationManager.Stub implements Runnable {
|
public class LocationManagerService extends ILocationManager.Stub implements Runnable {
|
||||||
private static final String TAG = "LocationManagerService";
|
private static final String TAG = "LocationManagerService";
|
||||||
private static final boolean LOCAL_LOGV = false;
|
private static final boolean LOCAL_LOGV = true;
|
||||||
|
|
||||||
// The last time a location was written, by provider name.
|
// The last time a location was written, by provider name.
|
||||||
private HashMap<String,Long> mLastWriteTime = new HashMap<String,Long>();
|
private HashMap<String,Long> mLastWriteTime = new HashMap<String,Long>();
|
||||||
@ -224,15 +224,18 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
String result;
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
return "Receiver{"
|
result = "Receiver{"
|
||||||
+ Integer.toHexString(System.identityHashCode(this))
|
+ Integer.toHexString(System.identityHashCode(this))
|
||||||
+ " Listener " + mKey + "}";
|
+ " Listener " + mKey + "}";
|
||||||
} else {
|
} else {
|
||||||
return "Receiver{"
|
result = "Receiver{"
|
||||||
+ Integer.toHexString(System.identityHashCode(this))
|
+ Integer.toHexString(System.identityHashCode(this))
|
||||||
+ " Intent " + mKey + "}";
|
+ " Intent " + mKey + "}";
|
||||||
}
|
}
|
||||||
|
result += "mUpdateRecords: " + mUpdateRecords;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isListener() {
|
public boolean isListener() {
|
||||||
@ -1004,7 +1007,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return "UpdateRecord{"
|
return "UpdateRecord{"
|
||||||
+ Integer.toHexString(System.identityHashCode(this))
|
+ Integer.toHexString(System.identityHashCode(this))
|
||||||
+ " " + mProvider + " " + mReceiver + "}";
|
+ " mProvider: " + mProvider + " mUid: " + mUid + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump(PrintWriter pw, String prefix) {
|
void dump(PrintWriter pw, String prefix) {
|
||||||
@ -1119,9 +1122,6 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
|||||||
|
|
||||||
private void requestLocationUpdatesLocked(String provider, long minTime, float minDistance,
|
private void requestLocationUpdatesLocked(String provider, long minTime, float minDistance,
|
||||||
boolean singleShot, Receiver receiver) {
|
boolean singleShot, Receiver receiver) {
|
||||||
if (LOCAL_LOGV) {
|
|
||||||
Slog.v(TAG, "_requestLocationUpdates: listener = " + receiver);
|
|
||||||
}
|
|
||||||
|
|
||||||
LocationProviderInterface p = mProvidersByName.get(provider);
|
LocationProviderInterface p = mProvidersByName.get(provider);
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
@ -1159,6 +1159,9 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
|||||||
// Notify the listener that updates are currently disabled
|
// Notify the listener that updates are currently disabled
|
||||||
receiver.callProviderEnabledLocked(provider, false);
|
receiver.callProviderEnabledLocked(provider, false);
|
||||||
}
|
}
|
||||||
|
if (LOCAL_LOGV) {
|
||||||
|
Slog.v(TAG, "_requestLocationUpdates: provider = " + provider + " listener = " + receiver);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(identity);
|
Binder.restoreCallingIdentity(identity);
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
|||||||
|
|
||||||
private static final String TAG = "GpsLocationProvider";
|
private static final String TAG = "GpsLocationProvider";
|
||||||
|
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = true;
|
||||||
private static final boolean VERBOSE = false;
|
private static final boolean VERBOSE = false;
|
||||||
|
|
||||||
// these need to match GpsPositionMode enum in gps.h
|
// these need to match GpsPositionMode enum in gps.h
|
||||||
@ -1240,6 +1240,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
|||||||
int result = mConnMgr.startUsingNetworkFeature(
|
int result = mConnMgr.startUsingNetworkFeature(
|
||||||
ConnectivityManager.TYPE_MOBILE, Phone.FEATURE_ENABLE_SUPL);
|
ConnectivityManager.TYPE_MOBILE, Phone.FEATURE_ENABLE_SUPL);
|
||||||
if (result == Phone.APN_ALREADY_ACTIVE) {
|
if (result == Phone.APN_ALREADY_ACTIVE) {
|
||||||
|
if (DEBUG) Log.d(TAG, "Phone.APN_ALREADY_ACTIVE");
|
||||||
if (mAGpsApn != null) {
|
if (mAGpsApn != null) {
|
||||||
native_agps_data_conn_open(mAGpsApn);
|
native_agps_data_conn_open(mAGpsApn);
|
||||||
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPEN;
|
mAGpsDataConnectionState = AGPS_DATA_CONNECTION_OPEN;
|
||||||
|
Reference in New Issue
Block a user