Merge change 352 into donut

* changes:
  Remove dangling media recorder client reference when setCamera() is used.
diff --git a/Android.mk b/Android.mk
index 4bd1220..de5f5f8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -297,12 +297,6 @@
 
 framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:=$(call intermediates-dir-for,JAVA_LIBRARIES,framework)
 
-web_docs_sample_code_flags := \
-		-hdf android.hasSamples 1 \
-		-samplecode samples/ApiDemos guide/samples/ApiDemos "API Demos" \
-		-samplecode samples/LunarLander guide/samples/LunarLander "Lunar Lander" \
-		-samplecode samples/NotePad guide/samples/NotePad "Note Pad"
-
 sample_dir := development/samples
 
 web_docs_sample_code_flags := \
@@ -314,6 +308,19 @@
 		-samplecode $(sample_dir)/NotePad \
 		            guide/samples/NotePad "Note Pad"
 
+# SDK version identifiers used in the published docs. 
+
+# major[.minor] version for SDK. Typically identical to the 
+# most current Android platform version included in the SDK package. 
+framework_docs_SDK_VERSION :=  1.5
+# release version for SDK (ie "Release x")
+framework_docs_SDK_REL_ID :=   1
+framework_docs_SDK_CURRENT_DIR := $(framework_docs_SDK_VERSION)_r$(framework_docs_SDK_REL_ID)
+
+framework_docs_LOCAL_DROIDDOC_OPTIONS += \
+		-hdf sdk.version $(framework_docs_SDK_VERSION) \
+		-hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
+		-hdf sdk.current $(framework_docs_SDK_CURRENT_DIR)
 
 # ====  static html in the sdk ==================================
 include $(CLEAR_VARS)
@@ -346,7 +353,7 @@
 
 static_doc_index_redirect := $(out_dir)/index.html
 $(static_doc_index_redirect): \
-		$(LOCAL_PATH)/docs/docs-documentation-redirect.html | $(ACP)
+	$(LOCAL_PATH)/docs/docs-documentation-redirect.html | $(ACP)
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(ACP) $< $@
 
@@ -371,10 +378,10 @@
 LOCAL_MODULE := online-sdk
 
 LOCAL_DROIDDOC_OPTIONS:= \
-	$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
-	$(web_docs_sample_code_flags) \
-	-toroot / \
-    -hdf android.whichdoc online
+		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
+		$(web_docs_sample_code_flags) \
+		-toroot / \
+		-hdf android.whichdoc online
 
 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
 LOCAL_DROIDDOC_CUSTOM_ASSET_DIR:=assets-sdk
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index c1d66f4..ecdd3f8 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -807,7 +807,7 @@
  * this way would be if you wish to partition it into separate sections with different search 
  * behaviors;  Otherwise this configuration is not recommended.
  * 
- * <p><b>Additional Metadata for search suggestions.</b>  If you have defined a content provider
+ * <p><b>Additional metadata for search suggestions.</b>  If you have defined a content provider
  * to generate search suggestions, you'll need to publish it to the system, and you'll need to 
  * provide a bit of additional XML metadata in order to configure communications with it.
  * 
@@ -880,7 +880,7 @@
  *     </tbody>
  * </table>
  * 
- * <p><b>Additional Metadata for search action keys.</b>  For each action key that you would like to
+ * <p><b>Additional metadata for search action keys.</b>  For each action key that you would like to
  * define, you'll need to add an additional element defining that key, and using the attributes
  * discussed in <a href="#ActionKeys">Action Keys</a>.  A simple example is shown here:
  * 
@@ -956,6 +956,84 @@
  *     </tbody>
  * </table>
  * 
