Merge change 844 into donut

* changes:
  clean up cdma sms creation and parsing
diff --git a/api/current.xml b/api/current.xml
index 93b3273..ceaaf79 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -529,6 +529,28 @@
  visibility="public"
 >
 </field>
+<field name="INSTALL_LOCATION_COLLECTOR"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;android.permission.INSTALL_LOCATION_COLLECTOR&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="INSTALL_LOCATION_PROVIDER"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;android.permission.INSTALL_LOCATION_PROVIDER&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="INSTALL_PACKAGES"
  type="java.lang.String"
  transient="false"
@@ -5344,6 +5366,17 @@
  visibility="public"
 >
 </field>
+<field name="onClick"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843375"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="oneshot"
  type="int"
  transient="false"
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 894045a..07c56ee 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -62,6 +62,8 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.lang.ref.SoftReference;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
 
 /**
  * <p>
@@ -1874,6 +1876,36 @@
                 case R.styleable.View_minHeight:
                     mMinHeight = a.getDimensionPixelSize(attr, 0);
                     break;
+                case R.styleable.View_onClick:
+                    final String handlerName = a.getString(attr);
+                    if (handlerName != null) {
+                        setOnClickListener(new OnClickListener() {
+                            private Method mHandler;
+
+                            public void onClick(View v) {
+                                if (mHandler == null) {
+                                    try {
+                                        mHandler = getContext().getClass().getMethod(handlerName,
+                                                View.class);
+                                    } catch (NoSuchMethodException e) {
+                                        throw new IllegalStateException("Could not find a method " +
+                                                handlerName + "(View) in the activity", e);
+                                    }
+                                }
+
+                                try {
+                                    mHandler.invoke(getContext(), View.this);
+                                } catch (IllegalAccessException e) {
+                                    throw new IllegalStateException("Could not execute non "
+                                            + "public method of the activity", e);
+                                } catch (InvocationTargetException e) {
+                                    throw new IllegalStateException("Could not execute "
+                                            + "method of the activity", e);
+                                }
+                            }
+                        });
+                    }
+                    break;
             }
         }
 
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index bd6fea8..93d68cb 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -722,8 +722,7 @@
         jsize textCount = env->GetArrayLength(text);
         SkScalar x_ = SkFloatToScalar(x);
         SkScalar y_ = SkFloatToScalar(y);
-        textArray += index;
-        canvas->drawText(textArray, count << 1, x_, y_, *paint);
+        canvas->drawText(textArray + index, count << 1, x_, y_, *paint);
         env->ReleaseCharArrayElements(text, textArray, 0);
     }
  
@@ -767,8 +766,7 @@
             posPtr[indx].fX = SkFloatToScalar(posArray[indx << 1]);
             posPtr[indx].fY = SkFloatToScalar(posArray[(indx << 1) + 1]);
         }
-        textArray += index;
-        canvas->drawPosText(textArray, count << 1, posPtr, *paint);
+        canvas->drawPosText(textArray + index, count << 1, posPtr, *paint);
         if (text) {
             env->ReleaseCharArrayElements(text, textArray, 0);
         }
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index caa1318..aa8fd74 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -214,6 +214,18 @@
         android:label="@string/permlab_accessLocationExtraCommands"
         android:description="@string/permdesc_accessLocationExtraCommands" />
 
+    <!-- Allows an application to install a location provider into the Location Manager -->
+    <permission android:name="android.permission.INSTALL_LOCATION_PROVIDER"
+        android:protectionLevel="signatureOrSystem"
+        android:label="@string/permlab_installLocationProvider"
+        android:description="@string/permdesc_installLocationProvider" />
+
+    <!-- Allows an application to install a location collector into the Location Manager -->
+    <permission android:name="android.permission.INSTALL_LOCATION_COLLECTOR"
+        android:protectionLevel="signatureOrSystem"
+        android:label="@string/permlab_installLocationCollector"
+        android:description="@string/permdesc_installLocationCollector" />
+
     <!-- ======================================= -->
     <!-- Permissions for accessing networks -->
     <!-- ======================================= -->
@@ -921,7 +933,7 @@
     <permission android:name="android.permission.CONTROL_LOCATION_UPDATES"
         android:label="@string/permlab_locationUpdates"
         android:description="@string/permdesc_locationUpdates"
-        android:protectionLevel="signature" />
+        android:protectionLevel="signatureOrSystem" />
 
     <!-- Allows read/write access to the "properties" table in the checkin
          database, to change values that get uploaded. -->
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 3d7f406..633a831 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1165,6 +1165,13 @@
              enabled for events such as long presses. -->
         <attr name="hapticFeedbackEnabled" format="boolean" />
 
+        <!-- Name of the method in this View's context to invoke when the view is
+             clicked. This name must correspond to a public method that takes
+             exactly one parameter of type View. For instance, if you specify
+             <code>android:onClick="sayHello"</code>, you must declare a
+             <code>public void sayHello(View v)</code> method of your context
+             (typically, your Activity.)-->
+        <attr name="onClick" format="string" />
     </declare-styleable>
 
     <!-- Attributes that can be used with a {@link android.view.ViewGroup} or any
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 072f0c3..9e4c6a9 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1096,6 +1096,7 @@
    <public type="attr" name="density" id="0x0101026c" />
    <public type="attr" name="searchSuggestThreshold" id="0x0101026d" />
    <public type="attr" name="includeInGlobalSearch" id="0x0101026e" />
+   <public type="attr" name="onClick" id="0x0101026f" />
 
    <public type="anim" name="anticipate_interpolator" id="0x010a0007" />
    <public type="anim" name="overshoot_interpolator" id="0x010a0008" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index c35676c..6e2da4b 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -753,6 +753,19 @@
         or other location sources.</string>
 
     <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permlab_installLocationProvider">permission to install a location provider</string>
+    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permdesc_installLocationProvider">Create mock location sources for testing.
+        Malicious applications can use this to override the location and/or status returned by real
+        location sources such as GPS or Network providers.</string>
+
+    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permlab_installLocationCollector">permission to install a location collector</string>
+    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permdesc_installLocationCollector">Create mock location sources for testing.
+        Malicious applications can use this to monitor and report your location to an external source.</string>
+
+    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permlab_accessFineLocation">fine (GPS) location</string>
     <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permdesc_accessFineLocation">Access fine location sources such as the
diff --git a/docs/html/community/index.jd b/docs/html/community/index.jd
index ad3a199..5512d9c 100644
--- a/docs/html/community/index.jd
+++ b/docs/html/community/index.jd
@@ -89,6 +89,13 @@
 <a href="mailto:android-platform-subscribe@googlegroups.com">    </a></li>
 </ul>
 </li>
+
+<li><b>Android Market Help Center</b> - A web-based discussion forum where you can ask questions or report issues relating to Android Market.
+<ul>
+<li>URL:&nbsp;<a href="http://www.google.com/support/forum/p/Android+Market?hl=en">http://www.google.com/support/forum/p/Android+Market?hl=en</a></li>
+</ul>
+</li>
+
 </ul>
 
 
diff --git a/docs/html/guide/developing/tools/traceview.jd b/docs/html/guide/developing/tools/traceview.jd
index dd3f4bb..95ae823 100644
--- a/docs/html/guide/developing/tools/traceview.jd
+++ b/docs/html/guide/developing/tools/traceview.jd
@@ -1,23 +1,32 @@
 page.title=Traceview: A Graphical Log Viewer
 @jd:body
 
+<div id="qv-wrapper">
+<div id="qv">
+
+  <h2>In this document</h2>
+<ol>
+    <li><a href="#creatingtracefiles">Creating Trace Files</a></li>
+    <li><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></li>
+    <li><a href="#runningtraceview">Viewing Trace Files in Traceview</a>
+            <ol>
+		<li><a href="#timelinepanel">Timeline Panel</a></li>
+        	<li><a href="#profilepanel">Profile Panel</a></li>
+	    </ol></li>
+    <li><a href="#format">Traceview File Format</a>
+            <ol>
+		<li><a href="#datafileformat">Data File Format</a></li>
+        	<li><a href="#keyfileformat">Key File Format</a></li>
+	    </ol></li>
+    <li><a href="#knownissues">Traceview Known Issues</a></li>
+    <li><a href="#dmtracedump">Using dmtracedump</a></li>
+</ol>
+</div>
+</div>
+
 <p>Traceview is a graphical viewer for execution logs
-saved by your application. The sections below describe how to use the program. </p>
-
-<h2>Contents</h2>
-
-<dl>
-    <dt><a href="#creatingtracefiles">Creating Trace Files</a></dt>
-    <dt><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></dt>
-    <dt><a href="#runningtraceview">Viewing Trace Files in Traceview</a></dt>
-            <dd><a href="#timelinepanel">Timeline Panel</a></dd>
-        	<dd><a href="#profilepanel">Profile Panel</a></dd>
-    <dt><a href="#format">Traceview File Format</a></dd>
-        	<dd><a href="#datafileformat">Data File Format</a><dd>
-        	<dd><a href="#keyfileformat">Key File Format</a></dd>
-	<dt><a href="#knownissues">Traceview Known Issues</a></dd>
-    <dt><a href="#dmtracedump">Using dmtracedump</a></dt>
-</dl>
+saved by your application. Traceview can help you debug your application and 
+profile its performance. The sections below describe how to use the program. </p>
 
 <a name="creatingtracefiles"></a>
 
@@ -63,10 +72,10 @@
 
 <p>When using the Android emulator, you must create an SD card image upon which
 the trace files will be written. For example, from the <code>/tools</code> directory, you 
-can create an SD card image and mount it when launching the emulator like so:</p>
+can create an SD card image named "imgcd" and mount it when launching the emulator like so:</p>
 <pre>
-<b>$</b> mksdcard 1024M ./imgcd 
-<b>$</b> emulator -sdcard ./img
+<b>$</b> mksdcard 1024M ./imgcd
+<b>$</b> emulator -sdcard ./imgcd
 </pre>
 <p>For more information, read about the 
 <a href="{@docRoot}guide/developing/tools/othertools.html#mksdcard">mksdcard tool</a>.</p>
diff --git a/docs/html/guide/samples/index.jd b/docs/html/guide/samples/index.jd
index 4e665fa..365284d 100644
--- a/docs/html/guide/samples/index.jd
+++ b/docs/html/guide/samples/index.jd
@@ -4,11 +4,13 @@
 
 
 <p>Sometimes, the best way to learn how things are done is to just look at some code. So here
- we've provided links to let you browse the source of some some simple Android applications. </p>
+ we've provided links to let you browse the source of some sample Android applications included
+in the Android SDK. </p>
 
-<p>The source code for these applications is included in the Android SDK, in this location:</p>
+<p>The SDK includes a full set of sample applications for each Android platform version 
+in the SDK. You can find the sample applications for each platform version in this location:</p>
 
-<p style="margin-left:2em"><code>&lt;sdk&gt;/samples/</code></p>
+<p style="margin-left:2em"><code>&lt;sdk&gt;/platforms/android-&lt;version&gt;/samples/</code></p>
 
 <p>You can easily add these applications as projects in your development environment, so that you 
 can modify them and watch them execute. </p>
diff --git a/docs/html/guide/topics/location/index.jd b/docs/html/guide/topics/location/index.jd
index d7a8ff2..e988ecb 100644
--- a/docs/html/guide/topics/location/index.jd
+++ b/docs/html/guide/topics/location/index.jd
@@ -116,12 +116,11 @@
 and it lets you work with Maps data as you would other types of Views.</p>
 
 <p>The Maps external library is not part of the standard Android library, so it
-may not be present on some compliant Android-powered devices (although it is
-likely to be present on most devices). Similarly, the Maps external library is
-not included in the standard Android library provided in the SDK. So that you
-can develop using the classes of the com.google.android.maps package, the Maps
-external library is made available to you as part of the Google APIs add-on for
-the Android SDK. </p>
+may not be present on some compliant Android-powered devices. Similarly, the
+Maps external library is not included in the standard Android library provided
+in the SDK. So that you can develop using the classes of the
+com.google.android.maps package, the Maps external library is made available to
+you as part of the Google APIs add-on for the Android SDK. </p>
 
 <p>To learn more about the Maps external library and how to download and use the
 Google APIs add-on, visit</p>
diff --git a/docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip b/docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip
index c7dd989..24fefc1 100644
--- a/docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip
+++ b/docs/html/guide/tutorials/notepad/codelab/NotepadCodeLab.zip
Binary files differ
diff --git a/docs/html/guide/tutorials/notepad/notepad-ex1.jd b/docs/html/guide/tutorials/notepad/notepad-ex1.jd
index b7f42bf..b5173b8 100644
--- a/docs/html/guide/tutorials/notepad/notepad-ex1.jd
+++ b/docs/html/guide/tutorials/notepad/notepad-ex1.jd
@@ -44,11 +44,13 @@
       In the New Android Project dialog, select <strong>Create project from existing source</strong>.</li>
     <li>
       Click <strong>Browse</strong> and navigate to where you copied the <code>NotepadCodeLab</code> 
-      (downloaded during <a href="{@docRoot}guide/tutorials/notepad/index.html#preparing">setup</a>). Select 
-      <code>Notepadv1</code> and click <strong>Choose</strong>.</li>
+      (downloaded during <a href="{@docRoot}guide/tutorials/notepad/index.html#preparing">setup</a>) 
+      and select <code>Notepadv1</code>.</li>
     <li>
-      You should see <code>Notepadv1</code> in the <em>Project name</em> and also see the <em>Location</em>
-      filled in with the path you selected.</li>
+      The Project Name and other properties should be automatically filled for you. 
+      You must select the Build Target&mdash;we recommend selecting a target with the 
+      lowest platform version available. Also add an integer to the Min SDK Version field 
+      that matches the API Level of the selected Build Target.</li>
     <li>
       Click <strong>Finish</strong>. The <code>Notepadv1</code> project should open and be 
       visible in your Eclipse package explorer.</li>
diff --git a/docs/html/guide/tutorials/views/hello-mapview.jd b/docs/html/guide/tutorials/views/hello-mapview.jd
index 30b92c4..868bfaa 100644
--- a/docs/html/guide/tutorials/views/hello-mapview.jd
+++ b/docs/html/guide/tutorials/views/hello-mapview.jd
@@ -75,7 +75,7 @@
       certificate has been registered with the Google Maps service. Because MapView uses Google Maps data, this key is required
       in order to receive the map data, even while you are developing. Registration is free and it only takes a couple
       minutes to register your certificate and receive a Maps API Key. For instructions on getting a key, read
-      <a href="{@docRoot}guide/topics/location/geo/mapkey.html">Obtaining a Maps API Key</a>.
+      <a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">Obtaining a Maps API Key</a>.
       (For the purpose of this tutorial, you should register with the fingerprint of the SDK debug certificate.)
       Once you've acquired the Maps API Key, insert it for the <code>apiKey</code> value.</p></li>
 
diff --git a/docs/html/sdk/RELEASENOTES.jd b/docs/html/sdk/RELEASENOTES.jd
index ed82b6b..db93215 100644
--- a/docs/html/sdk/RELEASENOTES.jd
+++ b/docs/html/sdk/RELEASENOTES.jd
@@ -207,7 +207,7 @@
 
 <pre><code>&lt;manifest&gt;
   ...
-  &lt;uses-sdk minSdkVersion="2" /&gt;
+  &lt;uses-sdk android:minSdkVersion="2" /&gt;
   ...
 &lt;/manifest&gt;</code>
 </pre>
@@ -219,11 +219,11 @@
 Android 1.1. </p>
 
 <p>If your application uses APIs introduced in Android 1.1 but does not declare
-<code>&lt;uses-sdk minSdkVersion="2" /&gt;</code>, then it will run properly on
+<code>&lt;uses-sdk android:minSdkVersion="2" /&gt;</code>, then it will run properly on
 Android 1.1 devices but <em>not</em> on Android 1.0 devices. </p>
 
 <p>If your application does not use any new APIs introduced in Android 1.1, you
-can indicate Android 1.0 compatibility by removing <code>minSdkVersion</code> or
+can indicate Android 1.0 compatibility by removing <code>android:minSdkVersion</code> or
 setting the attribute to "1". However, before publishing your application, you
 must make sure to compile your application against the Android 1.0 system image
 (available in the Android 1.0 SDK), to ensure that it builds and functions
@@ -271,7 +271,7 @@
 <p>Developers should note that the registration service for MapView is now
 active and Google Maps is actively enforcing the Maps API Key requirement. 
 For information about how to register for a Maps API Key, see 
-<a href="{@docRoot}guide/topics/location/geo/mapkey.html">
+<a href="http://code.google.com/android/add-ons/google-apis/mapkey.html">
 Obtaining a Maps API Key</a>.</p>
 
 <p><strong>USB Drivers for Windows</strong></p>
diff --git a/docs/html/sdk/android-1.1.jd b/docs/html/sdk/android-1.1.jd
index ce75e60..8123fa8 100644
--- a/docs/html/sdk/android-1.1.jd
+++ b/docs/html/sdk/android-1.1.jd
@@ -35,17 +35,17 @@
 the system, prior to installing the application. </p>
 
 <p>Applications indicate the lowest system API Level that they are compatible with by adding
-a value to the <code>minSdkVersion</code> attribute.
+a value to the <code>android:minSdkVersion</code> attribute.
 The value of the attribute is an integer corresponding to an API Level 
 identifier. Prior to installing an application, the system checks the value of 
-<code>minSdkVersion</code> and allows the install only
+<code>android:minSdkVersion</code> and allows the install only
 if the referenced integer is less than or equal to the API Level integer stored
 in the system itself. </p>
 
 <p>If you use the Android 1.1 system image to build an application
 compatible with Android-powered devices running the Android 1.1
 platform, you <strong style="color:red">must</strong> set the
-<code>minSdkVersion</code> attribute to "2" in order to specify that your application
+<code>android:minSdkVersion</code> attribute to "2" in order to specify that your application
 is compatible only with devices using the Android 1.1 (or greater) system image.
 </p>
 
@@ -68,14 +68,14 @@
 it uses <a href="#apichange">APIs introduced in Android 1.1</a>. </p>
 
 <p>If your application uses APIs introduced in Android 1.1 but does not
-declare <code>&lt;uses-sdk minSdkVersion="2" /&gt;</code>, then it will
+declare <code>&lt;uses-sdk android:minSdkVersion="2" /&gt;</code>, then it will
 run properly on Android 1.1 devices but <em>not</em> on Android 1.0
 devices. In the latter case, the application will crash at runtime when
 it tries to use the Android 1.1 APIs.</p>
 
 <p>If your application does not use any new APIs introduced in Android
 1.1, you can indicate Android 1.0 compatibility by removing
-<code>minSdkVersion</code> or setting the attribute to "1". However,
+<code>android:minSdkVersion</code> or setting the attribute to "1". However,
 before publishing your application, you must make sure to compile your
 application against the Android 1.0 system image (available in the
 Android 1.0 SDK), to ensure that it builds and functions properly for
diff --git a/docs/html/sdk/android-1.5.jd b/docs/html/sdk/android-1.5.jd
index df52b62..addd6446 100644
--- a/docs/html/sdk/android-1.5.jd
+++ b/docs/html/sdk/android-1.5.jd
@@ -38,10 +38,10 @@
 <p>Applications can reference a specific API Level value in their
 manifest files, to indicate the minimum version of the Android system
 required to run the application. To reference a minimum API Level, applications 
-can add a <code>minSdkVersion</code> attribute in their manifest files.
+can add an <code>android:minSdkVersion</code> attribute in their manifest files.
 The value of the attribute is an integer corresponding to an API Level 
 identifier. Prior to installing an application, the system then checks the value of 
-<code>minSdkVersion</code> and allows the install only
+<code>android:minSdkVersion</code> and allows the install only
 if the referenced integer is less than or equal to the API Level integer stored
 in the system itself. </p>
 
@@ -51,10 +51,10 @@
 version of the platform that your application can support. After you determine 
 the lowest version, you should ensure that your application's manifest file 
 defines the API Level of the lowest compatible platform version in the 
-<code>minSdkVersion</code> attribute.
+<code>android:minSdkVersion</code> attribute.
 
 <p>After compiling your application, you should make sure to test it on the
-platform specified in the application's <code>minSdkVersion</code> attribute. To
+platform specified in the application's <code>android:minSdkVersion</code> attribute. To
 ensure forward-compatibility, you should also run the application on platforms
 using a higher API Level than that used by your application. To run your
 application against different platform versions in the emulator, you create an
@@ -76,7 +76,7 @@
 
 <pre>&lt;manifest&gt;
   ...
-  &lt;uses-sdk minSdkVersion="3" /&gt;
+  &lt;uses-sdk android:minSdkVersion="3" /&gt;
   ...
 &lt;/manifest&gt;</pre>
 
@@ -88,7 +88,7 @@
 introduced in Android 1.5</a>. </p>
 
 <p>If your application uses APIs introduced in Android 1.5 but does not
-declare <code>&lt;uses-sdk minSdkVersion="3" /&gt;</code>, then it will
+declare <code>&lt;uses-sdk android:minSdkVersion="3" /&gt;</code>, then it will
 run properly on Android 1.5 devices but <em>not</em> on Android 1.0
 devices. In the latter case, the application will crash at runtime when
 it tries to use the Android 1.5 APIs.</p>
@@ -108,7 +108,7 @@
 set it to "1". However,
 before publishing your application, you must make sure to compile your
 application against the Android library that corresponds to the application's
-<code>minSdkVeresion</code> value.</p>
+<code>android:minSdkVeresion</code> value.</p>
 
 <h2 id="apps">Built-in Applications</h2>
 
diff --git a/docs/html/sdk/api_diff/3/changes.html b/docs/html/sdk/api_diff/3/changes.html
index 2ff5de8..bc0f879 100644
--- a/docs/html/sdk/api_diff/3/changes.html
+++ b/docs/html/sdk/api_diff/3/changes.html
@@ -25,16 +25,13 @@
 <style type="text/css">
 body{background-image:url();padding:12px;}
 </style>
-<style type="text/css">
-frame {border:10px solid green;}
-</style
-</HEAD>
-<FRAMESET COLS="242,**" frameborder="1" border="7" xframespacing="20" bordercolor="#e9e9e9"> 
-<frameset rows="164,**" frameborder="1" border="7" xframespacing="20" resizable="yes">
-    <FRAME SRC="changes/jdiff_topleftframe.html" SCROLLING="no" NAME="topleftframe" xframeborder="1" xborder="6" xframespacing="0">
-    <FRAME SRC="changes/alldiffs_index_all.html" SCROLLING="auto" NAME="bottomleftframe" xframeborder="1" xborder="1" xframespacing="0">
+</head>
+<FRAMESET COLS="242,**" frameborder="1" border="7" bordercolor="#e9e9e9"> 
+<frameset rows="164,**" frameborder="1" border="7" resizable="yes">
+    <FRAME SRC="changes/jdiff_topleftframe.html" SCROLLING="no" NAME="topleftframe">
+    <FRAME SRC="changes/alldiffs_index_all.html" SCROLLING="auto" NAME="bottomleftframe">
   </FRAMESET>
-  <FRAME SRC="changes/changes-summary.html" SCROLLING="auto" NAME="rightframe" xframeborder="1" xborder="1" xframespacing="0">
+  <FRAME SRC="changes/changes-summary.html" SCROLLING="auto" NAME="rightframe">
 </FRAMESET>
 <NOFRAMES>
 <H2>
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index 096622a..2c214c9 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -59,9 +59,9 @@
     boolean isProviderEnabled(String provider);
 
     Location getLastKnownLocation(String provider);
-    
+
     /* used by location providers to tell the location manager when it has a new location */
