Unhide API additions to AudioManager for AudioFocus support.

Change-Id: Ifc7d764703632eb91db11587675ae70ec14510e8
diff --git a/api/current.xml b/api/current.xml
index dd0a804..e273cd2 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -80262,6 +80262,19 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<method name="abandonAudioFocus"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="l" type="android.media.AudioManager.OnAudioFocusChangeListener">
+</parameter>
+</method>
 <method name="adjustStreamVolume"
  return="void"
  abstract="false"
@@ -80503,6 +80516,36 @@
 <parameter name="volume" type="float">
 </parameter>
 </method>
+<method name="registerAudioFocusListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="l" type="android.media.AudioManager.OnAudioFocusChangeListener">
+</parameter>
+</method>
+<method name="requestAudioFocus"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="l" type="android.media.AudioManager.OnAudioFocusChangeListener">
+</parameter>
+<parameter name="streamType" type="int">
+</parameter>
+<parameter name="durationHint" type="int">
+</parameter>
+</method>
 <method name="setBluetoothA2dpOn"
  return="void"
  abstract="false"
@@ -80710,6 +80753,19 @@
  visibility="public"
 >
 </method>
+<method name="unregisterAudioFocusListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="l" type="android.media.AudioManager.OnAudioFocusChangeListener">
+</parameter>
+</method>
 <field name="ACTION_AUDIO_BECOMING_NOISY"
  type="java.lang.String"
  transient="false"
@@ -80754,6 +80810,72 @@
  visibility="public"
 >
 </field>
+<field name="AUDIOFOCUS_GAIN"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="AUDIOFOCUS_GAIN_TRANSIENT"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="2"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="AUDIOFOCUS_LOSS"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="-1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="AUDIOFOCUS_LOSS_TRANSIENT"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="-2"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="AUDIOFOCUS_REQUEST_FAILED"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="0"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="AUDIOFOCUS_REQUEST_GRANTED"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="EXTRA_RINGER_MODE"
  type="java.lang.String"
  transient="false"
@@ -81283,6 +81405,27 @@
 >
 </field>
 </class>
+<interface name="AudioManager.OnAudioFocusChangeListener"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="onAudioFocusChanged"
+ return="void"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="focusChange" type="int">
+</parameter>
+</method>
+</interface>
 <class name="AudioRecord"
  extends="java.lang.Object"
  abstract="false"
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index b0a179f..4fa3327 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1132,41 +1132,31 @@
     }
 
     /**
-     * TODO unhide for SDK
      * Used to indicate a loss of audio focus of unknown duration.
      * @see OnAudioFocusChangeListener#onAudioFocusChanged(int)
-     * {@hide}
      */
     public static final int AUDIOFOCUS_LOSS = -1;
     /**
-     * TODO unhide for SDK
      * Used to indicate a transient loss of audio focus.
      * @see OnAudioFocusChangeListener#onAudioFocusChanged(int)
-     * {@hide}
      */
     public static final int AUDIOFOCUS_LOSS_TRANSIENT = -2;
     /**
-     * TODO unhide for SDK
      * Used to indicate a gain of audio focus, or a request of audio focus, of unknown duration.
      * @see OnAudioFocusChangeListener#onAudioFocusChanged(int)
      * @see #requestAudioFocus(OnAudioFocusChangeListener, int, int)
-     * {@hide}
      */
     public static final int AUDIOFOCUS_GAIN = 1;
     /**
-     * TODO unhide for SDK
      * Used to indicate a temporary gain or request of audio focus, anticipated to last a short
      * amount of time. Examples of temporary changes are the playback of driving directions, or an
      * event notification.
      * @see OnAudioFocusChangeListener#onAudioFocusChanged(int)
      * @see #requestAudioFocus(OnAudioFocusChangeListener, int, int)
-     * {@hide}
      */
     public static final int AUDIOFOCUS_GAIN_TRANSIENT = 2;
 
     /**
-     * TODO unhide for SDK
-     * {@hide}
      * Interface definition for a callback to be invoked when the audio focus of the system is
      * updated.
      */
@@ -1267,8 +1257,6 @@
     }
 
     /**
-     * TODO unhide for SDK
-     * {@hide}
      * Register a listener for audio focus updates.
      */
     public void registerAudioFocusListener(OnAudioFocusChangeListener l) {
@@ -1284,9 +1272,7 @@
     }
 
     /**
-     * TODO unhide for SDK
      * TODO document for SDK
-     * {@hide}
      */
     public void unregisterAudioFocusListener(OnAudioFocusChangeListener l) {
         // notify service to remove it from audio focus stack
@@ -1304,22 +1290,16 @@
 
 
     /**
-     * TODO unhide for SDK
      * TODO document for SDK
-     * {@hide}
      */
     public static final int AUDIOFOCUS_REQUEST_FAILED = 0;
     /**
-     * TODO unhide for SDK
      * TODO document for SDK
-     * {@hide}
      */
     public static final int AUDIOFOCUS_REQUEST_GRANTED = 1;
 
 
     /**
-     *  TODO unhide for SDK
-     *  {@hide}
      *  Request audio focus.
      *  Send a request to obtain the audio focus for a specific stream type
      *  @param l the listener to be notified of audio focus changes
@@ -1347,9 +1327,7 @@
 
 
     /**
-     *  TODO unhide for SDK
      *  TODO document for SDK
-     *  {@hide}
      *  Abandon audio focus.
      *  @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
      */