Add logging for route provider service proxies
Bug: 243116883 Test: Manually using adb shell dumpsys media_router Change-Id: Ie88dc61d4b1177d922f264b7d832c811e17c9243
This commit is contained in:
@@ -84,12 +84,7 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
|
||||
}
|
||||
|
||||
public void dump(PrintWriter pw, String prefix) {
|
||||
pw.println(prefix + "Proxy");
|
||||
pw.println(prefix + " mUserId=" + mUserId);
|
||||
pw.println(prefix + " mRunning=" + mRunning);
|
||||
pw.println(prefix + " mBound=" + mBound);
|
||||
pw.println(prefix + " mActiveConnection=" + mActiveConnection);
|
||||
pw.println(prefix + " mConnectionReady=" + mConnectionReady);
|
||||
pw.println(prefix + getDebugString());
|
||||
}
|
||||
|
||||
public void setManagerScanning(boolean managerScanning) {
|
||||
@@ -494,7 +489,16 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Service connection " + mComponentName.flattenToShortString();
|
||||
return getDebugString();
|
||||
}
|
||||
|
||||
private String getDebugString() {
|
||||
return TextUtils.formatSimple(
|
||||
"ProviderServiceProxy - package: %s, bound: %b, connection (active:%b, ready:%b)",
|
||||
mComponentName.getPackageName(),
|
||||
mBound,
|
||||
mActiveConnection != null,
|
||||
mConnectionReady);
|
||||
}
|
||||
|
||||
private final class Connection implements DeathRecipient {
|
||||
|
||||
@@ -63,10 +63,15 @@ final class MediaRoute2ProviderWatcher {
|
||||
}
|
||||
|
||||
public void dump(PrintWriter pw, String prefix) {
|
||||
pw.println(prefix + "Watcher");
|
||||
pw.println(prefix + " mUserId=" + mUserId);
|
||||
pw.println(prefix + " mRunning=" + mRunning);
|
||||
pw.println(prefix + " mProxies.size()=" + mProxies.size());
|
||||
pw.println(prefix + "MediaRoute2ProviderWatcher");
|
||||
prefix += " ";
|
||||
if (mProxies.isEmpty()) {
|
||||
pw.println(prefix + "<no provider service proxies>");
|
||||
} else {
|
||||
for (MediaRoute2ProviderServiceProxy proxy : mProxies) {
|
||||
proxy.dump(pw, prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
|
||||
Reference in New Issue
Block a user