-    void setLocation(in Location location);
+    void reportLocation(in Location location);
 
     String getFromLocation(double latitude, double longitude, int maxResults,
         String language, String country, String variant, String appName, out List<Address> addrs);
@@ -82,7 +82,7 @@
     void clearTestProviderStatus(String provider);
 
     /* for installing external Location Providers */
-    void setNetworkLocationProvider(ILocationProvider provider);
-    void setLocationCollector(ILocationCollector collector);
-    void setGeocodeProvider(IGeocodeProvider provider);
+    void installLocationProvider(String name, ILocationProvider provider);
+    void installLocationCollector(ILocationCollector collector);
+    void installGeocodeProvider(IGeocodeProvider provider);
 }
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index dacfeb9..aef8985 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -1255,4 +1255,85 @@
             return false;
         }
     }
+
+    /**
+     * Installs a network location provider.
+     *
+     * @param name of the location provider
+     * @param provider Binder interface for the location provider
+     *
+     * @return true if the command succeeds.
+     *
+     * Requires the android.permission.INSTALL_LOCATION_PROVIDER permission.
+     *
+     * {@hide}
+     */
+    public boolean installLocationProvider(String name, ILocationProvider provider) {
+        try {
+            mService.installLocationProvider(name, provider);
+            return true;
+        } catch (RemoteException e) {
+            Log.e(TAG, "RemoteException in installLocationProvider: ", e);
+            return false;
+        }
+    }
+
+    /**
+     * Installs a location collector.
+     *
+     * @param provider Binder interface for the location collector
+     *
+     * @return true if the command succeeds.
+     *
+     * Requires the android.permission.INSTALL_LOCATION_COLLECTOR permission.
+     *
+     * {@hide}
+     */
+    public boolean installLocationCollector(ILocationCollector collector) {
+        try {
+            mService.installLocationCollector(collector);
+            return true;
+        } catch (RemoteException e) {
+            Log.e(TAG, "RemoteException in setLocationCollector: ", e);
+            return false;
+        }
+    }
+
+    /**
+     * Installs a geocoder server.
+     *
+     * @param provider Binder interface for the geocoder provider
+     *
+     * @return true if the command succeeds.
+     *
+     * Requires the android.permission.INSTALL_LOCATION_PROVIDER permission.
+     *
+     * {@hide}
+     */
+    public boolean installGeocodeProvider(IGeocodeProvider provider) {
+        try {
+            mService.installGeocodeProvider(provider);
+            return true;
+        } catch (RemoteException e) {
+            Log.e(TAG, "RemoteException in setGeocodeProvider: ", e);
+            return false;
+        }
+    }
+
+    /**
+     * Used by location providers to report new locations.
+     *
+     * @param location new Location to report
+     *
+     * Requires the android.permission.INSTALL_LOCATION_PROVIDER permission.
+     *
+     * {@hide}
+     */
+    public void reportLocation(Location location) {
+        try {
+            mService.reportLocation(location);
+        } catch (RemoteException e) {
+            Log.e(TAG, "RemoteException in reportLocation: ", e);
+        }
+    }
 }
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java
index 693848b..5877dd1 100644
--- a/location/java/com/android/internal/location/GpsLocationProvider.java
+++ b/location/java/com/android/internal/location/GpsLocationProvider.java
@@ -708,7 +708,7 @@
             }
 
             try {
-                mLocationManager.setLocation(mLocation);
+                mLocationManager.reportLocation(mLocation);
             } catch (RemoteException e) {
                 Log.e(TAG, "RemoteException calling reportLocation");
             }
