Merge change 21298 into eclair

* changes:
  ConnectivityService: Do not send broadcasts until the system is ready.
diff --git a/core/java/android/provider/Im.java b/core/java/android/provider/Im.java
index b11abe8..b1cf648 100644
--- a/core/java/android/provider/Im.java
+++ b/core/java/android/provider/Im.java
@@ -1620,6 +1620,9 @@
         /** specifies the last heartbeat interval received from the server */
         public static final String SETTING_HEARTBEAT_INTERVAL = "heartbeat_interval";
 
+        /** specifiy the JID resource used for Google Talk connection */
+        public static final String SETTING_JID_RESOURCE = "jid_resource";
+
         /**
          * Used for reliable message queue (RMQ). This is for storing the last rmq id received
          * from the GTalk server
@@ -1861,6 +1864,14 @@
             putLongValue(contentResolver, providerId, SETTING_HEARTBEAT_INTERVAL, interval);
         }
 
+        /**
+         * A convenience method to set the jid resource.
+         */
+        public static void setJidResource(ContentResolver contentResolver,
+                                          long providerId, String jidResource) {
+            putStringValue(contentResolver, providerId, SETTING_JID_RESOURCE, jidResource);
+        }
+
         public static class QueryMap extends ContentQueryMap {
             private ContentResolver mContentResolver;
             private long mProviderId;
@@ -2047,6 +2058,23 @@
             }
 
             /**
+             * Set the JID resource.
+             *
+             * @param jidResource the jid resource to be stored.
+             */
+            public void setJidResource(String jidResource) {
+                ProviderSettings.setJidResource(mContentResolver, mProviderId, jidResource);
+            }
+            /**
+             * Get the JID resource used for the Google Talk connection
+             *
+             * @return the JID resource stored.
+             */
+            public String getJidResource() {
+                return getString(SETTING_JID_RESOURCE, null);
+            }
+
+            /**
              * Convenience function for retrieving a single settings value
              * as a boolean.
              *
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 85a2041..d3e4c4c 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -413,8 +413,6 @@
 
     private static final String TAG = "Settings";
 
-    private static String sJidResource = null;
-
     public static class SettingNotFoundException extends AndroidException {
         public SettingNotFoundException(String msg) {
             super(msg);
@@ -3622,42 +3620,6 @@
     }
 
     /**
-     * Returns the GTalk JID resource associated with this device.
-     *
-     * @return  String  the JID resource of the device. It uses the device IMEI in the computation
-     * of the JID resource. If IMEI is not ready (i.e. telephony module not ready), we'll return
-     * an empty string.
-     * @hide
-     */
-    // TODO: we shouldn't not have a permenant Jid resource, as that's an easy target for
-    // spams. We should change it once a while, like when we resubscribe to the subscription feeds
-    // server.
-    // (also, should this live in GTalkService?)
-    public static synchronized String getJidResource() {
-        if (sJidResource != null) {
-            return sJidResource;
-        }
-
-        MessageDigest digest;
-        try {
-            digest = MessageDigest.getInstance("SHA-1");
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException("this should never happen");
-        }
-
-        String deviceId = TelephonyManager.getDefault().getDeviceId();
-        if (TextUtils.isEmpty(deviceId)) {
-            return "";
-        }
-
-        byte[] hashedDeviceId = digest.digest(deviceId.getBytes());
-        String id = new String(Base64.encodeBase64(hashedDeviceId), 0, 12);
-        id = id.replaceAll("/", "_");
-        sJidResource = JID_RESOURCE_PREFIX + id;
-        return sJidResource;
-    }
-
-    /**
      * Returns the device ID that we should use when connecting to the mobile gtalk server.
      * This is a string like "android-0x1242", where the hex string is the Android ID obtained
      * from the GoogleLoginService.
diff --git a/core/java/android/webkit/CallbackProxy.java b/core/java/android/webkit/CallbackProxy.java
index 96bf46e..e77d29b 100644
--- a/core/java/android/webkit/CallbackProxy.java
+++ b/core/java/android/webkit/CallbackProxy.java
@@ -70,6 +70,9 @@
     private final WebBackForwardList mBackForwardList;
     // Used to call startActivity during url override.
     private final Context mContext;
+    // Stores the URL being loaded and the viewing mode to switch into when
+    // the URL finishes loading.
+    private ChangeViewModeOnFinishedLoad mChange;
 
     // Message Ids
     private static final int PAGE_STARTED                        = 100;
@@ -177,6 +180,37 @@
     }
 
     /**
+     * Tell the host application that the WebView has changed viewing modes.
+     * @param toZoomedOut If true, the WebView has zoomed out so that the page
+     *          fits the screen.  If false, it is zoomed to the setting
+     *          specified by the user.
+     */
+    /* package */ void uiOnChangeViewingMode(boolean toZoomOverview) {
+        if (mWebChromeClient != null) {
+            mWebChromeClient.onChangeViewingMode(toZoomOverview);
+        }
+    }
+
+    private static class ChangeViewModeOnFinishedLoad {
+        boolean mToZoomOverView;
+        String mOriginalUrl;
+        ChangeViewModeOnFinishedLoad(boolean toZoomOverview,
+                String originalUrl) {
+            mToZoomOverView = toZoomOverview;
+            mOriginalUrl = originalUrl;
+        }
+    }
+
+    /**
+     * Keep track of the url and the viewing mode to change into.  If/when that
+     * url finishes loading, this will change the viewing mode.
+     */
+    /* package */ void uiChangeViewingModeOnFinishedLoad(
+            boolean toZoomOverview, String originalUrl) {
+        if (mWebChromeClient == null) return;
+        mChange = new ChangeViewModeOnFinishedLoad(toZoomOverview, originalUrl);
+    }
+    /**
      * Called by the UI side.  Calling overrideUrlLoading from the WebCore
      * side will post a message to call this method.
      */
