am ced2c37d: (-s ours) DO NOT MERGE: Add audio info to tv_input

* commit 'ced2c37d0579d9182c6b44fd50419209613c8c0a':
  DO NOT MERGE: Add audio info to tv_input
diff --git a/include/hardware/audio.h b/include/hardware/audio.h
index d0648b7..6558dda 100644
--- a/include/hardware/audio.h
+++ b/include/hardware/audio.h
@@ -97,6 +97,9 @@
 /* A2DP sink address set by framework */
 #define AUDIO_PARAMETER_A2DP_SINK_ADDRESS "a2dp_sink_address"
 
+/* A2DP source address set by framework */
+#define AUDIO_PARAMETER_A2DP_SOURCE_ADDRESS "a2dp_source_address"
+
 /* Screen state */
 #define AUDIO_PARAMETER_KEY_SCREEN_STATE "screen_state"
 
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 9327c41..caf0ea0 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -416,10 +416,17 @@
  * trigger-mode: on-change
  * wake-up sensor: no
  *
- *  A sensor of this type returns the current heart rate if activated.
- *  The value is returned as a float which represents the heart rate in beats
- *  per minute (BPM).
- *  When the sensor cannot measure the heart rate, the returned value must be 0.
+ *  A sensor of this type returns the current heart rate.
+ *  The events contain the current heart rate in beats per minute (BPM) and the
+ *  status of the sensor during the measurement. See heart_rate_event_t for more
+ *  details.
+ *
+ *  Because this sensor is on-change, events must be generated when and only
+ *  when heart_rate.bpm or heart_rate.status have changed since the last
+ *  event. The event should be generated no faster than every period_ns passed
+ *  to setDelay() or to batch(). See the definition of the on-change trigger
+ *  mode for more information.
+ *
  *  sensor_t.requiredPermission must be set to SENSOR_PERMISSION_BODY_SENSORS.
  */
 #define SENSOR_TYPE_HEART_RATE                      (21)
@@ -514,9 +521,10 @@
  *
  * A sensor of this type generates an event each time a tilt event is detected. A tilt event
  * should be generated if the direction of the 2-seconds window average gravity changed by at least
- * 35 degrees since the activation of the sensor.
+ * 35 degrees since the activation or the last trigger of the sensor.
  *     initial_estimated_gravity = average of accelerometer measurements over the first
- *                                 1 second after activation.
+ *                                 1 second after activation or the estimated gravity at the last
+ *                                 trigger.
  *     current_estimated_gravity = average of accelerometer measurements over the last 2 seconds.
  *     trigger when angle (initial_estimated_gravity, current_estimated_gravity) > 35 degrees
  *
@@ -567,17 +575,15 @@
 /** Minimum magnetic field on Earth's surface */
 #define MAGNETIC_FIELD_EARTH_MIN    (30.0f)
 
-
 /**
- * status of orientation sensor
+ * Possible values of the status field of sensor events.
  */
-
+#define SENSOR_STATUS_NO_CONTACT        -1
 #define SENSOR_STATUS_UNRELIABLE        0
 #define SENSOR_STATUS_ACCURACY_LOW      1
 #define SENSOR_STATUS_ACCURACY_MEDIUM   2
 #define SENSOR_STATUS_ACCURACY_HIGH     3
 
-
 /**
  * sensor event data
  */
@@ -627,6 +633,17 @@
 } meta_data_event_t;
 
 /**
+ * Heart rate event data
+ */
+typedef struct {
+  // Heart rate in beats per minute.
+  // Set to 0 when status is SENSOR_STATUS_UNRELIABLE or ..._NO_CONTACT
+  float bpm;
+  // Status of the sensor for this reading. Set to one SENSOR_STATUS_...
+  int8_t status;
+} heart_rate_event_t;
+
+/**
  * Union of the various types of sensor data
  * that can be returned.
  */
@@ -683,8 +700,8 @@
             /* uncalibrated magnetometer values are in micro-Teslas */
             uncalibrated_event_t uncalibrated_magnetic;
 
