docs: Fix a bunch of issues

External tracker 42609
External tracker 42607
External tracker 42604
External tracker 42600
External tracker 42574
External tracker 42450
External tracker 41050
External tracker 40995
External tracker 40970
External tracker 40935
External tracker 40507
External tracker 40481
External tracker 40435
External tracker 40406
External tracker 40297
External tracker 40281
External tracker 39978
External tracker 39929
External tracker 39803
External tracker 39715
External tracker 39441

Change-Id: If4215cef850ba8e4e8df356a68192566806e7914
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index 6ab2bd1..10d5e25 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -90,7 +90,7 @@
 
     /**
      * Special theme constant for {@link #AlertDialog(Context, int)}: use
-     * the device's default alert theme with a dark background.
+     * the device's default alert theme with a light background.
      */
     public static final int THEME_DEVICE_DEFAULT_LIGHT = 5;
     
diff --git a/core/java/android/app/admin/DeviceAdminInfo.java b/core/java/android/app/admin/DeviceAdminInfo.java
index b351811..66fc816 100644
--- a/core/java/android/app/admin/DeviceAdminInfo.java
+++ b/core/java/android/app/admin/DeviceAdminInfo.java
@@ -139,9 +139,9 @@
     public static final int USES_POLICY_DISABLE_CAMERA = 8;
 
     /**
-     * A type of policy that this device admin can use: disables use of keyguard widgets.
+     * A type of policy that this device admin can use: disables use of keyguard features.
      *
-     * <p>To control this policy, the device admin must have a "disable-keyguard-widgets"
+     * <p>To control this policy, the device admin must have a "disable-keyguard-features"
      * tag in the "uses-policies" section of its meta-data.
      */
     public static final int USES_POLICY_DISABLE_KEYGUARD_FEATURES = 9;
diff --git a/core/java/android/content/BroadcastReceiver.java b/core/java/android/content/BroadcastReceiver.java
index 1500b00..4f42d50 100644
--- a/core/java/android/content/BroadcastReceiver.java
+++ b/core/java/android/content/BroadcastReceiver.java
@@ -117,7 +117,7 @@
  *
  * <ul>
  * <li><p>The Intent namespace is global.  Make sure that Intent action names and
