Merge "LTE Changes for Telephony including Multiple PDN support and IPV6 support"
diff --git a/api/12.xml b/api/12.xml
index 6c6ede1..7835c7f 100644
--- a/api/12.xml
+++ b/api/12.xml
@@ -201551,14 +201551,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="Config"
- type="android.util.Config"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <field name="DEBUG"
  type="boolean"
  transient="false"
@@ -201621,14 +201613,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="DebugUtils"
- type="android.util.DebugUtils"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="isObjectSelected"
  return="boolean"
  abstract="false"
@@ -201817,14 +201801,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="EventLog"
- type="android.util.EventLog"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="getTagCode"
  return="int"
  abstract="false"
@@ -204105,14 +204081,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="StateSet"
- type="android.util.StateSet"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="dump"
  return="java.lang.String"
  abstract="false"
@@ -204258,14 +204226,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="TimeUtils"
- type="android.util.TimeUtils"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="getTimeZone"
  return="java.util.TimeZone"
  abstract="false"
@@ -205066,14 +205026,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="Xml"
- type="android.util.Xml"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="asAttributeSet"
  return="android.util.AttributeSet"
  abstract="false"
diff --git a/api/current.xml b/api/current.xml
index bf388b1..5ceca12 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -204927,14 +204927,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="Config"
- type="android.util.Config"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <field name="DEBUG"
  type="boolean"
  transient="false"
@@ -204997,14 +204989,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="DebugUtils"
- type="android.util.DebugUtils"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="isObjectSelected"
  return="boolean"
  abstract="false"
@@ -205193,14 +205177,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="EventLog"
- type="android.util.EventLog"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="getTagCode"
  return="int"
  abstract="false"
@@ -207694,14 +207670,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="StateSet"
- type="android.util.StateSet"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="dump"
  return="java.lang.String"
  abstract="false"
@@ -207847,14 +207815,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="TimeUtils"
- type="android.util.TimeUtils"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="getTimeZone"
  return="java.util.TimeZone"
  abstract="false"
@@ -208655,14 +208615,6 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<constructor name="Xml"
- type="android.util.Xml"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
 <method name="asAttributeSet"
  return="android.util.AttributeSet"
  abstract="false"
diff --git a/core/java/android/nfc/tech/Ndef.java b/core/java/android/nfc/tech/Ndef.java
index 6727d6a..e4daa57 100644
--- a/core/java/android/nfc/tech/Ndef.java
+++ b/core/java/android/nfc/tech/Ndef.java
@@ -103,6 +103,8 @@
     public static final int TYPE_4 = 4;
     /** @hide */
     public static final int TYPE_MIFARE_CLASSIC = 101;
+    /** @hide */
+    public static final int TYPE_ICODE_SLI = 102;
 
     /** @hide */
     public static final String UNKNOWN = "android.ndef.unknown";
@@ -117,6 +119,11 @@
     public static final String NFC_FORUM_TYPE_4 = "org.nfcforum.ndef.type4";
     /** NDEF on MIFARE Classic */
     public static final String MIFARE_CLASSIC = "com.nxp.ndef.mifareclassic";
+    /**
+     * NDEF on iCODE SLI
+     * @hide
+     */
+    public static final String ICODE_SLI = "com.nxp.ndef.icodesli";
 
     private final int mMaxNdefSize;
     private final int mCardState;
@@ -200,6 +207,8 @@
                 return NFC_FORUM_TYPE_4;
             case TYPE_MIFARE_CLASSIC:
                 return MIFARE_CLASSIC;
+            case TYPE_ICODE_SLI:
+                return ICODE_SLI;
             default:
                 return UNKNOWN;
         }
diff --git a/core/java/android/util/Config.java b/core/java/android/util/Config.java
index 924b49d..becb882 100644
--- a/core/java/android/util/Config.java
+++ b/core/java/android/util/Config.java
@@ -21,8 +21,9 @@
  * on release vs. debug build.
  * {@more}
  */
