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

Commit 8536574a authored by Santiago Seifert's avatar Santiago Seifert Committed by Android (Google) Code Review
Browse files

Merge changes I5a36dac7,Ie88dc61d

* changes:
  Move EventLogger.dump call to MR2ServiceImpl.dump
  Add logging for route provider service proxies
parents 310e9641 3c155090
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() {
+2 −3
Original line number Diff line number Diff line
@@ -630,6 +630,7 @@ class MediaRouter2ServiceImpl {
            } else {
                pw.println(indent + "  <no user records>");
            }
            mEventLogger.dump(pw, indent);
        }
    }

@@ -1382,8 +1383,6 @@ class MediaRouter2ServiceImpl {
            if (!mHandler.runWithScissors(() -> mHandler.dump(pw, indent), 1000)) {
                pw.println(indent + "<could not dump handler state>");
            }

            mEventLogger.dump(pw, indent);
        }
    }