+ * <p><b>Additional metadata for enabling voice search.</b>  To enable voice search for your
+ * activity, you can add fields to the metadata that enable and configure voice search.  When
+ * enabled (and available on the device), a voice search button will be displayed in the
+ * Search UI.  Clicking this button will launch a voice search activity.  When the user has
+ * finished speaking, the voice search phrase will be transcribed into text and presented to the
+ * searchable activity as if it were a typed query.
+ * 
+ * <p>Elements of search metadata that support voice search:
+ * <table border="2" width="85%" align="center" frame="hsides" rules="rows">
+ *
+ *     <thead>
+ *     <tr><th>Attribute</th> <th>Description</th> <th>Required?</th></tr>
+ *     </thead>
+ *     
+ *     <tr><th>android:voiceSearchMode</th>
+ *         <td>If provided and non-zero, enables voice search.  (Voice search may not be
+ *             provided by the device, in which case these flags will have no effect.)  The
+ *             following mode bits are defined:
+ *             <table border="2" align="center" frame="hsides" rules="rows">
+ *                 <tbody>
+ *                 <tr><th>showVoiceSearchButton</th>
+ *                     <td>If set, display a voice search button.  This only takes effect if voice
+ *                         search is available on the device.  If set, then launchWebSearch or
+ *                         launchRecognizer must also be set.</td>
+ *                 </tr>
+ *                 <tr><th>launchWebSearch</th>
+ *                     <td>If set, the voice search button will take the user directly to a 
+ *                         built-in voice web search activity.  Most applications will not use this
+ *                         flag, as it will take the user away from the activity in which search
+ *                         was invoked.</td>
+ *                 </tr>
+ *                 <tr><th>launchRecognizer</th>
+ *                     <td>If set, the voice search button will take the user directly to a
+ *                         built-in voice recording activity.  This activity will prompt the user
+ *                         to speak, transcribe the spoken text, and forward the resulting query
+ *                         text to the searchable activity, just as if the user had typed it into
+ *                         the search UI and clicked the search button.</td>
+ *                 </tr>
+ *                 </tbody>
+ *            </table></td>
+ *         <td align="center">No</td>
+ *     </tr>
+ *     
+ *     <tr><th>android:voiceLanguageModel</th>
+ *         <td>If provided, this specifies the language model that should be used by the voice
+ *             recognition system.  
+ *             See {@link android.speech.RecognizerIntent#EXTRA_LANGUAGE_MODEL}
+ *             for more information.  If not provided, the default value
+ *             {@link android.speech.RecognizerIntent#LANGUAGE_MODEL_FREE_FORM} will be used.</td>
+ *         <td align="center">No</td>
+ *     </tr>
+ *     
+ *     <tr><th>android:voicePromptText</th>
+ *         <td>If provided, this specifies a prompt that will be displayed during voice input.
+ *             (If not provided, a default prompt will be displayed.)</td>
+ *         <td align="center">No</td>
+ *     </tr>
+ *     
+ *     <tr><th>android:voiceLanguage</th>
+ *         <td>If provided, this specifies the spoken language to be expected.  This is only
+ *             needed if it is different from the current value of
+ *             {@link java.util.Locale#getDefault()}.
+ *             </td>
+ *         <td align="center">No</td>
+ *     </tr>
+ *     
+ *     <tr><th>android:voiceMaxResults</th>
+ *         <td>If provided, enforces the maximum number of results to return, including the "best"
+ *             result which will always be provided as the SEARCH intent's primary query.  Must be
+ *             one or greater.  Use {@link android.speech.RecognizerIntent#EXTRA_RESULTS} 
+ *             to get the results from the intent.  If not provided, the recognizer will choose
+ *             how many results to return.</td>
+ *         <td align="center">No</td>
+ *     </tr>
+ * 
+ *     </tbody>
+ * </table>
+ * 
  * <a name="PassingSearchContext"></a>
  * <h3>Passing Search Context</h3>
  * 
diff --git a/core/java/android/test/InstrumentationTestCase.java b/core/java/android/test/InstrumentationTestCase.java
index 82f2ef9..470ab0d 100644
--- a/core/java/android/test/InstrumentationTestCase.java
+++ b/core/java/android/test/InstrumentationTestCase.java
@@ -62,6 +62,10 @@
      *  action = {@link Intent#ACTION_MAIN}
      *  extras = null, unless a custom bundle is provided here
      * All other fields are null or empty.
+     * 
+     * <p><b>NOTE:</b> The parameter <i>pkg</i> must refer to the package identifier of the
+     * package hosting the activity to be launched, which is specified in the AndroidManifest.xml
+     * file.  This is not necessarily the same as the java package name.
      *
      * @param pkg The package hosting the activity to be launched.
      * @param activityCls The activity class to launch.
@@ -82,6 +86,11 @@
 
     /**
      * Utility method for launching an activity with a specific Intent.
+     * 
+     * <p><b>NOTE:</b> The parameter <i>pkg</i> must refer to the package identifier of the
+     * package hosting the activity to be launched, which is specified in the AndroidManifest.xml
+     * file.  This is not necessarily the same as the java package name.
+     *
      * @param pkg The package hosting the activity to be launched.
      * @param activityCls The activity class to launch.
      * @param intent The intent to launch with
diff --git a/core/java/android/widget/MediaController.java b/core/java/android/widget/MediaController.java
index b162a0e..0c9d980 100644
--- a/core/java/android/widget/MediaController.java
+++ b/core/java/android/widget/MediaController.java
@@ -444,27 +444,55 @@
         updatePausePlay();
     }
 
+    // There are two scenarios that can trigger the seekbar listener to trigger:
+    //
+    // The first is the user using the touchpad to adjust the posititon of the
+    // seekbar's thumb. In this case onStartTrackingTouch is called followed by
+    // a number of onProgressChanged notifications, concluded by onStopTrackingTouch.
+    // We're setting the field "mDragging" to true for the duration of the dragging
+    // session to avoid jumps in the position in case of ongoing playback.
+    //
+    // The second scenario involves the user operating the scroll ball, in this
+    // case there WON'T BE onStartTrackingTouch/onStopTrackingTouch notifications,
+    // we will simply apply the updated position without suspending regular updates.
     private OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {
-        long duration;
         public void onStartTrackingTouch(SeekBar bar) {
             show(3600000);
-            duration = mPlayer.getDuration();
+
+            mDragging = true;
+
+            // By removing these pending progress messages we make sure
+            // that a) we won't update the progress while the user adjusts
+            // the seekbar and b) once the user is done dragging the thumb
+            // we will post one of these messages to the queue again and
+            // this ensures that there will be exactly one message queued up.
+            mHandler.removeMessages(SHOW_PROGRESS);
         }
-        public void onProgressChanged(SeekBar bar, int progress, boolean fromtouch) {
-            if (fromtouch) {
-                mDragging = true;
-                duration = mPlayer.getDuration();
-                long newposition = (duration * progress) / 1000L;
-                mPlayer.seekTo( (int) newposition);
-                if (mCurrentTime != null)
-                    mCurrentTime.setText(stringForTime( (int) newposition));
+
+        public void onProgressChanged(SeekBar bar, int progress, boolean fromuser) {
+            if (!fromuser) {
+                // We're not interested in programmatically generated changes to
+                // the progress bar's position.
+                return;
             }
+
+            long duration = mPlayer.getDuration();
+            long newposition = (duration * progress) / 1000L;
+            mPlayer.seekTo( (int) newposition);
+            if (mCurrentTime != null)
+                mCurrentTime.setText(stringForTime( (int) newposition));
         }
+
         public void onStopTrackingTouch(SeekBar bar) {
             mDragging = false;
             setProgress();
             updatePausePlay();
             show(sDefaultTimeout);
+
+            // Ensure that progress is properly updated in the future,
+            // the call to show() does not guarantee this because it is a
+            // no-op if we are already showing.
+            mHandler.sendEmptyMessage(SHOW_PROGRESS);
         }
     };
 
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index f90929a..b98558e 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2720,12 +2720,13 @@
           <flag name="showVoiceSearchButton" value="0x01" />
           <!-- If set, the voice search button will take the user directly to a built-in
                voice web search activity.  Most applications will not use this flag, as it
-               will take the user away from your searchable activity. -->
+               will take the user away from the activity in which search was invoked. -->
           <flag name="launchWebSearch" value="0x02" />
           <!-- If set, the voice search button will take the user directly to a built-in
                voice recording activity.  This activity will prompt the user to speak,
-               transcribe the spoke text, and forward the resulting query text to your
-               searchable activity, just as if the user had typed it into the search UI. -->
+               transcribe the spoken text, and forward the resulting query
+               text to the searchable activity, just as if the user had typed it into
+               the search UI and clicked the search button. -->
           <flag name="launchRecognizer" value="0x04" />
         </attr>
 
diff --git a/docs/html/guide/developing/tools/avd.jd b/docs/html/guide/developing/tools/avd.jd
new file mode 100644
index 0000000..7ba7968
--- /dev/null
+++ b/docs/html/guide/developing/tools/avd.jd
@@ -0,0 +1,496 @@
+page.title=Android Virtual Devices
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+  <h2>AVD quickview</h2>
+  <ul>
+    <li>You need to create an AVD to run any app in the Android emulator</li>
+    <li>Each AVD is a completely independent virtual device, with its own
+        hardware options, system image, and data storage.
+    <li>You create AVD configurations to model different device environments 
+        in the Android emulator.</li>
+  </ul>
+  <h2>In this document</h2>
+  <ol>
+    <li><a href="#creating">Creating an AVD</a>
+      <ol>
+        <li><a href="#listingtargets">Listing targets</a></li>
+        <li><a href="#selectingtarget">Selecting a target</a></li>
+        <li><a href="#createavd">Creating the AVD</a></li>
+        <li><a href="#hardwareopts">Setting hardware emulation options</a></li>
+        <li><a href="#location">Default location of the AVD files</a></li>
+        <li><a href="#createavdopts">Command-line options, create avd</a></li>
+      </ol>
+    </li>
+    <li><a href="#managing">Managing AVDs</a>
+      <ol>
+        <li><a href="#moving">Moving an AVD</a></li>
+        <li><a href="#updating">Deleting an AVD</a></li>
+        <li><a href="#deleting">Deleting an AVD</a></li>
+      </ol>
+    </li>
+    <li><a href="#options">Command-line options</a></li>
+  </ol>
+  <h2>See Also</h2>
+  <ol>
+    <li>Android <a href="{@docRoot}guide/developing/tools/emulator.html">Emulator</a></li>
+  </ol>
+</div>
+</div>
+
+<p>Android Virtual Devices (AVDs) are configurations of emulator options that let
+you better model an actual device.</p>
+
+<p>Each AVD is made up of: </p>
+
+<ul>
+<li>A hardware profile.&nbsp;&nbsp;You can set options to define the hardware
+features of the virtual device. For example, you can define whether the device
+has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how
+much memory it has, and so on. </li>
+<li>A mapping to a system image.&nbsp;&nbsp;You can define what version of the
+Android platform will run on the virtual device. You can choose a version of the
+standard Android platform or the system image packaged with an SDK add-on.</li>
+<li>Other options.&nbsp;&nbsp;You can specify the emulator skin you want to use
+with the AVD, which lets you control the screen dimensions, appearance, and so
+on. You can also specify the emulated SD card to use with the AVD.</li>
+<li>A dedicated storage area on your development machine, in which is stored the
+device's user data (installed applications, settings, and so on) and emulated SD
+card.</li>
+</ul>
+
+<p>You can create as many AVDs as you need, based on the types of devices you
+want to model and the Android platforms and external libraries you want to run
+your application on. </p>
+
+<p>In addition to the options in an AVD configuration, you can also
+specify emulator command-line options at launch or by using the emulator
+console to change behaviors or characteristics at run time. For a complete
+reference of emulator options, please see the <a
+href="{@docRoot}/guide/developing/tools/emulator.html">Emulator</a>
+documentation. </p>
+
+<p>To create and manage AVDs, you use the android tool provided in the Android
+SDK. For more information about how to work with AVDs from inside
+your development environment, see <a
+href="{@docRoot}guide/developing/eclipse-adt.html">Developing in Eclipse with
+ADT</a> or <a href="{@docRoot}guide/developing/other-ide.html">Developing in
+Other IDEs</a>, as appropriate for your environment.</p>
+
+<h2 id="creating">Creating an AVD</h2>
+
+<div class="sidebox">The Android SDK does not include any preconfigured AVDs, so
+you need to create an AVD before you can run any application in the emulator
+(even the Hello World application). </div>
+
+<p>To create an AVD, you use the android tool, a command-line utility
+available in the <code>&lt;sdk&gt;/tools/</code> directory. Managing AVDs is one
+of the two main function of the android tool (the other is creating and updating
+Android projects). Open a terminal window and change to the 
+<code>&lt;sdk&gt;/tools/</code> directory, if needed</p>
+
+<p>To create each AVD, you issue the command <code>android avd create</code>,
+with options that specify a name for the new AVD and the system image you want
+to run on the emulator when the AVD is invoked. You can specify other options on
+the command line also, such as to create an emulated SD card for the new AVD, set
+the emulator skin to use, or set a custom location for the AVD's files.</p>
+
+<p>Here's the command-line usage for creating an AVD: </p>
+
+<pre>android -n &lt;name&gt; -t &lt;targetID&gt; [-&lt;option&gt; &lt;value&gt;] ... </pre>
+
+<p>You can use any name you want for the AVD, but since you are likely to be
+creating multiple AVDs, you should choose a name that lets you recognize the
+general characteristics offered by the AVD. </p>
+
+<p>As shown in the usage above, you must use the <code>-t</code> (or
+<code>--target</code>) argument when creating a new AVD. The argument sets up a
+mapping between the AVD and the system image that you want to use whenever the
+AVD is invoked. You can specify any Android system image that is available in
+your local SDK &mdash; it can be the system image of a standard Android platform
+version or that of any SDK add-on. Later, when applications use the AVD, they'll
+be running on the system that you specify in the <code>-t</code> argument.<p>
+
+<p>To specify the system image to use, you refer to its <em>target ID</em>
+&mdash; an integer &mdash; as assigned by the android tool. The target ID is not
+derived from the system image name, version, or API Level, or other attribute,
+so you need to have the android tool list the available system images and the
+target ID of each, as described in the next section. You should do this
+<em>before</em> you run the <code>android create avd</code> command.
+</p>
+
+<h3 id="listingtargets">Listing targets</h3>
+
+<p>To generate a list of system image targets, use this command: </p>
+
+<pre>android list targets</pre>
+
+<p>The android tool scans the <code>&lt;sdk&gt;/platforms</code> and
+<code>&lt;sdk&gt;/add-ons</code> directories looking for valid system images and
+then generates the list of targets. Here's an example of the command output:
+</p>
+
+<pre>Available Android targets:
+id:1
+    Name: Android 1.1
+    Type: platform
+    API level: 2
+    Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
+id:2
+    Name: Android 1.5
+    Type: platform
+    API level: 3
+    Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
+id:3
+    Name: Google APIs
+    Type: add-on
+    Vendor: Google Inc.
+    Description: Android + Google APIs
+    Based on Android 1.5 (API level 3)
+    Libraries:
+    * com.google.android.maps (maps.jar)
+        API for Google Maps
+    Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L</pre>
+
+<h3 id="selectingtarget">Selecting a target</h3>
+
+<p>Once you have generated the list of targets available, you can look at the
+characteristics of each system image &mdash; name, API Level, external
+libraries, and so on &mdash; and determine which target is appropriate for the
+new AVD. </p>
+
+<p>Keep these points in mind when you are selecting a system image target for
+your AVD:</p>
+<ul>
+<li>The API Level of the target is important, because your application will not
+be able to run on a system image whose API Level is less than that required by
+your application, as specified in the <code>minSdkVersion</code> attribute of
+the application's manifest file. For more information about the relationship
+between system API Level and application <code>minSdkVersion</code>, see <a
+href="{@docRoot}guide/publishing/versioning.html#minsdkversion">Specifying
+Minimum System API Version</a>.
+<li>Creating at least one AVD that uses a target whose API Level is greater than
+that required by your application is strongly encouraged, because it allows you to
+test the forward-compatibility of your application. Forward-compatibility
+testing ensures that, when users who have downloaded your application receive a
+system update, your application will continue to function normally. </li>
+<li>If your application declares a <code>uses-library</code> element in its
+manifest file, the application can only run on a system image in which that
+external library is present. If you want your application to run on the AVD you
+are creating, check the application's <code>uses-library</code> element and
+select a system image target that includes that library. 
+
+</ul>
+
+<h3 id="createavd">Creating the AVD</h3>
+
+<p>When you've selected the target you want to use and made a note of its ID,
+use the <code>android create avd</code> command to create the AVD, supplying the
+target ID as the <code>-t</code> argument. Here's an example that creates an
+AVD with name "my_android1.5" and target ID "2" (the standard Android 1.5 
+system image in the list above): </p>
+
+<pre>android create avd -n my_android1.5 -t 2</pre>
+
+<p>If the target you selected was a standard Android system image ("Type:
+platform"), the android tool next asks you whether you want to create a custom
+hardware profile. </p>
+
+<pre>Android 1.5 is a basic Android platform.
+Do you wish to create a custom hardware profile [no]</pre>
+
+<p>If you want to set custom hardware emulation options for the AVD, enter
+"yes" and set values as needed. If you want to use the default hardware
+emulation options for the AVD, just press the return key (the default is "no").
+The android tool creates the AVD with name and system image mapping you
+requested, with the options you specified. 
+
+<p class="note">If you are creating an AVD whose target is an SDK add-on,
+the android tool does not allow you to set hardware emulation options. It
+assumes that the provider of the add-on has set emulation options appropriately
+for the device that the add-on is modeling, and so prevents you from resetting
+the options. </p>
+
+<p>For a list of options you can use in the <code>android create avd</code>
+command, see the table in <a href="#options">Command-line options for AVDs</a>,
+at the bottom of
+this page. </p>
+
+<h3 id="hardwareopts">Setting hardware emulation options</h3>
+
+<p>When are creating a new AVD that uses a standard Android system image ("Type:
+platform"), the android tool lets you set hardware emulation options for virtual
+device. The table below lists the options available and the default values, as
+well as the names of properties that store the emulated hardware options in the AVD's
+configuration file (the config.ini file in the AVD's local directory). </p>
+
+
+<table>
+<tr>
+<th>Characteristic</th>
+<th>Description</th>
+<th>Property</th>
+</tr>
+
+<tr>
+<td>Device ram size</td>
+<td>The amount of physical RAM on the device, in megabytes. Default value is "96".
+<td>hw.ramSize</td>
+</tr>
+
+<tr>
+<td>Touch-screen support</td>
+<td>Whether there is a touch screen or not on the device. Default value is "yes".</td>
+<td>hw.touchScreen
+
+
+<tr>
+<td>Trackball support </td>
+<td>Whether there is a trackball on the device. Default value is "yes".</td>
+<td>hw.trackBall</td>
+</tr>
+
+<tr>
+<td>Keyboard support</td>
+<td>Whether the device has a QWERTY keyboard. Default value is "yes".</td>
+<td>hw.keyboard</td>
+</tr>
+
+<tr>
+<td>DPad support</td>
+<td>Whether the device has DPad keys. Default value is "yes".</td>
+<td>hw.dPad</td>
+</tr>
+
+<tr>
+<td>GSM modem support</td>
+<td>Whether there is a GSM modem in the device. Default value is "yes".</td>
+<td>hw.gsmModem</td>
+</tr>
+
+<tr>
+<td>Camera support</td>
+<td>Whether the device has a camera. Default value is "no".</td>
+<td>hw.camera</td>
+</tr>
+
+<tr>
+<td>Maximum horizontal camera pixels</td>
+<td>Default value is "640".</td>
+<td>hw.camera.maxHorizontalPixels</td>
+</tr>
+
+<tr>
+<td>Maximum vertical camera pixels</td>
+<td>Default value is "480".</td>
+<td>hw.camera.maxVerticalPixels</td>
+</tr>
+
+<tr>
+<td>GPS support</td>
+<td>Whether there is a GPS in the device. Default value is "yes".</td>
+<td>hw.gps</td>
+</tr>
+
+<tr>
+<td>Battery support</td>
+<td>Whether the device can run on a battery. Default value is "yes".</td>
+<td>hw.battery</td>
+</tr>
+
+<tr>
+<td>Accelerometer</td>
+<td>Whether there is an accelerometer in the device. Default value is "yes".</td>
+<td>hw.accelerometer</td>
+</tr>
+
+<tr>
+<td>Audio recording support</td>
+<td>Whether the device can record audio. Default value is "yes".</td>
+<td>hw.audioInput</td>
+</tr>
+
+<tr>
+<td>Audio playback support</td>
+<td>Whether the device can play audio. Default value is "yes".</td>
+<td>hw.audioOutput</td>
+</tr>
+
+<tr>
+<td>SD Card support</td>
+<td>Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes".</td>
+<td>hw.sdCard</td>
+</tr>
+
+<tr>
+<td>Cache partition support</td>
+<td>Whether we use a /cache partition on the device. Default value is "yes".</td>
+<td>disk.cachePartition</td>
+</tr>
+
+<tr>
+<td>Cache partition size</td>
+<td>Default value is "66MB".</td>
+<td>disk.cachePartition.size </td>
+</tr>
+</table>
+
+<h3 id="location">Default location of the AVD files</h3>
+
+<p>When you create an AVD, the android tool creates a dedicated directory for it
+on your development computer. The directory contains the AVD configuration file,
+the user data image and SD card image (if available), and any other files
+associated with the device. Note that the directory does not contain a system
+image &mdash; instead, the AVD configuration file contains a mapping to the
+system image, which it loads when the AVD is launched. </p>
+
+<p>The android tool also creates a &lt;AVD name&gt;.ini file for the AVD at the
+root of the .android/avd directory on your computer. The file specifies the
+location of the AVD directory and always remains at the root the .android 
+directory.</p>
+
+<p>By default, the android tool creates the AVD directory inside
+<code>~/.android/avd/</code> (on Linux/Mac), <code>C:\Documents and
+Settings\&lt;user&gt;\.android\</code> on Windows XP, and 
+<code>C:\Users\&lt;user&gt;\.android\</code> on Windows Vista. 
+If you want to use a custom location for the AVD directory, you 
+can do so by using the <code>-p &lt;path&gt;</code> option when 
+you create the AVD: </p>
+
+<pre>android create avd -n my_android1.5 -t 2 -p path/to/my/avd</pre>
+
+<p>If the .android directory is hosted on a network drive, we recommend using
+the <code>-p</code> option to place the AVD directory in another location. 
+The  AVD's .ini file remains in the .android directory on the network
+drive, regardless of the location of the AVD directory. </p>
+
+<h3 id="moving">Moving an AVD</h3>
+
+<p>If you want to move or rename an AVD, you can do so using this command:</p>
+
+<pre>android move avd -n &lt;name&gt; [-&lt;option&gt; &lt;value&gt;] ...</pre>
+
+<p>The options for this command are listed in <a href="#options">Command-line
+options for AVDs</a> at the bottom of this page. </p>
+
+<h3 id="updating">Updating an AVD</h3>
+
+<p>If, for any reason, the platform/add-on root folder has its name changed (maybe because the user has installed an update of the platform/add-on) then the AVD will not be able to load the system image that it is mapped to. In this case, the <code>android list targets</code> command will produce this output: 
+
+<pre>The following Android Virtual Devices could not be loaded: 
+Name: foo 
+Path: &lt;path&gt;/.android/avd/foo.avd 
+Error: Invalid value in image.sysdir. Run 'android update avd -n foo' </pre>
+
+<p>To fix this error, use the <code>android update avd</code> command to recompute the path to the system images.</p>
+
+<h3 id="deleting">Deleting an AVD</h3>
+
+<p>You can use the android tool to delete an AVD. Here is the command usage:</p>
+
+<pre>android delete avd -n &lt;name&gt; </pre>
+
+<p>When you issue the command, the android tool looks for an AVD matching the 
+specified name deletes the AVD's directory and files. </p>
+
+
+<h2 id="options">Command-line options for AVDs</h2>
+
+<p>The table below lists the command-line options you can use with the 
+android tool. </p>
+
+
+<table>
+<tr>
+  <th width="15%">Action</th>
+  <th width="20%">Option</th>
+  <th width="30%">Description</th>
+  <th>Comments</th>
+</tr>
+
+
+<tr>
+  <td><code>list&nbsp;avds</code></td>
+  <td>&nbsp;</td>
+  <td>List all known AVDs, with name, path, target, and skin. </td>
+  <td>&nbsp;</td>
+</tr>
+<tr>
+  <td rowspan="6"><code>create&nbsp;avd</code></td>
+  <td><code>-n &lt;name&gt; or <br></code></td>
+  <td>The name for the AVD.</td>
+  <td>Required</td>
+</tr>
+<tr>
+  <td><code>-t &lt;targetID&gt;</code></td>
+  <td>Target ID of the system image to use with the new AVD.</td>
+  <td>Required. To obtain a list of available targets, use <code>android list
+      targets</code>.</td>
+</tr>
+<tr>
+  <td><code>-c &lt;path&gt;</code> or <br>
+      <code>-c &lt;size&gt;[K|M]</code></td>
+  <td>The path to the SD card image to use with this AVD or the size of a new SD
+      card image to create for this AVD.</td>
+  <td>Examples: <code>-c path/to/sdcard</code> or <code>-c 1000M</code></td>
+</tr>
+<tr>
+  <td><code>-f</code></td>
+  <td>Force creation of the AVD</td>
+  <td>By default, if the name of the AVD being created matches that of an 
+      existing AVD, the android tool will not create the new AVD or overwrite 
+      the existing AVD. If you specify the <code>-f</code> option, however, the 
+      android tool will automatically overwrite any existing AVD that has the 
+      same name as the new AVD. The files and data of the existing AVD are 
+      deleted. </td>
+</tr>
+
+<tr>
+  <td><code>-p &lt;path&gt;</code></td>
+  <td>Path to the location at which to create the directory for this AVD's
+files.</td>
+  <td>&nbsp;</td>
+</tr>
+<tr>
+  <td><code>-s &lt;name&gt;</code> or <br>
+      <code>-s &lt;dimensions&gt;</code> </td>
+  <td>The skin to use for this AVD, identified by name or dimensions.</td>
+  <td>The android tool scans for a matching skin by name or dimension in the
+<code>skins/</code> directory of the target referenced in the <code>-t
+&lt;targetID&gt;</code> argument. Example: <code>-s HVGA-L</code></td>
+</tr>
+<tr>
+  <td><code>delete&nbsp;avd</code></td>
+  <td><code>-n &lt;name&gt;</code></td>
+  <td>Delete the specified AVD.</td>
+  <td>Required</td>
+</tr>
+<tr>
+  <td rowspan="3"><code>move&nbsp;avd</code></td>
+  <td><code>-n &lt;name&gt;</code></td>
+  <td>The name of the AVD to move.</td>
+  <td>Required</td>
+</tr>
+<tr>
+  <td><code>-p &lt;path&gt;</code></td>
+  <td>The path to the new location for the AVD.</td>
+  <td>&nbsp;</td>
+</tr>
+<tr>
+  <td><code>-r &lt;new-name&gt;</code></td>
+  <td>Rename the AVD.</td>
+  <td>&nbsp;</td>
+</tr>
+<tr>
+  <td><code>update&nbsp;avds</code></td>
+  <td>&nbsp;</td>
+  <td>Recompute the paths to all system images.</td>
+  <td>&nbsp;</td>
+</tr>
+
+
+
+</table>
+
diff --git a/docs/html/offline.jd b/docs/html/offline.jd
index d41459b..57c55c7 100644
--- a/docs/html/offline.jd
+++ b/docs/html/offline.jd
@@ -9,10 +9,10 @@
 <img src="{@docRoot}images/android_icon_125.png" style="float:right; margin:1em 6em 6em;" />
 
 <p>If you've just downloaded the SDK, then continue with  
-<a href="{@docRoot}sdk/1.1_r1/installing.html">Installing the Android SDK</a>.</p>
+<a href="{@docRoot}sdk/{@sdkCurrent}/installing.html">Installing the Android SDK</a>.</p>
 
 <p>If you're upgrading from a previously installed version, then refer to the 
-<a href="{@docRoot}sdk/1.1_r1/upgrading.html">Upgrading</a> guide.</p>
+<a href="{@docRoot}sdk/{@sdkCurrent}/upgrading.html">Upgrading</a> guide.</p>
 
 <p>Once you've completed the SDK installation, you can start learning about
 development on the Android framework by reading the <a
diff --git a/location/java/android/location/ILocationProvider.aidl b/location/java/android/location/ILocationProvider.aidl
index d43fd6e..82533a5 100644
--- a/location/java/android/location/ILocationProvider.aidl
+++ b/location/java/android/location/ILocationProvider.aidl
@@ -48,7 +48,6 @@
     boolean sendExtraCommand(String command, inout Bundle extras);
     void addListener(int uid);
     void removeListener(int uid);
-
-    /* the following is used only for NetworkLocationProvider */
-    void updateCellLockStatus(boolean acquired);
+    void wakeLockAcquired();
+    void wakeLockReleased();
 }
diff --git a/location/java/android/location/LocationProviderImpl.java b/location/java/android/location/LocationProviderImpl.java
index fa0cd2d..a20aa3c 100644
--- a/location/java/android/location/LocationProviderImpl.java
+++ b/location/java/android/location/LocationProviderImpl.java
@@ -259,10 +259,22 @@
     }
 
     /**
-     * Informs the location provider when a client is no longerlistening for location information
+     * Informs the location provider when a client is no longer listening for location information
      *
      * @param uid the uid of the client proces
      */
     public void removeListener(int uid) {
     }
+
+    /**
+     * Informs the location provider when the location manager service has acquired its wake lock
+     */
+    public void wakeLockAcquired() {
+    }
+
+    /**
+     * Informs the location provider when the location manager service has released its wake lock
+     */
+    public void wakeLockReleased() {
+    }
 }
diff --git a/location/java/com/android/internal/location/LocationProviderProxy.java b/location/java/com/android/internal/location/LocationProviderProxy.java
index 84462b2..72dd07d 100644
--- a/location/java/com/android/internal/location/LocationProviderProxy.java
+++ b/location/java/com/android/internal/location/LocationProviderProxy.java
@@ -222,14 +222,6 @@
         }
     }
 