-public final class Config
-{
+public final class Config {
+    /** @hide */ public Config() {}
+
     /**
      * If this is a debug build, this field will be true.
      */
diff --git a/core/java/android/util/DebugUtils.java b/core/java/android/util/DebugUtils.java
index 65fc35c..7e3c855 100644
--- a/core/java/android/util/DebugUtils.java
+++ b/core/java/android/util/DebugUtils.java
@@ -20,9 +20,11 @@
 import java.lang.reflect.InvocationTargetException;
 
 /**
- * <p>Various utilities for debugging and logging.</p> 
+ * <p>Various utilities for debugging and logging.</p>
  */
 public class DebugUtils {
+    /** @hide */ public DebugUtils() {}
+
     /**
      * <p>Filters objects against the <code>ANDROID_OBJECT_FILTER</code>
      * environment variable. This environment variable can filter objects
diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java
index b596d32..29c0ba2 100644
--- a/core/java/android/util/EventLog.java
+++ b/core/java/android/util/EventLog.java
@@ -42,6 +42,8 @@
  * event-log-tags file defines the payload contents for each type code.
  */
 public class EventLog {
+    /** @hide */ public EventLog() {}
+
     private static final String TAG = "EventLog";
 
     private static final String TAGS_FILE = "/system/etc/event-log-tags";
diff --git a/core/java/android/util/StateSet.java b/core/java/android/util/StateSet.java
index 21d8e45..2623638 100644
--- a/core/java/android/util/StateSet.java
+++ b/core/java/android/util/StateSet.java
@@ -36,13 +36,14 @@
  */
 
 public class StateSet {
+    /** @hide */ public StateSet() {}
 
     public static final int[] WILD_CARD = new int[0];
     public static final int[] NOTHING = new int[] { 0 };
 
     /**
      * Return whether the stateSetOrSpec is matched by all StateSets.
-     * 
+     *
      * @param stateSetOrSpec a state set or state spec.
      */
     public static boolean isWildCard(int[] stateSetOrSpec) {
@@ -51,7 +52,7 @@
 
     /**
      * Return whether the stateSet matches the desired stateSpec.
-     * 
+     *
      * @param stateSpec an array of required (if positive) or
      *        prohibited (if negative) {@link android.view.View} states.
      * @param stateSet an array of {@link android.view.View} states
@@ -111,7 +112,7 @@
 
     /**
      * Return whether the state matches the desired stateSpec.
-     * 
+     *
      * @param stateSpec an array of required (if positive) or
      *        prohibited (if negative) {@link android.view.View} states.
      * @param state a {@link android.view.View} state
@@ -148,13 +149,13 @@
         System.arraycopy(states, 0, trimmedStates, 0, newSize);
         return trimmedStates;
     }
-    
+
     public static String dump(int[] states) {
         StringBuilder sb = new StringBuilder();
-        
+
         int count = states.length;
         for (int i = 0; i < count; i++) {
-            
+
             switch (states[i]) {
             case R.attr.state_window_focused:
                 sb.append("W ");
@@ -173,7 +174,7 @@
                 break;
             }
         }
-        
+
         return sb.toString();
     }
 }
diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java
index 85ce5e1..d7b0dc1 100644
--- a/core/java/android/util/TimeUtils.java
+++ b/core/java/android/util/TimeUtils.java
@@ -34,6 +34,7 @@
  * A class containing utility methods related to time zones.
  */
 public class TimeUtils {
+    /** @hide */ public TimeUtils() {}
     private static final String TAG = "TimeUtils";
 
     /**
@@ -116,14 +117,14 @@
      * in use.  The format of the string is dependent on the underlying time zone
      * database implementation, but will typically contain the year in which the database
      * was updated plus a letter from a to z indicating changes made within that year.
-     * 
+     *
      * <p>Time zone database updates should be expected to occur periodically due to
      * political and legal changes that cannot be anticipated in advance.  Therefore,
      * when computing the UTC time for a future event, applications should be aware that
      * the results may differ following a time zone database update.  This method allows
      * applications to detect that a database change has occurred, and to recalculate any
      * cached times accordingly.
-     * 
+     *
      * <p>The time zone database may be assumed to change only when the device runtime
      * is restarted.  Therefore, it is not necessary to re-query the database version
      * during the lifetime of an activity.
@@ -134,14 +135,14 @@
 
     /** @hide Field length that can hold 999 days of time */
     public static final int HUNDRED_DAY_FIELD_LEN = 19;
-    
+
     private static final int SECONDS_PER_MINUTE = 60;
     private static final int SECONDS_PER_HOUR = 60 * 60;
     private static final int SECONDS_PER_DAY = 24 * 60 * 60;
 
     private static final Object sFormatSync = new Object();
     private static char[] sFormatStr = new char[HUNDRED_DAY_FIELD_LEN+5];
-    
+
     static private int accumField(int amt, int suffix, boolean always, int zeropad) {
         if (amt > 99 || (always && zeropad >= 3)) {
             return 3+suffix;
@@ -154,7 +155,7 @@
         }
         return 0;
     }
-    
+
     static private int printField(char[] formatStr, int amt, char suffix, int pos,
             boolean always, int zeropad) {
         if (always || amt > 0) {
@@ -178,14 +179,14 @@
         }
         return pos;
     }
-    
+
     private static int formatDurationLocked(long duration, int fieldLen) {
         if (sFormatStr.length < fieldLen) {
             sFormatStr = new char[fieldLen];
         }
-        
+
         char[] formatStr = sFormatStr;
-        
+
         if (duration == 0) {
             int pos = 0;
             fieldLen -= 1;
@@ -195,7 +196,7 @@
             formatStr[pos] = '0';
             return pos+1;
         }
-        
+
         char prefix;
         if (duration > 0) {
             prefix = '+';
@@ -222,7 +223,7 @@
         }
 
         int pos = 0;
-        
+
         if (fieldLen != 0) {
             int myLen = accumField(days, 1, false, 0);
             myLen += accumField(hours, 1, myLen > 0, 2);
@@ -235,10 +236,10 @@
                 myLen++;
             }
         }
-        
+
         formatStr[pos] = prefix;
         pos++;
-        
+
         int start = pos;
         boolean zeropad = fieldLen != 0;
         pos = printField(formatStr, days, 'd', pos, false, 0);
@@ -249,7 +250,7 @@
         formatStr[pos] = 's';
         return pos + 1;
     }
-    
+
     /** @hide Just for debugging; not internationalized. */
     public static void formatDuration(long duration, StringBuilder builder) {
         synchronized (sFormatSync) {
@@ -270,7 +271,7 @@
     public static void formatDuration(long duration, PrintWriter pw) {
         formatDuration(duration, pw, 0);
     }
-    
+
     /** @hide Just for debugging; not internationalized. */
     public static void formatDuration(long time, long now, PrintWriter pw) {
         if (time == 0) {
diff --git a/core/java/android/util/Xml.java b/core/java/android/util/Xml.java
index 873a218..b0c33e5 100644
--- a/core/java/android/util/Xml.java
+++ b/core/java/android/util/Xml.java
@@ -38,6 +38,7 @@
  * XML utility methods.
  */
 public class Xml {
+    /** @hide */ public Xml() {}
 
     /**
      * {@link org.xmlpull.v1.XmlPullParser} "relaxed" feature name.
@@ -156,21 +157,21 @@
         }
         throw new UnsupportedEncodingException(encodingName);
     }
-    
+
     /**
      * Return an AttributeSet interface for use with the given XmlPullParser.
      * If the given parser itself implements AttributeSet, that implementation
      * is simply returned.  Otherwise a wrapper class is
      * instantiated on top of the XmlPullParser, as a proxy for retrieving its
      * attributes, and returned to you.
-     * 
+     *
      * @param parser The existing parser for which you would like an
      *               AttributeSet.
-     * 
+     *
      * @return An AttributeSet you can use to retrieve the
      *         attribute values at each of the tags as the parser moves
      *         through its XML document.
-     *         
+     *
      * @see AttributeSet
      */
     public static AttributeSet asAttributeSet(XmlPullParser parser) {
diff --git a/docs/html/guide/developing/projects/index.jd b/docs/html/guide/developing/projects/index.jd
index e27fcb4..273a405 100644
--- a/docs/html/guide/developing/projects/index.jd
+++ b/docs/html/guide/developing/projects/index.jd
@@ -10,11 +10,13 @@
 
         <li><a href="#LibraryProjects">Library Projects</a>
           <ol>
-            <li><a href="#libraryMigrating">Migrating library projects to ADT 0.9.8 or higher</a></li>
+            <li><a href="#considerations">Development considerations</a></li>
           </ol>
         </li>
 
         <li><a href="#TestProjects">Test Projects</a></li>
+        
+        <li><a href="#testing">Testing a Library Project</a></li>
       </ol>
     </div>
   </div>
@@ -210,6 +212,11 @@
     and, at build time, include its compiled sources in their <code>.apk</code> files. Multiple
     application projects can reference the same library project and any single application project
     can reference multiple library projects.</p>
+        
+    <p class="note"><strong>Note:</strong> You need SDK Tools r8 or newer to fully support library projects
+    for all Android platform versions. You can download the tools and platforms using the
+    <em>Android SDK and AVD Manager</em>, as described in
+    <a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</p>
 
     <p>If you have source code and resources that are common to multiple Android projects, you
     can move them to a library project so that it is easier to maintain across applications and
@@ -262,84 +269,11 @@
     the application. However, note that a library can import an external library (JAR) in the
     normal way.</p>
 
-  <h3 id="libraryReqts">Development requirements</h3>
-
-  <p>Android library projects are a build-time construct, so you can use them to build a final
-  application <code>.apk</code> that targets any API level and is compiled against any version of
-  the Android library.</p>
-
-  <p>However, to use library projects, you need to update your development environment to use the
-  latest tools and platforms, since older releases of the tools and platforms do not support
-  building with library projects. Specifically, you need to download and install the versions
-  listed below:</p>
-
-  <p class="table-caption"><strong>Table 1.</strong> Minimum versions of SDK tools and platforms on
-  which you can develop library projects.</p>
-
-  <table>
-    <tr>
-      <th>Component</th>
-
-      <th>Minimum Version</th>
-    </tr>
-
-    <tr>
-      <td>SDK Tools</td>
-
-      <td>r6 (or higher)</td>
-    </tr>
-
-    <tr>
-      <td>Android 2.2 platform</td>
-
-      <td>r1 (or higher)</td>
-    </tr>
-
-    <tr>
-      <td>Android 2.1 platform</td>
-
-      <td>r2 (or higher)</td>
-    </tr>
-
-    <tr>
-      <td style="color:gray">Android 2.0.1 platform</td>
-
-      <td style="color:gray"><em>not supported</em></td>
-    </tr>
-
-    <tr>
-      <td style="color:gray">Android 2.0 platform</td>
-
-      <td style="color:gray"><em>not supported</em></td>
-    </tr>
-
-    <tr>
-      <td>Android 1.6 platform</td>
-
-      <td>r3 (or higher)</td>
-    </tr>
-
-    <tr>
-      <td>Android 1.5 platform</td>
-
-      <td>r4 (or higher)</td>
-    </tr>
-
-    <tr>
-      <td>ADT Plugin</td>
-
-      <td>0.9.7 (or higher)</td>
-    </tr>
-  </table>
-
-  <p>You can download the tools and platforms using the <em>Android SDK and AVD Manager</em>, as
-  described in <a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</p>
-
   <h3 id="considerations">Development considerations</h3>
 
   <p>As you develop your library project and dependent applications, keep the points listed below
   in mind:</p>
-  
+
   <ul>
   <li><p><strong>Resource conflicts</strong></p>
   <p>Since the tools merge the resources of a library project with those of a dependent application
@@ -359,10 +293,7 @@
 
   <p>A library cannot be distributed as a binary file (such as a jar file). This is because the
   library project is compiled by the main project to use the correct resource IDs.</p></li>
-  <li><p><strong>One library project cannot reference another</strong></p>
 
-  <p>A library cannot depend on another library</p></li>
-  
   <li><p><strong>A library project can include a JAR library</strong></p>
 
   <p>You can develop a library project that itself includes a JAR library, however you need to
@@ -377,11 +308,7 @@
   files, in a <a href=
   "{@docRoot}guide/topics/manifest/uses-library-element.html"><code>&lt;uses-library&gt;</code></a>
   element.</p></li>
-  <li><p><strong>Library project cannot include AIDL files</strong></p>
 
-  <p>The tools do not support the use of AIDL files in a library project. Any AIDL files used by an
-  application must be stored in the application project itself.</p></li>
-  
   <li> <p><strong>Library projects cannot include raw assets</strong></p>
 
   <p>The tools do not support the use of raw asset files (saved in the <code>assets/</code> directory)
@@ -421,82 +348,6 @@
   project by a relative link. What is important is that the main
   project can reference the library project through a relative link.</p></li>
   </ul>
-  
-  
-  
-  <h3 id="libraryMigrating">Migrating library projects to ADT 0.9.8 or higher</h3> 
- 
-<p>This section provides information about how to migrate a library project
-created with ADT 0.9.7 to ADT 0.9.8 or higher. The migration is needed only if
-you are developing in Eclipse with ADT and assumes that you have also upgraded
-to SDK Tools r7 (or higher). </p> 
- 
-<p>The way that ADT handles library projects has changed between
-ADT 0.9.7 and ADT 0.9.8. Specifically, in ADT 0.9.7, the <code>src/</code> 
-source folder of the library was linked into the dependent application project
-as a folder that had the same name as the library project. This worked because
-of two restrictions on the library projects:</p> 
- 
-<ul> 
-<li>The library was only able to contain a single source folder (excluding the
-special <code>gen/</code> source folder), and</li> 
-<li>The source folder was required to have the name <code>src/</code> and be
-stored at the root of the project.</li> 
-</ul> 
- 
-<p>In ADT 0.9.8, both of those restrictions were removed. A library project can
-have as many source folders as needed and each can have any name. Additionally,
-a library project can store source folders in any location of the project. For
-example, you could store sources in a <code>src/java/</code> directory. In order
-to support this, the name of the linked source folders in the main project are
-now called &lt;library-name&gt;_&lt;folder-name&gt; For
-example: <code>MyLibrary_src/</code> or <code>MyLibrary_src_java/</code>.</p> 
- 
-<p>Additionally, the linking process now flags those folders in order for ADT to
-recognize that it created them. This will allow ADT to automatically migrate the
-project to new versions of ADT, should they contain changes to the handling of
-library projects. ADT 0.9.7 did not flag the linked source folders, so ADT 0.9.8
-cannot be sure whether the old linked folders can be removed safely. After
-upgrading ADT to 0.9.8, you will need to remove the old linked folders manually
-in a simple two-step process, as described below.</p> 
- 
-<p>Before you begin, make sure to create a backup copy of your application or
-save the latest version to your code version control system. This ensures that
-you will be able to easily revert the migration changes in case there is a
-problem in your environment.</p> 
- 
-<p>When you first upgrade to ADT 0.9.8, your main project will look as shown
-in figure 1, with two linked folders (in this example, <code>MyLibrary</code> and
-<code>MyLibrary_src</code> &mdash; both of which link to
-<code>MyLibrary/src</code>. Eclipse shows an error on one of them because they
-are duplicate links to a single class.</p> 
- 
-<img src="{@docRoot}images/developing/lib-migration-0.png" alt=""> 
-<p class="img-caption"><strong>Figure 1.</strong> Library project migration error</p>
-<p>To fix the error, remove the linked folder that <em>does not</em> contain the
-<code>_src</code> suffix. </p> 
- 
-<ol> 
-<li>Right click the folder that you want to remove (in this case, the
-<code>MyLibrary</code> folder) and choose <strong>Build Path</strong> &gt;
-<strong>Remove from Build Path</strong>, as shown in figure 2.</li> 
- 
-<img src="{@docRoot}images/developing/lib-migration-1.png" style="height:600px"
-alt=""> 
-<p class="img-caption"><strong>Figure 2.</strong> Remove from Build Path menu item</p>
- 
-<li>Next, when asked about unlinking the folder from the project, select
-<strong>Yes</strong>, as shown in figure 3.</li> 
- 
-<img src="{@docRoot}images/developing/lib-migration-2.png" alt=""> 
-
-<p class="img-caption"><strong>Figure 3.</strong> Unlink folder confirmation window</p>
-</ol> 
- 
-<p>This should resolve the error and migrate your library project to the new
-ADT environment. </p> 
- 
-  
 
   <h2 id="TestProjects">Test Projects</h2>
 
@@ -556,7 +407,7 @@
   "{@docRoot}guide/developing/testing/index.html">Testing</a> section.
 
 
-  <h2>Testing a library project</h2>
+  <h2 id="testing">Testing a Library Project</h2>
 
   <p>There are two recommended ways of setting up testing on code and resources in a library
   project:</p>
diff --git a/docs/html/guide/topics/nfc/index.jd b/docs/html/guide/topics/nfc/index.jd
index c4917b4..f907b70 100644
--- a/docs/html/guide/topics/nfc/index.jd
+++ b/docs/html/guide/topics/nfc/index.jd
@@ -14,17 +14,17 @@
           <a href="#dispatch">The Tag Dispatch System</a>
 
           <ol>
-            <li><a href="#foreground-dispatch">Using the foreground dispatch system</a></li>
-
             <li><a href="#intent-dispatch">Using the intent dispatch system</a></li>
+            
+            <li><a href="#foreground-dispatch">Using the foreground dispatch system</a></li>
           </ol>
         </li>
 
-        <li><a href="#ndef">NDEF messages</a></li>
+        <li><a href="#ndef">NDEF Messages</a></li>
 
-        <li><a href="#read">Reading an NFC tag</a></li>
+        <li><a href="#read">Reading an NFC Tag</a></li>
 
-        <li><a href="#write">Writing to an NFC tag</a></li>
+        <li><a href="#write">Writing to an NFC Tag</a></li>
 
         <li><a href="#p2p">Peer to Peer Data Exchange</a></li>
       </ol>
@@ -32,32 +32,29 @@
   </div>
 
   <p>Near Field Communication (NFC) is a set of short-range wireless technologies, typically
-  requiring a distance of 4cm or less. NFC operates at 13.56mhz, and at rates ranging
-  from 106 kbit/s to 848 kbit/s. NFC communication always involves an initiator and a target.
-  The initiator actively generates an RF field that can power a passive target. This
-  enables NFC targets to take very simple form factors such as tags, stickers or cards that do
-  not require power. NFC peer-to-peer communication is also possible, where both devices
-  are powered.
-  <p>
-  Compared to other wireless technologies such as Bluetooth or WiFi, NFC provides much lower
-  bandwidth and range, but enables low-cost, un-powered targets
-  and does not require discovery or pairing. Interactions can be initiated with just a tap.
-  <p>
-  An Android device with NFC hardware will typically act as an initiator when the screen is
-  on. This mode is also known as NFC reader/writer. It will actively look for NFC tags and start
-  activities to handle them. Android 2.3.3 also has some limited P2P support.
-  <p>
-  Tags can range in complexity, simple tags just offer read/write semantics, sometimes
-  with one-time-programmable areas to make the card read-only. More complex tags offer
-  math operations, and have cryptographic hardware to authenticate access to a sector.
-  The most sophisticated tags contain operating environments, allowing
-  complex interactions with code executing on the tag.
+  requiring a distance of 4cm or less. NFC operates at 13.56mhz, and at rates ranging from 106
+  kbit/s to 848 kbit/s. NFC communication always involves an initiator and a target. The initiator
+  actively generates an RF field that can power a passive target. This enables NFC targets to take
+  very simple form factors such as tags, stickers or cards that do not require power. NFC
+  peer-to-peer communication is also possible, where both devices are powered.</p>
+
+  <p>Compared to other wireless technologies such as Bluetooth or WiFi, NFC provides much lower
+  bandwidth and range, but enables low-cost, un-powered targets and does not require discovery or
+  pairing. Interactions can be initiated with just a tap.</p>
+
+  <p>An Android device with NFC hardware will typically act as an initiator when the screen is on.
+  This mode is also known as NFC reader/writer. It will actively look for NFC tags and start
+  activities to handle them. Android 2.3.3 also has some limited P2P support.</p>
+
+  <p>Tags can range in complexity, simple tags just offer read/write semantics, sometimes with
+  one-time-programmable areas to make the card read-only. More complex tags offer math operations,
+  and have cryptographic hardware to authenticate access to a sector. The most sophisticated tags
+  contain operating environments, allowing complex interactions with code executing on the tag.</p>
 
   <h2 id="api">API Overview</h2>
 
-  <p>The {@link android.nfc} package contains the high-level classes to interact
-  with the local device's NFC adapter, to represent discovered tags, and to use
-  the NDEF data format.
+  <p>The {@link android.nfc} package contains the high-level classes to interact with the local
+  device's NFC adapter, to represent discovered tags, and to use the NDEF data format.</p>
 
   <table>
     <tr>
@@ -69,52 +66,44 @@
     <tr>
       <td>{@link android.nfc.NfcManager}</td>
 
-
-      <td>A high level manager class that enumerates the NFC adapters on this Android device.
-      Since most Android devices only have one NFC adapter, you can just use the static helper
-      {@link android.nfc.NfcAdapter#getDefaultAdapter(Context)} for most situations.</td>
+      <td>A high level manager class that enumerates the NFC adapters on this Android device. Since
+      most Android devices only have one NFC adapter, you can just use the static helper {@link
+      android.nfc.NfcAdapter#getDefaultAdapter(Context)} for most situations.</td>
     </tr>
 
     <tr>
       <td>{@link android.nfc.NfcAdapter}</td>
 
-      <td>Represents the local NFC adapter. Defines the intent's used to request
-      tag dispatch to your activity, and provides methods to register for foreground
-      tag dispatch and foreground NDEF push. Foreground NDEF push is the only
-      peer-to-peer support that is currently provided in Android.</td>
+      <td>Represents the local NFC adapter. Defines the intent's used to request tag dispatch to
+      your activity, and provides methods to register for foreground tag dispatch and foreground
+      NDEF push. Foreground NDEF push is the only peer-to-peer support that is currently provided
+      in Android.</td>
     </tr>
 
     <tr>
       <td>{@link android.nfc.NdefMessage} and {@link android.nfc.NdefRecord}</td>
 
-      <td>NDEF is an NFC Forum defined data structure, designed to efficiently
-      store data on NFC tags, such as text, URL's, and other MIME types. A
-      {@link android.nfc.NdefMessage} acts as a
+      <td>NDEF is an NFC Forum defined data structure, designed to efficiently store data on NFC
+      tags, such as text, URL's, and other MIME types. A {@link android.nfc.NdefMessage} acts as a
       container for the data that you want to transmit or read. One {@link android.nfc.NdefMessage}
-      object contains zero or more {@link android.nfc.NdefRecord}s. Each NDEF record
-      has a type such as text, URL, smart poster, or any MIME data. The type of the
-      first NDEF record in the NDEF message is used to dispatch a tag to an activity
-      on Android.</td>
+      object contains zero or more {@link android.nfc.NdefRecord}s. Each NDEF record has a type
+      such as text, URL, smart poster, or any MIME data. The type of the first NDEF record in the
+      NDEF message is used to dispatch a tag to an activity on Android.</td>
     </tr>
 
     <tr>
       <td>{@link android.nfc.Tag}</td>
 
-      <td>Represents a passive NFC target. These can come in many form factors such as
-      a tag, card, key fob, or even a phone doing card emulation. When a tag is
-      discovered, a {@link android.nfc.Tag} object is created and wrapped inside an
-      Intent. The NFC dispatch system sends the intent to a compatible actvitiy
-      using <code>startActivity()</code>. You can use the {@link
-      android.nfc.Tag#getTechList getTechList()} method to determine the technologies supported by
-      this tag and create the corresponding {@link android.nfc.tech.TagTechnology} object with one
-      of classes provided by {@link android.nfc.tech}.</td>
+      <td>Represents a passive NFC target. These can come in many form factors such as a tag, card,
+      key fob, or even a phone doing card emulation. When a tag is discovered, a {@link
+      android.nfc.Tag} object is created and wrapped inside an Intent. The NFC dispatch system
+      sends the intent to a compatible activity using <code>startActivity()</code>. You can use the
+      {@link android.nfc.Tag#getTechList getTechList()} method to determine the technologies
+      supported by this tag and create the corresponding {@link android.nfc.tech.TagTechnology}
+      object with one of classes provided by {@link android.nfc.tech}.</td>
     </tr>
   </table>
 
-  <p>The {@link android.nfc.tech} package contains classes to query properties
-  and perform I/O operations on a tag. The classes are divided to represent different
-  NFC technologies that can be available on a tag.
-
   <p>The {@link android.nfc.tech} package contains classes to query properties and perform I/O
   operations on a tag. The classes are divided to represent different NFC technologies that can be
   available on a Tag:</p>
@@ -165,28 +154,28 @@
     <tr>
       <td>{@link android.nfc.tech.Ndef}</td>
 
-      <td>Provides access to NDEF data and operations on NFC tags that have been formatted as NDEF.
-      </td>
+      <td>Provides access to NDEF data and operations on NFC tags that have been formatted as
+      NDEF.</td>
     </tr>
 
     <tr>
       <td>{@link android.nfc.tech.NdefFormatable}</td>
 
-      <td>Provides a format operations for tags that may be NDEF formatable.</td>
+      <td>Provides a format operations for tags that may be NDEF formattable.</td>
     </tr>
 
     <tr>
       <td>{@link android.nfc.tech.MifareClassic}</td>
 
-      <td>Provides access to MIFARE Classic properties and I/O operations, if this
-      Android device supports MIFARE.</td>
+      <td>Provides access to MIFARE Classic properties and I/O operations, if this Android device
+      supports MIFARE.</td>
     </tr>
 
     <tr>
       <td>{@link android.nfc.tech.MifareUltralight}</td>
 
-      <td>Provides access to MIFARE Ultralight properties and I/O operations, if this
-      Android device supports MIFARE.</td>
+      <td>Provides access to MIFARE Ultralight properties and I/O operations, if this Android
+      device supports MIFARE.</td>
     </tr>
   </table>
 
@@ -203,12 +192,11 @@
     </li>
 
     <li>The minimum SDK version that your application can support. API level 9 only supports
-    limited tag dispatch via {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED},
-    and only gives access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES}
-    extra. No other tag properties or I/O operations are accessible. You probably want
-    to use API level 10 which includes comprehensive reader/writer support.
-
-<pre class="pretty-print">
+    limited tag dispatch via {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, and only gives
+    access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} extra. No
+    other tag properties or I/O operations are accessible. You probably want to use API level 10
+    which includes comprehensive reader/writer support.
+      <pre class="pretty-print">
 &lt;uses-sdk android:minSdkVersion="10"/&gt;
 </pre>
     </li>
@@ -252,7 +240,7 @@
   <h2 id="dispatch">The Tag Dispatch System</h2>
 
   <p>When an Android device scans an NFC tag, the desired behavior is to have the most appropriate
-  Activity handle the intent without asking the user what appplication to use. Because devices scan
+  Activity handle the intent without asking the user what application to use. Because devices scan
   NFC tags at a very short range, it is likely that making users manually select an Activity forces
   them to move the device away from the tag and break the connection. You should develop your
   Activity to only handle the NFC tags that your Activity cares about to prevent the Activity
@@ -314,12 +302,18 @@
 
   <p>If your Activity declares the <code>android.nfc.action.TECH_DISCOVERED</code> intent in your
   <code>AndroidManifest.xml</code> file, you must create an XML resource file that specifies the
-  technologies that your Activity supports. The following sample defines all of the technologies.
-  Specifiying multiple technologies within the same list tells the system
-  to filter tags that support all of the technologies. The example below never filters a tag
-  because no tag supports all of the technologies at once.
-  You can remove the ones that you do not need. Save this file (you can name it anything you wish)
-  in the <code>&lt;project-root&gt;/res/xml</code> folder.</p>
+  technologies that your Activity supports within a <code>tech-list</code> set. Your Activity is
+  considered a match if a <code>tech-list</code> set is a subset of the technologies that are
+  supported by the tag, which you can obtain by calling {@link android.nfc.Tag#getTechList
+  getTechList()}.</p>
+
+  <p>For example, if the tag that is scanned supports MifareClassic, NdefFormatable, and NfcA, your
+  <code>tech-list</code> set must specify all three, two, or one of the technologies (and nothing
+  else) in order for your Activity to be matched.</p>
+
+  <p>The following sample defines all of the technologies. You can remove the ones that you do not
+  need. Save this file (you can name it anything you wish) in the
+  <code>&lt;project-root&gt;/res/xml</code> folder.</p>
   <pre>
 &lt;resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"&gt;
     &lt;tech-list&gt;
@@ -336,12 +330,13 @@
 &lt;/resources&gt;
 </pre>
 
-You can also specify multiple filter lists. In this case, a tag must match all of the
-technologies within one of the lists. The following example filters for
-cards that support the NfcA and Ndef technology or support the
-NfcB and Ndef technology.
-
-<pre>
+  <p>You can also specify multiple <code>tech-list</code> sets. Each of the <code>tech-list</code>
+  sets is considered independently, and your Activity is considered a match if any single
+  <code>tech-list</code> set is a subset of the technologies that are returned by {@link
+  android.nfc.Tag#getTechList getTechList()}. This provides <code>AND</code> and <code>OR</code>
+  semantics for matching technologies. The following example matches tags that can support the
+  NfcA and Ndef technologies or can support the NfcB and Ndef technologies:</p>
+  <pre>
 &lt;resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"&gt;
     &lt;tech-list&gt;
         &lt;tech&gt;android.nfc.tech.NfcA&lt;/tech&gt;        
@@ -358,14 +353,19 @@
 </pre>
 
   <p>In your <code>AndroidManifest.xml</code> file, specify the resource file that you just created
-  in the <code>&lt;meta-data&gt;</code> element inside the <code>&lt;intent-filter&gt;</code>
+  in the <code>&lt;meta-data&gt;</code> element inside the <code>&lt;activity&gt;</code>
   element like in the following example:</p>
   <pre>
+&lt;activity&gt;
+...
 &lt;intent-filter&gt;
     &lt;action android:name="android.nfc.action.TECH_DISCOVERED"/&gt;
-    &lt;meta-data android:name="android.nfc.action.TECH_DISCOVERED"
-        android:resource="@xml/nfc_tech_filter.xml" /&gt;
 &lt;/intent-filter&gt;
+
+&lt;meta-data android:name="android.nfc.action.TECH_DISCOVERED"
+    android:resource="@xml/nfc_tech_filter" /&gt;
+...
+&lt;/activity&gt;
 </pre>
 
   <h3 id="foreground-dispatch">Using the foreground dispatch system</h3>
@@ -391,9 +391,9 @@
         dispatch system checks the specified intent filters with the intent that is received when
         the device scans a tag. If they match, then your application handles the intent. If it does
         not match, the foreground dispatch system falls back to the intent dispatch system.
-        Specifying a <code>null</code> array of intent filters and for the technology filters,
-        you receive a <code>TAG_DISCOVERED</code> intent for all tags discovered. Note that the
-        snippet below handles all MIME types. You should only handle the ones that you need.
+        Specifying a <code>null</code> array of intent filters and for the technology filters, you
+        receive a <code>TAG_DISCOVERED</code> intent for all tags discovered. Note that the snippet
+        below handles all MIME types. You should only handle the ones that you need.
           <pre>
     IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
         try {
@@ -424,7 +424,7 @@
     <li>Override the following Activity lifecycle callbacks and add logic to enable and disable the
     foreground dispatch when the Activity loses ({@link android.app.Activity#onPause onPause()})
     and regains ({@link android.app.Activity#onResume onResume()}) focus. {@link
-    android.nfc.NfcAdapter#enableForegroundDispatch} must best called from the main thread and only
+    android.nfc.NfcAdapter#enableForegroundDispatch} must be called from the main thread and only
     when the activity is in the foreground (calling in {@link android.app.Activity#onResume
     onResume()} guarantees this). You also need to implement the {@link
     android.app.Activity#onNewIntent onNewIntent} callback to process the data from the scanned NFC
@@ -452,7 +452,7 @@
   "{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.html">ForegroundDispatch</a>
   sample from API Demos for the complete sample.</p>
 
-  <h2 id="ndef">Working with Data on NFC tags</h2>
+  <h2 id="ndef">Working with Data on NFC Tags</h2>
 
   <p>Data on NFC tags are encoded in raw bytes, so you must convert the bytes to something human
   readable if you are presenting the data to the user. When writing to NFC tags, you must write
@@ -462,7 +462,7 @@
   Android NFC devices if you are writing to tags. However, many tag technologies use their own
   standard for storing data and are supported by Android as well, but you have to implement your
   own protocol stack to read and write to these tags. You can find a full list of the supported
-  technologies in {@link android.nfc.tech} and an overview of the technolgies in the {@link
+  technologies in {@link android.nfc.tech} and an overview of the technologies in the {@link
   android.nfc.tech.TagTechnology} interface. This section is a brief overview of how to work with
   NDEF messages in the context of the Android system. It is not meant to be a complete discussion
   of the NDEF specification, but highlights the main things that you need to be aware of when
@@ -477,8 +477,8 @@
   {@link android.nfc.NdefMessage}. The size constraint of the NFC tag determines how big your
   {@link android.nfc.NdefMessage} can be.</p>
 
-  <p>Tags that support the {@link android.nfc.tech.Ndef} and {@link android.nfc.tech.NdefFormatable}
-  technologies return and accept {@link android.nfc.NdefMessage}
+  <p>Tags that support the {@link android.nfc.tech.Ndef} and {@link
+  android.nfc.tech.NdefFormatable} technologies return and accept {@link android.nfc.NdefMessage}
   objects as parameters for read and write operations. You need to create your own logic to read
   and write bytes for other tag technologies in {@link android.nfc.tech}.</p>
 
@@ -488,7 +488,7 @@
   "{@docRoot}resources/samples/NFCDemo/src/com/example/android/nfc/simulator/MockNdefMessages.html">
   plain text and SmartPoster NDEF messages.</a></p>
 
-  <h2 id="read">Reading an NFC tag</h2>
+  <h2 id="read">Reading an NFC Tag</h2>
 
   <p>When a device comes in proximity to an NFC tag, the appropriate intent is started on the
   device, notifying interested applications that a NFC tag was scanned. By previously declaring the
@@ -532,7 +532,7 @@
   <code>com.example.android.nfc.record</code> of the NFCDemo sample show you how to parse some
   common types of NDEF messages such as plain text or a SmartPoster.</p>
 
-  <h2 id="write">Writing to an NFC tag</h2>
+  <h2 id="write">Writing to an NFC Tag</h2>
 
   <p>Writing to an NFC tag involves constructing your NDEF message in bytes and using the
   appropriate tag technology for the tag that you are writing to. The following code sample shows
@@ -558,7 +558,7 @@
 }
 </pre>
 
-  <h2 id="p2p">Peer-to-peer data exchange</h2>
+  <h2 id="p2p">Peer-to-Peer Data Exchange</h2>
 
   <p>Support for simple peer-to-peer data exchange is supported by the foreground push feature,
   which is enabled with the {@link android.nfc.NfcAdapter#enableForegroundNdefPush} method. To use
@@ -572,7 +572,6 @@
 
     <li>The NFC device that is receiving the pushed data (the scanned device) must support the
     <code>com.android.npp</code> NDEF push protocol, which is optional for Android devices.</li>
-</li>
   </ul>
 
   <p class="note">If your Activity enables the foreground push feature and is in the foreground,
@@ -610,4 +609,4 @@
   <p>When the Activity is in the foreground, you can now tap the device to another device and push
   the data to it. See the <a href=
   "../../../resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundNdefPush.html">ForegroundNdefPush</a>
-  sample in API Demos for a simple example of peer-to-peer data exchange.</p>
+  sample in API Demos for a simple example of peer-to-peer data exchange.</p>
\ No newline at end of file
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h
index 9b0e7d8..f355087 100644
--- a/include/utils/RefBase.h
+++ b/include/utils/RefBase.h
@@ -425,8 +425,11 @@
 template<typename T>
 sp<T> wp<T>::promote() const
 {
-    T* p = (m_ptr && m_refs->attemptIncStrong(this)) ? m_ptr : 0;
-    return sp<T>(p, true);
+    sp<T> result;
+    if (m_ptr && m_refs->attemptIncStrong(&result)) {
+        result.set_pointer(m_ptr);
+    }
+    return result;
 }
 
 template<typename T>
diff --git a/include/utils/StrongPointer.h b/include/utils/StrongPointer.h
index 5daccf4..a8c9897 100644
--- a/include/utils/StrongPointer.h
+++ b/include/utils/StrongPointer.h
@@ -104,11 +104,8 @@
 private:    
     template<typename Y> friend class sp;
     template<typename Y> friend class wp;
-
-    // Optimization for wp::promote().
-    sp(T* p, bool);
-
-    T*              m_ptr;
+    void set_pointer(T* ptr);
+    T* m_ptr;
 };
 
 #undef COMPARE
@@ -206,10 +203,9 @@
 }
 
 template<typename T>
-sp<T>::sp(T* p, bool)
-: m_ptr(p)
-  {
-  }
+void sp<T>::set_pointer(T* ptr) {
+    m_ptr = ptr;
+}
 
 template <typename T>
 inline TextOutput& operator<<(TextOutput& to, const sp<T>& val)
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 0f22bea..367c627 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -44,7 +44,9 @@
 
     mCache.setOnEntryRemovedListener(NULL);
     for (size_t i = 0; i < pathsToRemove.size(); i++) {
-        mCache.removeAt(pathsToRemove.itemAt(i));
+        // This will work because pathsToRemove is sorted
+        // and because the cache is a sorted keyed vector
+        mCache.removeAt(pathsToRemove.itemAt(i) - i);
     }
     mCache.setOnEntryRemovedListener(this);
 }
diff --git a/voip/java/android/net/sip/SipAudioCall.java b/voip/java/android/net/sip/SipAudioCall.java
index 90d286d..b46f8268 100644
--- a/voip/java/android/net/sip/SipAudioCall.java
+++ b/voip/java/android/net/sip/SipAudioCall.java
@@ -754,7 +754,6 @@
     }
 
     private void grabWifiHighPerfLock() {
-        /* not available in master yet
         if (mWifiHighPerfLock == null) {
             Log.v(TAG, "acquire wifi high perf lock");
             mWifiHighPerfLock = ((WifiManager)
@@ -762,7 +761,6 @@
                     .createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, TAG);
             mWifiHighPerfLock.acquire();
         }
-        */
     }
 
     private void releaseWifiHighPerfLock() {