RebootEscrow: add bugreport dump
To make it a little easier to understand the current state
in a bugreport, log some of the internal state when a dump
is requested.
(cherry picked from commit cdd8467a34)
Bug: 151512506
Test: adb shell dumpsys lock_settings
Merged-In: If6889737a5be452833f587db5400dc5fde27cd47
Change-Id: If6889737a5be452833f587db5400dc5fde27cd47
This commit is contained in:
@@ -3193,6 +3193,12 @@ public class LockSettingsService extends ILockSettings.Stub {
|
||||
mStrongAuth.dump(pw);
|
||||
pw.println();
|
||||
pw.decreaseIndent();
|
||||
|
||||
pw.println("RebootEscrow:");
|
||||
pw.increaseIndent();
|
||||
mRebootEscrowManager.dump(pw);
|
||||
pw.println();
|
||||
pw.decreaseIndent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.server.locksettings;
|
||||
|
||||
import static android.os.UserHandle.USER_SYSTEM;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.content.Context;
|
||||
@@ -35,6 +36,7 @@ import com.android.internal.util.FrameworkStatsLog;
|
||||
import com.android.internal.widget.RebootEscrowListener;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
@@ -390,4 +392,23 @@ class RebootEscrowManager {
|
||||
void setRebootEscrowListener(RebootEscrowListener listener) {
|
||||
mRebootEscrowListener = listener;
|
||||
}
|
||||
|
||||
void dump(@NonNull PrintWriter pw) {
|
||||
pw.print("mRebootEscrowWanted=");
|
||||
pw.println(mRebootEscrowWanted);
|
||||
|
||||
pw.print("mRebootEscrowReady=");
|
||||
pw.println(mRebootEscrowReady);
|
||||
|
||||
pw.print("mRebootEscrowListener=");
|
||||
pw.println(mRebootEscrowListener);
|
||||
|
||||
boolean keySet;
|
||||
synchronized (mKeyGenerationLock) {
|
||||
keySet = mPendingRebootEscrowKey != null;
|
||||
}
|
||||
|
||||
pw.print("mPendingRebootEscrowKey is ");
|
||||
pw.println(keySet ? "set" : "not set");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user