diff --git a/location/java/com/android/internal/location/MockProvider.java b/location/java/com/android/internal/location/MockProvider.java
index 6fa2c29..d81d0ab 100644
--- a/location/java/com/android/internal/location/MockProvider.java
+++ b/location/java/com/android/internal/location/MockProvider.java
@@ -138,7 +138,7 @@
         mLocation.set(l);
         mHasLocation = true;
         try {
-            mLocationManager.setLocation(mLocation);
+            mLocationManager.reportLocation(mLocation);
         } catch (RemoteException e) {
             Log.e(TAG, "RemoteException calling reportLocation");
         }
diff --git a/media/jni/Android.mk b/media/jni/Android.mk
index 3620494..8ee0cbd 100644
--- a/media/jni/Android.mk
+++ b/media/jni/Android.mk
@@ -3,31 +3,32 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
-	android_media_MediaPlayer.cpp \
-	android_media_MediaRecorder.cpp \
-	android_media_MediaScanner.cpp \
-	android_media_MediaMetadataRetriever.cpp \
-	android_media_AmrInputStream.cpp \
-	android_media_ResampleInputStream.cpp
+    android_media_MediaPlayer.cpp \
+    android_media_MediaRecorder.cpp \
+    android_media_MediaScanner.cpp \
+    android_media_MediaMetadataRetriever.cpp \
+    android_media_AmrInputStream.cpp \
+    android_media_ResampleInputStream.cpp
 
 LOCAL_SHARED_LIBRARIES := \
