Merge "Refine hotword dumpsys information"

This commit is contained in:
Joanne Chung
2023-02-10 01:52:17 +00:00
committed by Android (Google) Code Review
3 changed files with 11 additions and 6 deletions

View File

@@ -766,11 +766,13 @@ public class VoiceInteractionService extends Service {
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println("VOICE INTERACTION");
synchronized (mLock) {
pw.println(" Sandboxed Detector(s)");
pw.println(" Sandboxed Detector(s):");
if (mActiveDetectors.size() == 0) {
pw.println(" NULL");
pw.println(" No detector.");
} else {
mActiveDetectors.forEach(detector -> {
pw.print(" Using sandboxed detection service=");
pw.println(detector.isUsingSandboxedDetectionService());
detector.dump(" ", pw);
pw.println();
});

View File

@@ -578,18 +578,19 @@ final class HotwordDetectionConnection {
public void dump(String prefix, PrintWriter pw) {
synchronized (mLock) {
pw.print(prefix); pw.print("mReStartPeriodSeconds="); pw.println(mReStartPeriodSeconds);
pw.print(prefix); pw.print("mBound=");
pw.print(prefix); pw.print("bound for HotwordDetectionService=");
pw.println(mRemoteHotwordDetectionService != null
&& mRemoteHotwordDetectionService.isBound());
pw.print(prefix); pw.print("bound for VisualQueryDetectionService=");
pw.println(mRemoteVisualQueryDetectionService != null
&& mRemoteHotwordDetectionService != null
&& mRemoteHotwordDetectionService.isBound());
pw.print(prefix); pw.print("mRestartCount=");
pw.println(mRestartCount);
pw.print(prefix); pw.print("mLastRestartInstant="); pw.println(mLastRestartInstant);
pw.print(prefix); pw.print("mDetectorType=");
pw.println(HotwordDetector.detectorTypeToString(mDetectorType));
pw.print(prefix); pw.println("DetectorSession(s)");
pw.print(prefix); pw.println("DetectorSession(s):");
pw.print(prefix); pw.print("Num of DetectorSession(s)=");
pw.println(mDetectorSessions.size());
runForEachDetectorSessionLocked((session) -> {
session.dumpLocked(prefix, pw);
});

View File

@@ -986,6 +986,8 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne
if (mHotwordDetectionConnection != null) {
pw.println(" Hotword detection connection:");
mHotwordDetectionConnection.dump(" ", pw);
} else {
pw.println(" No Hotword detection connection");
}
if (mActiveSession != null) {
pw.println(" Active session:");