-    public void updateCellLockStatus(boolean acquired) {
-        try {
-            mProvider.updateCellLockStatus(acquired);
-        } catch (RemoteException e) {
-            Log.e(TAG, "updateCellLockStatus failed", e);
-        }
-    }
-
     public void addListener(int uid) {
         try {
             mProvider.addListener(uid);
@@ -245,4 +237,20 @@
             Log.e(TAG, "removeListener failed", e);
         }
     }
+
+    public void wakeLockAcquired() {
+        try {
+            mProvider.wakeLockAcquired();
+        } catch (RemoteException e) {
+            Log.e(TAG, "wakeLockAcquired failed", e);
+        }
+    }
+
+    public void wakeLockReleased() {
+        try {
+            mProvider.wakeLockReleased();
+        } catch (RemoteException e) {
+            Log.e(TAG, "wakeLockReleased failed", e);
+        }
+    }
 }
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index c60e4ea..5238c58 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -56,7 +56,6 @@
 import android.location.LocationProviderImpl;
 import android.net.ConnectivityManager;
 import android.net.Uri;
-import android.net.wifi.WifiManager;
 import android.os.Binder;
 import android.os.Bundle;
 import android.os.Handler;
@@ -67,7 +66,6 @@
 import android.os.RemoteException;
 import android.os.SystemClock;
 import android.provider.Settings;
