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

Commit 67ff750f authored by Joanne Chung's avatar Joanne Chung
Browse files

Refine hotword dumpsys information

1. system: print no hotword connection if using normal detector
2. system: print number of trusted session
3. system: detector type will be printed with specific session
4. client: print isUsingSandboxedDetectionService to identify using
trusted hotword
5. Add missing bound information for different service type

Bug: 266128223
Test: dumpsys voiceinteraction
Test: dumpsys activity service <target service>
Change-Id: I71671548e5c0efd15847f0b6cfb7f94924e0fcbf
parent 3ba57951
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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();
                });
+5 −4
Original line number Diff line number Diff line
@@ -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);
            });
+2 −0
Original line number Diff line number Diff line
@@ -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:");