Loading services/core/java/com/android/server/audio/AudioService.java +27 −11 Original line number Diff line number Diff line Loading @@ -3835,6 +3835,10 @@ public class AudioService extends IAudioService.Stub int delay = checkSendBecomingNoisyIntent( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, intState, AudioSystem.DEVICE_NONE); final String addr = btDevice == null ? "null" : btDevice.getAddress(); mDeviceLogger.log(new AudioEventLogger.StringEvent( "A2DP service connected: device addr=" + addr + " state=" + state)); queueMsgUnderWakeLock(mAudioHandler, MSG_SET_A2DP_SINK_CONNECTION_STATE, state, Loading Loading @@ -4698,7 +4702,14 @@ public class AudioService extends IAudioService.Stub public int setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(BluetoothDevice device, int state, int profile, boolean suppressNoisyIntent, int a2dpVolume) { mDeviceLogger.log(new AudioEventLogger.StringEvent( "setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent state=" + state // only querying address as this is the only readily available field on the device + " addr=" + device.getAddress() + " prof=" + profile + " supprNoisy=" + suppressNoisyIntent + " vol=" + a2dpVolume)); if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE, device)) { mDeviceLogger.log(new AudioEventLogger.StringEvent("A2DP connection state ignored")); return 0; } return setBluetoothA2dpDeviceConnectionStateInt( Loading Loading @@ -5645,7 +5656,7 @@ public class AudioService extends IAudioService.Stub case MSG_SET_WIRED_DEVICE_CONNECTION_STATE: { WiredDeviceConnectionState connectState = (WiredDeviceConnectionState)msg.obj; mWiredDevLogger.log(new WiredDevConnectEvent(connectState)); mDeviceLogger.log(new WiredDevConnectEvent(connectState)); onSetWiredDeviceConnectionState(connectState.mType, connectState.mState, connectState.mAddress, connectState.mName, connectState.mCaller); mAudioEventWakeLock.release(); Loading Loading @@ -6100,10 +6111,14 @@ public class AudioService extends IAudioService.Stub if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } mDeviceLogger.log(new AudioEventLogger.StringEvent( "onBluetoothA2dpDeviceConfigChange addr=" + address)); int device = AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP; synchronized (mConnectedDevices) { if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE, btDevice)) { mDeviceLogger.log(new AudioEventLogger.StringEvent( "A2dp config change ignored")); return; } final String key = makeDeviceListKey(device, address); Loading Loading @@ -7199,19 +7214,20 @@ public class AudioService extends IAudioService.Stub //========================================================================================== // AudioService logging and dumpsys //========================================================================================== final int LOG_NB_EVENTS_PHONE_STATE = 20; final int LOG_NB_EVENTS_WIRED_DEV_CONNECTION = 30; final int LOG_NB_EVENTS_FORCE_USE = 20; final int LOG_NB_EVENTS_VOLUME = 40; final int LOG_NB_EVENTS_DYN_POLICY = 10; static final int LOG_NB_EVENTS_PHONE_STATE = 20; static final int LOG_NB_EVENTS_DEVICE_CONNECTION = 30; static final int LOG_NB_EVENTS_FORCE_USE = 20; static final int LOG_NB_EVENTS_VOLUME = 40; static final int LOG_NB_EVENTS_DYN_POLICY = 10; final private AudioEventLogger mModeLogger = new AudioEventLogger(LOG_NB_EVENTS_PHONE_STATE, "phone state (logged after successfull call to AudioSystem.setPhoneState(int))"); final private AudioEventLogger mWiredDevLogger = new AudioEventLogger( LOG_NB_EVENTS_WIRED_DEV_CONNECTION, "wired device connection (logged before onSetWiredDeviceConnectionState() is executed)" ); // logs for wired + A2DP device connections: // - wired: logged before onSetWiredDeviceConnectionState() is executed // - A2DP: logged at reception of method call final private AudioEventLogger mDeviceLogger = new AudioEventLogger( LOG_NB_EVENTS_DEVICE_CONNECTION, "wired/A2DP device connection"); final private AudioEventLogger mForceUseLogger = new AudioEventLogger( LOG_NB_EVENTS_FORCE_USE, Loading Loading @@ -7300,7 +7316,7 @@ public class AudioService extends IAudioService.Stub pw.println("\nEvent logs:"); mModeLogger.dump(pw); pw.println("\n"); mWiredDevLogger.dump(pw); mDeviceLogger.dump(pw); pw.println("\n"); mForceUseLogger.dump(pw); pw.println("\n"); Loading Loading
services/core/java/com/android/server/audio/AudioService.java +27 −11 Original line number Diff line number Diff line Loading @@ -3835,6 +3835,10 @@ public class AudioService extends IAudioService.Stub int delay = checkSendBecomingNoisyIntent( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, intState, AudioSystem.DEVICE_NONE); final String addr = btDevice == null ? "null" : btDevice.getAddress(); mDeviceLogger.log(new AudioEventLogger.StringEvent( "A2DP service connected: device addr=" + addr + " state=" + state)); queueMsgUnderWakeLock(mAudioHandler, MSG_SET_A2DP_SINK_CONNECTION_STATE, state, Loading Loading @@ -4698,7 +4702,14 @@ public class AudioService extends IAudioService.Stub public int setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(BluetoothDevice device, int state, int profile, boolean suppressNoisyIntent, int a2dpVolume) { mDeviceLogger.log(new AudioEventLogger.StringEvent( "setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent state=" + state // only querying address as this is the only readily available field on the device + " addr=" + device.getAddress() + " prof=" + profile + " supprNoisy=" + suppressNoisyIntent + " vol=" + a2dpVolume)); if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE, device)) { mDeviceLogger.log(new AudioEventLogger.StringEvent("A2DP connection state ignored")); return 0; } return setBluetoothA2dpDeviceConnectionStateInt( Loading Loading @@ -5645,7 +5656,7 @@ public class AudioService extends IAudioService.Stub case MSG_SET_WIRED_DEVICE_CONNECTION_STATE: { WiredDeviceConnectionState connectState = (WiredDeviceConnectionState)msg.obj; mWiredDevLogger.log(new WiredDevConnectEvent(connectState)); mDeviceLogger.log(new WiredDevConnectEvent(connectState)); onSetWiredDeviceConnectionState(connectState.mType, connectState.mState, connectState.mAddress, connectState.mName, connectState.mCaller); mAudioEventWakeLock.release(); Loading Loading @@ -6100,10 +6111,14 @@ public class AudioService extends IAudioService.Stub if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } mDeviceLogger.log(new AudioEventLogger.StringEvent( "onBluetoothA2dpDeviceConfigChange addr=" + address)); int device = AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP; synchronized (mConnectedDevices) { if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE, btDevice)) { mDeviceLogger.log(new AudioEventLogger.StringEvent( "A2dp config change ignored")); return; } final String key = makeDeviceListKey(device, address); Loading Loading @@ -7199,19 +7214,20 @@ public class AudioService extends IAudioService.Stub //========================================================================================== // AudioService logging and dumpsys //========================================================================================== final int LOG_NB_EVENTS_PHONE_STATE = 20; final int LOG_NB_EVENTS_WIRED_DEV_CONNECTION = 30; final int LOG_NB_EVENTS_FORCE_USE = 20; final int LOG_NB_EVENTS_VOLUME = 40; final int LOG_NB_EVENTS_DYN_POLICY = 10; static final int LOG_NB_EVENTS_PHONE_STATE = 20; static final int LOG_NB_EVENTS_DEVICE_CONNECTION = 30; static final int LOG_NB_EVENTS_FORCE_USE = 20; static final int LOG_NB_EVENTS_VOLUME = 40; static final int LOG_NB_EVENTS_DYN_POLICY = 10; final private AudioEventLogger mModeLogger = new AudioEventLogger(LOG_NB_EVENTS_PHONE_STATE, "phone state (logged after successfull call to AudioSystem.setPhoneState(int))"); final private AudioEventLogger mWiredDevLogger = new AudioEventLogger( LOG_NB_EVENTS_WIRED_DEV_CONNECTION, "wired device connection (logged before onSetWiredDeviceConnectionState() is executed)" ); // logs for wired + A2DP device connections: // - wired: logged before onSetWiredDeviceConnectionState() is executed // - A2DP: logged at reception of method call final private AudioEventLogger mDeviceLogger = new AudioEventLogger( LOG_NB_EVENTS_DEVICE_CONNECTION, "wired/A2DP device connection"); final private AudioEventLogger mForceUseLogger = new AudioEventLogger( LOG_NB_EVENTS_FORCE_USE, Loading Loading @@ -7300,7 +7316,7 @@ public class AudioService extends IAudioService.Stub pw.println("\nEvent logs:"); mModeLogger.dump(pw); pw.println("\n"); mWiredDevLogger.dump(pw); mDeviceLogger.dump(pw); pw.println("\n"); mForceUseLogger.dump(pw); pw.println("\n"); Loading