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

Commit 6b8556d2 authored by Sandeep Siddhartha's avatar Sandeep Siddhartha
Browse files

Dump the state of SoundTriggerHelper for bugreports

Change-Id: I01a17d969fbd22c6bcbb161e3542ca14a3f8c7c8
parent f30fc111
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Slog;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.UUID;

@@ -508,4 +510,22 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {
        // Unregister from call state changes.
        mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
    }

    void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        synchronized (mLock) {
            pw.print("  module properties=");
            pw.println(moduleProperties == null ? "null" : moduleProperties);
            pw.print("  keyphrase ID="); pw.println(mKeyphraseId);
            pw.print("  sound model handle="); pw.println(mCurrentSoundModelHandle);
            pw.print("  sound model UUID=");
            pw.println(mCurrentSoundModelUuid == null ? "null" : mCurrentSoundModelUuid);
            pw.print("  current listener=");
            pw.println(mActiveListener == null ? "null" : mActiveListener.asBinder());

            pw.print("  requested="); pw.println(mRequested);
            pw.print("  started="); pw.println(mStarted);
            pw.print("  call active="); pw.println(mCallActive);
            pw.print("  service disabled="); pw.println(mServiceDisabled);
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -432,6 +432,7 @@ public class VoiceInteractionManagerService extends SystemService {
                }
                mImpl.dumpLocked(fd, pw, args);
            }
            mSoundTriggerHelper.dump(fd, pw, args);
        }

        class SettingsObserver extends ContentObserver {