-	libopencoreplayer \
-	libopencoreauthor \
-	libandroid_runtime \
-	libnativehelper \
-	libcutils \
-	libutils \
-	libmedia \
-	libsgl \
-	libui
+    libopencore_player \
+    libopencore_author \
+    libomx_amrenc_sharedlibrary \
+    libandroid_runtime \
+    libnativehelper \
+    libcutils \
+    libutils \
+    libmedia \
+    libsgl \
+    libui
 
 LOCAL_STATIC_LIBRARIES :=
 
 LOCAL_C_INCLUDES += \
-	external/tremor/Tremor \
-	$(PV_INCLUDES) \
-	$(JNI_H_INCLUDE) \
-	$(call include-path-for, corecg graphics)
+    external/tremor/Tremor \
+    $(PV_INCLUDES) \
+    $(JNI_H_INCLUDE) \
+    $(call include-path-for, corecg graphics)
 
 LOCAL_CFLAGS +=
 
diff --git a/media/jni/android_media_AmrInputStream.cpp b/media/jni/android_media_AmrInputStream.cpp
index 978c110..51cb6c7 100644
--- a/media/jni/android_media_AmrInputStream.cpp
+++ b/media/jni/android_media_AmrInputStream.cpp
@@ -74,7 +74,7 @@
     encodeProps.iInNumChannels = 1;
     encodeProps.iInInterleaveMode = TEncodeProperties::EINTERLEAVE_LR;
     encodeProps.iMode = CPvGsmAmrEncoder::GSM_AMR_12_2;
