Merge "Implement dump method in RouteDiscoveryPreference"
This commit is contained in:
@@ -24,6 +24,8 @@ import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -180,6 +182,24 @@ public final class RouteDiscoveryPreference implements Parcelable {
|
||||
dest.writeBundle(mExtras);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps current state of the instance. Use with {@code dumpsys}.
|
||||
*
|
||||
* See {@link android.os.Binder#dump(FileDescriptor, PrintWriter, String[])}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public void dump(@NonNull PrintWriter pw, @NonNull String prefix) {
|
||||
pw.println(prefix + "RouteDiscoveryPreference");
|
||||
|
||||
String indent = prefix + " ";
|
||||
|
||||
pw.println(indent + "mPreferredFeatures=" + mPreferredFeatures);
|
||||
pw.println(indent + "mPackageOrder=" + mPackageOrder);
|
||||
pw.println(indent + "mAllowedPackages=" + mAllowedPackages);
|
||||
pw.println(indent + "mExtras=" + mExtras);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder result = new StringBuilder()
|
||||
|
||||
@@ -1242,6 +1242,8 @@ class MediaRouter2ServiceImpl {
|
||||
pw.println(indent + "<no manager records>");
|
||||
}
|
||||
|
||||
mCompositeDiscoveryPreference.dump(pw, indent);
|
||||
|
||||
if (!mHandler.runWithScissors(() -> mHandler.dump(pw, indent), 1000)) {
|
||||
pw.println(indent + "<could not dump handler state>");
|
||||
}
|
||||
@@ -1299,6 +1301,8 @@ class MediaRouter2ServiceImpl {
|
||||
pw.println(indent + "mHasModifyAudioRoutingPermission="
|
||||
+ mHasModifyAudioRoutingPermission);
|
||||
pw.println(indent + "mRouterId=" + mRouterId);
|
||||
|
||||
mDiscoveryPreference.dump(pw, indent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user