@@ -237,6 +271,15 @@
                 if (mWebViewClient != null) {
                     mWebViewClient.onPageFinished(mWebView, (String) msg.obj);
                 }
+                if (mChange != null) {
+                    if (mWebView.getOriginalUrl().equals(mChange.mOriginalUrl)) {
+                        uiOnChangeViewingMode(mChange.mToZoomOverView);
+                    } else {
+                        // The user has gone to a different page, so there is
+                        // no need to hang on to the old object.
+                        mChange = null;
+                    }
+                }
                 break;
                 
             case RECEIVED_ICON:
diff --git a/core/java/android/webkit/MockGeolocation.java b/core/java/android/webkit/MockGeolocation.java
new file mode 100644
index 0000000..028cb19
--- /dev/null
+++ b/core/java/android/webkit/MockGeolocation.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.webkit;
+
+/**
+ * This class is simply a container for the methods used to configure WebKit's
+ * mock Geolocation service for use in LayoutTests.
+ * @hide Pending API council review.
+ */
+public final class MockGeolocation {
+
+    // Global instance of a MockGeolocation
+    private static MockGeolocation sMockGeolocation;
+
+    /**
+     * Set the position for the mock Geolocation service.
+     */
+    public void setPosition(double latitude, double longitude, double accuracy) {
+        // This should only ever be called on the WebKit thread.
+        nativeSetPosition(latitude, longitude, accuracy);
+    }
+
+    /**
+     * Set the error for the mock Geolocation service.
+     */
+    public void setError(int code, String message) {
+        // This should only ever be called on the WebKit thread.
+        nativeSetError(code, message);
+    }
+
+    /**
+     * Get the global instance of MockGeolocation.
+     * @return The global MockGeolocation instance.
+     */
+    public static MockGeolocation getInstance() {
+      if (sMockGeolocation == null) {
+          sMockGeolocation = new MockGeolocation();
+      }
+      return sMockGeolocation;
+    }
+
+    // Native functions
+    private static native void nativeSetPosition(double latitude, double longitude, double accuracy);
+    private static native void nativeSetError(int code, String message);
+}
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java
index c10bc97..e1c8d4d 100644
--- a/core/java/android/webkit/WebChromeClient.java
+++ b/core/java/android/webkit/WebChromeClient.java
@@ -23,6 +23,15 @@
 public class WebChromeClient {
 
     /**
+     * Tell the host application that the WebView has changed viewing modes.
+     * @param toZoomedOut If true, the WebView has zoomed out so that the page
+     *          fits the screen.  If false, it is zoomed to the setting
+     *          specified by the user.
+     * @hide
+     */
+    public void onChangeViewingMode(boolean toZoomedOut) {}
+
+    /**
      * Tell the host application the current progress of loading a page.
      * @param view The WebView that initiated the callback.
      * @param newProgress Current page loading progress, represented by
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index be9daa5..7468aef 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -521,6 +521,7 @@
     // follow the links. Double tap will toggle between zoom overview mode and
     // the last zoom scale.
     boolean mInZoomOverview = false;
+
     // ideally mZoomOverviewWidth should be mContentWidth. But sites like espn,
     // engadget always have wider mContentWidth no matter what viewport size is.
     int mZoomOverviewWidth = WebViewCore.DEFAULT_VIEWPORT_WIDTH;
@@ -4687,6 +4688,7 @@
         mZoomCenterX = mLastTouchX;
         mZoomCenterY = mLastTouchY;
         mInZoomOverview = !mInZoomOverview;
+        mCallbackProxy.uiOnChangeViewingMode(mInZoomOverview);
         if (mInZoomOverview) {
             if (getSettings().getBuiltInZoomControls()) {
                 if (mZoomButtonsController.isVisible()) {
@@ -5034,6 +5036,14 @@
                             mInZoomOverview = ENABLE_DOUBLETAP_ZOOM
                                     && settings.getLoadWithOverviewMode();
                         }
+                        mCallbackProxy.uiOnChangeViewingMode(true);
+                        if (!mInZoomOverview) {
+                            // We are going to start zoomed in.  However, we
+                            // truly want to show the title bar, and then hide
+                            // it once the page has loaded
+                            mCallbackProxy.uiChangeViewingModeOnFinishedLoad(
+                                    false, getOriginalUrl());
+                        }
                         setNewZoomScale(mLastScale, false);
                         setContentScrollTo(restoreState.mScrollX,
                                 restoreState.mScrollY);
diff --git a/core/res/res/values-en-rUS/donottranslate-names.xml b/core/res/res/values-en-rUS/donottranslate-names.xml
new file mode 100644
index 0000000..42c8ab4
--- /dev/null
+++ b/core/res/res/values-en-rUS/donottranslate-names.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    
+    <!-- various string resources for Contacts -->
+    <string-array name="common_nicknames">
+        <item>Albert, Al, Bert, Bertie</item>
+        <item>Alexander, Al, Alex, Lex, Sasha</item>
+        <item>Alexandra, Al, Alex, Allie, Ally, Lex, Lexie, Sandra, Sandy, Sasha</item>
+        <item>Alice, Allie, Ally</item>
+        <item>Alison, Allie, Ally</item>
+        <item>Allison, Allie, Ally</item>
+        <item>Amanda, Mandi, Mandy</item>
+        <item>Andrea, Andie</item>
+        <item>Andrew, Andy, Drew</item>
+        <item>Anthony, Tony, Toni, Tone</item>
+        <item>Arthur, Art, Arty</item>
+        <item>Barbara, Babs, Barb, Barbie</item>
+        <item>Benjamin, Ben, Benji, Benny</item>
+        <item>Bernard, Bern, Bernie</item>
+        <item>Bertram, Bert, Bertie</item>
+        <item>Bradly, Brad</item>
+        <item>Catherine, Cat, Cate, Cath, Catie, Cathy, Kat, Kate, Katie, Kathy</item>
+        <item>Charles, Chuck, Chaz, Charlie, Buck</item>
+        <item>Christine, Chris, Chrissy, Chrissie</item>
+        <item>Christopher, Chris</item>
+        <item>Cynthia, Cindy, Cynth</item>
+        <item>Daniel, Dan, Danny</item>
+        <item>David, Dave</item>
+        <item>Deborah, Deb, Debbie</item>
+        <item>Dennis, Den, Denny, Dean</item>
+        <item>Dolores, Dolly</item>
+        <item>Donald, Don, Donny</item>
+        <item>Donnatella, Donna</item>
+        <item>Dorothea, Dot, Dotty</item>
+        <item>Dorothy, Dot, Dotty</item>
+        <item>Douglas, Doug</item>
+        <item>Edward, Ed, Eddie, Ned, Neddie, Neddy, Ted, Teddy, Teddie</item>
+        <item>Eleanor, Ella, Ellie, Elle</item>
+        <item>Elisabetta, Betta</item>
+        <item>Elizabeth, Beth, Bess, Bessie, Betsy, Betty, Bette, Eliza, Lisa, Liza, Liz</item>
+        <item>Emily, Em, Ems, Emmy</item>
+        <item>Emma, Em, Ems, Emmy</item>
+        <item>Erica, Rikki, Rikkie, Ricky</item>
+        <item>Eugene, Gene</item>
+        <item>Florence, Flo</item>
+        <item>Frances, Fran, Francie</item>
+        <item>Francis, Fran, Frank</item>
+        <item>Frederick, Fred, Freddy</item>
+        <item>Gabriel, Gabe</item>
+        <item>Geoffrey, Jeff</item>
+        <item>Gerald, Gerry</item>
+        <item>Gerard, Gerry</item>
+        <item>Gregory, Greg</item>
+        <item>Harold, Hal, Hank, Harry</item>
+        <item>Henry, Hal, Hank, Harry</item>
+        <item>Herbert, Bert, Bertie</item>
+        <item>Irving, Irv</item>
+        <item>Isabella, Isa, Izzy</item>
+        <item>Jacob, Jake</item>
+        <item>Jacqueline, Jackie</item>
+        <item>James, Jim, Jimmy, Jamie, Jock</item>
+        <item>Janet, Jan</item>
+        <item>Janice, Jan</item>
+        <item>Jason, Jay</item>
+        <item>Jefferson, Jeff</item>
+        <item>Jeffrey, Jeff</item>
+        <item>Jennifer, Jen, Jenny</item>
+        <item>Jerome, Jerry</item>
+        <item>Jessica, Jessie</item>
+        <item>John, Jack, Jacky, Johnny, Jon</item>
+        <item>Jonathan, Jon, John</item>
+        <item>Joseph, Joe, Joey</item>
+        <item>Joshua, Josh</item>
+        <item>Kaitlyn, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
+        <item>Katherine, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
+        <item>Kathleen, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
+        <item>Katrina, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
+        <item>Kenneth, Ken</item>
+        <item>Kevin, Kev</item>
+        <item>Laura, Lauri, Laurie</item>
+        <item>Lauren, Lauri, Laurie</item>
+        <item>Laurence, Larry, Lauri, Laurie</item>
+        <item>Lawrence, Larry, Lauri, Laurie</item>
+        <item>Leonard, Leo, Len, Lenny</item>
+        <item>Leopold, Leo, Len, Lenny</item>
+        <item>Madeline, Maddie, Maddy</item>
+        <item>Margaret, Marge, Marg, Maggie, Mags, Meg, Peggy</item>
+        <item>Matthew, Matt, Mattie</item>
+        <item>Maureen, Mo</item>
+        <item>Maurice, Mo</item>
+        <item>Megan, Meg</item>
+        <item>Michael, Mickey, Mick, Mike, Mikey</item>
+        <item>Morris, Mo</item>
+        <item>Nancy, Nan</item>
+        <item>Nathan, Nat, Nate</item>
+        <item>Nathaniel, Nat, Nate</item>
+        <item>Nicholas, Nick</item>
+        <item>Pamela, Pam</item>
+        <item>Patricia, Pat, Patsy, Patty, Trish, Tricia</item>
+        <item>Patrick, Paddy, Pat, Patty, Patter, Rick, Ricky</item>
+        <item>Peter, Pete</item>
+        <item>Raymond, Ray</item>
+        <item>Philip, Phil</item>
+        <item>Rebecca, Becca</item>
+        <item>Richard, Rick, Rich, Dick</item>
+        <item>Robert, Bob, Rob, Robbie, Bobby, Rab</item>
+        <item>Roberta, Bobbie</item>
+        <item>Rodney. Rod</item>
+        <item>Ronald, Ron, Ronnie</item>
+        <item>Rosemary, Rosie, Rose</item>
+        <item>Russell, Russ, Rusty</item>
+        <item>Ryan, Ry</item>
+        <item>Samantha, Sam</item>
+        <item>Samuel, Sam, Sammy</item>
+        <item>Sophia, Sophie</item>
+        <item>Stephanie, Steph, Stephie</item>
+        <item>Stephen, Steve</item>
+        <item>Steven, Steve</item>
+        <item>Stuart, Stu</item>
+        <item>Susan, Sue, Susie, Suzie</item>
+        <item>Suzanne, Sue, Susie, Suzie</item>
+        <item>Teresa, Terrie, Terry</item>
+        <item>Theodora, Teddie, Thea, Theo</item>
+        <item>Theodore, Ted, Teddy, Theo</item>
+        <item>Thomas, Tom, Thom, Tommy</item>
+        <item>Timothy, Tim, Timmy</item>
+        <item>Valerie, Val</item>
+        <item>Veronica, Ronnie, Roni, Nica, Nikki, Nikka</item>
+        <item>Victor, Vic</item>
+        <item>Victoria, Vicky, Vicki, Vickie, Tori</item>
+        <item>Vincent, Vince, Vin, Vinnie</item>
+        <item>Vivian, Vivi</item>
+        <item>Walter, Walt, Wally</item>
+        <item>Wendy, Wen, Wendel</item>
+        <item>William, Bill, Billy, Will, Willy, Liam</item>
+        <item>Yvonna, Vonna</item>
+        <item>Zachary, Zach, Zack, Zac</item>
+    </string-array>
+    <string name="common_name_prefixes">
+        1LT, 1ST, 2LT, 2ND, 3RD, ADMIRAL, CAPT, CAPTAIN, COL, CPT, DR,
+        GEN, GENERAL, LCDR, LT, LTC, LTG, LTJG, MAJ, MAJOR, MG, MR,
+        MRS, MS, PASTOR, PROF, REP, REVEREND, REV, SEN, ST
+    </string>
+    <string name="common_name_suffixes">
+        B.A., BA, D.D.S., DDS, I, II, III, IV, IX, JR, M.A., M.D, MA,
+        MD, MS, PH.D., PHD, SR, V, VI, VII, VIII, X
+    </string>
+    <string name="common_last_name_prefixes">
+        D', DE, DEL, DI, LA, LE, MC, SAN, ST, TER, VAN, VON
+    </string>
+    <string name="common_name_conjunctions">
+        &amp;, AND, OR
+    </string>
+</resources>
diff --git a/core/res/res/values/donottranslate-names.xml b/core/res/res/values/donottranslate-names.xml
new file mode 100644
index 0000000..56ae47a
--- /dev/null
+++ b/core/res/res/values/donottranslate-names.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    
+    <!-- Various locale-specific string resources for Contacts -->
+    <string-array name="common_nicknames"></string-array>
+    <string name="common_name_prefixes"></string>
+    <string name="common_name_suffixes"></string>
+    <string name="common_last_name_prefixes"></string>
+    <string name="common_name_conjunctions"></string>
+</resources>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 815b767..22f9136 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1923,157 +1923,6 @@
     <!-- This string appears (on two lines) when you type a number into contacts search, to let you create a contact whose phone number is the number you typed.  The first line will be in bigger type than the second. -->
     <string name="create_contact_using">Create contact\nusing <xliff:g id="number" example="555">%s</xliff:g></string>
 
-    <!-- various string resources for Contacts -->
-    <string-array name="common_nicknames">
-        <item>Albert, Al, Bert, Bertie</item>
-        <item>Alexander, Al, Alex, Lex, Sasha</item>
-        <item>Alexandra, Al, Alex, Allie, Ally, Lex, Lexie, Sandra, Sandy, Sasha</item>
-        <item>Alice, Allie, Ally</item>
-        <item>Alison, Allie, Ally</item>
-        <item>Allison, Allie, Ally</item>
-        <item>Amanda, Mandi, Mandy</item>
-        <item>Andrea, Andie</item>
-        <item>Andrew, Andy, Drew</item>
-        <item>Anthony, Tony, Toni, Tone</item>
-        <item>Arthur, Art, Arty</item>
-        <item>Barbara, Babs, Barb, Barbie</item>
-        <item>Benjamin, Ben, Benji, Benny</item>
-        <item>Bernard, Bern, Bernie</item>
-        <item>Bertram, Bert, Bertie</item>
-        <item>Bradly, Brad</item>
-        <item>Catherine, Cat, Cate, Cath, Catie, Cathy, Kat, Kate, Katie, Kathy</item>
-        <item>Charles, Chuck, Chaz, Charlie, Buck</item>
-        <item>Christine, Chris, Chrissy, Chrissie</item>
-        <item>Christopher, Chris</item>
-        <item>Cynthia, Cindy, Cynth</item>
-        <item>Daniel, Dan, Danny</item>
-        <item>David, Dave</item>
-        <item>Deborah, Deb, Debbie</item>
-        <item>Dennis, Den, Denny, Dean</item>
-        <item>Dolores, Dolly</item>
-        <item>Donald, Don, Donny</item>
-        <item>Donnatella, Donna</item>
-        <item>Dorothea, Dot, Dotty</item>
-        <item>Dorothy, Dot, Dotty</item>
-        <item>Douglas, Doug</item>
-        <item>Edward, Ed, Eddie, Ned, Neddie, Neddy, Ted, Teddy, Teddie</item>
-        <item>Eleanor, Ella, Ellie, Elle</item>
-        <item>Elisabetta, Betta</item>
-        <item>Elizabeth, Beth, Bess, Bessie, Betsy, Betty, Bette, Eliza, Lisa, Liza, Liz</item>
-        <item>Emily, Em, Ems, Emmy</item>
-        <item>Emma, Em, Ems, Emmy</item>
-        <item>Erica, Rikki, Rikkie, Ricky</item>
-        <item>Eugene, Gene</item>
-        <item>Florence, Flo</item>
-        <item>Frances, Fran, Francie</item>
-        <item>Francis, Fran, Frank</item>
-        <item>Frederick, Fred, Freddy</item>
-        <item>Gabriel, Gabe</item>
-        <item>Geoffrey, Jeff</item>
-        <item>Gerald, Gerry</item>
-        <item>Gerard, Gerry</item>
-        <item>Gregory, Greg</item>
-        <item>Harold, Hal, Hank, Harry</item>
-        <item>Henry, Hal, Hank, Harry</item>
-        <item>Herbert, Bert, Bertie</item>
-        <item>Irving, Irv</item>
-        <item>Isabella, Isa, Izzy</item>
-        <item>Jacob, Jake</item>
-        <item>Jacqueline, Jackie</item>
-        <item>James, Jim, Jimmy, Jamie, Jock</item>
-        <item>Janet, Jan</item>
-        <item>Janice, Jan</item>
-        <item>Jason, Jay</item>
-        <item>Jefferson, Jeff</item>
-        <item>Jeffrey, Jeff</item>
-        <item>Jennifer, Jen, Jenny</item>
-        <item>Jerome, Jerry</item>
-        <item>Jessica, Jessie</item>
-        <item>John, Jack, Jacky, Johnny, Jon</item>
-        <item>Jonathan, Jon, John</item>
-        <item>Joseph, Joe, Joey</item>
-        <item>Joshua, Josh</item>
-        <item>Kaitlyn, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
-        <item>Katherine, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
-        <item>Kathleen, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
-        <item>Katrina, Cat, Cate, Catie, Cath, Cathy, Kat, Kate, Katie, Kathy</item>
-        <item>Kenneth, Ken</item>
-        <item>Kevin, Kev</item>
-        <item>Laura, Lauri, Laurie</item>
-        <item>Lauren, Lauri, Laurie</item>
-        <item>Laurence, Larry, Lauri, Laurie</item>
-        <item>Lawrence, Larry, Lauri, Laurie</item>
-        <item>Leonard, Leo, Len, Lenny</item>
-        <item>Leopold, Leo, Len, Lenny</item>
-        <item>Madeline, Maddie, Maddy</item>
-        <item>Margaret, Marge, Marg, Maggie, Mags, Meg, Peggy</item>
-        <item>Matthew, Matt, Mattie</item>
-        <item>Maureen, Mo</item>
-        <item>Maurice, Mo</item>
-        <item>Megan, Meg</item>
-        <item>Michael, Mickey, Mick, Mike, Mikey</item>
-        <item>Morris, Mo</item>
-        <item>Nancy, Nan</item>
-        <item>Nathan, Nat, Nate</item>
-        <item>Nathaniel, Nat, Nate</item>
-        <item>Nicholas, Nick</item>
-        <item>Pamela, Pam</item>
-        <item>Patricia, Pat, Patsy, Patty, Trish, Tricia</item>
-        <item>Patrick, Paddy, Pat, Patty, Patter, Rick, Ricky</item>
-        <item>Peter, Pete</item>
-        <item>Raymond, Ray</item>
-        <item>Philip, Phil</item>
-        <item>Rebecca, Becca</item>
-        <item>Richard, Rick, Rich, Dick</item>
-        <item>Robert, Bob, Rob, Robbie, Bobby, Rab</item>
-        <item>Roberta, Bobbie</item>
-        <item>Rodney. Rod</item>
-        <item>Ronald, Ron, Ronnie</item>
-        <item>Rosemary, Rosie, Rose</item>
-        <item>Russell, Russ, Rusty</item>
-        <item>Ryan, Ry</item>
-        <item>Samantha, Sam</item>
-        <item>Samuel, Sam, Sammy</item>
-        <item>Sophia, Sophie</item>
-        <item>Stephanie, Steph, Stephie</item>
-        <item>Stephen, Steve</item>
-        <item>Steven, Steve</item>
-        <item>Stuart, Stu</item>
-        <item>Susan, Sue, Susie, Suzie</item>
-        <item>Suzanne, Sue, Susie, Suzie</item>
-        <item>Teresa, Terrie, Terry</item>
-        <item>Theodora, Teddie, Thea, Theo</item>
-        <item>Theodore, Ted, Teddy, Theo</item>
-        <item>Thomas, Tom, Thom, Tommy</item>
-        <item>Timothy, Tim, Timmy</item>
-        <item>Valerie, Val</item>
-        <item>Veronica, Ronnie, Roni, Nica, Nikki, Nikka</item>
-        <item>Victor, Vic</item>
-        <item>Victoria, Vicky, Vicki, Vickie, Tori</item>
-        <item>Vincent, Vince, Vin, Vinnie</item>
-        <item>Vivian, Vivi</item>
-        <item>Walter, Walt, Wally</item>
-        <item>Wendy, Wen, Wendel</item>
-        <item>William, Bill, Billy, Will, Willy, Liam</item>
-        <item>Yvonna, Vonna</item>
-        <item>Zachary, Zach, Zack, Zac</item>
-    </string-array>
-    <string name="common_name_prefixes">
-        1LT, 1ST, 2LT, 2ND, 3RD, ADMIRAL, CAPT, CAPTAIN, COL, CPT, DR,
-        GEN, GENERAL, LCDR, LT, LTC, LTG, LTJG, MAJ, MAJOR, MG, MR,
-        MRS, MS, PASTOR, PROF, REP, REVEREND, REV, SEN, ST
-    </string>
-    <string name="common_name_suffixes">
-        B.A., BA, D.D.S., DDS, I, II, III, IV, IX, JR, M.A., M.D, MA,
-        MD, MS, PH.D., PHD, SR, V, VI, VII, VIII, X
-    </string>
-    <string name="common_last_name_prefixes">
-        D', DE, DEL, DI, LA, LE, MC, SAN, ST, TER, VAN, VON
-    </string>
-    <string name="common_name_conjunctions">
-        &amp;, AND, OR
-    </string>
-
     <!-- This string array should be overridden by the manufacture to present a list of carrier-id,locale,wifi-channel sets.  This is used at startup to set system defaults by checking the system property ro.carrier for the carrier-id and searching through this array -->
     <!-- An Array of [[Carrier-ID]                     -->
     <!--              [default-locale]                 -->
diff --git a/graphics/java/android/graphics/DashPathEffect.java b/graphics/java/android/graphics/DashPathEffect.java
index 3deca4a..4f16dc4 100644
--- a/graphics/java/android/graphics/DashPathEffect.java
+++ b/graphics/java/android/graphics/DashPathEffect.java
@@ -23,13 +23,13 @@
      * the even indices specifying the "on" intervals, and the odd indices
      * specifying the "off" intervals. phase is an offset into the intervals
      * array (mod the sum of all of the intervals). The intervals array
-     * controlls the width of the dashes. The paint's strokeWidth controlls the
-     * height of the dashes.
+     * controls the length of the dashes. The paint's strokeWidth controls the
+     * thickness of the dashes.
      * Note: this patheffect only affects drawing with the paint's style is set
      * to STROKE or STROKE_AND_FILL. It is ignored if the drawing is done with
      * style == FILL.
      * @param intervals array of ON and OFF distances
-     * @param phase offset before the first ON interval is drawn
+     * @param phase offset into the intervals array
      */
     public DashPathEffect(float intervals[], float phase) {
         if (intervals.length < 2) {
diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h
index 3db8a0f..9ea2775 100644
--- a/include/media/mediametadataretriever.h
+++ b/include/media/mediametadataretriever.h
@@ -52,6 +52,7 @@
     METADATA_KEY_VIDEO_FORMAT    = 18,
     METADATA_KEY_VIDEO_HEIGHT    = 19,
     METADATA_KEY_VIDEO_WIDTH     = 20,
+    METADATA_KEY_WRITER          = 21,
     // Add more here...
 };
 
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index c6a9ae8..cecf4f8 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -254,5 +254,6 @@
     public static final int METADATA_KEY_VIDEO_FORMAT    = 18;
     public static final int METADATA_KEY_VIDEO_HEIGHT    = 19;
     public static final int METADATA_KEY_VIDEO_WIDTH     = 20;
+    public static final int METADATA_KEY_WRITER          = 21;
     // Add more here...
 }
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index 71af909..376057e 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -396,6 +396,7 @@
         private String mPath;
         private long mLastModified;
         private long mFileSize;
+        private String mWriter;
 
         public FileCacheEntry beginFile(String path, String mimeType, long lastModified, long fileSize) {
 
@@ -479,6 +480,7 @@
             mDuration = 0;
             mPath = path;
             mLastModified = lastModified;
+            mWriter = null;
 
             return entry;
         }
@@ -593,6 +595,8 @@
                 mTrack = (num * 1000) + (mTrack % 1000);
             } else if (name.equalsIgnoreCase("duration")) {
                 mDuration = parseSubstring(value, 0, 0);
+            } else if (name.equalsIgnoreCase("writer") || name.startsWith("writer;")) {
+                mWriter = value.trim();
             }
         }
 
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java
index e76967d..3f2bc39 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaNames.java
@@ -372,81 +372,81 @@
   public static final String META_DATA_MP3 [][] = {
       {"/sdcard/media_api/metaDataTestMedias/MP3/ID3V1_ID3V2.mp3", "1/10", "ID3V2.3 Album", "ID3V2.3 Artist",
           "ID3V2.3 Lyricist", "ID3V2.3 Composer", null, "Blues",
-          "ID3V2.3 Title", "1234", "295", "1"},
+          "ID3V2.3 Title", "1234", "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/ID3V2.mp3", "1/10", "ID3V2.3 Album", "ID3V2.3 Artist",
           "ID3V2.3 Lyricist", "ID3V2.3 Composer", null, "Blues", 
-          "ID3V2.3 Title", "1234", "287", "1"},
+          "ID3V2.3 Title", "1234", "287", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/ID3V1.mp3", "1", "test ID3V1 Album", "test ID3V1 Artist",
-          null, null, null, "255", "test ID3V1 Title", "1234", "231332", "1"},
+          null, null, null, "255", "test ID3V1 Title", "1234", "231332", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V1.mp3" , null, null, null,
-              null, null, null, null, null, null, "231330", "1"},
+              null, null, null, null, null, null, "231330", "1", null},
       //The corrupted TALB field in id3v2 would not switch to id3v1 tag automatically
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TALB.mp3", "01", null, "ID3V2.3 Artist",
           "ID3V2.3 Lyricist", "ID3V2.3 Composer", null, 
