Merge "Missing getter and additional tests." into graphics-dev
diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java
index 0b68dd8..c5a4171 100644
--- a/core/java/android/animation/AnimatorSet.java
+++ b/core/java/android/animation/AnimatorSet.java
@@ -39,6 +39,13 @@
  * result in none of the affected animations being played. Because of this (and because
  * circular dependencies do not make logical sense anyway), circular dependencies
  * should be avoided, and the dependency flow of animations should only be in one direction.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about animating with {@code AnimatorSet}, read the
+ * <a href="{@docRoot}guide/topics/graphics/prop-animation.html#choreography">Property
+ * Animation</a> developer guide.</p>
+ * </div>
  */
 public final class AnimatorSet extends Animator {
 
diff --git a/core/java/android/animation/ObjectAnimator.java b/core/java/android/animation/ObjectAnimator.java
index d2d66b6..0372cb0 100644
--- a/core/java/android/animation/ObjectAnimator.java
+++ b/core/java/android/animation/ObjectAnimator.java
@@ -29,6 +29,13 @@
  * are then determined internally and the animation will call these functions as necessary to
  * animate the property.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about animating with {@code ObjectAnimator}, read the
+ * <a href="{@docRoot}guide/topics/graphics/prop-animation.html#object-animator">Property
+ * Animation</a> developer guide.</p>
+ * </div>
+ *
  * @see #setPropertyName(String)
  *
  */
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index 9bf1634..c7a129e 100755
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -39,6 +39,13 @@
  * {@link AccelerateDecelerateInterpolator} class, which accelerates into and decelerates
  * out of an animation. This behavior can be changed by calling
  * {@link ValueAnimator#setInterpolator(TimeInterpolator)}.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about animating with {@code ValueAnimator}, read the
+ * <a href="{@docRoot}guide/topics/graphics/prop-animation.html#value-animator">Property
+ * Animation</a> developer guide.</p>
+ * </div>
  */
 public class ValueAnimator extends Animator {
 
diff --git a/core/java/android/animation/package.html b/core/java/android/animation/package.html
index 92eeb20..59178f7 100644
--- a/core/java/android/animation/package.html
+++ b/core/java/android/animation/package.html
@@ -7,15 +7,15 @@
 to calculate the values for that given type with a custom {@link android.animation.TypeEvaluator}.
 </p>
 
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/graphics/animation.html">Animation</a> developer guide.</p>
+{@more}
+
 <p>
 You can set many different types of interpolators (contained in {@link android.view.animation}),
 specify {@link android.animation.Keyframe keyframes}, or group animations to play sequentially
 or simultaneously (with {@link android.animation.AnimatorSet}) to further control your animation
 behaviors.</p>
 
-<p>
-For a guide on how to use the property animation system, see the
-<a href="{@docRoot}guide/topics/graphics/animation.html">Animation</a> developer guide.
-</p>
 </body>
-</html>
+</html>
\ No newline at end of file
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index 3aa159e..2ff45fb 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -48,10 +48,11 @@
  * {@link android.content.Context#getSystemService
  * context.getSystemService(Context.SEARCH_SERVICE)}.
  *
- * <div class="special">
- * <p>For a guide to using the search dialog and adding search
- * suggestions in your application, see the Dev Guide topic about <strong><a
- * href="{@docRoot}guide/topics/search/index.html">Search</a></strong>.</p>
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using the search dialog and adding search
+ * suggestions in your application, read the
+ * <a href="{@docRoot}guide/topics/search/index.html">Search</a> developer guide.</p>
  * </div>
  */
 public class SearchManager
diff --git a/core/java/android/app/admin/DeviceAdminReceiver.java b/core/java/android/app/admin/DeviceAdminReceiver.java
index 473aec60..43cd330 100644
--- a/core/java/android/app/admin/DeviceAdminReceiver.java
+++ b/core/java/android/app/admin/DeviceAdminReceiver.java
@@ -49,6 +49,13 @@
  * A typical file would be:</p>
  * 
  * {@sample development/samples/ApiDemos/res/xml/device_admin_sample.xml meta_data}
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about device administration, read the
+ * <a href="{@docRoot}guide/topics/admin/device-admin.html">Device Administration</a>
+ * developer guide.</p>
+ * </div>
  */
 public class DeviceAdminReceiver extends BroadcastReceiver {
     private static String TAG = "DevicePolicy";
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index c89396b..4ed0766 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -40,6 +40,13 @@
  * Public interface for managing policies enforced on a device.  Most clients
  * of this class must have published a {@link DeviceAdminReceiver} that the user
  * has currently enabled.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about managing policies for device adminstration, read the
+ * <a href="{@docRoot}guide/topics/admin/device-admin.html">Device Administration</a>
+ * developer guide.</p>
+ * </div>
  */
 public class DevicePolicyManager {
     private static String TAG = "DevicePolicyManager";
diff --git a/core/java/android/app/admin/package.html b/core/java/android/app/admin/package.html
index 1a81083..c363c25 100644
--- a/core/java/android/app/admin/package.html
+++ b/core/java/android/app/admin/package.html
@@ -4,8 +4,9 @@
 security-aware applications that are useful in enterprise settings, in which IT professionals
 require rich control over employee devices.</p>
 
-<p>For more information, see the <a
-href="{@docRoot}guide/topics/admin/device-admin.html">Device Administration</a> developer guide.</p>
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/admin/device-admin.html">Device Administration</a> 
+developer guide.</p>
 {@more}
 
 </BODY>
diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java
index 09661a5..a7f7792 100644
--- a/core/java/android/appwidget/AppWidgetManager.java
+++ b/core/java/android/appwidget/AppWidgetManager.java
@@ -35,6 +35,12 @@
 /**
  * Updates AppWidget state; gets information about installed AppWidget providers and other
  * AppWidget related state.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about creating app widgets, read the
+ * <a href="{@docRoot}guide/topics/appwidgets/index.html">App Widgets</a> developer guide.</p>
+ * </div>
  */
 public class AppWidgetManager {
     static final String TAG = "AppWidgetManager";
diff --git a/core/java/android/appwidget/AppWidgetProvider.java b/core/java/android/appwidget/AppWidgetProvider.java
index f1bbede..00a5f0c 100755
--- a/core/java/android/appwidget/AppWidgetProvider.java
+++ b/core/java/android/appwidget/AppWidgetProvider.java
@@ -31,8 +31,13 @@
  * <p>Extend this class and override one or more of the {@link #onUpdate}, {@link #onDeleted},
  * {@link #onEnabled} or {@link #onDisabled} methods to implement your own AppWidget functionality.
  * </p>
- * <p>For an example of how to write a AppWidget provider, see the
- * <a href="{@docRoot}guide/topics/appwidgets/index.html#Providers">AppWidgets</a> documentation.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about how to write an app widget provider, read the
+ * <a href="{@docRoot}guide/topics/appwidgets/index.html#AppWidgetProvider">App Widgets</a>
+ * developer guide.</p>
+ * </div>
  */
 public class AppWidgetProvider extends BroadcastReceiver {
     /**
diff --git a/core/java/android/appwidget/package.html b/core/java/android/appwidget/package.html
index 19fd2f7..aa72da2 100644
--- a/core/java/android/appwidget/package.html
+++ b/core/java/android/appwidget/package.html
@@ -2,11 +2,11 @@
 <p>Contains the components necessary to create "app widgets", which users can embed in other
 applications (such as the home screen) to quickly access application data and services without
 launching a new activity.</p>
-<p>For more information, see the
-<a href="{@docRoot}guide/topics/appwidgets/index.html">App Widgets</a>
-developer guide.</p>
 
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/appwidgets/index.html">App Widgets</a> developer guide.</p>
 {@more}
+
 <p>The behavior of an app widget is published by an "app widget provider."  An "app widget host" is
 a component that can contain app widgets (such as the Home screen).</p>
 
@@ -24,9 +24,8 @@
 widgets, but the lock screen could also contain widgets, and it would have a different way of
 adding, removing and otherwise managing widgets.</p>
 
-<p>The <a href="{@docRoot}guide/topics/appwidgets/index.html">App Widgets</a>
-developer guide shows you how to create an app widget provider. For information about implementing
-an app widget host, see the {@link android.appwidget.AppWidgetHost} class.</p>
+<p>For information about implementing an app widget host, see the {@link
+android.appwidget.AppWidgetHost} class.</p>
 
 </body>
 
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index e420bfd..600ce6f 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -62,6 +62,12 @@
  * permission and some also require the
  * {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using Bluetooth, read the
+ * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p>
+ * </div>
+ *
  * {@see BluetoothDevice}
  * {@see BluetoothServerSocket}
  */
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 0306521..189e8fc 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -54,6 +54,12 @@
  * <p class="note"><strong>Note:</strong>
  * Requires the {@link android.Manifest.permission#BLUETOOTH} permission.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using Bluetooth, read the
+ * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p>
+ * </div>
+ *
  * {@see BluetoothAdapter}
  * {@see BluetoothSocket}
  */
diff --git a/core/java/android/bluetooth/BluetoothServerSocket.java b/core/java/android/bluetooth/BluetoothServerSocket.java
index acce182..4021f7b 100644
--- a/core/java/android/bluetooth/BluetoothServerSocket.java
+++ b/core/java/android/bluetooth/BluetoothServerSocket.java
@@ -55,6 +55,12 @@
  * <p class="note"><strong>Note:</strong>
  * Requires the {@link android.Manifest.permission#BLUETOOTH} permission.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using Bluetooth, read the
+ * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p>
+ * </div>
+ *
  * {@see BluetoothSocket}
  */
 public final class BluetoothServerSocket implements Closeable {
diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java
index 9a13c3e..19d13ef 100644
--- a/core/java/android/bluetooth/BluetoothSocket.java
+++ b/core/java/android/bluetooth/BluetoothSocket.java
@@ -65,6 +65,12 @@
  * <p class="note"><strong>Note:</strong>
  * Requires the {@link android.Manifest.permission#BLUETOOTH} permission.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using Bluetooth, read the
+ * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p>
+ * </div>
+ *
  * {@see BluetoothServerSocket}
  * {@see java.io.InputStream}
  * {@see java.io.OutputStream}
diff --git a/core/java/android/bluetooth/package.html b/core/java/android/bluetooth/package.html
index 37505fd..81bf1cf 100644
--- a/core/java/android/bluetooth/package.html
+++ b/core/java/android/bluetooth/package.html
@@ -3,8 +3,8 @@
 <p>Provides classes that manage Bluetooth functionality, such as scanning for
 devices, connecting with devices, and managing data transfer between devices.</p>
 
-<p>For more information, see the <a
-href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p>
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p>
 {@more}
 
 <p>The Bluetooth APIs let applications:</p>
@@ -26,5 +26,6 @@
 
 <p class="note"><strong>Note:</strong>
 Not all Android-powered devices provide Bluetooth functionality.</p>
+
 </BODY>
 </HTML>
diff --git a/core/java/android/content/ClipData.java b/core/java/android/content/ClipData.java
index d9c6b07..a8b1bf4 100644
--- a/core/java/android/content/ClipData.java
+++ b/core/java/android/content/ClipData.java
@@ -50,6 +50,13 @@
  * CharSequence of text, a single Intent object, or a Uri.  See {@link Item}
  * for more details.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using the clipboard framework, read the
+ * <a href="{@docRoot}guide/topics/clipboard/copy-paste.html">Copy and Paste</a>
+ * developer guide.</p>
+ * </div>
+ *
  * <a name="ImplementingPaste"></a>
  * <h3>Implementing Paste or Drop</h3>
  *
diff --git a/core/java/android/content/ClipDescription.java b/core/java/android/content/ClipDescription.java
index 0d9d807..b5fa20c 100644
--- a/core/java/android/content/ClipDescription.java
+++ b/core/java/android/content/ClipDescription.java
@@ -26,6 +26,13 @@
  * Meta-data describing the contents of a {@link ClipData}.  Provides enough
  * information to know if you can handle the ClipData, but not the data
  * itself.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using the clipboard framework, read the
+ * <a href="{@docRoot}guide/topics/clipboard/copy-paste.html">Copy and Paste</a>
+ * developer guide.</p>
+ * </div>
  */
 public class ClipDescription implements Parcelable {
     /**
diff --git a/core/java/android/content/ClipboardManager.java b/core/java/android/content/ClipboardManager.java
index a79f060..800d0d2 100644
--- a/core/java/android/content/ClipboardManager.java
+++ b/core/java/android/content/ClipboardManager.java
@@ -40,6 +40,13 @@
  * is expressed as a {@link ClipData} object, which defines the protocol
  * for data exchange between applications.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using the clipboard framework, read the
+ * <a href="{@docRoot}guide/topics/clipboard/copy-paste.html">Copy and Paste</a>
+ * developer guide.</p>
+ * </div>
+ *
  * @see android.content.Context#getSystemService
  */
 public class ClipboardManager extends android.text.ClipboardManager {
diff --git a/core/java/android/content/SearchRecentSuggestionsProvider.java b/core/java/android/content/SearchRecentSuggestionsProvider.java
index e1a8d21..d6f7d97 100644
--- a/core/java/android/content/SearchRecentSuggestionsProvider.java
+++ b/core/java/android/content/SearchRecentSuggestionsProvider.java
@@ -61,6 +61,12 @@
  * for future searches by calling {@link android.provider.SearchRecentSuggestions#saveRecentQuery
  * SearchRecentSuggestions.saveRecentQuery()}.</li>
  * </ul>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For information about using search suggestions in your application, read the
+ * <a href="{@docRoot}guide/topics/search/index.html">Search</a> developer guide.</p>
+ * </div>
  * 
  * @see android.provider.SearchRecentSuggestions
  */
diff --git a/core/java/android/hardware/usb/UsbAccessory.java b/core/java/android/hardware/usb/UsbAccessory.java
index c8ea825..7702044 100644
--- a/core/java/android/hardware/usb/UsbAccessory.java
+++ b/core/java/android/hardware/usb/UsbAccessory.java
@@ -37,6 +37,12 @@
  * {@link UsbManager#ACTION_USB_ACCESSORY_ATTACHED} Intent.
  * The application can then call {@link UsbManager#openAccessory} to open a file descriptor
  * for reading and writing data to and from the accessory.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about communicating with USB hardware, read the
+ * <a href="{@docRoot}guide/topics/usb/index.html">USB</a> developer guide.</p>
+ * </div>
  */
 public class UsbAccessory implements Parcelable {
 
diff --git a/core/java/android/hardware/usb/UsbDevice.java b/core/java/android/hardware/usb/UsbDevice.java
index af3f7f0..9bd38f9 100644
--- a/core/java/android/hardware/usb/UsbDevice.java
+++ b/core/java/android/hardware/usb/UsbDevice.java
@@ -34,6 +34,12 @@
  * To communicate with the device, you open a {@link UsbDeviceConnection} for the device
  * and use {@link UsbRequest} to send and receive data on an endpoint.
  * {@link UsbDeviceConnection#controlTransfer} is used for control requests on endpoint zero.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about communicating with USB hardware, read the
+ * <a href="{@docRoot}guide/topics/usb/index.html">USB</a> developer guide.</p>
+ * </div>
  */
 public class UsbDevice implements Parcelable {
 
diff --git a/core/java/android/hardware/usb/UsbInterface.java b/core/java/android/hardware/usb/UsbInterface.java
index 3b51063..d6c54a8 100644
--- a/core/java/android/hardware/usb/UsbInterface.java
+++ b/core/java/android/hardware/usb/UsbInterface.java
@@ -26,6 +26,12 @@
  * piece of functionality, separate from the other interfaces.
  * An interface will have one or more {@link UsbEndpoint}s, which are the
  * channels by which the host transfers data with the device.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about communicating with USB hardware, read the
+ * <a href="{@docRoot}guide/topics/usb/index.html">USB</a> developer guide.</p>
+ * </div>
  */
 public class UsbInterface implements Parcelable {
 
diff --git a/core/java/android/hardware/usb/UsbManager.java b/core/java/android/hardware/usb/UsbManager.java
index 551926c..93f93c7 100644
--- a/core/java/android/hardware/usb/UsbManager.java
+++ b/core/java/android/hardware/usb/UsbManager.java
@@ -35,8 +35,13 @@
  * {@link android.content.Context#getSystemService(java.lang.String) Context.getSystemService()}.
  *
  * {@samplecode
- * UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
- * }
+ * UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);}
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about communicating with USB hardware, read the
+ * <a href="{@docRoot}guide/topics/usb/index.html">USB</a> developer guide.</p>
+ * </div>
  */
 public class UsbManager {
     private static final String TAG = "UsbManager";
diff --git a/core/java/android/hardware/usb/package.html b/core/java/android/hardware/usb/package.html
index 5fd5a30..b32e0df 100644
--- a/core/java/android/hardware/usb/package.html
+++ b/core/java/android/hardware/usb/package.html
@@ -1,9 +1,16 @@
 <HTML>
 <BODY>
-<p>Provides support to communicate with USB hardware peripherals that are connected to Android-powered
-devices. Use {@link android.hardware.usb.UsbManager} to access the state of the USB and to
+<p>Provides support to communicate with USB hardware peripherals that are connected to 
+Android-powered devices.</p>
+
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/usb/index.html">USB</a> developer guide.</p>
+{@more}
+
+<p>Use {@link android.hardware.usb.UsbManager} to access the state of the USB and to
 communicate with connected hardware peripherals. Use {@link android.hardware.usb.UsbDevice} to
-communicate with the hardware peripheral if the Android-powered device is acting as the USB host. Use
-{@link android.hardware.usb.UsbAccessory} if the peripheral is acting as the USB host.</p>
+communicate with the hardware peripheral if the Android-powered device is acting as the USB host.
+Use {@link android.hardware.usb.UsbAccessory} if the peripheral is acting as the USB host.</p>
+
 </BODY>
 </HTML>
\ No newline at end of file
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index f3c884d..53a0341 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -42,6 +42,12 @@
  * <p>
  * Use the helper {@link #getDefaultAdapter(Context)} to get the default NFC
  * adapter for this Android device.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using NFC, read the
+ * <a href="{@docRoot}guide/topics/nfc/index.html">Near Field Communication</a> developer guide.</p>
+ * </div>
  */
 public final class NfcAdapter {
     static final String TAG = "NFC";
diff --git a/core/java/android/nfc/NfcManager.java b/core/java/android/nfc/NfcManager.java
index 2bbed57..ea08014 100644
--- a/core/java/android/nfc/NfcManager.java
+++ b/core/java/android/nfc/NfcManager.java
@@ -28,6 +28,12 @@
  * Alternately, you can just call the static helper
  * {@link NfcAdapter#getDefaultAdapter(android.content.Context)}.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using NFC, read the
+ * <a href="{@docRoot}guide/topics/nfc/index.html">Near Field Communication</a> developer guide.</p>
+ * </div>
+ *
  * @see Context#getSystemService
  * @see NfcAdapter#getDefaultAdapter(android.content.Context)
  */
diff --git a/core/java/android/nfc/package.html b/core/java/android/nfc/package.html
index 97bb29d..9e028a5 100644
--- a/core/java/android/nfc/package.html
+++ b/core/java/android/nfc/package.html
@@ -1,7 +1,11 @@
 <HTML>
 <BODY>
-Provides access to Near Field Communication (NFC) functionality, allowing applications to read
-NDEF message in NFC tags. A "tag" may actually be another device that appears as a tag.
+<p>Provides access to Near Field Communication (NFC) functionality, allowing applications to read
+NDEF message in NFC tags. A "tag" may actually be another device that appears as a tag.</p>
+
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/nfc/index.html">Near Field Communication</a> developer guide.</p>
+{@more}
 
 <p>Here's a summary of the classes:</p>
 
@@ -24,5 +28,6 @@
 
 <p class="note"><strong>Note:</strong>
 Not all Android-powered devices provide NFC functionality.</p>
+
 </BODY>
 </HTML>
diff --git a/core/java/android/provider/SearchRecentSuggestions.java b/core/java/android/provider/SearchRecentSuggestions.java
index 13ad9d3..c165487 100644
--- a/core/java/android/provider/SearchRecentSuggestions.java
+++ b/core/java/android/provider/SearchRecentSuggestions.java
@@ -44,6 +44,13 @@
  *
  * <p>For a working example, see SearchSuggestionSampleProvider and SearchQueryResults in
  * samples/ApiDemos/app.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For information about using search suggestions in your application, read the
+ * <a href="{@docRoot}guide/topics/search/adding-recent-query-suggestions.html">Adding Recent Query
+ * Suggestions</a> developer guide.</p>
+ * </div>
  */
 public class SearchRecentSuggestions {
     // debugging support
diff --git a/core/java/android/test/package.html b/core/java/android/test/package.html
index 1972bed..770e9a5 100644
--- a/core/java/android/test/package.html
+++ b/core/java/android/test/package.html
@@ -1,5 +1,10 @@
 <HTML>
 <BODY>
-A framework for writing Android test cases and suites.
+<p>A framework for writing Android test cases and suites.</p>
+
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
+{@more}
+
 </BODY>
 </HTML>
\ No newline at end of file
diff --git a/core/java/android/view/animation/AnimationSet.java b/core/java/android/view/animation/AnimationSet.java
index def4d70..14d3d19 100644
--- a/core/java/android/view/animation/AnimationSet.java
+++ b/core/java/android/view/animation/AnimationSet.java
@@ -348,12 +348,13 @@
 
             for (int i = count - 1; i >= 0; --i) {
                 final Animation a = animations.get(i);
-
-                temp.clear();
-                final Interpolator interpolator = a.mInterpolator;
-                a.applyTransformation(interpolator != null ? interpolator.getInterpolation(0.0f)
-                        : 0.0f, temp);
-                previousTransformation.compose(temp);
+                if (!a.isFillEnabled() || a.getFillBefore() || a.getStartOffset() == 0) {
+                    temp.clear();
+                    final Interpolator interpolator = a.mInterpolator;
+                    a.applyTransformation(interpolator != null ? interpolator.getInterpolation(0.0f)
+                            : 0.0f, temp);
+                    previousTransformation.compose(temp);
+                }
             }
         }
     }
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index baa7c0f..fa82c46 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -1012,10 +1012,19 @@
             mExtra = extra;
         }
 
+        /**
+         * Gets the type of the hit test result.
+         * @return See the XXX_TYPE constants defined in this class.
+         */
         public int getType() {
             return mType;
         }
 
+        /**
+         * Gets additional type-dependant information about the result, see
+         * {@link WebView#getHitTestResult()} for details.
+         * @return may either be null or contain extra information about this result.
+         */
         public String getExtra() {
             return mExtra;
         }
@@ -1053,6 +1062,7 @@
      * @param context A Context object used to access application assets.
      * @param attrs An AttributeSet passed to our parent.
      * @param defStyle The default style resource ID.
+     * @param privateBrowsing If true the web view will be initialized in private mode.
      */
     public WebView(Context context, AttributeSet attrs, int defStyle,
             boolean privateBrowsing) {
@@ -1069,6 +1079,7 @@
      * @param defStyle The default style resource ID.
      * @param javaScriptInterfaces is a Map of interface names, as keys, and
      * object implementing those interfaces, as values.
+     * @param privateBrowsing If true the web view will be initialized in private mode.
      * @hide This is an implementation detail.
      */
     protected WebView(Context context, AttributeSet attrs, int defStyle,
@@ -5706,6 +5717,7 @@
      * @deprecated WebView no longer needs to implement
      * ViewGroup.OnHierarchyChangeListener.  This method does nothing now.
      */
+    // Cannot add @hide as this can always be accessed via the interface.
     @Deprecated
     public void onChildViewAdded(View parent, View child) {}
 
@@ -5713,6 +5725,7 @@
      * @deprecated WebView no longer needs to implement
      * ViewGroup.OnHierarchyChangeListener.  This method does nothing now.
      */
+    // Cannot add @hide as this can always be accessed via the interface.
     @Deprecated
     public void onChildViewRemoved(View p, View child) {}
 
@@ -5720,6 +5733,7 @@
      * @deprecated WebView should not have implemented
      * ViewTreeObserver.OnGlobalFocusChangeListener. This method does nothing now.
      */
+    // Cannot add @hide as this can always be accessed via the interface.
     @Deprecated
     public void onGlobalFocusChanged(View oldFocus, View newFocus) {
     }
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index f524ef0..9d2ff2e 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -75,10 +75,11 @@
  * If you want the search field to always be visible, then call setIconifiedByDefault(false).
  * </p>
  *
- * <p>
- * For more information, see the <a href="{@docRoot}guide/topics/search/index.html">Search</a>
- * documentation.
- * <p>
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For information about using {@code SearchView}, read the
+ * <a href="{@docRoot}guide/topics/search/index.html">Search</a> developer guide.</p>
+ * </div>
  *
  * @see android.view.MenuItem#SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
  * @attr ref android.R.styleable#SearchView_iconifiedByDefault
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index 2cb23c1..7b869a0 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -186,36 +186,34 @@
 <p>Here's a summary of the <code>&lt;appwidget-provider></code> attributes:</p>
 <ul>
   <li>The values for the <code>minWidth</code> and <code>minHeight</code>
-attributes specify the minimum
-    area required by the App Widget's layout. 
-    <p>The default Home screen positions App Widgets in its window based on a
-grid of
-    cells that have a defined height and width. If the values for an App
-Widget's minimum width 
-    or height don't match the dimensions of the cells,
-    then the App Widget dimensions round <em>up</em> to the nearest cell size.
-    (See the <a
-href="{@docRoot}guide/practices/ui_guidelines/widget_design.html">App Widget
-Design 
-    Guidelines</a> for more information on the Home screen cell sizes.)</p>
-    <p>Because the Home screen's layout orientation (and thus, the cell sizes)
-can change,
-    as a rule of thumb, you should assume the worst-case cell size of 74 pixels
-for the height
-    <em>and</em> width of a cell. However, you must subtract 2 from the final
-dimension to account
-    for any integer rounding errors that occur in the pixel count. To find your
-minimum width
-    and height in density-independent pixels (dp), use this formula:<br/>
-      <code>(number of cells * 74) - 2</code><br/>
-    Following this formula, you should use 72 dp for a height of one cell, 294
-dp and for a width of four cells.</p>
-<p class="note"><strong>Note:</strong> To make your app widget portable across
-devices, your app widget's minimum size should never be larger than 4 x 4 cells.
-See the <a
-href="{@docRoot}guide/practices/ui_guidelines/widget_design.html#sizes">App
-Widget Design Guidelines</a> for more discussion of Home screen cell sizes.</p>
+    attributes specify the minimum amount of space the App Widget consumes
+    <em>by default</em>. The default Home screen positions App Widgets in its
+    window based on a grid of cells that have a defined height and width. If
+    the values for an App Widget's minimum width or height don't match the
+    dimensions of the cells, then the App Widget dimensions round
+    <em>up</em> to the nearest cell size.
+    <p>See the <a href="{@docRoot}guide/practices/ui_guidelines/widget_design.html#anatomy_determining_size">
+    App Widget Design Guidelines</a> for more information on sizing your App
+    Widgets.</p>
+
+    <p class="note"><strong>Note:</strong> To make your app widget portable
+    across devices, your app widget's minimum size should never be larger
+    than 4 x 4 cells.</p>
   </li>
+
+  <li>The <code>minResizeWidth</code> and <code>minResizeHeight</code> attributes
+    specify the App Widget's absolute minimum size. These values should specify
+    the size below which the App Widget would be illegible or otherwise unusable.
+    Using these attributes allows the user to resize the widget to a size that
+    may be smaller than the default widget size defined by the
+    <code>minWidth</code> and <code>minHeight</code> attributes.
+    Introduced in Android 3.1.
+
+    <p>See the <a href="{@docRoot}guide/practices/ui_guidelines/widget_design.html#anatomy_determining_size">
+    App Widget Design Guidelines</a> for more information on sizing your App
+    Widgets.</p>
+  </li>
+
   <li>The <code>updatePeriodMillis</code> attribute defines how often the App
 Widget framework should request an update from the {@link
 android.appwidget.AppWidgetProvider} by calling the 
diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java
index f02d0f9..4ad5b9f 100644
--- a/graphics/java/android/graphics/drawable/AnimationDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java
@@ -64,8 +64,13 @@
  * // Start the animation (looped playback by default).
  * frameAnimation.start();
  * </pre>
- * <p>For more information, see the guide to <a
- * href="{@docRoot}guide/topics/resources/animation-resource.html">Animation Resources</a>.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about animating with {@code AnimationDrawable}, read the
+ * <a href="{@docRoot}guide/topics/graphics/drawable-animation.html">Drawable Animation</a>
+ * developer guide.</p>
+ * </div>
  *
  * @attr ref android.R.styleable#AnimationDrawable_visible
  * @attr ref android.R.styleable#AnimationDrawable_variablePadding
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index 7e542ad..59a9e5d 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -62,6 +62,11 @@
  * The unchecked variants exist to allow apps to copy over arrays of structures from a
  * control language that does not support structures.</p>
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about creating an application that uses Renderscript, read the
+ * <a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
+ * </div>
  **/
 public class Allocation extends BaseObj {
     Type mType;
diff --git a/graphics/java/android/renderscript/Element.java b/graphics/java/android/renderscript/Element.java
index 195814c..f6a0281 100644
--- a/graphics/java/android/renderscript/Element.java
+++ b/graphics/java/android/renderscript/Element.java
@@ -40,6 +40,12 @@
  * <p>The primary source of elements are from scripts. A script that exports a
  * bind point for a data structure generates a Renderscript element to represent the
  * data exported by the script. The other common source of elements is from bitmap formats.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about creating an application that uses Renderscript, read the
+ * <a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
+ * </div>
  **/
 public class Element extends BaseObj {
     int mSize;
diff --git a/graphics/java/android/renderscript/RSSurfaceView.java b/graphics/java/android/renderscript/RSSurfaceView.java
index a8e3107..6756fd0 100644
--- a/graphics/java/android/renderscript/RSSurfaceView.java
+++ b/graphics/java/android/renderscript/RSSurfaceView.java
@@ -31,6 +31,12 @@
 
 /**
  * The Surface View for a graphics renderscript (RenderScriptGL) to draw on.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about creating an application that uses Renderscript, read the
+ * <a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
+ * </div>
  */
 public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
     private SurfaceHolder mSurfaceHolder;
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index c0cb324..85af5be 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -32,13 +32,16 @@
 
 
 /**
- * RenderScript base master class.  An instance of this class creates native
+ * Renderscript base master class.  An instance of this class creates native
  * worker threads for processing commands from this object.  This base class
  * does not provide any extended capabilities beyond simple data processing.
  * For extended capabilities use derived classes such as RenderScriptGL.
  *
- *
- *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about creating an application that uses Renderscript, read the
+ * <a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
+ * </div>
  **/
 public class RenderScript {
     static final String LOG_TAG = "RenderScript_jni";
diff --git a/graphics/java/android/renderscript/RenderScriptGL.java b/graphics/java/android/renderscript/RenderScriptGL.java
index 2dfcc83f..2cfeb17 100644
--- a/graphics/java/android/renderscript/RenderScriptGL.java
+++ b/graphics/java/android/renderscript/RenderScriptGL.java
@@ -29,11 +29,17 @@
 import android.view.SurfaceView;
 
 /**
- * The Graphics derivitive of RenderScript.  Extends the basic context to add a
+ * The Graphics derivitive of Renderscript.  Extends the basic context to add a
  * root script which is the display window for graphical output.  When the
  * system needs to update the display the currently bound root script will be
  * called.  This script is expected to issue the rendering commands to repaint
  * the screen.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about creating an application that uses Renderscript, read the
+ * <a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
+ * </div>
  **/
 public class RenderScriptGL extends RenderScript {
     int mWidth;
diff --git a/graphics/java/android/renderscript/Type.java b/graphics/java/android/renderscript/Type.java
index f88af8b..70d1de4 100644
--- a/graphics/java/android/renderscript/Type.java
+++ b/graphics/java/android/renderscript/Type.java
@@ -35,6 +35,11 @@
  *
  * <p>The LOD and Faces dimensions are booleans to indicate present or not present.</p>
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about creating an application that uses Renderscript, read the
+ * <a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
+ * </div>
  **/
 public class Type extends BaseObj {
     int mDimX;
diff --git a/graphics/java/android/renderscript/package.html b/graphics/java/android/renderscript/package.html
index 36a24ff..775645f 100644
--- a/graphics/java/android/renderscript/package.html
+++ b/graphics/java/android/renderscript/package.html
@@ -1,10 +1,16 @@
 <HTML>
 <BODY>
 <p>The Renderscript rendering and computational APIs offer a low-level, high performance means of
-carrying out mathematical calculations and 3D graphics rendering. An example of Renderscript in
-applications include the 3D carousel view that is present in Android 3.0 applications such as the
-Books and YouTube applications. This API is intended for developers who are comfortable working with
-native code and want to maximize their performance critical applications.</p>
+carrying out mathematical calculations and 3D graphics rendering.</p>
+
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
+{@more}
+
+<p>An example of Renderscript in applications include the 3D carousel view that is present in
+Android 3.0 applications such as the Books and YouTube applications. This API is intended for
+developers who are comfortable working with native code and want to maximize their performance
+critical applications.</p>
 
 <p>Renderscript adopts a control and slave architecture where the low-level native code is controlled by the
 higher level Android system that runs in the virtual machine (VM). The VM code handles resource
@@ -14,7 +20,7 @@
 does the intensive computation and returns the result back to the Android VM.</p>
 
 <p>You can find the Renderscript native
-APIs in the <code>&lt;sdk_root&gt;/platforms/android-3.0/renderscript</code> directory. 
+APIs in the <code>&lt;sdk_root&gt;/platforms/android-11/renderscript</code> directory.
 The Android system APIs are broken into a few main groups:</p>
 
 <h4>Core</h4>
@@ -37,7 +43,7 @@
   <li>Byte2, Byte3, and Byte4</li>
   <li>Float2, Float3, Float4</li>
   <li>Int2, Int3, Int4</li>
-  <li>Long2, Long3, Long4</li>  
+  <li>Long2, Long3, Long4</li>
   <li>Matrix2f, Matrix3f, Matrix4f</li>
   <li>Short2, Short3, Short4</li>
 </ul>
@@ -76,10 +82,5 @@
 </ul>
 
 </p>
-<p>
-For information on how to create an application that uses Renderscript, and also the
-see <a href="../../../guide/topics/graphics/renderscript.html">3D with
-Renderscript</a> dev guide. 
-</p>
 </BODY>
 </HTML>
diff --git a/location/java/android/location/LocationListener.java b/location/java/android/location/LocationListener.java
index 0f5f388..88904c8 100644
--- a/location/java/android/location/LocationListener.java
+++ b/location/java/android/location/LocationListener.java
@@ -24,6 +24,13 @@
  * LocationListener has been registered with the location manager service
  * using the {@link LocationManager#requestLocationUpdates(String, long, float, LocationListener)}
  * method.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about identifying user location, read the
+ * <a href="{@docRoot}guide/topics/location/obtaining-user-location.html">Obtaining User
+ * Location</a> developer guide.</p>
+ * </div>
  */
 public interface LocationListener {
 
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 2817df8..91d8bc1 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -42,6 +42,13 @@
  * instantiate this class directly; instead, retrieve it through
  * {@link android.content.Context#getSystemService
  * Context.getSystemService(Context.LOCATION_SERVICE)}.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using location services, read the
+ * <a href="{@docRoot}guide/topics/location/index.html">Location and Maps</a>
+ * developer guide.</p>
+ * </div>
  */
 public class LocationManager {
     private static final String TAG = "LocationManager";
diff --git a/location/java/android/location/package.html b/location/java/android/location/package.html
index be34774..1abe098 100644
--- a/location/java/android/location/package.html
+++ b/location/java/android/location/package.html
@@ -1,10 +1,10 @@
 <html>
-
 <body>
 
 <p>Contains classes that define Android location-based and related services.</p>
-<p>For more information about location services, see the documentation for <a
-href="{@docRoot}guide/topics/location/obtaining-user-location.html">Obtaining User Location</a>.</p>
+
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/location/index.html">Location and Maps</a> developer guide.</p>
 {@more}
 
 </body>
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index c201417..093b108 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -102,8 +102,6 @@
     private VolumePanel mVolumePanel;
 
     // sendMsg() flags
-    /** Used when a message should be shared across all stream types. */
-    private static final int SHARED_MSG = -1;
     /** If the msg is already queued, replace it with this one. */
     private static final int SENDMSG_REPLACE = 0;
     /** If the msg is already queued, ignore this one and leave the old. */
@@ -127,6 +125,12 @@
     private static final int MSG_RCDISPLAY_CLEAR = 13;
     private static final int MSG_RCDISPLAY_UPDATE = 14;
 
+
+    // flags for MSG_PERSIST_VOLUME indicating if current and/or last audible volume should be
+    // persisted
+    private static final int PERSIST_CURRENT = 0x1;
+    private static final int PERSIST_LAST_AUDIBLE = 0x2;
+
     private static final int BTA2DP_DOCK_TIMEOUT_MILLIS = 8000;
     // Timeout for connection to bluetooth headset service
     private static final int BT_HEADSET_CNCT_TIMEOUT_MS = 3000;
@@ -209,14 +213,14 @@
             switch (error) {
             case AudioSystem.AUDIO_STATUS_SERVER_DIED:
                 if (mMediaServerOk) {
-                    sendMsg(mAudioHandler, MSG_MEDIA_SERVER_DIED, SHARED_MSG, SENDMSG_NOOP, 0, 0,
+                    sendMsg(mAudioHandler, MSG_MEDIA_SERVER_DIED, SENDMSG_NOOP, 0, 0,
                             null, 1500);
                     mMediaServerOk = false;
                 }
                 break;
             case AudioSystem.AUDIO_STATUS_OK:
                 if (!mMediaServerOk) {
-                    sendMsg(mAudioHandler, MSG_MEDIA_SERVER_STARTED, SHARED_MSG, SENDMSG_NOOP, 0, 0,
+                    sendMsg(mAudioHandler, MSG_MEDIA_SERVER_STARTED, SENDMSG_NOOP, 0, 0,
                             null, 0);
                     mMediaServerOk = true;
                 }
@@ -556,8 +560,13 @@
 
                         s.adjustLastAudibleIndex(direction);
                         // Post a persist volume msg
-                        sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, i,
-                                SENDMSG_REPLACE, 0, 1, s, PERSIST_DELAY);
+                        sendMsg(mAudioHandler,
+                                MSG_PERSIST_VOLUME,
+                                SENDMSG_REPLACE,
+                                PERSIST_LAST_AUDIBLE,
+                                0,
+                                s,
+                                PERSIST_DELAY);
                     }
                 }
             }
@@ -566,8 +575,13 @@
             if (adjustVolume && streamState.adjustIndex(direction)) {
                 // Post message to set system volume (it in turn will post a message
                 // to persist). Do not change volume if stream is muted.
-                sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, streamTypeAlias, SENDMSG_NOOP, 0, 0,
-                        streamState, 0);
+                sendMsg(mAudioHandler,
+                        MSG_SET_SYSTEM_VOLUME,
+                        SENDMSG_NOOP,
+                        0,
+                        0,
+                        streamState,
+                        0);
             }
             index = streamState.mIndex;
         }
@@ -643,15 +657,25 @@
             if (index != 0) {
                 streamState.setLastAudibleIndex(index);
                 // Post a persist volume msg
-                sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, streamType,
-                        SENDMSG_REPLACE, 0, 1, streamState, PERSIST_DELAY);
+                sendMsg(mAudioHandler,
+                        MSG_PERSIST_VOLUME,
+                        SENDMSG_REPLACE,
+                        PERSIST_LAST_AUDIBLE,
+                        0,
+                        streamState,
+                        PERSIST_DELAY);
             }
         } else {
             if (streamState.setIndex(index, lastAudible) || force) {
                 // Post message to set system volume (it in turn will post a message
                 // to persist).
-                sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, streamType, SENDMSG_NOOP, 0, 0,
-                        streamState, 0);
+                sendMsg(mAudioHandler,
+                        MSG_SET_SYSTEM_VOLUME,
+                        SENDMSG_NOOP,
+                        0,
+                        0,
+                        streamState,
+                        0);
             }
         }
     }
@@ -745,7 +769,7 @@
 
         // Post a persist ringer mode msg
         if (persist) {
-            sendMsg(mAudioHandler, MSG_PERSIST_RINGER_MODE, SHARED_MSG,
+            sendMsg(mAudioHandler, MSG_PERSIST_RINGER_MODE,
                     SENDMSG_REPLACE, 0, 0, null, PERSIST_DELAY);
         }
     }
@@ -785,7 +809,7 @@
 
         // Post message to set ringer mode (it in turn will post a message
         // to persist)
-        sendMsg(mAudioHandler, MSG_PERSIST_VIBRATE_SETTING, SHARED_MSG, SENDMSG_NOOP, 0, 0,
+        sendMsg(mAudioHandler, MSG_PERSIST_VIBRATE_SETTING, SENDMSG_NOOP, 0, 0,
                 null, 0);
     }
 
@@ -998,14 +1022,14 @@
 
     /** @see AudioManager#playSoundEffect(int) */
     public void playSoundEffect(int effectType) {
-        sendMsg(mAudioHandler, MSG_PLAY_SOUND_EFFECT, SHARED_MSG, SENDMSG_NOOP,
+        sendMsg(mAudioHandler, MSG_PLAY_SOUND_EFFECT, SENDMSG_NOOP,
                 effectType, -1, null, 0);
     }
 
     /** @see AudioManager#playSoundEffect(int, float) */
     public void playSoundEffectVolume(int effectType, float volume) {
         loadSoundEffects();
-        sendMsg(mAudioHandler, MSG_PLAY_SOUND_EFFECT, SHARED_MSG, SENDMSG_NOOP,
+        sendMsg(mAudioHandler, MSG_PLAY_SOUND_EFFECT, SENDMSG_NOOP,
                 effectType, (int) (volume * 1000), null, 0);
     }
 
@@ -1264,7 +1288,7 @@
         }
         mForcedUseForComm = on ? AudioSystem.FORCE_SPEAKER : AudioSystem.FORCE_NONE;
 
-        sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SHARED_MSG, SENDMSG_QUEUE,
+        sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SENDMSG_QUEUE,
                 AudioSystem.FOR_COMMUNICATION, mForcedUseForComm, null, 0);
     }
 
@@ -1280,9 +1304,9 @@
         }
         mForcedUseForComm = on ? AudioSystem.FORCE_BT_SCO : AudioSystem.FORCE_NONE;
 
-        sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SHARED_MSG, SENDMSG_QUEUE,
+        sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SENDMSG_QUEUE,
                 AudioSystem.FOR_COMMUNICATION, mForcedUseForComm, null, 0);
-        sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SHARED_MSG, SENDMSG_QUEUE,
+        sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SENDMSG_QUEUE,
                 AudioSystem.FOR_RECORD, mForcedUseForComm, null, 0);
     }
 
@@ -1522,7 +1546,7 @@
         // without delay to reset the SCO audio state and clear SCO clients.
         // If we could get a proxy, send a delayed failure message that will reset our state
         // in case we don't receive onServiceConnected().
-        sendMsg(mAudioHandler, MSG_BT_HEADSET_CNCT_FAILED, 0,
+        sendMsg(mAudioHandler, MSG_BT_HEADSET_CNCT_FAILED,
                 SENDMSG_REPLACE, 0, 0, null, result ? BT_HEADSET_CNCT_TIMEOUT_MS : 0);
         return result;
     }
@@ -1536,7 +1560,7 @@
                     if (mBluetoothHeadset != null) {
                         if (!mBluetoothHeadset.stopVoiceRecognition(
                                 mBluetoothHeadsetDevice)) {
-                            sendMsg(mAudioHandler, MSG_BT_HEADSET_CNCT_FAILED, 0,
+                            sendMsg(mAudioHandler, MSG_BT_HEADSET_CNCT_FAILED,
                                     SENDMSG_REPLACE, 0, 0, null, 0);
                         }
                     } else if (mScoAudioState == SCO_STATE_ACTIVE_EXTERNAL &&
@@ -1619,7 +1643,7 @@
                             }
                         }
                         if (!status) {
-                            sendMsg(mAudioHandler, MSG_BT_HEADSET_CNCT_FAILED, 0,
+                            sendMsg(mAudioHandler, MSG_BT_HEADSET_CNCT_FAILED,
                                     SENDMSG_REPLACE, 0, 0, null, 0);
                         }
                     }
@@ -1816,17 +1840,9 @@
     }
 
     // Message helper methods
-    private static int getMsg(int baseMsg, int streamType) {
-        return (baseMsg & 0xffff) | streamType << 16;
-    }
 
-    private static int getMsgBase(int msg) {
-        return msg & 0xffff;
-    }
-
-    private static void sendMsg(Handler handler, int baseMsg, int streamType,
+    private static void sendMsg(Handler handler, int msg,
             int existingMsgPolicy, int arg1, int arg2, Object obj, int delay) {
-        int msg = (streamType == SHARED_MSG) ? baseMsg : getMsg(baseMsg, streamType);
 
         if (existingMsgPolicy == SENDMSG_REPLACE) {
             handler.removeMessages(msg);
@@ -1834,8 +1850,7 @@
             return;
         }
 
-        handler
-                .sendMessageDelayed(handler.obtainMessage(msg, arg1, arg2, obj), delay);
+        handler.sendMessageDelayed(handler.obtainMessage(msg, arg1, arg2, obj), delay);
     }
 
     boolean checkAudioSettingsPermission(String method) {
@@ -1970,7 +1985,7 @@
                                 // If the stream is not yet muted by any client, set lvel to 0
                                 if (muteCount() == 0) {
                                     setIndex(0, false);
-                                    sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, mStreamType, SENDMSG_NOOP, 0, 0,
+                                    sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, SENDMSG_NOOP, 0, 0,
                                             VolumeStreamState.this, 0);
                                 }
                             } catch (RemoteException e) {
@@ -2000,7 +2015,7 @@
                                     // ringer mode allows it
                                     if (!isStreamAffectedByRingerMode(mStreamType) || mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
                                         setIndex(mLastAudibleIndex, false);
-                                        sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, mStreamType, SENDMSG_NOOP, 0, 0,
+                                        sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, SENDMSG_NOOP, 0, 0,
                                                 VolumeStreamState.this, 0);
                                     }
                                 }
@@ -2094,16 +2109,23 @@
             }
 
             // Post a persist volume msg
-            sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, streamState.mStreamType,
-                    SENDMSG_REPLACE, 1, 1, streamState, PERSIST_DELAY);
+            sendMsg(mAudioHandler,
+                    MSG_PERSIST_VOLUME,
+                    SENDMSG_REPLACE,
+                    PERSIST_CURRENT|PERSIST_LAST_AUDIBLE,
+                    0,
+                    streamState,
+                    PERSIST_DELAY);
+
         }
 
-        private void persistVolume(VolumeStreamState streamState, boolean current, boolean lastAudible) {
-            if (current) {
+        private void persistVolume(VolumeStreamState streamState,
+                                   int persistType) {
+            if ((persistType & PERSIST_CURRENT) != 0) {
                 System.putInt(mContentResolver, streamState.mVolumeIndexSettingName,
                               (streamState.mIndex + 5)/ 10);
             }
-            if (lastAudible) {
+            if ((persistType & PERSIST_LAST_AUDIBLE) != 0) {
                 System.putInt(mContentResolver, streamState.mLastAudibleVolumeIndexSettingName,
                     (streamState.mLastAudibleIndex + 5) / 10);
             }
@@ -2185,16 +2207,15 @@
 
         @Override
         public void handleMessage(Message msg) {
-            int baseMsgWhat = getMsgBase(msg.what);
 
-            switch (baseMsgWhat) {
+            switch (msg.what) {
 
                 case MSG_SET_SYSTEM_VOLUME:
                     setSystemVolume((VolumeStreamState) msg.obj);
                     break;
 
                 case MSG_PERSIST_VOLUME:
-                    persistVolume((VolumeStreamState) msg.obj, (msg.arg1 != 0), (msg.arg2 != 0));
+                    persistVolume((VolumeStreamState) msg.obj, msg.arg1);
                     break;
 
                 case MSG_PERSIST_RINGER_MODE:
@@ -2211,7 +2232,7 @@
                         // Force creation of new IAudioFlinger interface so that we are notified
                         // when new media_server process is back to life.
                         AudioSystem.setErrorCallback(mAudioSystemCallback);
-                        sendMsg(mAudioHandler, MSG_MEDIA_SERVER_DIED, SHARED_MSG, SENDMSG_NOOP, 0, 0,
+                        sendMsg(mAudioHandler, MSG_MEDIA_SERVER_DIED, SENDMSG_NOOP, 0, 0,
                                 null, 500);
                     }
                     break;
@@ -2660,7 +2681,7 @@
                 }
             } else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
                 mBootCompleted = true;
-                sendMsg(mAudioHandler, MSG_LOAD_SOUND_EFFECTS, SHARED_MSG, SENDMSG_NOOP,
+                sendMsg(mAudioHandler, MSG_LOAD_SOUND_EFFECTS, SENDMSG_NOOP,
                         0, 0, null, 0);
 
                 mKeyguardManager =
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
index 1f24b58..dbb35f2 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
@@ -36,7 +36,6 @@
 
     //***** Instance Variables
     protected int mProfileId = RILConstants.DATA_PROFILE_DEFAULT;
-    protected String mActiveApnType = Phone.APN_TYPE_DEFAULT;
     //***** Constructor
     private GsmDataConnection(PhoneBase phone, String name, int id, RetryManager rm) {
         super(phone, name, id, rm);
@@ -113,10 +112,6 @@
         return mProfileId;
     }
 
-    public void setActiveApnType(String apnType) {
-        mActiveApnType = apnType;
-    }
-
     @Override
     public String toString() {
         return "State=" + getCurrentState().getName() + " Apn=" + mApn +
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 963db2c..fd85642 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -993,17 +993,11 @@
             return false;
         }
 
-        // First, check to see if ApnContext already has DC.
-        // This could happen if the retries are currently  engaged.
-        dc = (GsmDataConnection)apnContext.getDataConnection();
+
+        dc = (GsmDataConnection) checkForConnectionForApnContext(apnContext);
 
         if (dc == null) {
-
-            dc = (GsmDataConnection) checkForConnectionForApnContext(apnContext);
-
-            if (dc == null) {
-                dc = findReadyDataConnection(apn);
-            }
+            dc = findReadyDataConnection(apn);
 
             if (dc == null) {
                 if (DBG) log("setupData: No ready GsmDataConnection found!");
@@ -1020,21 +1014,23 @@
                 if (DBG) log("setupData: No free GsmDataConnection found!");
                 return false;
             }
-
-            DataConnectionAc dcac = mDataConnectionAsyncChannels.get(dc.getDataConnectionId());
-            dc.setProfileId( profileId );
-            dc.setActiveApnType(apnContext.getApnType());
-            int refCount = dcac.getRefCountSync();
-            if (DBG) log("setupData: init dc and apnContext refCount=" + refCount);
-
-            // configure retry count if no other Apn is using the same connection.
-            if (refCount == 0) {
-                configureRetry(dc, apn.canHandleType(Phone.APN_TYPE_DEFAULT));
-            }
-            apnContext.setDataConnectionAc(dcac);
-            apnContext.setDataConnection(dc);
+        } else {
+            apn = mDataConnectionAsyncChannels.get(dc.getDataConnectionId()).getApnSettingSync();
         }
 
+        DataConnectionAc dcac = mDataConnectionAsyncChannels.get(dc.getDataConnectionId());
+        dc.setProfileId( profileId );  //  assumed no connection sharing on profiled types
+
+        int refCount = dcac.getRefCountSync();
+        if (DBG) log("setupData: init dc and apnContext refCount=" + refCount);
+
+        // configure retry count if no other Apn is using the same connection.
+        if (refCount == 0) {
+            configureRetry(dc, apn.canHandleType(Phone.APN_TYPE_DEFAULT));
+        }
+        apnContext.setDataConnectionAc(dcac);
+        apnContext.setDataConnection(dc);
+
         apnContext.setApnSetting(apn);
         apnContext.setState(State.INITING);
         mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
@@ -1732,27 +1728,46 @@
             dunSetting = fetchDunApn();
         }
 
+        DataConnection potential = null;
         for (ApnContext c : mApnContexts.values()) {
             DataConnection conn = c.getDataConnection();
             if (conn != null) {
                 ApnSetting apnSetting = c.getApnSetting();
                 if (dunSetting != null) {
                     if (dunSetting.equals(apnSetting)) {
-                        if (DBG) {
-                            log("checkForConnectionForApnContext: apnContext=" + apnContext +
-                                    " found conn=" + conn);
+                        switch (c.getState()) {
+                            case CONNECTED:
+                                if (DBG) {
+                                    log("checkForConnectionForApnContext: apnContext=" +
+                                            apnContext + " found conn=" + conn);
+                                }
+                                return conn;
+                            case CONNECTING:
+                                potential = conn;
                         }
-                        return conn;
                     }
                 } else if (apnSetting != null && apnSetting.canHandleType(apnType)) {
-                    if (DBG) {
-                        log("checkForConnectionForApnContext: apnContext=" + apnContext +
-                                " found conn=" + conn);
+                    switch (c.getState()) {
+                        case CONNECTED:
+                            if (DBG) {
+                                log("checkForConnectionForApnContext: apnContext=" + apnContext +
+                                        " found conn=" + conn);
+                            }
+                            return conn;
+                        case CONNECTING:
+                            potential = conn;
                     }
-                    return conn;
                 }
             }
         }
+        if (potential != null) {
+            if (DBG) {
+                log("checkForConnectionForApnContext: apnContext=" + apnContext +
+                    " found conn=" + potential);
+            }
+            return potential;
+        }
+
         if (DBG) log("checkForConnectionForApnContext: apnContext=" + apnContext + " NO conn");
         return null;
     }
diff --git a/test-runner/src/android/test/ActivityInstrumentationTestCase2.java b/test-runner/src/android/test/ActivityInstrumentationTestCase2.java
index 24b125e..c4bcf31 100644
--- a/test-runner/src/android/test/ActivityInstrumentationTestCase2.java
+++ b/test-runner/src/android/test/ActivityInstrumentationTestCase2.java
@@ -37,6 +37,12 @@
  * New tests should be written using this base class.
  * 
  * <p>If you prefer an isolated unit test, see {@link android.test.ActivityUnitTestCase}.
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about application testing, read the
+ * <a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
+ * </div>
  */
 public abstract class ActivityInstrumentationTestCase2<T extends Activity> 
         extends ActivityTestCase {
diff --git a/test-runner/src/android/test/InstrumentationTestRunner.java b/test-runner/src/android/test/InstrumentationTestRunner.java
index 70cf89e..43285fb 100644
--- a/test-runner/src/android/test/InstrumentationTestRunner.java
+++ b/test-runner/src/android/test/InstrumentationTestRunner.java
@@ -54,7 +54,15 @@
 
 /**
  * An {@link Instrumentation} that runs various types of {@link junit.framework.TestCase}s against
- * an Android package (application). Typical usage:
+ * an Android package (application).
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about application testing, read the
+ * <a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
+ * </div>
+ *
+ * <h3>Typical Usage</h3>
  * <ol>
  * <li>Write {@link junit.framework.TestCase}s that perform unit, functional, or performance tests
  * against the classes in your package.  Typically these are subclassed from:
diff --git a/test-runner/src/android/test/ServiceTestCase.java b/test-runner/src/android/test/ServiceTestCase.java
index 8fad5d6..06c1c5b 100644
--- a/test-runner/src/android/test/ServiceTestCase.java
+++ b/test-runner/src/android/test/ServiceTestCase.java
@@ -34,6 +34,12 @@
  * Service, and hooks with which you can inject various dependencies and control
  * the environment in which your Service is tested.
  *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about application testing, read the
+ * <a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
+ * </div>
+ *
  * <p><b>Lifecycle Support.</b>
  * A Service is accessed with a specific sequence of
  * calls, as described in the
diff --git a/test-runner/src/android/test/mock/MockContentResolver.java b/test-runner/src/android/test/mock/MockContentResolver.java
index 26eb8e4..6c91f4e 100644
--- a/test-runner/src/android/test/mock/MockContentResolver.java
+++ b/test-runner/src/android/test/mock/MockContentResolver.java
@@ -43,6 +43,12 @@
  *      Users can also set an authority's entry in the map to null, so that a provider is completely
  *      mocked out.
  * </p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about application testing, read the
+ * <a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
+ * </div>
  */
 
 public class MockContentResolver extends ContentResolver {
diff --git a/test-runner/src/android/test/mock/package.html b/test-runner/src/android/test/mock/package.html
index 0f1bc6f4..29b2d80 100644
--- a/test-runner/src/android/test/mock/package.html
+++ b/test-runner/src/android/test/mock/package.html
@@ -1,5 +1,10 @@
 <HTML>
 <BODY>
-Utility classes providing stubs or mocks of various Android framework building blocks.
+<p>Utility classes providing stubs or mocks of various Android framework building blocks.</p>
+
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
+{@more}
+
 </BODY>
 </HTML>
diff --git a/voip/java/android/net/sip/SipAudioCall.java b/voip/java/android/net/sip/SipAudioCall.java
index fcdbd2c..1d67055 100644
--- a/voip/java/android/net/sip/SipAudioCall.java
+++ b/voip/java/android/net/sip/SipAudioCall.java
@@ -44,13 +44,20 @@
  *
  * <p class="note"><strong>Note:</strong> Using this class require the
  *   {@link android.Manifest.permission#INTERNET} and
- *   {@link android.Manifest.permission#USE_SIP} permissions.<br/><br/>In addition, {@link
+ *   {@link android.Manifest.permission#USE_SIP} permissions. In addition, {@link
  *   #startAudio} requires the
  *   {@link android.Manifest.permission#RECORD_AUDIO},
  *   {@link android.Manifest.permission#ACCESS_WIFI_STATE}, and
  *   {@link android.Manifest.permission#WAKE_LOCK} permissions; and {@link #setSpeakerMode
  *   setSpeakerMode()} requires the
  *   {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS} permission.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using SIP, read the
+ * <a href="{@docRoot}guide/topics/network/sip.html">Session Initiation Protocol</a>
+ * developer guide.</p>
+ * </div>
  */
 public class SipAudioCall {
     private static final String TAG = SipAudioCall.class.getSimpleName();
diff --git a/voip/java/android/net/sip/SipManager.java b/voip/java/android/net/sip/SipManager.java
index cd0b5c4..74c3672 100644
--- a/voip/java/android/net/sip/SipManager.java
+++ b/voip/java/android/net/sip/SipManager.java
@@ -49,9 +49,16 @@
  * SIP. You should always call {@link android.net.sip.SipManager#isVoipSupported
  * isVoipSupported()} to verify that the device supports VOIP calling and {@link
  * android.net.sip.SipManager#isApiSupported isApiSupported()} to verify that the device supports
- * the SIP APIs.<br/><br/>Your application must also request the {@link
+ * the SIP APIs. Your application must also request the {@link
  * android.Manifest.permission#INTERNET} and {@link android.Manifest.permission#USE_SIP}
  * permissions.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using SIP, read the
+ * <a href="{@docRoot}guide/topics/network/sip.html">Session Initiation Protocol</a>
+ * developer guide.</p>
+ * </div>
  */
 public class SipManager {
     /**
diff --git a/voip/java/android/net/sip/SipProfile.java b/voip/java/android/net/sip/SipProfile.java
index 34d91dd..0ef754c 100644
--- a/voip/java/android/net/sip/SipProfile.java
+++ b/voip/java/android/net/sip/SipProfile.java
@@ -37,6 +37,13 @@
  * <p>You can create a {@link SipProfile} using {@link
  * SipProfile.Builder}. You can also retrieve one from a {@link SipSession}, using {@link
  * SipSession#getLocalProfile} and {@link SipSession#getPeerProfile}.</p>
+ *
+ * <div class="special reference">
+ * <h3>Developer Guides</h3>
+ * <p>For more information about using SIP, read the
+ * <a href="{@docRoot}guide/topics/network/sip.html">Session Initiation Protocol</a>
+ * developer guide.</p>
+ * </div>
  */
 public class SipProfile implements Parcelable, Serializable, Cloneable {
     private static final long serialVersionUID = 1L;
diff --git a/voip/java/android/net/sip/package.html b/voip/java/android/net/sip/package.html
index 790656b..eb683d0 100644
--- a/voip/java/android/net/sip/package.html
+++ b/voip/java/android/net/sip/package.html
@@ -3,6 +3,11 @@
 <p>Provides access to Session Initiation Protocol (SIP) functionality, such as
 making and answering VOIP calls using SIP.</p>
 
+<p>For more information, see the
+<a href="{@docRoot}guide/topics/network/sip.html">Session Initiation Protocol</a>
+developer guide.</p>
+{@more}
+
 <p>To get started, you need to get an instance of the {@link android.net.sip.SipManager} by
 calling {@link android.net.sip.SipManager#newInstance newInstance()}.</p>
 
@@ -31,9 +36,10 @@
 activity, you should call {@link android.net.sip.SipManager#isVoipSupported isVoipSupported()}
 to verify that the device supports VOIP calling and {@link
 android.net.sip.SipManager#isApiSupported isApiSupported()} to verify that the device supports the
-SIP APIs.<br/><br/>
+SIP APIs.
 Your application must also request the {@link android.Manifest.permission#INTERNET} and {@link
 android.Manifest.permission#USE_SIP} permissions in order to use the SIP APIs.
 </p>
+
 </BODY>
 </HTML>
\ No newline at end of file
diff --git a/wifi/java/android/net/wifi/WifiMonitor.java b/wifi/java/android/net/wifi/WifiMonitor.java
index 80963a8..05b8fe1 100644
--- a/wifi/java/android/net/wifi/WifiMonitor.java
+++ b/wifi/java/android/net/wifi/WifiMonitor.java
@@ -196,7 +196,7 @@
     private static final String P2P_PROV_DISC_SHOW_PIN_STR = "P2P-PROV-DISC-SHOW-PIN";
 
     private static final String HOST_AP_EVENT_PREFIX_STR = "AP";
-    /* AP-STA-CONNECTED 42:fc:89:a8:96:09 */
+    /* AP-STA-CONNECTED 42:fc:89:a8:96:09 dev_addr=02:90:4c:a0:92:54 */
     private static final String AP_STA_CONNECTED_STR = "AP-STA-CONNECTED";
     /* AP-STA-DISCONNECTED 42:fc:89:a8:96:09 */
     private static final String AP_STA_DISCONNECTED_STR = "AP-STA-DISCONNECTED";
@@ -504,9 +504,17 @@
          */
         private void handleHostApEvents(String dataString) {
             String[] tokens = dataString.split(" ");
+            /* AP-STA-CONNECTED 42:fc:89:a8:96:09 dev_addr=02:90:4c:a0:92:54 */
             if (tokens[0].equals(AP_STA_CONNECTED_STR)) {
-                mStateMachine.sendMessage(AP_STA_CONNECTED_EVENT, tokens[1]);
+                String[] nameValue = tokens[2].split("=");
+                if (nameValue.length != 2) return;
+                WifiP2pDevice device = new WifiP2pDevice();
+                device.interfaceAddress = tokens[1];
+                device.deviceAddress = nameValue[1];
+                mStateMachine.sendMessage(AP_STA_CONNECTED_EVENT, device);
+            /* AP-STA-DISCONNECTED 42:fc:89:a8:96:09 */
             } else if (tokens[0].equals(AP_STA_DISCONNECTED_STR)) {
+                //TODO: fix this once wpa_supplicant reports this consistently
                 mStateMachine.sendMessage(AP_STA_DISCONNECTED_EVENT, tokens[1]);
             }
         }
diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java
index 0fc0a45..4c06558 100644
--- a/wifi/java/android/net/wifi/WifiNative.java
+++ b/wifi/java/android/net/wifi/WifiNative.java
@@ -307,9 +307,11 @@
 
         if (joinExistingGroup) args.add("join");
 
+        //TODO: This can be adapted based on device plugged in state and
+        //device battery state
         int groupOwnerIntent = config.groupOwnerIntent;
         if (groupOwnerIntent < 0 || groupOwnerIntent > 15) {
-            groupOwnerIntent = 3; //default value
+            groupOwnerIntent = 7; //default value
         }
         args.add("go_intent=" + groupOwnerIntent);
 
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java b/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java
index b47e098..7471a2d 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java
@@ -34,12 +34,12 @@
     /**
      * The device name is a user friendly string to identify a Wi-Fi p2p device
      */
-    public String deviceName;
+    public String deviceName = "";
 
     /**
      * The device MAC address uniquely identifies a Wi-Fi p2p device
      */
-    public String deviceAddress;
+    public String deviceAddress = "";
 
     /**
      * interfaceAddress
@@ -134,7 +134,7 @@
      * @hide
      */
     public WifiP2pDevice(String string) throws IllegalArgumentException {
-        String[] tokens = string.split(" ");
+        String[] tokens = string.split("[ \n]");
 
         if (tokens.length < 1) {
             throw new IllegalArgumentException("Malformed supplicant event");
@@ -166,7 +166,7 @@
                 continue;
             }
 
-            if (nameValue[0].equals("name")) {
+            if (nameValue[0].equals("name") || nameValue[0].equals("device_name")) {
                 deviceName = trimQuotes(nameValue[1]);
                 continue;
             }
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.java b/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.java
index 9ce2545..cbb4e81 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.java
@@ -80,6 +80,19 @@
     }
 
     /** @hide */
+    public void updateInterfaceAddress(WifiP2pDevice device) {
+        for (WifiP2pDevice d : mDevices) {
+            //Found, update interface address
+            if (d.equals(device)) {
+                d.interfaceAddress = device.interfaceAddress;
+                return;
+            }
+        }
+        //Not found, add a new one
+        mDevices.add(device);
+    }
+
+    /** @hide */
     public boolean remove(WifiP2pDevice device) {
         if (device == null) return false;
         return mDevices.remove(device);
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
index dede1b5..84a4fe0 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
@@ -727,6 +727,8 @@
                 case WifiP2pManager.CONNECT:
                     if (DBG) logd(getName() + " sending connect");
                     mSavedPeerConfig = (WifiP2pConfig) message.obj;
+                    String updatedPeerDetails = WifiNative.p2pPeer(mSavedPeerConfig.deviceAddress);
+                    mPeers.update(new WifiP2pDevice(updatedPeerDetails));
                     mPersistGroup = false;
                     int netId = configuredNetworkId(mSavedPeerConfig.deviceAddress);
                     if (netId >= 0) {
@@ -736,13 +738,7 @@
                         //If peer is a GO, we do not need to send provisional discovery,
                         //the supplicant takes care of it.
                         if (isGroupOwner(mSavedPeerConfig.deviceAddress)) {
-                            String pin = WifiNative.p2pConnect(mSavedPeerConfig, JOIN_GROUP);
-                            try {
-                                Integer.parseInt(pin);
-                                notifyInvitationSent(pin, mSavedPeerConfig.deviceAddress);
-                            } catch (NumberFormatException ignore) {
-                                // do nothing if p2pConnect did not return a pin
-                            }
+                            p2pConnectWithPinDisplay(mSavedPeerConfig, JOIN_GROUP);
                             transitionTo(mGroupNegotiationState);
                         } else {
                             transitionTo(mProvisionDiscoveryState);
@@ -758,8 +754,27 @@
                     break;
                 case WifiMonitor.P2P_INVITATION_RECEIVED_EVENT:
                     WifiP2pGroup group = (WifiP2pGroup) message.obj;
-                    //TODO: fix p2p invitation to handle as a regular config
-                    //and update mSavedPeerConfig
+                    WifiP2pDevice owner = group.getOwner();
+
+                    if (owner == null) {
+                        if (DBG) loge("Ignored invitation from null owner");
+                        break;
+                    }
+
+                    mSavedPeerConfig = new WifiP2pConfig();
+                    mSavedPeerConfig.deviceAddress = group.getOwner().deviceAddress;
+
+                    //Check if we have the owner in peer list and use appropriate
+                    //wps method. Default is to use PBC.
+                    if ((owner = getDeviceFromPeerList(owner.deviceAddress)) != null) {
+                        if (owner.wpsPbcSupported()) {
+                            mSavedPeerConfig.wps.setup = WpsInfo.PBC;
+                        } else if (owner.wpsKeypadSupported()) {
+                            mSavedPeerConfig.wps.setup = WpsInfo.KEYPAD;
+                        } else if (owner.wpsDisplaySupported()) {
+                            mSavedPeerConfig.wps.setup = WpsInfo.DISPLAY;
+                        }
+                    }
                     transitionTo(mUserAuthorizingInvitationState);
                     break;
                 case WifiMonitor.P2P_PROV_DISC_PBC_REQ_EVENT:
@@ -853,9 +868,9 @@
                 case PEER_CONNECTION_USER_ACCEPT:
                     //TODO: handle persistence
                     if (isGroupOwner(mSavedPeerConfig.deviceAddress)) {
-                        WifiNative.p2pConnect(mSavedPeerConfig, JOIN_GROUP);
+                        p2pConnectWithPinDisplay(mSavedPeerConfig, JOIN_GROUP);
                     } else {
-                        WifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP);
+                        p2pConnectWithPinDisplay(mSavedPeerConfig, FORM_GROUP);
                     }
                     updateDeviceStatus(mSavedPeerConfig.deviceAddress, WifiP2pDevice.INVITED);
                     sendP2pPeersChangedBroadcast();
@@ -1007,20 +1022,22 @@
             if (DBG) logd(getName() + message.toString());
             switch (message.what) {
                 case WifiMonitor.AP_STA_CONNECTED_EVENT:
-                    //After a GO setup, STA connected event comes with interface address
-                    String interfaceAddress = (String) message.obj;
-                    String deviceAddress = getDeviceAddress(interfaceAddress);
+                    WifiP2pDevice device = (WifiP2pDevice) message.obj;
+                    String deviceAddress = device.deviceAddress;
                     if (deviceAddress != null) {
                         mGroup.addClient(deviceAddress);
+                        mPeers.updateInterfaceAddress(device);
                         updateDeviceStatus(deviceAddress, WifiP2pDevice.CONNECTED);
                         if (DBG) logd(getName() + " ap sta connected");
                         sendP2pPeersChangedBroadcast();
                     } else {
-                        loge("Connect on unknown device address : " + interfaceAddress);
+                        loge("Connect on null device address, ignore");
                     }
                     break;
                 case WifiMonitor.AP_STA_DISCONNECTED_EVENT:
-                    interfaceAddress = (String) message.obj;
+                    //TODO: the disconnection event is still inconsistent and reports
+                    //interface address. Fix this after wpa_supplicant is fixed.
+                    String interfaceAddress = (String) message.obj;
                     deviceAddress = getDeviceAddress(interfaceAddress);
                     if (deviceAddress != null) {
                         updateDeviceStatus(deviceAddress, WifiP2pDevice.AVAILABLE);
@@ -1039,7 +1056,7 @@
                         sendP2pPeersChangedBroadcast();
                         if (DBG) loge(getName() + " ap sta disconnected");
                     } else {
-                        loge("Disconnect on unknown device address : " + interfaceAddress);
+                        loge("Disconnect on unknown interface address : " + interfaceAddress);
                     }
                     break;
                 case DhcpStateMachine.CMD_POST_DHCP_ACTION:
@@ -1087,7 +1104,7 @@
                     transitionTo(mInactiveState);
                     break;
                 case WifiMonitor.P2P_DEVICE_LOST_EVENT:
-                    WifiP2pDevice device = (WifiP2pDevice) message.obj;
+                    device = (WifiP2pDevice) message.obj;
                     //Device loss for a connected device indicates it is not in discovery any more
                     if (mGroup.contains(device)) {
                         if (DBG) logd("Lost " + device +" , do nothing");
@@ -1388,13 +1405,32 @@
 
     private String getDeviceAddress(String interfaceAddress) {
         for (WifiP2pDevice d : mPeers.getDeviceList()) {
-            if (interfaceAddress.equals(WifiNative.p2pGetInterfaceAddress(d.deviceAddress))) {
+            if (interfaceAddress.equals(d.interfaceAddress)) {
                 return d.deviceAddress;
             }
         }
         return null;
     }
 
+    private WifiP2pDevice getDeviceFromPeerList(String deviceAddress) {
+        for (WifiP2pDevice d : mPeers.getDeviceList()) {
+            if (d.deviceAddress.equals(deviceAddress)) {
+                return d;
+            }
+        }
+        return null;
+    }
+
+    private void p2pConnectWithPinDisplay(WifiP2pConfig config, boolean join) {
+        String pin = WifiNative.p2pConnect(config, join);
+        try {
+            Integer.parseInt(pin);
+            notifyInvitationSent(pin, config.deviceAddress);
+        } catch (NumberFormatException ignore) {
+            // do nothing if p2pConnect did not return a pin
+        }
+    }
+
     private void initializeP2pSettings() {
         WifiNative.setPersistentReconnect(true);
         WifiNative.setDeviceName(mThisDevice.deviceName);