Merge "A2dp SDP record: We only support player category." into gingerbread
diff --git a/audio/control.c b/audio/control.c
index 1674b0d..617b7c7 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -373,6 +373,15 @@
 		pressed = 1;
 	}
 
+#ifdef ANDROID
+	if ((operands[0] & 0x7F) == PAUSE_OP) {
+		if (!sink_is_streaming(control->dev)) {
+			DBG("AVRCP: Ignoring Pause key");
+			return;
+		}
+	}
+#endif
+
 	for (i = 0; key_map[i].name != NULL; i++) {
 		uint8_t key_quirks;
 
diff --git a/audio/sink.c b/audio/sink.c
index 94fe9f2..ba9f27e 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -877,6 +877,16 @@
 	return FALSE;
 }
 
+gboolean sink_is_streaming(struct audio_device *dev)
+{
+	struct sink *sink = dev->sink;
+
+	if (sink_get_state(dev) == AVDTP_STATE_STREAMING)
+		return TRUE;
+
+	return FALSE;
+}
+
 avdtp_state_t sink_get_state(struct audio_device *dev)
 {
 	struct sink *sink = dev->sink;
diff --git a/audio/sink.h b/audio/sink.h
index 7b1902b..2d7f9e5 100644
--- a/audio/sink.h
+++ b/audio/sink.h
@@ -42,6 +42,7 @@
 struct sink *sink_init(struct audio_device *dev);
 void sink_unregister(struct audio_device *dev);
 gboolean sink_is_active(struct audio_device *dev);
+gboolean sink_is_streaming(struct audio_device *dev);
 avdtp_state_t sink_get_state(struct audio_device *dev);
 gboolean sink_new_stream(struct audio_device *dev, struct avdtp *session,
 				struct avdtp_stream *stream);