-          "Blues", "ID3V2.3 Title", "1234", "295", "1"},
+          "Blues", "ID3V2.3 Title", "1234", "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TCOM.mp3", "01", "ID3V2.3 Album", 
            "ID3V2.3 Artist", "ID3V2.3 Lyricist", null, null, 
-           "Blues", "ID3V2.3 Title", "1234", "295", "1"},
+           "Blues", "ID3V2.3 Title", "1234", "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TCOM_2.mp3", "01", "ID3V2.3 Album", 
-           "ID3V2.3 Artist", null, null, null, "Blues", "ID3V2.3 Title", "1234", "295", "1"},
+           "ID3V2.3 Artist", null, null, null, "Blues", "ID3V2.3 Title", "1234", "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TRCK.mp3", "dd", "ID3V2.3 Album", 
            "ID3V2.3 Artist", "ID3V2.3 Lyricist", "ID3V2.3 Composer", null,
-           "Blues", "ID3V2.3 Title", "1234", "295", "1"},
+           "Blues", "ID3V2.3 Title", "1234", "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TRCK_2.mp3", "01", "ID3V2.3 Album", 
-           "ID3V2.3 Artist", null, null, null, "255", "ID3V2.3 Title", "1234", "295", "1"},
+           "ID3V2.3 Artist", null, null, null, "255", "ID3V2.3 Title", "1234", "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TYER.mp3", "01", "ID3V2.3 Album",
-           "ID3V2.3 Artist", null, null, null, null, "ID3V2.3 Title", "9999", "295", "1"},
+           "ID3V2.3 Artist", null, null, null, null, "ID3V2.3 Title", "9999", "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TYER_2.mp3", "01", "ID3V2.3 Album",
            "ID3V2.3 Artist", "ID3V2.3 Lyricist", "ID3V2.3 Composer", null, 