- * other strings are written in a namespace you own, or else you may inadvertantly
+ * other strings are written in a namespace you own, or else you may inadvertently
  * conflict with other applications.
  * <li><p>When you use {@link Context#registerReceiver(BroadcastReceiver, IntentFilter)},
  * <em>any</em> application may send broadcasts to that registered receiver.  You can
diff --git a/core/java/android/hardware/SensorEventListener.java b/core/java/android/hardware/SensorEventListener.java
index 716d0d4..677d244 100644
--- a/core/java/android/hardware/SensorEventListener.java
+++ b/core/java/android/hardware/SensorEventListener.java
@@ -30,7 +30,7 @@
      * 
      * <p><b>NOTE:</b> The application doesn't own the
      * {@link android.hardware.SensorEvent event}
-     * object passed as a parameter and therefore cannot hold on o it.
+     * object passed as a parameter and therefore cannot hold on to it.
      * The object may be part of an internal pool and may be reused by
      * the framework.
      *
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 5b49ba3..8f54a38 100755
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -4695,7 +4695,8 @@
          * The content:// style URI for this table. Append the phone number you want to lookup
          * to this URI and query it to perform a lookup. For example:
          * <pre>
-         * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_URI, Uri.encode(phoneNumber));
+         * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
+         *         Uri.encode(phoneNumber));
          * </pre>
          */
         public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(AUTHORITY_URI,
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index b71649a..1460737 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -42,7 +42,7 @@
 
 /**
  * <p>A popup window that can be used to display an arbitrary view. The popup
- * windows is a floating container that appears on top of the current
+ * window is a floating container that appears on top of the current
  * activity.</p>
  * 
  * @see android.widget.AutoCompleteTextView
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 447daab..0cdc448 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3501,7 +3501,7 @@
         <attr name="calendarViewShown" format="boolean" />
         <!-- The minimal date shown by this calendar view in mm/dd/yyyy format. -->
         <attr name="minDate" format="string" />
-        <!-- The minimal date shown by this calendar view in mm/dd/yyyy format. -->
+        <!-- The maximal date shown by this calendar view in mm/dd/yyyy format. -->
         <attr name="maxDate" format="string" />
         <!-- @hide The layout of the date picker. -->
         <attr name="internalLayout" format="reference"  />
diff --git a/docs/html/google/gcm/gcm.jd b/docs/html/google/gcm/gcm.jd
index 1762e12..f218bc2 100644
--- a/docs/html/google/gcm/gcm.jd
+++ b/docs/html/google/gcm/gcm.jd
@@ -208,9 +208,9 @@
 <p>The registration ID lasts until the Android application explicitly unregisters
 itself, or until Google refreshes the registration ID for your Android application.</p>
 
-<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only  unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents. At that point, you server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error).
+<p class="note"><strong>Note:</strong> When users uninstall an application, it is not automatically unregistered on GCM. It is only  unregistered when the GCM server tries to send a message to the device and the device answers that the application is uninstalled or it does not have a broadcast receiver configured to receive <code>com.google.android.c2dm.intent.RECEIVE</code> intents. At that point, your server should mark the device as unregistered (the server will receive a <code><a href="#unreg_device">NotRegistered</a></code> error).
   <p>
-Note that it might take a few minutes for the registration ID to be completed removed from the GCM server. So if the 3rd party server sends a message during this time, it will get a valid message ID, even though the message will not be delivered to the device.</p>
+Note that it might take a few minutes for the registration ID to be completely removed from the GCM server. So if the 3rd party server sends a message during this time, it will get a valid message ID, even though the message will not be delivered to the device.</p>
 </p>
 
 <h4 id="push-process">Sending a Message</h4>
@@ -593,7 +593,7 @@
 <ul>
   <li>Able to communicate with your client.</li>
   <li>Able to  fire off HTTPS requests to the GCM server.</li>
-  <li>Able to handle requests and resend then as needed, using <a href="http://en.wikipedia.org/wiki/Exponential_backoff">exponential back-off.</a></li>
+  <li>Able to handle requests and resend them as needed, using <a href="http://en.wikipedia.org/wiki/Exponential_backoff">exponential back-off.</a></li>
   <li>Able to store the API key and client registration IDs. The
 API key is included in the header of POST requests that send
 messages.</li>
diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
index 3f6df927..315befa 100755
--- a/docs/html/google/play/billing/billing_integrate.jd
+++ b/docs/html/google/play/billing/billing_integrate.jd
@@ -149,7 +149,7 @@
 <p>To retrieve this information from Google Play, call the {@code getSkuDetails} method on the In-app Billing Version 3 API, and pass the method the In-app Billing API version (“3”), the package name of your calling app, the purchase type (“inapp”), and the {@link android.os.Bundle} that you created.</p>
 <pre>
 Bundle skuDetails = mService.getSkuDetails(3, 
-   getPackageName(), “inapp”, querySkus);
+   getPackageName(), "inapp", querySkus);
 </pre>
 <p>If the request is successful, the returned {@link android.os.Bundle}has a response code of {@code BILLING_RESPONSE_RESULT_OK} (0).</p>
 <p class="note"><strong>Warning:</strong> Do not call the {@code getSkuDetails} method on the main thread. Calling this method triggers a network request which could block your main thread.  Instead, create a separate thread and call the {@code getSkuDetails} method from inside that thread.</p>
@@ -169,8 +169,8 @@
       JSONObject object = new JSONObject(thisResponse);
       String sku = object.getString("productId");
       String price = object.getString("price");
-      if (sku.equals(“premiumUpgrade”)) mPremiumUpgradePrice = price;
-      else if (sku.equals(“gas”)) mGasPrice = price;
+      if (sku.equals("premiumUpgrade")) mPremiumUpgradePrice = price;
+      else if (sku.equals("gas")) mGasPrice = price;
    }
 }
 </pre>
@@ -186,7 +186,7 @@
 If the request is successful, the returned {@link android.os.Bundle} has a response code of {@code BILLING_RESPONSE_RESULT_OK} (0) and a {@link android.app.PendingIntent} that you can use to start the purchase flow. To see all the possible response codes from Google Play, see <a href="{@docRoot}google/play/billing/billing_reference.html#billing-codes">In-app Billing Reference</a>. Next, extract a {@link android.app.PendingIntent} from the response {@link android.os.Bundle} with key {@code BUY_INTENT}.
 </p>
 <pre>
-PendingIntent pendingIntent = buyIntentBundle.getParcelable(“BUY_INTENT”);
+PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
 </pre>
 <p>
 To complete the purchase transaction, call the {@link android.app.Activity#startIntentSenderForResult startIntentSenderForResult} method and use the {@link android.app.PendingIntent} that you created. In this example, you are using an arbitrary value of 1001 for the request code.</p>
@@ -206,7 +206,7 @@
    "purchaseTime":1345678900000,
    "purchaseState":0,
    "developerPayload":"bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
-   “purchaseToken”:“rojeslcdyyiapnqcynkjyyjh”
+   "purchaseToken":"rojeslcdyyiapnqcynkjyyjh"
  }'
 </pre>
 </p>
@@ -217,8 +217,8 @@
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {	
    if (requestCode == 1001) {    	
       int responseCode = data.getIntExtra("RESPONSE_CODE", 0);
-      String purchaseData = data.getStringExtra(“INAPP_PURCHASE_DATA”);
-      String dataSignature = data.getStringExtra(“INAPP_DATA_SIGNATURE”);
+      String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
+      String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
         
       if (resultCode == RESULT_OK) {
          try {
@@ -240,7 +240,7 @@
 <h3 id="QueryPurchases">Querying for Purchased Items</h3>
 <p>To retrieve information about purchases made by a user from your app, call the {@code getPurchases} method on the In-app Billing Version 3 service. Pass in to the method the In-app Billing API version (“3”), the package name of your calling app, and the purchase type (“inapp”).</p>
 <pre>
-Bundle ownedItems = mService.getPurchases(3, getPackageName(), “inapp”, null);
+Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null);
 </pre>
 <p>The Google Play service returns only the purchases made by the user account that is currently logged in to the device. If the request is successful, the returned {@link android.os.Bundle} has a response code of 0. The response {@link android.os.Bundle} also contains a list of the product IDs, a list of the order details for each purchase, and the signatures for each purchase.</p>
 <p>To improve performance, the In-app Billing service returns only up to 700 products that are owned by the user when {@code getPurchase} is first called. If the user owns a large number of products, Google Play includes a String token mapped to the key {@code INAPP_CONTINUATION_TOKEN} in the response {@link android.os.Bundle} to indicate that more products can be retrieved. Your application can then make a subsequent {@code getPurchases} call, and pass in this token as an argument. Google Play continues to return a continuation token in the response {@link android.os.Bundle} until all products that are owned by the user has been sent to your app.</p>
diff --git a/docs/html/google/play/expansion-files.jd b/docs/html/google/play/expansion-files.jd
index 271c192..d2ab509 100644
--- a/docs/html/google/play/expansion-files.jd
+++ b/docs/html/google/play/expansion-files.jd
@@ -684,7 +684,7 @@
     <p>The Downloader Library includes some APIs in the {@code Helper} class to
 help with this process:</p>
   <ul>
-    <li>{@code getExtendedAPKFileName(Context, c, boolean mainFile, int
+    <li>{@code getExpansionAPKFileName(Context, c, boolean mainFile, int
 versionCode)}</li>
     <li>{@code doesFileExist(Context c, String fileName, long fileSize)}</li>
   </ul>
diff --git a/docs/html/guide/components/activities.jd b/docs/html/guide/components/activities.jd
index 36f651f..2897804 100644
--- a/docs/html/guide/components/activities.jd
+++ b/docs/html/guide/components/activities.jd
@@ -691,7 +691,7 @@
 android.app.Activity#onSaveInstanceState onSaveInstanceState()} helps save the state of the UI, if
 you override the method in order to save additional state information, you should always call the
 superclass implementation of {@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}
-before doing any work. Likewise, you should also call the supercall implementation of {@link
+before doing any work. Likewise, you should also call the superclass implementation of {@link
 android.app.Activity#onRestoreInstanceState onRestoreInstanceState()} if you override it, so the
 default implementation can restore view states.</p>
 
@@ -773,4 +773,4 @@
 enables user multitasking, continue with the <b><a
 href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back
 Stack</a></b> document.</p>
--->
\ No newline at end of file
+-->
diff --git a/docs/html/guide/components/bound-services.jd b/docs/html/guide/components/bound-services.jd
index 8d2bba5..653c7a0 100644
--- a/docs/html/guide/components/bound-services.jd
+++ b/docs/html/guide/components/bound-services.jd
@@ -578,7 +578,7 @@
 </pre>
 
 <p>With this {@link android.content.ServiceConnection}, the client can bind to a service by passing
-this it to {@link android.content.Context#bindService bindService()}. For example:</p>
+it to {@link android.content.Context#bindService bindService()}. For example:</p>
 
 <pre>
 Intent intent = new Intent(this, LocalService.class);
@@ -667,7 +667,7 @@
 and also allows binding.</p>
 
 
-<p>For more information about the lifecycle of an started service, see the <a
+<p>For more information about the lifecycle of a started service, see the <a
 href="{@docRoot}guide/components/services.html#Lifecycle">Services</a> document.</p>
 
 
diff --git a/docs/html/guide/topics/location/strategies.jd b/docs/html/guide/topics/location/strategies.jd
index f790953..404b797 100644
--- a/docs/html/guide/topics/location/strategies.jd
+++ b/docs/html/guide/topics/location/strategies.jd
@@ -202,7 +202,7 @@
 android.location.LocationManager#requestLocationUpdates requestLocationUpdates()}:</p>
 
 <pre>
-LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
+String locationProvider = LocationManager.NETWORK_PROVIDER;
 // Or, use GPS location data:
 // LocationProvider locationProvider = LocationManager.GPS_PROVIDER;
 
@@ -217,7 +217,7 @@
 should utilize a cached location by calling {@link
 android.location.LocationManager#getLastKnownLocation}:</p>
 <pre>
-LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER;
+String locationProvider = LocationManager.NETWORK_PROVIDER;
 // Or use LocationManager.GPS_PROVIDER
 
 Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
diff --git a/docs/html/guide/topics/resources/layout-resource.jd b/docs/html/guide/topics/resources/layout-resource.jd
index cd88ae9..380ab15 100644
--- a/docs/html/guide/topics/resources/layout-resource.jd
+++ b/docs/html/guide/topics/resources/layout-resource.jd
@@ -264,7 +264,7 @@
 <pre>
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
-    setContentView.(R.layout.main_activity);
+    setContentView(R.layout.main_activity);
 }
 </pre>
 </dd> <!-- end example -->
@@ -279,4 +279,4 @@
 </ul>
 </dd>
 
-</dl>
\ No newline at end of file
+</dl>
diff --git a/docs/html/guide/topics/resources/string-resource.jd b/docs/html/guide/topics/resources/string-resource.jd
index da410a4..27761e2 100644
--- a/docs/html/guide/topics/resources/string-resource.jd
+++ b/docs/html/guide/topics/resources/string-resource.jd
@@ -177,7 +177,7 @@
 
     </dd>
   <dt id="string-array-item-element"><code>&lt;item&gt;</code></dt>
-    <dd>A string, which can include styling tags. The value can be a referenced to another
+    <dd>A string, which can include styling tags. The value can be a reference to another
 string resource. Must be a child of a {@code &lt;string-array&gt;} element. Beware that you
 must escape apostrophes and
 quotation marks. See <a href="#FormattingAndStyling">Formatting and Styling</a>, below, for
diff --git a/docs/html/tools/extras/oem-usb.jd b/docs/html/tools/extras/oem-usb.jd
index 005ba29..9e3c709 100644
--- a/docs/html/tools/extras/oem-usb.jd
+++ b/docs/html/tools/extras/oem-usb.jd
@@ -292,7 +292,7 @@
     </td>
   </tr>
   <tr>
-    <td>Lenevo</td>
+    <td>Lenovo</td>
     <td><a href="http://developer.lenovomm.com/developer/download.jsp"
         >http://developer.lenovomm.com/developer/download.jsp</a>
     </td>
diff --git a/docs/html/tools/testing/testing_ui.jd b/docs/html/tools/testing/testing_ui.jd
index 5289ffa..701415e 100644
--- a/docs/html/tools/testing/testing_ui.jd
+++ b/docs/html/tools/testing/testing_ui.jd
@@ -141,11 +141,11 @@
 </ul>
 </p>
 
-<p>For more information about implementing and testing accessibility, see <a href="{@docRoot}/guide/topics/ui/accessibility/apps.html">Making Applications Accessible</a>.</p>
+<p>For more information about implementing and testing accessibility, see <a href="{@docRoot}guide/topics/ui/accessibility/apps.html">Making Applications Accessible</a>.</p>
 
 <p class="note"><strong>Note: </strong>To identify the non-accessible components in the UI, click on the <strong>Toggle NAF Nodes</strong> option in the {@code uiautomatorviewer} tool.</p>
 
-<p>Generally, Android application developers get accessibility support for free, courtesy of the {@link android.view.View} and {@link android.view.ViewGroup} classes. However, some applications use custom view components to provide a richer user experience. Such custom components won't get the accessibility support that is provided by the standard Android UI components. If this applies to your application, ensure that the application developer exposes the custom drawn UI components to Android accessibility services, by implementing the {@link android.view.accessibility.AccessibilityNodeProvider} class. For more information about making custom view components accessible, see <a href="{@docRoot}/guide/topics/ui/accessibility/apps.html#custom-views">Making Applications Accessible</a>.</p>
+<p>Generally, Android application developers get accessibility support for free, courtesy of the {@link android.view.View} and {@link android.view.ViewGroup} classes. However, some applications use custom view components to provide a richer user experience. Such custom components won't get the accessibility support that is provided by the standard Android UI components. If this applies to your application, ensure that the application developer exposes the custom drawn UI components to Android accessibility services, by implementing the {@link android.view.accessibility.AccessibilityNodeProvider} class. For more information about making custom view components accessible, see <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#custom-views">Making Applications Accessible</a>.</p>
 
 <h3 id="configure">Configure your development environment</h3>
 <p>If you're developing in Eclipse, the Android SDK provides additional tools that help you write test cases using {@code uiautomator} and buiild your JAR file. In order to set up Eclipse to assist you, you need to create a project that includes the {@code uiautomator} client library, along with the Android SDK library. To configure Eclipse:</p>
diff --git a/docs/html/training/basics/location/geocoding.jd b/docs/html/training/basics/location/geocoding.jd
index 6364976..3192d14 100644
--- a/docs/html/training/basics/location/geocoding.jd
+++ b/docs/html/training/basics/location/geocoding.jd
@@ -82,7 +82,7 @@
             // Update UI field with the exception.
             Message.obtain(mHandler, UPDATE_ADDRESS, e.toString()).sendToTarget();
         }
-        if (addresses != null &amps;&amps; addresses.size() &gt; 0) {
+        if (addresses != null &amp;&amp; addresses.size() &gt; 0) {
             Address address = addresses.get(0);
             // Format the first line of address (if available), city, and country name.
             String addressText = String.format("&#037;s, &#037;s, &#037;s",
@@ -95,4 +95,4 @@
         return null;
     }
 }
-</pre>
\ No newline at end of file
+</pre>
diff --git a/docs/html/training/in-app-billing/purchase-iab-products.jd b/docs/html/training/in-app-billing/purchase-iab-products.jd
index d5f6634..7fa77d3 100644
--- a/docs/html/training/in-app-billing/purchase-iab-products.jd
+++ b/docs/html/training/in-app-billing/purchase-iab-products.jd
@@ -65,7 +65,7 @@
       else if (purchase.getSku().equals(SKU_GAS)) {
          // consume the gas and update the UI
       }
-      else (purchase.getSku().equals(SKU_PREMIUM)) {
+      else if (purchase.getSku().equals(SKU_PREMIUM)) {
          // give user access to premium content and update the UI
       }
    }
diff --git a/docs/html/training/multiple-threads/create-threadpool.jd b/docs/html/training/multiple-threads/create-threadpool.jd
index 4a4ddb1..e22afd3 100644
--- a/docs/html/training/multiple-threads/create-threadpool.jd
+++ b/docs/html/training/multiple-threads/create-threadpool.jd
@@ -46,7 +46,7 @@
     <code>synchronized</code> block. This approach will prevent one thread from reading the variable
     while another is writing to it. Typically, this situation arises with static variables, but it
     also occurs in any object that is only instantiated once. To learn more about this, read the
-    <a href="{@docRoot}http://developer.android.com/guide/components/processes-and-threads.html">
+    <a href="{@docRoot}guide/components/processes-and-threads.html">
     Processes and Threads</a> API guide.
     
 </p>
diff --git a/docs/html/training/notepad/notepad-ex2.jd b/docs/html/training/notepad/notepad-ex2.jd
index 1334d7a..895a071 100644
--- a/docs/html/training/notepad/notepad-ex2.jd
+++ b/docs/html/training/notepad/notepad-ex2.jd
@@ -100,7 +100,7 @@
 </ol>
 
 <h2>Step 3</h2>
-  <p>Now that the we've registered our ListView for a context menu and defined our context menu item, we need
+  <p>Now that we've registered our ListView for a context menu and defined our context menu item, we need
   to handle the callback when it is selected. For this, we need to identify the list ID of the
   selected item, then delete it. So fill in the
   <code>onContextItemSelected()</code> method like this:</p>