diff options
| -rw-r--r-- | services/core/java/com/android/server/location/LocationManagerService.java | 3 | ||||
| -rw-r--r-- | services/core/java/com/android/server/location/eventlog/LocationEventLog.java | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/location/LocationManagerService.java b/services/core/java/com/android/server/location/LocationManagerService.java index 28dc5167487d..47cb43e2d4af 100644 --- a/services/core/java/com/android/server/location/LocationManagerService.java +++ b/services/core/java/com/android/server/location/LocationManagerService.java @@ -1253,7 +1253,8 @@ public class LocationManagerService extends ILocationManager.Stub { ArrayMap<String, ArrayMap<String, LocationEventLog.AggregateStats>> aggregateStats = mEventLog.copyAggregateStats(); for (int i = 0; i < aggregateStats.size(); i++) { - ipw.println(aggregateStats.keyAt(i)); + ipw.print(aggregateStats.keyAt(i)); + ipw.println(":"); ipw.increaseIndent(); ArrayMap<String, LocationEventLog.AggregateStats> providerStats = aggregateStats.valueAt(i); diff --git a/services/core/java/com/android/server/location/eventlog/LocationEventLog.java b/services/core/java/com/android/server/location/eventlog/LocationEventLog.java index 67060fc2c082..865d41f1baee 100644 --- a/services/core/java/com/android/server/location/eventlog/LocationEventLog.java +++ b/services/core/java/com/android/server/location/eventlog/LocationEventLog.java @@ -164,6 +164,7 @@ public class LocationEventLog extends LocalEventLog { if (Build.IS_DEBUGGABLE || D) { addLogEvent(EVENT_PROVIDER_DELIVER_LOCATION, provider, numLocations, identity); } + getAggregateStats(provider, identity.getPackageName()).markLocationDelivered(); } /** Logs that the location power save mode has changed. */ @@ -397,6 +398,8 @@ public class LocationEventLog extends LocalEventLog { private int mActiveRequestCount; @GuardedBy("this") private int mForegroundRequestCount; + @GuardedBy("this") + private int mDeliveredLocationCount; @GuardedBy("this") private long mFastestIntervalMs = Long.MAX_VALUE; @@ -464,6 +467,10 @@ public class LocationEventLog extends LocalEventLog { Preconditions.checkState(mForegroundRequestCount >= 0); } + synchronized void markLocationDelivered() { + mDeliveredLocationCount++; + } + public synchronized void updateTotals() { if (mAddedRequestCount > 0) { long realtimeMs = SystemClock.elapsedRealtime(); @@ -488,7 +495,8 @@ public class LocationEventLog extends LocalEventLog { + intervalToString(mSlowestIntervalMs) + ", total/active/foreground duration = " + formatDuration(mAddedTimeTotalMs) + "/" + formatDuration(mActiveTimeTotalMs) + "/" - + formatDuration(mForegroundTimeTotalMs); + + formatDuration(mForegroundTimeTotalMs) + ", locations = " + + mDeliveredLocationCount; } private static String intervalToString(long intervalMs) { |