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>
This commit is contained in:
Fred Fettinger
2010-01-04 15:38:13 -06:00
committed by Mike Lockwood
parent 83835359e5
commit 3c8fbdf5dd
9 changed files with 76 additions and 10 deletions

View File

@@ -765,7 +765,9 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
pw.println(prefix + "mMinTime=" + mMinTime + " mMinDistance=" + mMinDistance);
pw.println(prefix + "mUid=" + mUid);
pw.println(prefix + "mLastFixBroadcast:");
mLastFixBroadcast.dump(new PrintWriterPrinter(pw), prefix + " ");
if (mLastFixBroadcast != null) {
mLastFixBroadcast.dump(new PrintWriterPrinter(pw), prefix + " ");
}
pw.println(prefix + "mLastStatusBroadcast=" + mLastStatusBroadcast);
}
}
@@ -1954,6 +1956,13 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
i.getValue().dump(pw, " ");
}
}
for (LocationProviderInterface provider: mProviders) {
String state = provider.getInternalState();
if (state != null) {
pw.println(provider.getName() + " Internal State:");
pw.write(state);
}
}
}
}
}