Merge "Fix disconnect log printf in ConnectionService." into lmp-dev
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 40d45ea..71a05ab 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1351,6 +1351,16 @@
streamType = AudioSystem.STREAM_NOTIFICATION;
}
+ // If Hdmi-CEC system audio mode is on, show volume bar
+ // only when TV receives volume notification from Audio Receiver.
+ if (mHdmiTvClient != null && streamType == AudioSystem.STREAM_MUSIC) {
+ synchronized (mHdmiTvClient) {
+ if (mHdmiSystemAudioSupported &&
+ ((flags & AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME) == 0)) {
+ flags &= ~AudioManager.FLAG_SHOW_UI;
+ }
+ }
+ }
mVolumeController.postVolumeChanged(streamType, flags);
if ((flags & AudioManager.FLAG_FIXED_VOLUME) == 0) {
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 9a34047..4d9b4e9 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -798,7 +798,7 @@
// FLAG_HDMI_SYSTEM_AUDIO_VOLUME prevents audio manager from announcing
// volume change notification back to hdmi control service.
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume,
- AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME);
+ AudioManager.FLAG_SHOW_UI | AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME);
}
}
diff --git a/services/core/java/com/android/server/hdmi/MhlConstants.java b/services/core/java/com/android/server/hdmi/MhlConstants.java
deleted file mode 100644
index fe479f3..0000000
--- a/services/core/java/com/android/server/hdmi/MhlConstants.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.android.server.hdmi;
-
-/**
- * Defines constants related to MHL protocol internal implementation.
- */
-final class MhlConstants {
- // --------------------------------------------------
- // MHL sub command message types.
- static final int MSG_MSGE = 0x02;
- static final int MSG_RCP = 0x10;
- static final int MSG_RCPK = 0x11;
- static final int MSG_RCPE = 0x12;
- static final int MSG_RAP = 0x20;
- static final int MSG_RAPK = 0x21;
-
- // MHL RAP messages.
- static final int RAP_ACTION_POLL = 0x00;
- static final int RAP_ACTION_CONTENT_ON = 0x10;
- static final int RAP_ACTION_CONTENT_OFF = 0x11;
-
- // MHL RAPK messages.
- static final int RAPK_NO_ERROR = 0x00;
- static final int RAPK_UNRECOGNIZED_ACTION = 0x01;
- static final int RAPK_UNSUPPORTED_ACTION = 0x02;
- static final int RAPK_RESPONDER_BUSY = 0x03;
-
- static final int INVALID_ADOPTER_ID = -1;
- static final int INVALID_DEVICE_ID = -1;
-
- static final int CBUS_MODE_OCBUS = 1;
- static final int CBUS_MODE_ECBUS_S = 2;
- static final int CBUS_MODE_ECBUS_D = 3;
-
- // MHL RCPE messages
- static final int RCPE_NO_ERROR = 0x00;
- static final int RCPE_INEFFECTIVE_KEYCODE = 0x01;
- static final int RCPE_RESPONDER_BUSY = 0x02;
-
- private MhlConstants() { /* cannot be instantiated */ }
-}
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 76348ec..7979e44 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -771,7 +771,7 @@
public final void setDisconnected(DisconnectCause disconnectCause) {
mDisconnectCause = disconnectCause;
setState(STATE_DISCONNECTED);
- Log.d(this, "Disconnected with cause %d message %s", disconnectCause);
+ Log.d(this, "Disconnected with cause %s", disconnectCause);
for (Listener l : mListeners) {
l.onDisconnected(this, disconnectCause);
}