-    encodeProps.iBitStreamFormatIf2 = false;
+    encodeProps.iBitStreamFormat = false;
     encodeProps.iAudioObjectType = 0;
     encodeProps.iOutSamplingRate = encodeProps.iInSamplingRate;
     encodeProps.iOutNumChannels = encodeProps.iInNumChannels;
diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk
index f710921..f7f2490 100644
--- a/media/libmediaplayerservice/Android.mk
+++ b/media/libmediaplayerservice/Android.mk
@@ -7,28 +7,28 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:=               \
-	MediaRecorderClient.cpp \
-	MediaPlayerService.cpp \
-	MetadataRetrieverClient.cpp \
-	VorbisPlayer.cpp \
-	MidiFile.cpp
+    MediaRecorderClient.cpp \
+    MediaPlayerService.cpp \
+    MetadataRetrieverClient.cpp \
+    VorbisPlayer.cpp \
+    MidiFile.cpp
 
 ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
 LOCAL_LDLIBS += -ldl -lpthread
 endif
 
 LOCAL_SHARED_LIBRARIES := \
-	libcutils \
-	libutils \
-	libvorbisidec \
-	libsonivox \
-	libopencoreplayer \
-	libopencoreauthor \
-	libmedia \
-	libandroid_runtime
+    libcutils \
+    libutils \
+    libvorbisidec \
+    libsonivox \
+    libopencore_player \
+    libopencore_author \
+    libmedia \
+    libandroid_runtime
 
 LOCAL_C_INCLUDES := external/tremor/Tremor \