-import android.telephony.TelephonyManager;
 import android.util.Config;
 import android.util.Log;
 import android.util.PrintWriterPrinter;
@@ -138,17 +136,13 @@
     // Alarm manager and wakelock variables
     private final static String ALARM_INTENT = "com.android.location.ALARM_INTENT";
     private final static String WAKELOCK_KEY = "LocationManagerService";
-    private final static String WIFILOCK_KEY = "LocationManagerService";
     private AlarmManager mAlarmManager;
     private long mAlarmInterval = 0;
     private boolean mScreenOn = true;
     private PowerManager.WakeLock mWakeLock = null;
-    private WifiManager.WifiLock mWifiLock = null;
     private long mWakeLockAcquireTime = 0;
     private boolean mWakeLockGpsReceived = true;
     private boolean mWakeLockNetworkReceived = true;
-    private boolean mWifiWakeLockAcquired = false;
-    private boolean mCellWakeLockAcquired = false;
     
     /**
      * List of all receivers.
@@ -177,15 +171,9 @@
     private HashMap<String,Location> mLastKnownLocation =
         new HashMap<String,Location>();
 
-    // Last known cell service state
-    private TelephonyManager mTelephonyManager;
-
     // Location collector
     private ILocationCollector mCollector;
 
-    // Wifi Manager
-    private WifiManager mWifiManager;
-
     private int mNetworkState = LocationProvider.TEMPORARILY_UNAVAILABLE;
 
     // for Settings change notification
@@ -538,9 +526,6 @@
         // Load providers
         loadProviders();
 
-        // Listen for Radio changes
-        mTelephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
-
         // Register for Network (Wifi or Mobile) updates
         NetworkStateBroadcastReceiver networkReceiver = new NetworkStateBroadcastReceiver();
         IntentFilter networkIntentFilter = new IntentFilter();
@@ -567,12 +552,6 @@
         mSettings = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, mLocationHandler);
         SettingsObserver settingsObserver = new SettingsObserver();
         mSettings.addObserver(settingsObserver);
-
-        // Get the wifi manager
-        mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
-
-        // Create a wifi lock for future use
-        mWifiLock = getWifiWakelockLocked();
     }
 
     public void setNetworkLocationProvider(ILocationProvider provider) {
@@ -589,7 +568,6 @@
             
             // notify NetworkLocationProvider of any events it might have missed
             mNetworkLocationProvider.updateNetworkState(mNetworkState);
-            mNetworkLocationProvider.updateCellLockStatus(mCellWakeLockAcquired);
         }
     }
 
@@ -611,14 +589,6 @@
         mGeocodeProvider = provider;
     }
 
-    private WifiManager.WifiLock getWifiWakelockLocked() {
-        if (mWifiLock == null && mWifiManager != null) {
-            mWifiLock = mWifiManager.createWifiLock(WifiManager.WIFI_MODE_SCAN_ONLY, WIFILOCK_KEY);
-            mWifiLock.setReferenceCounted(false);
-        }
-        return mWifiLock;
-    }
-
     private boolean isAllowedBySettingsLocked(String provider) {
         if (mEnabledProviders.contains(provider)) {
             return true;
@@ -1861,33 +1831,11 @@
         mWakeLockAcquireTime = SystemClock.elapsedRealtime();
         log("Acquired wakelock");
 
-        // Acquire cell lock
-        if (mCellWakeLockAcquired) {
-            // Lock is already acquired
-        } else if (!mWakeLockNetworkReceived) {
-            mTelephonyManager.enableLocationUpdates();
-            mCellWakeLockAcquired = true;
-        } else {
-            mCellWakeLockAcquired = false;
-        }
-
-        // Notify NetworkLocationProvider
         if (mNetworkLocationProvider != null) {
-            mNetworkLocationProvider.updateCellLockStatus(mCellWakeLockAcquired);
+            mNetworkLocationProvider.wakeLockAcquired();
         }
-
-        // Acquire wifi lock
-        WifiManager.WifiLock wifiLock = getWifiWakelockLocked();
-        if (wifiLock != null) {
-            if (mWifiWakeLockAcquired) {
-                // Lock is already acquired
-            } else if (mWifiManager.isWifiEnabled() && !mWakeLockNetworkReceived) {
-                wifiLock.acquire();
-                mWifiWakeLockAcquired = true;
-            } else {
-                mWifiWakeLockAcquired = false;
-                Log.w(TAG, "acquireWakeLock(): Unable to get WiFi lock");
-            }
+        if (mGpsLocationProvider != null) {
+            mGpsLocationProvider.wakeLockAcquired();
         }
     }
 
@@ -1902,24 +1850,11 @@
     }
 
     private void releaseWakeLockXLocked() {
-        // Release wifi lock
-        WifiManager.WifiLock wifiLock = getWifiWakelockLocked();
-        if (wifiLock != null) {
-            if (mWifiWakeLockAcquired) {
-                wifiLock.release();
-                mWifiWakeLockAcquired = false;
-            }
-        }
-
-        // Release cell lock
-        if (mCellWakeLockAcquired) {
-            mTelephonyManager.disableLocationUpdates();
-            mCellWakeLockAcquired = false;
-        }
-
-        // Notify NetworkLocationProvider
         if (mNetworkLocationProvider != null) {
-            mNetworkLocationProvider.updateCellLockStatus(mCellWakeLockAcquired);
+            mNetworkLocationProvider.wakeLockReleased();
+        }
+        if (mGpsLocationProvider != null) {
+            mGpsLocationProvider.wakeLockReleased();
         }
 
         // Release wake lock
@@ -2115,8 +2050,6 @@
                     + " mWakeLockAcquireTime=" + mWakeLockAcquireTime);
             pw.println("  mWakeLockGpsReceived=" + mWakeLockGpsReceived
                     + " mWakeLockNetworkReceived=" + mWakeLockNetworkReceived);
-            pw.println("  mWifiWakeLockAcquired=" + mWifiWakeLockAcquired
-                    + " mCellWakeLockAcquired=" + mCellWakeLockAcquired);
             pw.println("  Listeners:");
             int N = mReceivers.size();
             for (int i=0; i<N; i++) {
diff --git a/test-runner/android/test/ActivityInstrumentationTestCase.java b/test-runner/android/test/ActivityInstrumentationTestCase.java
index e5a9991..f6b31ad 100644
--- a/test-runner/android/test/ActivityInstrumentationTestCase.java
+++ b/test-runner/android/test/ActivityInstrumentationTestCase.java
@@ -40,7 +40,11 @@
     boolean mInitialTouchMode = false;
 
     /**
-     * @param pkg The package of the instrumentation.
+     * <b>NOTE:</b> The parameter <i>pkg</i> must refer to the package identifier of the
+     * package hosting the activity to be launched, which is specified in the AndroidManifest.xml
+     * file.  This is not necessarily the same as the java package name.
+     * 
+     * @param pkg The package hosting the activity to be launched.
      * @param activityClass The activity to test.
      */
     public ActivityInstrumentationTestCase(String pkg, Class<T> activityClass) {
@@ -48,7 +52,11 @@
     }
 
     /**
-     * @param pkg The package of the instrumentation.
+     * <b>NOTE:</b> The parameter <i>pkg</i> must refer to the package identifier of the
+     * package hosting the activity to be launched, which is specified in the AndroidManifest.xml
+     * file.  This is not necessarily the same as the java package name.
+     * 
+     * @param pkg The package hosting the activity to be launched.
      * @param activityClass The activity to test.
      * @param initialTouchMode true = in touch mode
      */