-           "Blues", "ID3V2.3 Title", null, "295", "1"},
+           "Blues", "ID3V2.3 Title", null, "295", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/MP3/Corrupted_ID3V2_TIT.mp3", null, null, null,
-          null, null, null, null, null, null, "295", "1"}
+          null, null, null, null, null, null, "295", "1", null}
   };
 
   public static final String META_DATA_OTHERS [][] = {
       {"/sdcard/media_api/metaDataTestMedias/3GP/cat.3gp", null, null, null,
           null, null, "20080309T002415.000Z", null,
-          null, null, "1404928", "2"},
+          null, null, "1404928", "2", null},
       {"/sdcard/media_api/metaDataTestMedias/AMR/AMR_NB.amr", null, null, null,
           null, null, null, null,
-          null, null, "126540", "1"},
+          null, null, "126540", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/AMRWB/AMR_WB.amr", null, null, null,
           null, null, null, null,
-          null, null, "231180", "1"},     
-      {"/sdcard/media_api/metaDataTestMedias/M4A/Jaws Of Life_ver1.m4a", null, "Suspended Animation", 
+          null, null, "231180", "1", null},
+      {"/sdcard/media_api/metaDataTestMedias/M4A/Jaws Of Life_ver1.m4a", "1/8", "Suspended Animation",
           "John Petrucci", null, null, "20070510T125223.000Z", 
-          null, null, "2005", "231180", "1"},     
+          "13", "Jaws Of Life", "2005", "19815424", "1", "m4a composer"},
       {"/sdcard/media_api/metaDataTestMedias/M4V/sample_iPod.m4v", null, null, 
           null, null, null, "20051220T202015.000Z", 
-          null, null, null, "3771392", "2"}, 
+          null, null, null, "3771392", "2", null},
       {"/sdcard/media_api/metaDataTestMedias/MIDI/MIDI.mid", null, "Suspended Animation", 
           "John Petrucci", null, null, "20070510T125223.000Z", 
-          null, null, "2005", "231180", "1"}, 
-      {"/sdcard/media_api/metaDataTestMedias/MP4/kung_fu_panda_h264.mp4", null, "mp4 album Kung Fu Panda", 
+          null, null, "2005", "231180", "1", null},
+      {"/sdcard/media_api/metaDataTestMedias/MP4/kung_fu_panda_h264.mp4", "2/0", "mp4 album Kung Fu Panda",
           "mp4 artist Kung Fu Panda", null, null, "20080517T091451.000Z", 
-          "41", "Kung Fu Panda", "2008", "5667840", "2"},
+          "41", "Kung Fu Panda", "2008", "5667840", "2", "mp4 composer"},
       {"/sdcard/media_api/metaDataTestMedias/OGG/Ring_Classic_02.ogg", null, "Suspended Animation", 
           "John Petrucci", null, null, "20070510T125223.000Z", 
-          null, null, "2005", "231180", "1"},
+          null, null, "2005", "231180", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/OGG/When You Say Nothing At All.ogg", 
           null, "Suspended Animation", "John Petrucci", 