-	$(call include-path-for, graphics corecg)
+    $(call include-path-for, graphics corecg)
 
 LOCAL_MODULE:= libmediaplayerservice
 
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index d44abaa..9af729e 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -106,6 +106,10 @@
         android.Manifest.permission.ACCESS_MOCK_LOCATION;
     private static final String ACCESS_LOCATION_EXTRA_COMMANDS =
         android.Manifest.permission.ACCESS_LOCATION_EXTRA_COMMANDS;
+    private static final String INSTALL_LOCATION_PROVIDER =
+        android.Manifest.permission.INSTALL_LOCATION_PROVIDER;
+    private static final String INSTALL_LOCATION_COLLECTOR =
+        android.Manifest.permission.INSTALL_LOCATION_COLLECTOR;
 
     // Set of providers that are explicitly enabled
     private final Set<String> mEnabledProviders = new HashSet<String>();
@@ -626,36 +630,39 @@
         Looper.loop();
     }
 
-    public void setNetworkLocationProvider(ILocationProvider provider) {
-        if (Binder.getCallingUid() != Process.SYSTEM_UID) {
-            throw new SecurityException(
-                "Installing location providers outside of the system is not supported");
+    public void installLocationProvider(String name, ILocationProvider provider) {
+        if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER)
+                != PackageManager.PERMISSION_GRANTED) {
+            throw new SecurityException("Requires INSTALL_LOCATION_PROVIDER permission");
         }
 
         synchronized (mLock) {
-            mNetworkLocationProvider =
-                    new LocationProviderProxy(LocationManager.NETWORK_PROVIDER, provider);
-            addProvider(mNetworkLocationProvider);
-            updateProvidersLocked();
-            
-            // notify NetworkLocationProvider of any events it might have missed
-            mNetworkLocationProvider.updateNetworkState(mNetworkState);
+            // FIXME - only network location provider supported for now
+            if (LocationManager.NETWORK_PROVIDER.equals(name)) {
+                mNetworkLocationProvider = new LocationProviderProxy(name, provider);
+                addProvider(mNetworkLocationProvider);
+                updateProvidersLocked();
+
+                // notify NetworkLocationProvider of any events it might have missed
+                mNetworkLocationProvider.updateNetworkState(mNetworkState);
+            }
         }
     }
 