diff --git a/test-runner/android/test/ActivityInstrumentationTestCase2.java b/test-runner/android/test/ActivityInstrumentationTestCase2.java
index 7a84eca..679f634 100644
--- a/test-runner/android/test/ActivityInstrumentationTestCase2.java
+++ b/test-runner/android/test/ActivityInstrumentationTestCase2.java
@@ -46,7 +46,11 @@
     Intent mActivityIntent = null;
 
     /**
-     * @param pkg The package of the instrumentation.
+     * <b>NOTE:</b> The parameter <i>pkg</i> must refer to the package identifier of the
+     * package hosting the activity to be launched, which is specified in the AndroidManifest.xml
+     * file.  This is not necessarily the same as the java package name.
+     * 
+     * @param pkg The package hosting the activity to be launched.
      * @param activityClass The activity to test.
      */
     public ActivityInstrumentationTestCase2(String pkg, Class<T> activityClass) {
diff --git a/test-runner/android/test/SingleLaunchActivityTestCase.java b/test-runner/android/test/SingleLaunchActivityTestCase.java
index 8d43b73..b63b3ce 100644
--- a/test-runner/android/test/SingleLaunchActivityTestCase.java
+++ b/test-runner/android/test/SingleLaunchActivityTestCase.java
@@ -37,7 +37,11 @@
     private static boolean sActivityLaunchedFlag = false;
 
     /**
-     * @param pkg The package of the instrumentation.
+     * <b>NOTE:</b> The parameter <i>pkg</i> must refer to the package identifier of the
+     * package hosting the activity to be launched, which is specified in the AndroidManifest.xml
+     * file.  This is not necessarily the same as the java package name.
+     *
+     * @param pkg The package hosting the activity to be launched.
      * @param activityClass The activity to test.
      */
     public SingleLaunchActivityTestCase(String pkg, Class<T> activityClass) {