AudioService: Add the service's message queue to the dump
Clogged queue means UI and other commands can not reach
the service and will cause volume controls to malfunction.
Example dump snippet:
Message handler (watch for unhandled messages):
Handler (com.android.server.audio.AudioService$AudioHandler) {a904698} @ 61825
Looper (AudioService, tid 118) {6808ef1}
Message 0: { when=-52s689ms what=25 ... }
Message 1: { when=-52s8ms what=8 ... }
Message 2: { when=-52s4ms what=8 ... }
...
Message 35: { when=-2s436ms what=0 ... }
(Total messages: 36, polling=false, quitting=false)
This indicates that the command queue is not being processed
because the handler got stuck. Checking stacks of the system_server
can help in figuring out the reason.
Bug: 135763139
Test: adb shell dumpsys audio
Change-Id: I02009720668af218edb38d5a5948a5964b72c685
This commit is contained in:
@@ -127,6 +127,7 @@ import android.util.AndroidRuntimeException;
|
||||
import android.util.IntArray;
|
||||
import android.util.Log;
|
||||
import android.util.MathUtils;
|
||||
import android.util.PrintWriterPrinter;
|
||||
import android.util.Slog;
|
||||
import android.util.SparseIntArray;
|
||||
import android.view.KeyEvent;
|
||||
@@ -6379,6 +6380,12 @@ public class AudioService extends IAudioService.Stub
|
||||
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
|
||||
|
||||
if (mAudioHandler != null) {
|
||||
pw.println("\nMessage handler (watch for unhandled messages):");
|
||||
mAudioHandler.dump(new PrintWriterPrinter(pw), " ");
|
||||
} else {
|
||||
pw.println("\nMessage handler is null");
|
||||
}
|
||||
mMediaFocusControl.dump(pw);
|
||||
dumpStreamStates(pw);
|
||||
dumpRingerMode(pw);
|
||||
|
||||
Reference in New Issue
Block a user