dump factory reset protection policy

Bug: 176109794
Test: Generate bug report and checked dumpsys
Change-Id: I08562763ce998b825830f8bcaba40b0f7fc5aaa3
This commit is contained in:
Alex Johnston
2022-03-15 20:48:50 +00:00
parent 31fc5489fd
commit ca234fdd8c
2 changed files with 22 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import android.annotation.Nullable;
import android.content.ComponentName;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.TypedXmlPullParser;
import android.util.TypedXmlSerializer;
@@ -254,4 +255,18 @@ public final class FactoryResetProtectionPolicy implements Parcelable {
return !mFactoryResetProtectionAccounts.isEmpty() && mFactoryResetProtectionEnabled;
}
/**
* @hide
*/
public void dump(IndentingPrintWriter pw) {
pw.print("factoryResetProtectionEnabled=");
pw.println(mFactoryResetProtectionEnabled);
pw.print("factoryResetProtectionAccounts=");
pw.increaseIndent();
for (int i = 0; i < mFactoryResetProtectionAccounts.size(); i++) {
pw.println(mFactoryResetProtectionAccounts.get(i));
}
pw.decreaseIndent();
}
}

View File

@@ -1227,5 +1227,12 @@ class ActiveAdmin {
pw.print("mSsidDenylist=");
pw.println(mSsidDenylist);
if (mFactoryResetProtectionPolicy != null) {
pw.println("mFactoryResetProtectionPolicy:");
pw.increaseIndent();
mFactoryResetProtectionPolicy.dump(pw);
pw.decreaseIndent();
}
}
}