-            /* heart rate in bpm */
-            float           heart_rate;
+            /* heart rate data containing value in bpm and status */
+            heart_rate_event_t heart_rate;
 
             /* this is a special event. see SENSOR_TYPE_META_DATA above.
              * sensors_meta_data_event_t events are all reported with a type of
diff --git a/modules/camera/Camera.cpp b/modules/camera/Camera.cpp
index 1f22e00..de3ae78 100644
--- a/modules/camera/Camera.cpp
+++ b/modules/camera/Camera.cpp
@@ -473,14 +473,14 @@
     ATRACE_CALL();
     android::Mutex::Autolock al(mDeviceLock);
 
-    fdprintf(fd, "Camera ID: %d (Busy: %d)\n", mId, mBusy);
+    dprintf(fd, "Camera ID: %d (Busy: %d)\n", mId, mBusy);
 
     // TODO: dump all settings
-    fdprintf(fd, "Most Recent Settings: (%p)\n", mSettings);
+    dprintf(fd, "Most Recent Settings: (%p)\n", mSettings);
 
-    fdprintf(fd, "Number of streams: %d\n", mNumStreams);
+    dprintf(fd, "Number of streams: %d\n", mNumStreams);
     for (int i = 0; i < mNumStreams; i++) {
-        fdprintf(fd, "Stream %d/%d:\n", i, mNumStreams);
+        dprintf(fd, "Stream %d/%d:\n", i, mNumStreams);
         mStreams[i]->dump(fd);
     }
 }
diff --git a/modules/camera/Stream.cpp b/modules/camera/Stream.cpp
index b846a71..2db3ed2 100644
--- a/modules/camera/Stream.cpp
+++ b/modules/camera/Stream.cpp
@@ -225,18 +225,18 @@
 {
     android::Mutex::Autolock al(mLock);
 
-    fdprintf(fd, "Stream ID: %d (%p)\n", mId, mStream);
-    fdprintf(fd, "Stream Type: %s (%d)\n", typeToString(mType), mType);
-    fdprintf(fd, "Width: %"PRIu32" Height: %"PRIu32"\n", mWidth, mHeight);
-    fdprintf(fd, "Stream Format: %s (%d)", formatToString(mFormat), mFormat);
+    dprintf(fd, "Stream ID: %d (%p)\n", mId, mStream);
+    dprintf(fd, "Stream Type: %s (%d)\n", typeToString(mType), mType);
+    dprintf(fd, "Width: %"PRIu32" Height: %"PRIu32"\n", mWidth, mHeight);
+    dprintf(fd, "Stream Format: %s (%d)", formatToString(mFormat), mFormat);
     // ToDo: prettyprint usage mask flags
-    fdprintf(fd, "Gralloc Usage Mask: %#"PRIx32"\n", mUsage);
-    fdprintf(fd, "Max Buffer Count: %"PRIu32"\n", mMaxBuffers);
-    fdprintf(fd, "Buffers Registered: %s\n", mRegistered ? "true" : "false");
-    fdprintf(fd, "Number of Buffers: %"PRIu32"\n", mNumBuffers);
+    dprintf(fd, "Gralloc Usage Mask: %#"PRIx32"\n", mUsage);
+    dprintf(fd, "Max Buffer Count: %"PRIu32"\n", mMaxBuffers);
+    dprintf(fd, "Buffers Registered: %s\n", mRegistered ? "true" : "false");
+    dprintf(fd, "Number of Buffers: %"PRIu32"\n", mNumBuffers);
     for (uint32_t i = 0; i < mNumBuffers; i++) {
-        fdprintf(fd, "Buffer %"PRIu32"/%"PRIu32": %p\n", i, mNumBuffers,
-                                                                mBuffers[i]);
+        dprintf(fd, "Buffer %"PRIu32"/%"PRIu32": %p\n", i, mNumBuffers,
+                mBuffers[i]);
     }
 }