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

Commit a3a5af04 authored by Sandeep Siddhartha's avatar Sandeep Siddhartha Committed by Android (Google) Code Review
Browse files

Merge "Add debugging info to VIS via dump()" into lmp-dev

parents a79e2bed 6df952ec
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

/**
@@ -263,4 +264,11 @@ public class KeyphraseEnrollmentInfo {
        Slog.w(TAG, "Enrollment application doesn't support the given keyphrase/locale");
        return null;
    }

    @Override
    public String toString() {
        return "KeyphraseEnrollmentInfo [Keyphrases=" + Arrays.toString(mKeyphrases)
                + ", EnrollmentPackage=" + mEnrollmentPackage + ", ParseError=" + mParseError
                + "]";
    }
}
+17 −4
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ import android.util.Slog;

import com.android.internal.app.IVoiceInteractionManagerService;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@@ -490,7 +492,7 @@ public class AlwaysOnHotwordDetector {
                    new RecognitionConfig(captureTriggerAudio, allowMultipleTriggers,
                            recognitionExtra, null /* additional data */));
        } catch (RemoteException e) {
            Slog.w(TAG, "RemoteException in startRecognition!");
            Slog.w(TAG, "RemoteException in startRecognition!", e);
        }
        if (code != STATUS_OK) {
            Slog.w(TAG, "startRecognition() failed with error code " + code);
@@ -504,7 +506,7 @@ public class AlwaysOnHotwordDetector {
            code = mModelManagementService.stopRecognition(
                    mVoiceInteractionService, mKeyphraseMetadata.id, mInternalCallback);
        } catch (RemoteException e) {
            Slog.w(TAG, "RemoteException in stopRecognition!");
            Slog.w(TAG, "RemoteException in stopRecognition!", e);
        }

        if (code != STATUS_OK) {
@@ -636,7 +638,7 @@ public class AlwaysOnHotwordDetector {
                dspModuleProperties =
                        mModelManagementService.getDspModuleProperties(mVoiceInteractionService);
            } catch (RemoteException e) {
                Slog.w(TAG, "RemoteException in getDspProperties!");
                Slog.w(TAG, "RemoteException in getDspProperties!", e);
            }
            // No DSP available
            if (dspModuleProperties == null) {
@@ -657,9 +659,20 @@ public class AlwaysOnHotwordDetector {
                return mModelManagementService.isEnrolledForKeyphrase(
                        mVoiceInteractionService, keyphraseId);
            } catch (RemoteException e) {
                Slog.w(TAG, "RemoteException in listRegisteredKeyphraseSoundModels!");
                Slog.w(TAG, "RemoteException in listRegisteredKeyphraseSoundModels!", e);
            }
            return false;
        }
    }

    /** @hide */
    public void dump(String prefix, PrintWriter pw) {
        synchronized (mLock) {
            pw.print(prefix); pw.print("Text="); pw.println(mText);
            pw.print(prefix); pw.print("Locale="); pw.println(mLocale);
            pw.print(prefix); pw.print("Availability="); pw.println(mAvailability);
            pw.print(prefix); pw.print("KeyphraseMetadata="); pw.println(mKeyphraseMetadata);
            pw.print(prefix); pw.print("EnrollmentInfo="); pw.println(mKeyphraseEnrollmentInfo);
        }
    }
}
+16 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ import android.provider.Settings;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.IVoiceInteractionManagerService;

import java.io.FileDescriptor;
import java.io.PrintWriter;


/**
 * Top-level service of the current global voice interactor, which is providing
@@ -244,4 +247,17 @@ public class VoiceInteractionService extends Service {
            // Ignore.
        }
    }

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("VOICE INTERACTION");
        synchronized (mLock) {
            pw.println("  AlwaysOnHotwordDetector");
            if (mHotwordDetector == null) {
                pw.println("    NULL");
            } else {
                mHotwordDetector.dump("    ", pw);
            }
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {
                try {
                    mActiveListener.onError(STATUS_ERROR);
                } catch (RemoteException e) {
                    Slog.w(TAG, "RemoteException in onDetectionStopped");
                    Slog.w(TAG, "RemoteException in onDetectionStopped", e);
                }
                mActiveListener = null;
            }