-          null, null, "20070510T125223.000Z", null, null, "2005", "231180", "1"},
+          null, null, "20070510T125223.000Z", null, null, "2005", "231180", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/WAV/Im With You.wav", null, null, 
           null, null, null, null, 
-          null, null, null, "224000", "1"},
+          null, null, null, "224000", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/WMA/WMA9.wma", "6", "Ten Songs in the Key of Betrayal", 
           "Alien Crime Syndicate", "Alien Crime Syndicate", 
           "wma 9 Composer", "20040521T175729.483Z", 
-          "Rock", "Run for the Money", "2004", "134479", "1"},
+          "Rock", "Run for the Money", "2004", "134479", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/WMA/WMA10.wma", "09", "wma 10 Album", 
           "wma 10 Album Artist", "wma 10 Artist", "wma 10 Composer", "20070705T063625.097Z", 
-          "Acid Jazz", "wma 10 Title", "2010", "126574", "1"},
+          "Acid Jazz", "wma 10 Title", "2010", "126574", "1", null},
       {"/sdcard/media_api/metaDataTestMedias/WMV/bugs.wmv", "8", "wmv 9 Album", 
           null, "wmv 9 Artist ", null, "20051122T155247.540Z", 
-          null, "Looney Tunes - Hare-Breadth Hurry", "2005", "193482", "2"},
+          null, "Looney Tunes - Hare-Breadth Hurry", "2005", "193482", "2", null},
       {"/sdcard/media_api/metaDataTestMedias/WMV/clips_ver7.wmv", "50", "wmv 7 Album", 
           null, "Hallau Shoots & Company", null, "20020226T170045.891Z", 
-          null, "CODEC Shootout", "1986", "43709", "2"}
+          null, "CODEC Shootout", "1986", "43709", "2", null}
   };
   
   //output recorded video
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java
index 3715913..1bf4958 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java
@@ -36,7 +36,7 @@
         FILE_PATH,CD_TRACK, ALBUM,
         ARTIST, AUTHOR, COMPOSER,
         DATE, GENRE, TITLE,