-    public void setLocationCollector(ILocationCollector collector) {
-        if (Binder.getCallingUid() != Process.SYSTEM_UID) {
-            throw new SecurityException(
-                "Installing location collectors outside of the system is not supported");
+    public void installLocationCollector(ILocationCollector collector) {
+        if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_COLLECTOR)
+                != PackageManager.PERMISSION_GRANTED) {
+            throw new SecurityException("Requires INSTALL_LOCATION_COLLECTOR permission");
         }
 
+        // FIXME - only support one collector
         mCollector = collector;
     }
 
-    public void setGeocodeProvider(IGeocodeProvider provider) {
-        if (Binder.getCallingUid() != Process.SYSTEM_UID) {
-            throw new SecurityException(
-                "Installing location providers outside of the system is not supported");
+    public void installGeocodeProvider(IGeocodeProvider provider) {
+        if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER)
+                != PackageManager.PERMISSION_GRANTED) {
+            throw new SecurityException("Requires INSTALL_LOCATION_PROVIDER permission");
         }
 
         mGeocodeProvider = provider;
@@ -1472,7 +1479,12 @@
         }
     }
 
-    public void setLocation(Location location) {
+    public void reportLocation(Location location) {
+        if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER)
+                != PackageManager.PERMISSION_GRANTED) {
+            throw new SecurityException("Requires INSTALL_LOCATION_PROVIDER permission");
+        }
+
         mLocationHandler.removeMessages(MESSAGE_LOCATION_CHANGED, location);
         Message m = Message.obtain(mLocationHandler, MESSAGE_LOCATION_CHANGED, location);
         mLocationHandler.sendMessageAtFrontOfQueue(m);
diff --git a/test-runner/android/test/TestLocationProvider.java b/test-runner/android/test/TestLocationProvider.java
index 500786d..08603e3 100644
--- a/test-runner/android/test/TestLocationProvider.java
+++ b/test-runner/android/test/TestLocationProvider.java
@@ -189,7 +189,7 @@
         mLocation.setExtras(extras);
         mLocation.setTime(time);
         try {
-            mLocationManager.setLocation(mLocation);
+            mLocationManager.reportLocation(mLocation);
         } catch (RemoteException e) {
             Log.e(TAG, "RemoteException calling updateLocation");
         }