Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa9ef89a authored by Santiago Seifert's avatar Santiago Seifert
Browse files

Add logging for route provider service proxies

Bug: 243116883
Test: Manually using adb shell dumpsys media_router
Change-Id: Ie88dc61d4b1177d922f264b7d832c811e17c9243
parent fd70b1be
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -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 {
+9 −4
Original line number Diff line number Diff line
@@ -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() {