-        YEAR, DURATION, NUM_TRACKS
+        YEAR, DURATION, NUM_TRACKS, WRITER
     }
     
     public static enum MP3_TEST_FILE{
@@ -130,8 +130,6 @@
         validateMetatData(non_mp3_test_file.AMRWB.ordinal(), MediaNames.META_DATA_OTHERS);
     }
     
-    //Bug# 1440173 - skip this test case now
-    @Suppress
     @MediumTest
     public static void testM4A1_Metadata() throws Exception {
         validateMetatData(non_mp3_test_file.M4A1.ordinal(), MediaNames.META_DATA_OTHERS);
@@ -254,6 +252,10 @@
         Log.v(TAG, "Track : "+ value);
         assertEquals(TAG,meta_data_file[fileIndex][meta.NUM_TRACKS.ordinal()], value);
      
+        value = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_WRITER);
+        Log.v(TAG, "Writer : "+ value);
+        assertEquals(TAG,meta_data_file[fileIndex][meta.WRITER.ordinal()], value);
+
         retriever.release();        
     }
 }
diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java
index 0a31396..9a293a9 100644
--- a/services/java/com/android/server/WallpaperManagerService.java
+++ b/services/java/com/android/server/WallpaperManagerService.java
@@ -325,8 +325,10 @@
             ComponentName realName = name;
             if (realName == null) {
                 // The default component is our static image wallpaper.
-                realName = new ComponentName("android",
-                        ImageWallpaper.class.getName());
+                //realName = new ComponentName("android",
+                //        ImageWallpaper.class.getName());
+                clearWallpaperComponentLocked();
+                return;
             }
             ServiceInfo si = mContext.getPackageManager().getServiceInfo(realName,
                     PackageManager.GET_META_DATA | PackageManager.GET_PERMISSIONS);
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java b/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java
index 97a8b25..b61b307 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java
@@ -18,6 +18,7 @@
 
 import android.os.Handler;
 import android.os.Message;
+import android.webkit.MockGeolocation;
 import android.webkit.WebStorage;
 
 import java.util.HashMap;
@@ -325,7 +326,7 @@
     }
 
     public void setWindowIsKey(boolean b) {
-        obtainMessage(LAYOUT_SET_WINDOW_KEY,b ? 1 : 0, 0).sendToTarget();
+        obtainMessage(LAYOUT_SET_WINDOW_KEY, b ? 1 : 0, 0).sendToTarget();
     }
 
     public void testRepaint() {
@@ -352,4 +353,15 @@
         obtainMessage(LAYOUT_SET_CAN_OPEN_WINDOWS).sendToTarget();
     }
 
+    public void setMockGeolocationPosition(double latitude,
+                                           double longitude,
+                                           double accuracy) {
+        MockGeolocation.getInstance().setPosition(latitude,
+                                                  longitude,
+                                                  accuracy);
+    }
+
+    public void setMockGeolocationError(int code, String message) {
+        MockGeolocation.getInstance().setError(code, message);
+    }
 }