Merge change 3907 into donut

* changes:
  Support SMS cell broadcasting for GSM in RIL.java
diff --git a/api/current.xml b/api/current.xml
index cb348e1..f30c505 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -3518,17 +3518,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad30"
- type="int"
- transient="false"
- volatile="false"
- value="16843394"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="donut_resource_pad4"
  type="int"
  transient="false"
@@ -6840,6 +6829,17 @@
  visibility="public"
 >
 </field>
+<field name="queryAfterZeroResults"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843394"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="radioButtonStyle"
  type="int"
  transient="false"
@@ -62837,7 +62837,7 @@
  type="float"
  transient="false"
  volatile="false"
- value="0.0010f"
+ value="0.001f"
  static="true"
  final="true"
  deprecated="not deprecated"
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index cc951c1..9a6684a 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -49,7 +49,11 @@
         PRINT("------ VIRTUAL MEMORY STATS ------");
         DUMP("/proc/vmstat");
         PRINT("------ SLAB INFO ------");
+#if 0
         DUMP("/proc/slabinfo");
+#else
+        PRINT("temporarily disabled to avoid kernel crasher");
+#endif
         PRINT("------ ZONEINFO ------");
         DUMP("/proc/zoneinfo");
         PRINT("------ SYSTEM LOG ------");
diff --git a/core/java/android/server/search/SearchableInfo.java b/core/java/android/server/search/SearchableInfo.java
index c083142..4df7368 100644
--- a/core/java/android/server/search/SearchableInfo.java
+++ b/core/java/android/server/search/SearchableInfo.java
@@ -66,6 +66,7 @@
     private final int mSearchInputType;
     private final int mSearchImeOptions;
     private final boolean mIncludeInGlobalSearch;
+    private final boolean mQueryAfterZeroResults;
     private final String mSuggestAuthority;
     private final String mSuggestPath;
     private final String mSuggestSelection;
@@ -276,6 +277,8 @@
                 EditorInfo.IME_ACTION_SEARCH);
         mIncludeInGlobalSearch = a.getBoolean(
                 com.android.internal.R.styleable.Searchable_includeInGlobalSearch, false);
+        mQueryAfterZeroResults = a.getBoolean(
+                com.android.internal.R.styleable.Searchable_queryAfterZeroResults, false);
 
         mSuggestAuthority = a.getString(
                 com.android.internal.R.styleable.Searchable_searchSuggestAuthority);
@@ -637,6 +640,17 @@
     }
 
     /**
+     * Checks whether this searchable activity should be invoked after a query returned zero
+     * results.
+     *
+     * @return The value of the <code>queryAfterZeroResults</code> attribute,
+     *         or <code>false</code> if the attribute is not set.
+     */
+    public boolean queryAfterZeroResults() {
+        return mQueryAfterZeroResults;
+    }
+
+    /**
      * Support for parcelable and aidl operations.
      */
     public static final Parcelable.Creator<SearchableInfo> CREATOR
@@ -667,6 +681,7 @@
         mSearchInputType = in.readInt();
         mSearchImeOptions = in.readInt();
         mIncludeInGlobalSearch = in.readInt() != 0;
+        mQueryAfterZeroResults = in.readInt() != 0;
 
         mSuggestAuthority = in.readString();
         mSuggestPath = in.readString();
@@ -702,6 +717,7 @@
         dest.writeInt(mSearchInputType);
         dest.writeInt(mSearchImeOptions);
         dest.writeInt(mIncludeInGlobalSearch ? 1 : 0);
+        dest.writeInt(mQueryAfterZeroResults ? 1 : 0);
         
         dest.writeString(mSuggestAuthority);
         dest.writeString(mSuggestPath);
diff --git a/core/java/android/speech/tts/Tts.java b/core/java/android/speech/tts/TextToSpeech.java
similarity index 60%
rename from core/java/android/speech/tts/Tts.java
rename to core/java/android/speech/tts/TextToSpeech.java
index 085b030..2c0c09e 100755
--- a/core/java/android/speech/tts/Tts.java
+++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -28,33 +28,39 @@
 import android.os.RemoteException;
 import android.util.Log;
 
+import java.util.HashMap;
+
 /**
  *
- * Synthesizes speech from text. This abstracts away the complexities of using
- * the TTS service such as setting up the IBinder connection and handling
- * RemoteExceptions, etc.
- *
- * The TTS should always be safe the use; if the user does not have the
- * necessary TTS apk installed, the behavior is that all calls to the TTS act as
- * no-ops.
+ * Synthesizes speech from text.
  *
  * {@hide}
  */
-//FIXME #TTS# review + complete javadoc
-//FIXME RENAME TO TextToSpeech.java
-public class Tts {
+//TODO #TTS# review + complete javadoc
+public class TextToSpeech {
+
+    /**
+     * Denotes a successful operation.
+     */
+    public static final int TTS_SUCCESS                = 0;
+    /**
+     * Denotes a generic operation failure.
+     */
+    public static final int TTS_ERROR                  = -1;
+    /**
+     * Denotes a failure due to a missing resource.
+     */
+    public static final int TTS_ERROR_MISSING_RESOURCE = -2;
 
 
     /**
      * Called when the TTS has initialized
      *
-     * The InitListener must implement the onInit function. onInit is passed the
-     * version number of the TTS library that the user has installed; since this
-     * is called when the TTS has started, it is a good time to make sure that
-     * the user's TTS library is up to date.
+     * The InitListener must implement the onInit function. onInit is passed a
+     * status code indicating the result of the TTS initialization.
      */
     public interface OnInitListener {
-        public void onInit(int version);
+        public void onInit(int status);
     }
 
     /**
@@ -71,15 +77,15 @@
      */
     private ServiceConnection serviceConnection;
 
-    private ITts itts = null;
-    private Context ctx = null;
-    private OnInitListener cb = null;
-    private int version = -1;
-    private boolean started = false;
-    private final Object startLock = new Object();
-    private boolean showInstaller = false;
-    private ITtsCallback ittscallback;
-    private OnSpeechCompletedListener speechCompletedCallback = null;
+    private ITts mITts = null;
+    private Context mContext = null;
+    private OnInitListener mInitListener = null;
+    private boolean mStarted = false;
+    private final Object mStartLock = new Object();
+    private ITtsCallback mITtsCallback;
+    private OnSpeechCompletedListener mSpeechCompListener = null;
+    private final Object mSpeechCompListenerLock = new Object();
+
 
 
     /**
@@ -87,58 +93,29 @@
      *
      * @param context
      *            The context
-     * @param callback
-     *            The InitListener that should be called when the TTS has
-     *            initialized successfully.
-     * @param displayInstallMessage
-     *            Boolean indicating whether or not an installation prompt
-     *            should be displayed to users who do not have the TTS library.
-     *            If this is true, a generic alert asking the user to install
-     *            the TTS will be used. If you wish to specify the exact message
-     *            of that prompt, please use TTS(Context context, InitListener
-     *            callback, TTSVersionAlert alert) as the constructor instead.
-     */
-    public Tts(Context context, OnInitListener callback,
-                boolean displayInstallMessage) {
-        showInstaller = displayInstallMessage;
-        ctx = context;
-        cb = callback;
-        if (dataFilesCheck()) {
-            initTts();
-        }
-    }
-
-    /**
-     * The constructor for the TTS.
-     *
-     * @param context
-     *            The context
-     * @param callback
-     *            The InitListener that should be called when the TTS has
+     * @param listener
+     *            The InitListener that will be called when the TTS has
      *            initialized successfully.
      */
-    public Tts(Context context, OnInitListener callback) {
-        // FIXME #TTS# support TtsVersionAlert
-        //     showInstaller = true;
-        //     versionAlert = alert;
-        ctx = context;
-        cb = callback;
-        if (dataFilesCheck()) {
-            initTts();
-        }
+    public TextToSpeech(Context context, OnInitListener listener) {
+        mContext = context;
+        mInitListener = listener;
+        initTts();
     }
 
 
     public void setOnSpeechCompletedListener(
             final OnSpeechCompletedListener listener) {
-        speechCompletedCallback = listener;
+        synchronized(mSpeechCompListenerLock) {
+            mSpeechCompListener = listener;
+        }
     }
 
 
     private boolean dataFilesCheck() {
-        // FIXME #TTS# config manager will be in settings
+        // TODO #TTS# config manager will be in settings
         Log.i("TTS_FIXME", "FIXME in Tts: config manager will be in settings");
-        // FIXME #TTS# implement checking of the correct installation of
+        // TODO #TTS# implement checking of the correct installation of
         //             the data files.
 
         return true;
@@ -146,62 +123,63 @@
 
 
     private void initTts() {
-        started = false;
+        mStarted = false;
 
         // Initialize the TTS, run the callback after the binding is successful
         serviceConnection = new ServiceConnection() {
             public void onServiceConnected(ComponentName name, IBinder service) {
-                synchronized(startLock) {
-                    itts = ITts.Stub.asInterface(service);
+                synchronized(mStartLock) {
+                    mITts = ITts.Stub.asInterface(service);
                     try {
-                        ittscallback = new ITtsCallback.Stub() {
-                            //@Override
+                        mITtsCallback = new ITtsCallback.Stub() {
                             public void markReached(String mark)
                             throws RemoteException {
-                                if (speechCompletedCallback != null) {
-                                    speechCompletedCallback.onSpeechCompleted();
+                                // call the listener of that event, but not
+                                // while locked.
+                                OnSpeechCompletedListener listener = null;
+                                synchronized(mSpeechCompListenerLock) {
+                                    listener = mSpeechCompListener;
+                                }
+                                if (listener != null) {
+                                    listener.onSpeechCompleted();
                                 }
                             }
                         };
-                        itts.registerCallback(ittscallback);
+                        mITts.registerCallback(mITtsCallback);
 
                     } catch (RemoteException e) {
                         initTts();
                         return;
                     }
 
-                    started = true;
+                    mStarted = true;
                     // The callback can become null if the Android OS decides to
                     // restart the TTS process as well as whatever is using it.
                     // In such cases, do nothing - the error handling from the
                     // speaking calls will kick in and force a proper restart of
                     // the TTS.
-                    if (cb != null) {
-                        cb.onInit(version);
+                    if (mInitListener != null) {
+                        // TODO manage failures and missing resources
+                        mInitListener.onInit(TTS_SUCCESS);
                     }
                 }
             }
 
             public void onServiceDisconnected(ComponentName name) {
-                synchronized(startLock) {
-                    itts = null;
-                    cb = null;
-                    started = false;
+                synchronized(mStartLock) {
+                    mITts = null;
+                    mInitListener = null;
+                    mStarted = false;
                 }
             }
         };
 
         Intent intent = new Intent("android.intent.action.USE_TTS");
         intent.addCategory("android.intent.category.TTS");
-        // Binding will fail only if the TTS doesn't exist;
-        // the TTSVersionAlert will give users a chance to install
-        // the needed TTS.
-        if (!ctx.bindService(intent, serviceConnection,
-                Context.BIND_AUTO_CREATE)) {
-            if (showInstaller) {
-                // FIXME #TTS# show version alert
-            }
-        }
+        mContext.bindService(intent, serviceConnection,
+                Context.BIND_AUTO_CREATE);
+        // TODO handle case where the binding works (should always work) but
+        //      the plugin fails
     }
 
 
@@ -212,7 +190,7 @@
      */
     public void shutdown() {
         try {
-            ctx.unbindService(serviceConnection);
+            mContext.unbindService(serviceConnection);
         } catch (IllegalArgumentException e) {
             // Do nothing and fail silently since an error here indicates that
             // binding never succeeded in the first place.
@@ -246,23 +224,23 @@
      *            Example: <b><code>R.raw.south_south_east</code></b>
      */
     public void addSpeech(String text, String packagename, int resourceId) {
-        synchronized(startLock) {
-            if (!started) {
+        synchronized(mStartLock) {
+            if (!mStarted) {
                 return;
             }
             try {
-                itts.addSpeech(text, packagename, resourceId);
+                mITts.addSpeech(text, packagename, resourceId);
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (NullPointerException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (IllegalStateException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
         }
@@ -280,23 +258,23 @@
      *            "/sdcard/mysounds/hello.wav")
      */
     public void addSpeech(String text, String filename) {
-        synchronized (startLock) {
-            if (!started) {
+        synchronized (mStartLock) {
+            if (!mStarted) {
                 return;
             }
             try {
-                itts.addSpeechFile(text, filename);
+                mITts.addSpeechFile(text, filename);
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (NullPointerException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (IllegalStateException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
         }
@@ -316,32 +294,29 @@
      *            The queuing strategy to use. Use 0 for no queuing, and 1 for
      *            queuing.
      * @param params
-     *            The array of speech parameters to be used. Currently, only
-     *            params[0] is defined - it is for setting the type of voice if
-     *            the engine allows it. Possible values are "VOICE_MALE",
-     *            "VOICE_FEMALE", and "VOICE_ROBOT". Note that right now only
-     *            the pre-recorded voice has this support - this setting has no
-     *            effect on eSpeak.
+     *            The hashmap of speech parameters to be used.
      */
-    public void speak(String text, int queueMode, String[] params) {
-        synchronized (startLock) {
+    public void speak(String text, int queueMode, HashMap<String,String> params)
+    {
+        synchronized (mStartLock) {
             Log.i("TTS received: ", text);
-            if (!started) {
+            if (!mStarted) {
                 return;
             }
             try {
-                itts.speak(text, queueMode, params);
+                // TODO support extra parameters, passing null for the moment
+                mITts.speak(text, queueMode, null);
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (NullPointerException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (IllegalStateException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
         }
@@ -357,30 +332,37 @@
      *            0 for no queue (interrupts all previous utterances), 1 for
      *            queued
      * @param params
-     *            An ArrayList of parameters.
+     *            The hashmap of parameters to be used.
      */
-    public void playEarcon(String earcon, int queueMode, String[] params) {
-        synchronized (startLock) {
-            if (!started) {
+    public void playEarcon(String earcon, int queueMode, 
+            HashMap<String,String> params) {
+        synchronized (mStartLock) {
+            if (!mStarted) {
                 return;
             }
             try {
-                itts.playEarcon(earcon, queueMode, params);
+                // TODO support extra parameters, passing null for the moment
+                mITts.playEarcon(earcon, queueMode, null);
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (NullPointerException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (IllegalStateException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
         }
     }
+    
+    
+    public void playSilence(long durationInMs, int queueMode) {
+        // TODO implement, already present in TTS service
+    }
 
 
     /**
@@ -389,23 +371,23 @@
      * @return Whether or not the TTS is busy speaking.
      */
     public boolean isSpeaking() {
-        synchronized (startLock) {
-            if (!started) {
+        synchronized (mStartLock) {
+            if (!mStarted) {
                 return false;
             }
             try {
-                return itts.isSpeaking();
+                return mITts.isSpeaking();
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (NullPointerException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (IllegalStateException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
             return false;
@@ -417,40 +399,29 @@
      * Stops speech from the TTS.
      */
     public void stop() {
-        synchronized (startLock) {
-            if (!started) {
+        synchronized (mStartLock) {
+            if (!mStarted) {
                 return;
             }
             try {
-                itts.stop();
+                mITts.stop();
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (NullPointerException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (IllegalStateException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
         }
     }
 
 
-    /**
-     * Returns the version number of the TTS library that the user has
-     * installed.
-     *
-     * @return The version number of the TTS library that the user has
-     *         installed.
-     */
-    public int getVersion() {
-        return version;
-    }
-
 
     /**
      * Sets the speech rate for the TTS engine.
@@ -466,15 +437,15 @@
      *            The speech rate for the TTS engine.
      */
     public void setSpeechRate(int speechRate) {
-        synchronized (startLock) {
-            if (!started) {
+        synchronized (mStartLock) {
+            if (!mStarted) {
                 return;
             }
             try {
-                itts.setSpeechRate(speechRate);
+                mITts.setSpeechRate(speechRate);
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
         }
@@ -498,15 +469,15 @@
      *            http://en.wikipedia.org/wiki/IETF_language_tag
      */
     public void setLanguage(String language) {
-        synchronized (startLock) {
-            if (!started) {
+        synchronized (mStartLock) {
+            if (!mStarted) {
                 return;
             }
             try {
-                itts.setLanguage(language);
+                mITts.setLanguage(language);
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
         }
@@ -519,32 +490,32 @@
      * @param text
      *            The String of text that should be synthesized
      * @param params
-     *            An ArrayList of parameters. The first element of this array
-     *            controls the type of voice to use.
+     *            A hashmap of parameters.
      * @param filename
      *            The string that gives the full output filename; it should be
      *            something like "/sdcard/myappsounds/mysound.wav".
      * @return A boolean that indicates if the synthesis succeeded
      */
-    public boolean synthesizeToFile(String text, String[] params,
+    public boolean synthesizeToFile(String text, HashMap<String,String> params,
             String filename) {
-        synchronized (startLock) {
-            if (!started) {
+        synchronized (mStartLock) {
+            if (!mStarted) {
                 return false;
             }
             try {
-                return itts.synthesizeToFile(text, params, filename);
+                // TODO support extra parameters, passing null for the moment
+                return mITts.synthesizeToFile(text, null, filename);
             } catch (RemoteException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (NullPointerException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             } catch (IllegalStateException e) {
                 // TTS died; restart it.
-                started = false;
+                mStarted = false;
                 initTts();
             }
             return false;
@@ -552,36 +523,4 @@
     }
 
 
-    /**
-     * Displays an alert that prompts users to install the TTS engine.
-     * This is useful if the application expects a newer version
-     * of the TTS than what the user has.
-     */
-    public void showVersionAlert() {
-        if (!started) {
-            return;
-        }
-        // FIXME #TTS# implement show version alert
-    }
-
-
-    /**
-     * Checks if the TTS service is installed or not
-     *
-     * @return A boolean that indicates whether the TTS service is installed
-     */
-    // TODO: TTS Service itself will always be installed. Factor this out
-    // (may need to add another method to see if there are any working
-    // TTS engines on the device).
-    public static boolean isInstalled(Context ctx) {
-        PackageManager pm = ctx.getPackageManager();
-        Intent intent = new Intent("android.intent.action.USE_TTS");
-        intent.addCategory("android.intent.category.TTS");
-        ResolveInfo info = pm.resolveService(intent, 0);
-        if (info == null) {
-            return false;
-        }
-        return true;
-    }
-
 }
diff --git a/core/java/android/text/format/DateFormat.java b/core/java/android/text/format/DateFormat.java
index 3156d8b..963f429 100644
--- a/core/java/android/text/format/DateFormat.java
+++ b/core/java/android/text/format/DateFormat.java
@@ -242,12 +242,21 @@
 
     /**
      * Returns a {@link java.text.DateFormat} object that can format the time according
-     * to the current locale. 
+     * to the current locale and the user's 12-/24-hour clock preference.
      * @param context the application context
      * @return the {@link java.text.DateFormat} object that properly formats the time.
      */
     public static final java.text.DateFormat getTimeFormat(Context context) {
-        return java.text.DateFormat.getTimeInstance(java.text.DateFormat.SHORT);
+        boolean b24 = is24HourFormat(context);
+        int res;
+
+        if (b24) {
+            res = R.string.twenty_four_hour_time_format;
+        } else {
+            res = R.string.twelve_hour_time_format;
+        }
+
+        return new java.text.SimpleDateFormat(context.getString(res));
     }
 
     /**
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index ba3f78c..dbd2682 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -143,6 +143,17 @@
     }
 
     /**
+     * Load a url with "POST" method from the network into the main frame.
+     * @param url The url to load.
+     * @param data The data for POST request.
+     */
+    public void postUrl(String url, byte[] data) {
+        mLoadInitFromJava = true;
+        nativePostUrl(url, data);
+        mLoadInitFromJava = false;
+    }
+
+    /**
      * Load the content as if it was loaded by the provided base URL. The
      * failUrl is used as the history entry for the load data. If null or
      * an empty string is passed for the failUrl, then no history entry is
@@ -752,6 +763,8 @@
      */
     private native void nativeLoadUrl(String url);
 
+    private native void nativePostUrl(String url, byte[] postData);
+
     private native void nativeLoadData(String baseUrl, String data,
             String mimeType, String encoding, String failUrl);
 
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 563d819..8e0a80c 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -1118,6 +1118,29 @@
     }
 
     /**
+     * Load the url with postData using "POST" method into the WebView. If url
+     * is not a network url, it will be loaded with {link
+     * {@link #loadUrl(String)} instead.
+     * 
+     * @param url The url of the resource to load.
+     * @param postData The data will be passed to "POST" request.
+     * 
+     * @hide pending API solidification
+     */
+    public void postUrl(String url, byte[] postData) {
+        if (URLUtil.isNetworkUrl(url)) {
+            switchOutDrawHistory();
+            HashMap arg = new HashMap();
+            arg.put("url", url);
+            arg.put("data", postData);
+            mWebViewCore.sendMessage(EventHub.POST_URL, arg);
+            clearTextEntry();
+        } else {
+            loadUrl(url);
+        }
+    }
+
+    /**
      * Load the given data into the WebView. This will load the data into
      * WebView using the data: scheme. Content loaded through this mechanism
      * does not have the ability to load content from the network.
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index e9df453..0dbfb83 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -544,6 +544,8 @@
             "WEBKIT_DRAW", // = 130;
             "SYNC_SCROLL", // = 131;
             "REFRESH_PLUGINS", // = 132;
+            // this will replace REFRESH_PLUGINS in the next release
+            "POST_URL", // = 142;
             "SPLIT_PICTURE_SET", // = 133;
             "CLEAR_CONTENT", // = 134;
             "SET_FINAL_FOCUS", // = 135;
@@ -589,6 +591,8 @@
         static final int WEBKIT_DRAW = 130;
         static final int SYNC_SCROLL = 131;
         static final int REFRESH_PLUGINS = 132;
+        // this will replace REFRESH_PLUGINS in the next release
+        static final int POST_URL = 142;
         static final int SPLIT_PICTURE_SET = 133;
         static final int CLEAR_CONTENT = 134;
         
@@ -672,6 +676,13 @@
                             loadUrl((String) msg.obj);
                             break;
 
+                        case POST_URL: {
+                            HashMap param = (HashMap) msg.obj;
+                            String url = (String) param.get("url");
+                            byte[] data = (byte[]) param.get("data");
+                            mBrowserFrame.postUrl(url, data);
+                            break;
+                        }
                         case LOAD_DATA:
                             HashMap loadParams = (HashMap) msg.obj;
                             String baseUrl = (String) loadParams.get("baseUrl");
diff --git a/core/jni/android_location_GpsLocationProvider.cpp b/core/jni/android_location_GpsLocationProvider.cpp
index 0858741..5c4fb22 100644
--- a/core/jni/android_location_GpsLocationProvider.cpp
+++ b/core/jni/android_location_GpsLocationProvider.cpp
@@ -270,6 +270,12 @@
     sGpsInterface->inject_time(time, timeReference, uncertainty);
 }
 
+static void android_location_GpsLocationProvider_inject_location(JNIEnv* env, jobject obj,
+        jdouble latitude, jdouble longitude, jfloat accuracy)
+{
+    sGpsInterface->inject_location(latitude, longitude, accuracy);
+}
+
 static jboolean android_location_GpsLocationProvider_supports_xtra(JNIEnv* env, jobject obj)
 {
     if (!sGpsXtraInterface) {
@@ -353,6 +359,7 @@
     {"native_wait_for_event", "()V", (void*)android_location_GpsLocationProvider_wait_for_event},
     {"native_read_sv_status", "([I[F[F[F[I)I", (void*)android_location_GpsLocationProvider_read_sv_status},
     {"native_inject_time", "(JJI)V", (void*)android_location_GpsLocationProvider_inject_time},
+    {"native_inject_location", "(DDF)V", (void*)android_location_GpsLocationProvider_inject_location},
     {"native_supports_xtra", "()Z", (void*)android_location_GpsLocationProvider_supports_xtra},
     {"native_inject_xtra_data", "([BI)V", (void*)android_location_GpsLocationProvider_inject_xtra_data},
     {"native_agps_data_conn_open", "(Ljava/lang/String;)V", (void*)android_location_GpsLocationProvider_agps_data_conn_open},
diff --git a/core/res/res/values-ar-rEG/donottranslate-cldr.xml b/core/res/res/values-ar-rEG/donottranslate-cldr.xml
index c88ab7f..02c098a 100644
--- a/core/res/res/values-ar-rEG/donottranslate-cldr.xml
+++ b/core/res/res/values-ar-rEG/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-e‏/%-m‏/%Y</string>
     <string name="numeric_date_format">d‏/M‏/yyyy</string>
     <string name="month_day_year">%-e %B، %Y</string>
diff --git a/core/res/res/values-bg-rBG/donottranslate-cldr.xml b/core/res/res/values-bg-rBG/donottranslate-cldr.xml
index 44b2cf9..2ba7ba2 100644
--- a/core/res/res/values-bg-rBG/donottranslate-cldr.xml
+++ b/core/res/res/values-bg-rBG/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%d %B %Y</string>
diff --git a/core/res/res/values-ca-rES/donottranslate-cldr.xml b/core/res/res/values-ca-rES/donottranslate-cldr.xml
index 52341fe..23c1508 100644
--- a/core/res/res/values-ca-rES/donottranslate-cldr.xml
+++ b/core/res/res/values-ca-rES/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e de %B de %Y</string>
diff --git a/core/res/res/values-cs-rCZ/donottranslate-cldr.xml b/core/res/res/values-cs-rCZ/donottranslate-cldr.xml
index 48e0b27..38e6a14 100644
--- a/core/res/res/values-cs-rCZ/donottranslate-cldr.xml
+++ b/core/res/res/values-cs-rCZ/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-e.%-m.%Y</string>
     <string name="numeric_date_format">d.M.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-cs/donottranslate-cldr.xml b/core/res/res/values-cs/donottranslate-cldr.xml
index 48e0b27..38e6a14 100644
--- a/core/res/res/values-cs/donottranslate-cldr.xml
+++ b/core/res/res/values-cs/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-e.%-m.%Y</string>
     <string name="numeric_date_format">d.M.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-da-rDK/donottranslate-cldr.xml b/core/res/res/values-da-rDK/donottranslate-cldr.xml
index 4b4794c..9e525a0 100644
--- a/core/res/res/values-da-rDK/donottranslate-cldr.xml
+++ b/core/res/res/values-da-rDK/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H.%M</string>
     <string name="hour_minute_ampm">%-l.%M %p</string>
     <string name="hour_minute_cap_ampm">%-l.%M %^p</string>
+    <string name="twelve_hour_time_format">h.mm a</string>
+    <string name="twenty_four_hour_time_format">HH.mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e. %b %Y</string>
diff --git a/core/res/res/values-de-rAT/donottranslate-cldr.xml b/core/res/res/values-de-rAT/donottranslate-cldr.xml
index 24aa25c..d90da70 100644
--- a/core/res/res/values-de-rAT/donottranslate-cldr.xml
+++ b/core/res/res/values-de-rAT/donottranslate-cldr.xml
@@ -61,6 +61,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%d. %B %Y</string>
diff --git a/core/res/res/values-de-rCH/donottranslate-cldr.xml b/core/res/res/values-de-rCH/donottranslate-cldr.xml
index 4a3d96c..9e05789 100644
--- a/core/res/res/values-de-rCH/donottranslate-cldr.xml
+++ b/core/res/res/values-de-rCH/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-de-rDE/donottranslate-cldr.xml b/core/res/res/values-de-rDE/donottranslate-cldr.xml
index 4a3d96c..9e05789 100644
--- a/core/res/res/values-de-rDE/donottranslate-cldr.xml
+++ b/core/res/res/values-de-rDE/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-de-rLI/donottranslate-cldr.xml b/core/res/res/values-de-rLI/donottranslate-cldr.xml
index 4a3d96c..9e05789 100644
--- a/core/res/res/values-de-rLI/donottranslate-cldr.xml
+++ b/core/res/res/values-de-rLI/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-de/donottranslate-cldr.xml b/core/res/res/values-de/donottranslate-cldr.xml
index 4a3d96c..9e05789 100644
--- a/core/res/res/values-de/donottranslate-cldr.xml
+++ b/core/res/res/values-de/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-el-rGR/donottranslate-cldr.xml b/core/res/res/values-el-rGR/donottranslate-cldr.xml
index ccfa794..0880190 100644
--- a/core/res/res/values-el-rGR/donottranslate-cldr.xml
+++ b/core/res/res/values-el-rGR/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%d %B %Y</string>
diff --git a/core/res/res/values-en-rAU/donottranslate-cldr.xml b/core/res/res/values-en-rAU/donottranslate-cldr.xml
index 452d586..903a36c 100644
--- a/core/res/res/values-en-rAU/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rAU/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%-e/%m/%Y</string>
     <string name="numeric_date_format">d/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-en-rCA/donottranslate-cldr.xml b/core/res/res/values-en-rCA/donottranslate-cldr.xml
index ce7bbd0..8f8097c 100644
--- a/core/res/res/values-en-rCA/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rCA/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%Y-%m-%d</string>
     <string name="numeric_date_format">yyyy-MM-dd</string>
     <string name="month_day_year">%B %-e, %Y</string>
diff --git a/core/res/res/values-en-rGB/donottranslate-cldr.xml b/core/res/res/values-en-rGB/donottranslate-cldr.xml
index 36afbd3b..b2182f5 100644
--- a/core/res/res/values-en-rGB/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rGB/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-en-rIE/donottranslate-cldr.xml b/core/res/res/values-en-rIE/donottranslate-cldr.xml
index dd8e730..fd0001a 100644
--- a/core/res/res/values-en-rIE/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rIE/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-en-rIN/donottranslate-cldr.xml b/core/res/res/values-en-rIN/donottranslate-cldr.xml
index df44b4a..ba3f94e 100644
--- a/core/res/res/values-en-rIN/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rIN/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-en-rNZ/donottranslate-cldr.xml b/core/res/res/values-en-rNZ/donottranslate-cldr.xml
index 1ed626e..ab71345 100644
--- a/core/res/res/values-en-rNZ/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rNZ/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%-e/%m/%Y</string>
     <string name="numeric_date_format">d/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-en-rSG/donottranslate-cldr.xml b/core/res/res/values-en-rSG/donottranslate-cldr.xml
index b13a986..2e87dee 100644
--- a/core/res/res/values-en-rSG/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rSG/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%-m/%-e/%Y</string>
     <string name="numeric_date_format">M/d/yyyy</string>
     <string name="month_day_year">%B %-e, %Y</string>
diff --git a/core/res/res/values-en-rUS/donottranslate-cldr.xml b/core/res/res/values-en-rUS/donottranslate-cldr.xml
index b13a986..2e87dee 100644
--- a/core/res/res/values-en-rUS/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rUS/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%-m/%-e/%Y</string>
     <string name="numeric_date_format">M/d/yyyy</string>
     <string name="month_day_year">%B %-e, %Y</string>
diff --git a/core/res/res/values-en-rZA/donottranslate-cldr.xml b/core/res/res/values-en-rZA/donottranslate-cldr.xml
index bc2083d..011e56e8 100644
--- a/core/res/res/values-en-rZA/donottranslate-cldr.xml
+++ b/core/res/res/values-en-rZA/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%Y/%m/%d</string>
     <string name="numeric_date_format">yyyy/MM/dd</string>
     <string name="month_day_year">%d %B %Y</string>
diff --git a/core/res/res/values-es-rES/donottranslate-cldr.xml b/core/res/res/values-es-rES/donottranslate-cldr.xml
index 5c6f721..590a21e 100644
--- a/core/res/res/values-es-rES/donottranslate-cldr.xml
+++ b/core/res/res/values-es-rES/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e de %B de %Y</string>
diff --git a/core/res/res/values-es-rUS/donottranslate-cldr.xml b/core/res/res/values-es-rUS/donottranslate-cldr.xml
index 9ba828d..bf61cd0 100644
--- a/core/res/res/values-es-rUS/donottranslate-cldr.xml
+++ b/core/res/res/values-es-rUS/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-m/%-e/%Y</string>
     <string name="numeric_date_format">M/d/yyyy</string>
     <string name="month_day_year">%-e de %B de %Y</string>
diff --git a/core/res/res/values-es/donottranslate-cldr.xml b/core/res/res/values-es/donottranslate-cldr.xml
index 5c6f721..590a21e 100644
--- a/core/res/res/values-es/donottranslate-cldr.xml
+++ b/core/res/res/values-es/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e de %B de %Y</string>
diff --git a/core/res/res/values-fi-rFI/donottranslate-cldr.xml b/core/res/res/values-fi-rFI/donottranslate-cldr.xml
index 36dbd04..fe140d3 100644
--- a/core/res/res/values-fi-rFI/donottranslate-cldr.xml
+++ b/core/res/res/values-fi-rFI/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k.%M</string>
     <string name="hour_minute_ampm">%-l.%M %p</string>
     <string name="hour_minute_cap_ampm">%-l.%M %^p</string>
+    <string name="twelve_hour_time_format">h.mm a</string>
+    <string name="twenty_four_hour_time_format">H.mm</string>
     <string name="numeric_date">%-e.%-m.%Y</string>
     <string name="numeric_date_format">d.M.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-fr-rBE/donottranslate-cldr.xml b/core/res/res/values-fr-rBE/donottranslate-cldr.xml
index 5a6f345..b7ec69a 100644
--- a/core/res/res/values-fr-rBE/donottranslate-cldr.xml
+++ b/core/res/res/values-fr-rBE/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-e/%m/%Y</string>
     <string name="numeric_date_format">d/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-fr-rCA/donottranslate-cldr.xml b/core/res/res/values-fr-rCA/donottranslate-cldr.xml
index 68f659a..d4033b5 100644
--- a/core/res/res/values-fr-rCA/donottranslate-cldr.xml
+++ b/core/res/res/values-fr-rCA/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y-%m-%d</string>
     <string name="numeric_date_format">yyyy-MM-dd</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-fr-rCH/donottranslate-cldr.xml b/core/res/res/values-fr-rCH/donottranslate-cldr.xml
index 0ca1549..a330cd2 100644
--- a/core/res/res/values-fr-rCH/donottranslate-cldr.xml
+++ b/core/res/res/values-fr-rCH/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-fr-rFR/donottranslate-cldr.xml b/core/res/res/values-fr-rFR/donottranslate-cldr.xml
index c3fce4c..0ee65c9 100644
--- a/core/res/res/values-fr-rFR/donottranslate-cldr.xml
+++ b/core/res/res/values-fr-rFR/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-fr/donottranslate-cldr.xml b/core/res/res/values-fr/donottranslate-cldr.xml
index c3fce4c..0ee65c9 100644
--- a/core/res/res/values-fr/donottranslate-cldr.xml
+++ b/core/res/res/values-fr/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-he-rIL/donottranslate-cldr.xml b/core/res/res/values-he-rIL/donottranslate-cldr.xml
index 11e820d..3b0f499 100644
--- a/core/res/res/values-he-rIL/donottranslate-cldr.xml
+++ b/core/res/res/values-he-rIL/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e ב%B %Y</string>
diff --git a/core/res/res/values-hi-rIN/donottranslate-cldr.xml b/core/res/res/values-hi-rIN/donottranslate-cldr.xml
index 44f29c0..476c4e1 100644
--- a/core/res/res/values-hi-rIN/donottranslate-cldr.xml
+++ b/core/res/res/values-hi-rIN/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-e-%-m-%Y</string>
     <string name="numeric_date_format">d-M-yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-hu-rHU/donottranslate-cldr.xml b/core/res/res/values-hu-rHU/donottranslate-cldr.xml
index a5493bb..b2119c6 100644
--- a/core/res/res/values-hu-rHU/donottranslate-cldr.xml
+++ b/core/res/res/values-hu-rHU/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%Y.%m.%d.</string>
     <string name="numeric_date_format">yyyy.MM.dd.</string>
     <string name="month_day_year">%Y. %B %-e.</string>
diff --git a/core/res/res/values-id-rID/donottranslate-cldr.xml b/core/res/res/values-id-rID/donottranslate-cldr.xml
index a09be25..4402b1e 100644
--- a/core/res/res/values-id-rID/donottranslate-cldr.xml
+++ b/core/res/res/values-id-rID/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-it-rCH/donottranslate-cldr.xml b/core/res/res/values-it-rCH/donottranslate-cldr.xml
index 48571a0e..251bd9b 100644
--- a/core/res/res/values-it-rCH/donottranslate-cldr.xml
+++ b/core/res/res/values-it-rCH/donottranslate-cldr.xml
@@ -89,6 +89,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-it-rIT/donottranslate-cldr.xml b/core/res/res/values-it-rIT/donottranslate-cldr.xml
index d20a631..7545581 100644
--- a/core/res/res/values-it-rIT/donottranslate-cldr.xml
+++ b/core/res/res/values-it-rIT/donottranslate-cldr.xml
@@ -89,6 +89,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%d %B %Y</string>
diff --git a/core/res/res/values-it/donottranslate-cldr.xml b/core/res/res/values-it/donottranslate-cldr.xml
index d20a631..7545581 100644
--- a/core/res/res/values-it/donottranslate-cldr.xml
+++ b/core/res/res/values-it/donottranslate-cldr.xml
@@ -89,6 +89,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%d %B %Y</string>
diff --git a/core/res/res/values-ja-rJP/donottranslate-cldr.xml b/core/res/res/values-ja-rJP/donottranslate-cldr.xml
index 52c93133..3d0531e 100644
--- a/core/res/res/values-ja-rJP/donottranslate-cldr.xml
+++ b/core/res/res/values-ja-rJP/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%p%-l:%M</string>
     <string name="hour_minute_cap_ampm">%p%-l:%M</string>
+    <string name="twelve_hour_time_format">ah:mm</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y/%m/%d</string>
     <string name="numeric_date_format">yyyy/MM/dd</string>
     <string name="month_day_year">%Y年%-m月%-e日</string>
diff --git a/core/res/res/values-ja/donottranslate-cldr.xml b/core/res/res/values-ja/donottranslate-cldr.xml
index 52c93133..3d0531e 100644
--- a/core/res/res/values-ja/donottranslate-cldr.xml
+++ b/core/res/res/values-ja/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%p%-l:%M</string>
     <string name="hour_minute_cap_ampm">%p%-l:%M</string>
+    <string name="twelve_hour_time_format">ah:mm</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y/%m/%d</string>
     <string name="numeric_date_format">yyyy/MM/dd</string>
     <string name="month_day_year">%Y年%-m月%-e日</string>
diff --git a/core/res/res/values-ko-rKR/donottranslate-cldr.xml b/core/res/res/values-ko-rKR/donottranslate-cldr.xml
index f641f65..b46d9cd 100644
--- a/core/res/res/values-ko-rKR/donottranslate-cldr.xml
+++ b/core/res/res/values-ko-rKR/donottranslate-cldr.xml
@@ -82,6 +82,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y. %-m. %-e.</string>
     <string name="numeric_date_format">yyyy. M. d.</string>
     <string name="month_day_year">%Y년 %-m월 %-e일</string>
diff --git a/core/res/res/values-ko/donottranslate-cldr.xml b/core/res/res/values-ko/donottranslate-cldr.xml
index f641f65..b46d9cd 100644
--- a/core/res/res/values-ko/donottranslate-cldr.xml
+++ b/core/res/res/values-ko/donottranslate-cldr.xml
@@ -82,6 +82,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y. %-m. %-e.</string>
     <string name="numeric_date_format">yyyy. M. d.</string>
     <string name="month_day_year">%Y년 %-m월 %-e일</string>
diff --git a/core/res/res/values-lt-rLT/donottranslate-cldr.xml b/core/res/res/values-lt-rLT/donottranslate-cldr.xml
index 87d7aae..0d18411 100644
--- a/core/res/res/values-lt-rLT/donottranslate-cldr.xml
+++ b/core/res/res/values-lt-rLT/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y-%m-%d</string>
     <string name="numeric_date_format">yyyy-MM-dd</string>
     <string name="month_day_year">%Y m. %B %-e d.</string>
diff --git a/core/res/res/values-lv-rLV/donottranslate-cldr.xml b/core/res/res/values-lv-rLV/donottranslate-cldr.xml
index bfc2d3b..14062ab 100644
--- a/core/res/res/values-lv-rLV/donottranslate-cldr.xml
+++ b/core/res/res/values-lv-rLV/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%Y. gada %-e. %B</string>
diff --git a/core/res/res/values-nb/donottranslate-cldr.xml b/core/res/res/values-nb/donottranslate-cldr.xml
index 61271ed..e7fe6af 100644
--- a/core/res/res/values-nb/donottranslate-cldr.xml
+++ b/core/res/res/values-nb/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H.%M</string>
     <string name="hour_minute_ampm">%-l.%M %p</string>
     <string name="hour_minute_cap_ampm">%-l.%M %^p</string>
+    <string name="twelve_hour_time_format">h.mm a</string>
+    <string name="twenty_four_hour_time_format">HH.mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-nl-rBE/donottranslate-cldr.xml b/core/res/res/values-nl-rBE/donottranslate-cldr.xml
index b29f0c0..1ff4b5a 100644
--- a/core/res/res/values-nl-rBE/donottranslate-cldr.xml
+++ b/core/res/res/values-nl-rBE/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%-e/%m/%Y</string>
     <string name="numeric_date_format">d/MM/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-nl-rNL/donottranslate-cldr.xml b/core/res/res/values-nl-rNL/donottranslate-cldr.xml
index a35d9e6..581177a 100644
--- a/core/res/res/values-nl-rNL/donottranslate-cldr.xml
+++ b/core/res/res/values-nl-rNL/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d-%m-%Y</string>
     <string name="numeric_date_format">dd-MM-yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-nl/donottranslate-cldr.xml b/core/res/res/values-nl/donottranslate-cldr.xml
index a35d9e6..581177a 100644
--- a/core/res/res/values-nl/donottranslate-cldr.xml
+++ b/core/res/res/values-nl/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d-%m-%Y</string>
     <string name="numeric_date_format">dd-MM-yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-pl-rPL/donottranslate-cldr.xml b/core/res/res/values-pl-rPL/donottranslate-cldr.xml
index 4537692..3b00264 100644
--- a/core/res/res/values-pl-rPL/donottranslate-cldr.xml
+++ b/core/res/res/values-pl-rPL/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d-%m-%Y</string>
     <string name="numeric_date_format">dd-MM-yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-pl/donottranslate-cldr.xml b/core/res/res/values-pl/donottranslate-cldr.xml
index 4537692..3b00264 100644
--- a/core/res/res/values-pl/donottranslate-cldr.xml
+++ b/core/res/res/values-pl/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d-%m-%Y</string>
     <string name="numeric_date_format">dd-MM-yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-pt-rBR/donottranslate-cldr.xml b/core/res/res/values-pt-rBR/donottranslate-cldr.xml
index 493a3cb..b2ee7c7 100644
--- a/core/res/res/values-pt-rBR/donottranslate-cldr.xml
+++ b/core/res/res/values-pt-rBR/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-kh%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H'h'mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e de %B de %Y</string>
diff --git a/core/res/res/values-pt-rPT/donottranslate-cldr.xml b/core/res/res/values-pt-rPT/donottranslate-cldr.xml
index e179c11..16f7cd8 100644
--- a/core/res/res/values-pt-rPT/donottranslate-cldr.xml
+++ b/core/res/res/values-pt-rPT/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-kh%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H'h'mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">%-e de %B de %Y</string>
diff --git a/core/res/res/values-pt/donottranslate-cldr.xml b/core/res/res/values-pt/donottranslate-cldr.xml
new file mode 100644
index 0000000..b2ee7c7
--- /dev/null
+++ b/core/res/res/values-pt/donottranslate-cldr.xml
@@ -0,0 +1,145 @@
+<?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">
+    <string name="month_long_standalone_january">janeiro</string>
+    <string name="month_long_standalone_february">fevereiro</string>
+    <string name="month_long_standalone_march">março</string>
+    <string name="month_long_standalone_april">abril</string>
+    <string name="month_long_standalone_may">maio</string>
+    <string name="month_long_standalone_june">junho</string>
+    <string name="month_long_standalone_july">julho</string>
+    <string name="month_long_standalone_august">agosto</string>
+    <string name="month_long_standalone_september">setembro</string>
+    <string name="month_long_standalone_october">outubro</string>
+    <string name="month_long_standalone_november">novembro</string>
+    <string name="month_long_standalone_december">dezembro</string>
+
+    <string name="month_long_january">janeiro</string>
+    <string name="month_long_february">fevereiro</string>
+    <string name="month_long_march">março</string>
+    <string name="month_long_april">abril</string>
+    <string name="month_long_may">maio</string>
+    <string name="month_long_june">junho</string>
+    <string name="month_long_july">julho</string>
+    <string name="month_long_august">agosto</string>
+    <string name="month_long_september">setembro</string>
+    <string name="month_long_october">outubro</string>
+    <string name="month_long_november">novembro</string>
+    <string name="month_long_december">dezembro</string>
+
+    <string name="month_medium_january">jan</string>
+    <string name="month_medium_february">fev</string>
+    <string name="month_medium_march">mar</string>
+    <string name="month_medium_april">abr</string>
+    <string name="month_medium_may">mai</string>
+    <string name="month_medium_june">jun</string>
+    <string name="month_medium_july">jul</string>
+    <string name="month_medium_august">ago</string>
+    <string name="month_medium_september">set</string>
+    <string name="month_medium_october">out</string>
+    <string name="month_medium_november">nov</string>
+    <string name="month_medium_december">dez</string>
+
+    <string name="month_shortest_january">J</string>
+    <string name="month_shortest_february">F</string>
+    <string name="month_shortest_march">M</string>
+    <string name="month_shortest_april">A</string>
+    <string name="month_shortest_may">M</string>
+    <string name="month_shortest_june">J</string>
+    <string name="month_shortest_july">J</string>
+    <string name="month_shortest_august">A</string>
+    <string name="month_shortest_september">S</string>
+    <string name="month_shortest_october">O</string>
+    <string name="month_shortest_november">N</string>
+    <string name="month_shortest_december">D</string>
+
+    <string name="day_of_week_long_sunday">domingo</string>
+    <string name="day_of_week_long_monday">segunda-feira</string>
+    <string name="day_of_week_long_tuesday">terça-feira</string>
+    <string name="day_of_week_long_wednesday">quarta-feira</string>
+    <string name="day_of_week_long_thursday">quinta-feira</string>
+    <string name="day_of_week_long_friday">sexta-feira</string>
+    <string name="day_of_week_long_saturday">sábado</string>
+
+    <string name="day_of_week_medium_sunday">dom</string>
+    <string name="day_of_week_medium_monday">seg</string>
+    <string name="day_of_week_medium_tuesday">ter</string>
+    <string name="day_of_week_medium_wednesday">qua</string>
+    <string name="day_of_week_medium_thursday">qui</string>
+    <string name="day_of_week_medium_friday">sex</string>
+    <string name="day_of_week_medium_saturday">sáb</string>
+
+    <string name="day_of_week_short_sunday">dom</string>
+    <string name="day_of_week_short_monday">seg</string>
+    <string name="day_of_week_short_tuesday">ter</string>
+    <string name="day_of_week_short_wednesday">qua</string>
+    <string name="day_of_week_short_thursday">qui</string>
+    <string name="day_of_week_short_friday">sex</string>
+    <string name="day_of_week_short_saturday">sáb</string>
+
+    <string name="day_of_week_shortest_sunday">D</string>
+    <string name="day_of_week_shortest_monday">S</string>
+    <string name="day_of_week_shortest_tuesday">T</string>
+    <string name="day_of_week_shortest_wednesday">Q</string>
+    <string name="day_of_week_shortest_thursday">Q</string>
+    <string name="day_of_week_shortest_friday">S</string>
+    <string name="day_of_week_shortest_saturday">S</string>
+
+    <string name="am">AM</string>
+    <string name="pm">PM</string>
+    <string name="yesterday">Ontem</string>
+    <string name="today">Hoje</string>
+    <string name="tomorrow">Amanhã</string>
+
+    <string name="hour_minute_24">%-kh%M</string>
+    <string name="hour_minute_ampm">%-l:%M %p</string>
+    <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H'h'mm</string>
+    <string name="numeric_date">%d/%m/%Y</string>
+    <string name="numeric_date_format">dd/MM/yyyy</string>
+    <string name="month_day_year">%-e de %B de %Y</string>
+    <string name="time_of_day">%H:%M:%S</string>
+    <string name="date_and_time">%H:%M:%S %d/%m/%Y</string>
+    <string name="date_time">%2$s %1$s</string>
+    <string name="time_date">%1$s %3$s</string>
+    <string name="abbrev_month_day_year">%d/%m/%Y</string>
+    <string name="month_day">%-e de %B</string>
+    <string name="month">%-B</string>
+    <string name="month_year">%B de %Y</string>
+    <string name="abbrev_month_day">%-e de %b</string>
+    <string name="abbrev_month">%-b</string>
+    <string name="abbrev_month_year">%b de %Y</string>
+    <string name="time1_time2">%1$s - %2$s</string>
+    <string name="date1_date2">%2$s - %5$s</string>
+    <string name="numeric_md1_md2">%3$s/%2$s - %8$s/%7$s</string>
+    <string name="numeric_wday1_md1_wday2_md2">%1$s, %3$s/%2$s - %6$s, %8$s/%7$s</string>
+    <string name="numeric_mdy1_mdy2">%3$s/%2$s/%4$s - %8$s/%7$s/%9$s</string>
+    <string name="numeric_wday1_mdy1_wday2_mdy2">%1$s, %3$s/%2$s/%4$s - %6$s, %8$s/%7$s/%9$s</string>
+    <string name="numeric_wday1_mdy1_time1_wday2_mdy2_time2">%5$s %1$s, %3$s/%2$s/%4$s - %10$s %6$s, %8$s/%7$s/%9$s</string>
+    <string name="numeric_md1_time1_md2_time2">%5$s %3$s/%2$s - %10$s %8$s/%7$s</string>
+    <string name="numeric_wday1_md1_time1_wday2_md2_time2">%5$s %1$s, %3$s/%2$s - %10$s %6$s, %8$s/%7$s</string>
+    <string name="numeric_mdy1_time1_mdy2_time2">%5$s %3$s/%2$s/%4$s - %10$s %8$s/%7$s/%9$s</string>
+    <string name="wday1_date1_time1_wday2_date2_time2">%3$s %1$s, %2$s - %6$s %4$s, %5$s</string>
+    <string name="wday1_date1_wday2_date2">%1$s, %2$s - %4$s, %5$s</string>
+    <string name="date1_time1_date2_time2">%3$s %2$s - %6$s %5$s</string>
+    <string name="time_wday_date">%1$s %2$s, %3$s</string>
+    <string name="wday_date">%2$s, %3$s</string>
+    <string name="time_wday">%1$s %2$s</string>
+    <string name="same_year_md1_md2">%3$s de %2$s - %8$s de %7$s</string>
+    <string name="same_year_wday1_md1_wday2_md2">%1$s, %3$s de %2$s - %6$s, %8$s de %7$s</string>
+    <string name="same_year_md1_time1_md2_time2">%5$s %3$s de %2$s - %10$s %8$s de %7$s</string>
+    <string name="same_month_md1_time1_md2_time2">%5$s %3$s de %2$s - %10$s %8$s de %7$s</string>
+    <string name="same_year_wday1_md1_time1_wday2_md2_time2">%5$s %1$s, %3$s de %2$s - %10$s %6$s, %8$s de %7$s</string>
+    <string name="same_month_wday1_md1_time1_wday2_md2_time2">%5$s %1$s, %3$s de %2$s - %10$s %6$s, %8$s de %7$s</string>
+    <string name="same_year_mdy1_time1_mdy2_time2">%5$s %3$s de %2$s de %4$s - %10$s %8$s de %7$s de %9$s</string>
+    <string name="same_month_mdy1_time1_mdy2_time2">%5$s %3$s de %2$s de %4$s - %10$s %8$s de %7$s de %9$s</string>
+    <string name="same_year_wday1_mdy1_time1_wday2_mdy2_time2">%5$s %1$s, %3$s de %2$s de %4$s - %10$s %6$s, %8$s de %7$s de %9$s</string>
+    <string name="same_month_wday1_mdy1_time1_wday2_mdy2_time2">%5$s %1$s, %3$s de %2$s de %4$s - %10$s %6$s, %8$s de %7$s de %9$s</string>
+    <string name="same_month_wday1_mdy1_wday2_mdy2">%1$s, %3$s de %2$s de %4$s - %6$s, %8$s de %7$s de %9$s</string>
+    <string name="same_month_md1_md2">%3$s-%8$s de %2$s</string>
+    <string name="same_month_wday1_md1_wday2_md2">%1$s, %3$s de %2$s - %6$s, %8$s de %7$s</string>
+    <string name="same_year_mdy1_mdy2">%3$s de %2$s - %8$s de %7$s de %9$s</string>
+    <string name="same_month_mdy1_mdy2">%3$s-%8$s de %2$s de %9$s</string>
+    <string name="same_year_wday1_mdy1_wday2_mdy2">%1$s, %3$s de %2$s - %6$s, %8$s de %7$s de %9$s</string>
+</resources>
diff --git a/core/res/res/values-ro-rRO/donottranslate-cldr.xml b/core/res/res/values-ro-rRO/donottranslate-cldr.xml
index 1b3438f..a4f1097 100644
--- a/core/res/res/values-ro-rRO/donottranslate-cldr.xml
+++ b/core/res/res/values-ro-rRO/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-ru-rRU/donottranslate-cldr.xml b/core/res/res/values-ru-rRU/donottranslate-cldr.xml
index 9197d12..64f9845 100644
--- a/core/res/res/values-ru-rRU/donottranslate-cldr.xml
+++ b/core/res/res/values-ru-rRU/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e %B %Y г.</string>
diff --git a/core/res/res/values-ru/donottranslate-cldr.xml b/core/res/res/values-ru/donottranslate-cldr.xml
index 9197d12..64f9845 100644
--- a/core/res/res/values-ru/donottranslate-cldr.xml
+++ b/core/res/res/values-ru/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e %B %Y г.</string>
diff --git a/core/res/res/values-sk-rSK/donottranslate-cldr.xml b/core/res/res/values-sk-rSK/donottranslate-cldr.xml
index 5ebb0b2..0a1245a 100644
--- a/core/res/res/values-sk-rSK/donottranslate-cldr.xml
+++ b/core/res/res/values-sk-rSK/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%-e.%-m.%Y</string>
     <string name="numeric_date_format">d.M.yyyy</string>
     <string name="month_day_year">%-e. %B %Y</string>
diff --git a/core/res/res/values-sl-rSI/donottranslate-cldr.xml b/core/res/res/values-sl-rSI/donottranslate-cldr.xml
index dc01c8c..f16b9ea 100644
--- a/core/res/res/values-sl-rSI/donottranslate-cldr.xml
+++ b/core/res/res/values-sl-rSI/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-e. %m. %Y</string>
     <string name="numeric_date_format">d. MM. yyyy</string>
     <string name="month_day_year">%d. %B %Y</string>
diff --git a/core/res/res/values-sr-rRS/donottranslate-cldr.xml b/core/res/res/values-sr-rRS/donottranslate-cldr.xml
index cf4f7cb..1cd9d6a 100644
--- a/core/res/res/values-sr-rRS/donottranslate-cldr.xml
+++ b/core/res/res/values-sr-rRS/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H.%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH.mm</string>
     <string name="numeric_date">%-e.%-m.%Y.</string>
     <string name="numeric_date_format">d.M.yyyy.</string>
     <string name="month_day_year">%d. %B %Y.</string>
diff --git a/core/res/res/values-sv-rSE/donottranslate-cldr.xml b/core/res/res/values-sv-rSE/donottranslate-cldr.xml
index 39e1f85..ce756bb 100644
--- a/core/res/res/values-sv-rSE/donottranslate-cldr.xml
+++ b/core/res/res/values-sv-rSE/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k.%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H.mm</string>
     <string name="numeric_date">%Y-%m-%d</string>
     <string name="numeric_date_format">yyyy-MM-dd</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-th-rTH/donottranslate-cldr.xml b/core/res/res/values-th-rTH/donottranslate-cldr.xml
index fec840b..876bb80 100644
--- a/core/res/res/values-th-rTH/donottranslate-cldr.xml
+++ b/core/res/res/values-th-rTH/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%-e/%-m/%Y</string>
     <string name="numeric_date_format">d/M/yyyy</string>
     <string name="month_day_year">%-e %B %Y</string>
diff --git a/core/res/res/values-tr-rTR/donottranslate-cldr.xml b/core/res/res/values-tr-rTR/donottranslate-cldr.xml
index 28b2d59..6220eba 100644
--- a/core/res/res/values-tr-rTR/donottranslate-cldr.xml
+++ b/core/res/res/values-tr-rTR/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%d %m %Y</string>
     <string name="numeric_date_format">dd MM yyyy</string>
     <string name="month_day_year">%d %B %Y</string>
diff --git a/core/res/res/values-uk-rUA/donottranslate-cldr.xml b/core/res/res/values-uk-rUA/donottranslate-cldr.xml
index 5c3542d..43eaba0 100644
--- a/core/res/res/values-uk-rUA/donottranslate-cldr.xml
+++ b/core/res/res/values-uk-rUA/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d.%m.%Y</string>
     <string name="numeric_date_format">dd.MM.yyyy</string>
     <string name="month_day_year">%-e %B %Y р.</string>
diff --git a/core/res/res/values-vi-rVN/donottranslate-cldr.xml b/core/res/res/values-vi-rVN/donottranslate-cldr.xml
index 5f14fe0..b9342fb 100644
--- a/core/res/res/values-vi-rVN/donottranslate-cldr.xml
+++ b/core/res/res/values-vi-rVN/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%-l:%M %p</string>
     <string name="hour_minute_cap_ampm">%-l:%M %^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%d/%m/%Y</string>
     <string name="numeric_date_format">dd/MM/yyyy</string>
     <string name="month_day_year">Ngày %d tháng %-m năm %Y</string>
diff --git a/core/res/res/values-zh-rCN/donottranslate-cldr.xml b/core/res/res/values-zh-rCN/donottranslate-cldr.xml
index faf6fee..631ef10 100644
--- a/core/res/res/values-zh-rCN/donottranslate-cldr.xml
+++ b/core/res/res/values-zh-rCN/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%p%-l:%M</string>
     <string name="hour_minute_cap_ampm">%p%-l:%M</string>
+    <string name="twelve_hour_time_format">ah:mm</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y-%-m-%-e</string>
     <string name="numeric_date_format">yyyy-M-d</string>
     <string name="month_day_year">%Y年%-m月%-e日</string>
diff --git a/core/res/res/values-zh-rTW/donottranslate-cldr.xml b/core/res/res/values-zh-rTW/donottranslate-cldr.xml
index faf6fee..631ef10 100644
--- a/core/res/res/values-zh-rTW/donottranslate-cldr.xml
+++ b/core/res/res/values-zh-rTW/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%-k:%M</string>
     <string name="hour_minute_ampm">%p%-l:%M</string>
     <string name="hour_minute_cap_ampm">%p%-l:%M</string>
+    <string name="twelve_hour_time_format">ah:mm</string>
+    <string name="twenty_four_hour_time_format">H:mm</string>
     <string name="numeric_date">%Y-%-m-%-e</string>
     <string name="numeric_date_format">yyyy-M-d</string>
     <string name="month_day_year">%Y年%-m月%-e日</string>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index c13bf775..99fe9c8 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2849,6 +2849,14 @@
              The default value is <code>false</code>. <i>Optional attribute.</i>. -->
         <attr name="includeInGlobalSearch" format="boolean" />
 
+        <!-- If provided and <code>true</code>, this searchable activity will be invoked for all
+             queries in a particular session. If set to <code>false</code> and the activity
+             returned zero results for a query, it will not be invoked again in that session for
+             supersets of that zero-results query. For example, if the activity returned zero
+             results for "bo", it would not be queried again for "bob".
+             The default value is <code>false</code>. <i>Optional attribute.</i>. -->
+        <attr name="queryAfterZeroResults" format="boolean" />
+
     </declare-styleable>
 
     <!-- In order to process special action keys during search, you must define them using
diff --git a/core/res/res/values/donottranslate-cldr.xml b/core/res/res/values/donottranslate-cldr.xml
index b13a986..2e87dee 100644
--- a/core/res/res/values/donottranslate-cldr.xml
+++ b/core/res/res/values/donottranslate-cldr.xml
@@ -94,6 +94,8 @@
     <string name="hour_minute_24">%H:%M</string>
     <string name="hour_minute_ampm">%-l:%M%p</string>
     <string name="hour_minute_cap_ampm">%-l:%M%^p</string>
+    <string name="twelve_hour_time_format">h:mm a</string>
+    <string name="twenty_four_hour_time_format">HH:mm</string>
     <string name="numeric_date">%-m/%-e/%Y</string>
     <string name="numeric_date_format">M/d/yyyy</string>
     <string name="month_day_year">%B %-e, %Y</string>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index a50f3f9..e5a58b1 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1115,6 +1115,7 @@
   <public type="attr" name="backupAgent" />
   <public type="attr" name="allowBackup" />
   <public type="attr" name="glEsVersion" />
+  <public type="attr" name="queryAfterZeroResults" />
   
   <public-padding type="attr" name="donut_resource_pad" end="0x0101029f" />
 
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java
index 725fbf9..9698553 100644
--- a/location/java/com/android/internal/location/GpsLocationProvider.java
+++ b/location/java/com/android/internal/location/GpsLocationProvider.java
@@ -410,6 +410,10 @@
      * Someday we might use this for network location injection to aid the GPS
      */
     public void updateLocation(Location location) {
+        if (location.hasAccuracy()) {
+            native_inject_location(location.getLatitude(), location.getLongitude(),
+                    location.getAccuracy());
+        }
     }
 
     /**
@@ -1210,7 +1214,8 @@
     // mask[0] is ephemeris mask and mask[1] is almanac mask
     private native int native_read_sv_status(int[] svs, float[] snrs,
             float[] elevations, float[] azimuths, int[] masks);
-    
+    private native void native_inject_location(double latitude, double longitude, float accuracy);
+
     // XTRA Support    
     private native void native_inject_time(long time, long timeReference, int uncertainty);
     private native boolean native_supports_xtra();
diff --git a/telephony/java/android/telephony/SmsMessage.java b/telephony/java/android/telephony/SmsMessage.java
index f9b95b2..b60da5a 100644
--- a/telephony/java/android/telephony/SmsMessage.java
+++ b/telephony/java/android/telephony/SmsMessage.java
@@ -224,25 +224,29 @@
 
     /**
      * Calculates the number of SMS's required to encode the message body and
-     * the number of characters remaining until the next message, given the
-     * current encoding.
+     * the number of characters remaining until the next message.
      *
-     * @param messageBody the message to encode
-     * @param use7bitOnly if true, characters that are not part of the GSM
-     *         alphabet are counted as a single space char.  If false, a
-     *         messageBody containing non-GSM alphabet characters is calculated
-     *         for 16-bit encoding.
+     * @param msgBody the message to encode
+     * @param use7bitOnly if true, characters that are not part of the
+     *         radio-specific 7-bit encoding are counted as single
+     *         space chars.  If false, and if the messageBody contains
+     *         non-7-bit encodable characters, length is calculated
+     *         using a 16-bit encoding.
      * @return an int[4] with int[0] being the number of SMS's required, int[1]
      *         the number of code units used, and int[2] is the number of code
      *         units remaining until the next message. int[3] is the encoding
      *         type that should be used for the message.
      */
-    public static int[] calculateLength(CharSequence messageBody, boolean use7bitOnly) {
+    public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly) {
+        int activePhone = TelephonyManager.getDefault().getPhoneType();
         int ret[] = new int[4];
 
-        try {
-            // Try GSM alphabet
-            int septets = GsmAlphabet.countGsmSeptets(messageBody, !use7bitOnly);
+        int septets = (PHONE_TYPE_CDMA == activePhone) ?
+                com.android.internal.telephony.cdma.SmsMessage.calc7bitEncodedLength(msgBody,
+                        use7bitOnly) :
+                com.android.internal.telephony.gsm.SmsMessage.calc7bitEncodedLength(msgBody,
+                        use7bitOnly);
+        if (septets != -1) {
             ret[1] = septets;
             if (septets > MAX_USER_DATA_SEPTETS) {
                 ret[0] = (septets / MAX_USER_DATA_SEPTETS_WITH_HEADER) + 1;
@@ -253,12 +257,10 @@
                 ret[2] = MAX_USER_DATA_SEPTETS - septets;
             }
             ret[3] = ENCODING_7BIT;
-        } catch (EncodeException ex) {
-            // fall back to UCS-2
-            int octets = messageBody.length() * 2;
-            ret[1] = messageBody.length();
+        } else {
+            int octets = msgBody.length() * 2;
+            ret[1] = msgBody.length();
             if (octets > MAX_USER_DATA_BYTES) {
-                // 6 is the size of the user data header
                 ret[0] = (octets / MAX_USER_DATA_BYTES_WITH_HEADER) + 1;
                 ret[2] = (MAX_USER_DATA_BYTES_WITH_HEADER
                             - (octets % MAX_USER_DATA_BYTES_WITH_HEADER))/2;
diff --git a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
index 9152559..bbdd0dd 100644
--- a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
@@ -357,6 +357,17 @@
     }
 
     /**
+     * Calculate the number of septets needed to encode the message.
+     *
+     * @param messageBody the message to encode
+     * @param force ignore (but still count) illegal characters if true
+     * @return septet count, or -1 on failure
+     */
+    public static int calc7bitEncodedLength(CharSequence msgBody, boolean force) {
+        return BearerData.calc7bitEncodedLength(msgBody.toString(), force);
+    }
+
+    /**
      * Note: This function is a GSM specific functionality which is not supported in CDMA mode.
      */
     public int getProtocolIdentifier() {
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
index ab65b0a..3c45aa4 100644
--- a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
@@ -385,7 +385,17 @@
         outStream.skip(3);
     }
 
-    private static byte[] encode7bitAscii(String msg)
+    private static class SeptetData {
+        byte data[];
+        int septetCount;
+
+        SeptetData(byte[] data, int septetCount) {
+            this.data = data;
+            this.septetCount = septetCount;
+        }
+    }
+
+    private static SeptetData encode7bitAscii(String msg, boolean force)
         throws CodingException
     {
         try {
@@ -396,23 +406,43 @@
                 // Test ourselves for ASCII membership, since Java seems not to care.
                 if ((charCode < UserData.PRINTABLE_ASCII_MIN_INDEX) ||
                         (charCode > UserData.PRINTABLE_ASCII_MAX_INDEX)) {
-                    throw new CodingException("illegal ASCII code (" + charCode + ")");
+                    if (force) {
+                        outStream.write(7, UserData.UNENCODABLE_7_BIT_CHAR);
+                    } else {
+                        throw new CodingException("illegal ASCII code (" + charCode + ")");
+                    }
+                } else {
+                    outStream.write(7, expandedData[i]);
                 }
-                outStream.write(7, expandedData[i]);
             }
-            return outStream.toByteArray();
-        } catch  (java.io.UnsupportedEncodingException ex) {
+            return new SeptetData(outStream.toByteArray(), expandedData.length);
+        } catch (java.io.UnsupportedEncodingException ex) {
             throw new CodingException("7bit ASCII encode failed: " + ex);
-        } catch  (BitwiseOutputStream.AccessException ex) {
+        } catch (BitwiseOutputStream.AccessException ex) {
             throw new CodingException("7bit ASCII encode failed: " + ex);
         }
     }
 
+    /**
+     * Calculate the number of septets needed to encode the message.
+     *
+     * @param force ignore (but still count) illegal characters if true
+     * @return septet count, or -1 on failure
+     */
+    public static int calc7bitEncodedLength(String msg, boolean force) {
+        try {
+            SeptetData data = encode7bitAscii(msg, force);
+            return data.septetCount;
+        } catch (CodingException ex) {
+            return -1;
+        }
+    }
+
     private static byte[] encodeUtf16(String msg)
         throws CodingException
     {
         try {
-            return msg.getBytes("utf-16be"); // XXX(do not submit) -- make sure decode matches
+            return msg.getBytes("utf-16be");
         } catch (java.io.UnsupportedEncodingException ex) {
             throw new CodingException("UTF-16 encode failed: " + ex);
         }
@@ -462,7 +492,8 @@
                 if (uData.msgEncoding == UserData.ENCODING_GSM_7BIT_ALPHABET) {
                     payloadData = encode7bitGsm(uData.payloadStr);
                 } else if (uData.msgEncoding == UserData.ENCODING_7BIT_ASCII) {
-                    payloadData = encode7bitAscii(uData.payloadStr);
+                    SeptetData septetData = encode7bitAscii(uData.payloadStr, true);
+                    payloadData = septetData.data;
                 } else if (uData.msgEncoding == UserData.ENCODING_UNICODE_16) {
                     payloadData = encodeUtf16(uData.payloadStr);
                 } else {
@@ -478,7 +509,8 @@
                 uData.payloadStr = "";
             }
             try {
-                payloadData = encode7bitAscii(uData.payloadStr);
+                SeptetData septetData = encode7bitAscii(uData.payloadStr, false);
+                payloadData = septetData.data;
                 uData.msgEncoding = UserData.ENCODING_7BIT_ASCII;
             } catch (CodingException ex) {
                 payloadData = encodeUtf16(uData.payloadStr);
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java b/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java
index 7c37bc2..8d4e769 100644
--- a/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java
@@ -50,6 +50,14 @@
         'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~'};
 
     /**
+     * Character to use when forced to encode otherwise unencodable
+     * characters, meaning those not in the respective ASCII or GSM
+     * 7-bit encoding tables.  Current choice is SPACE, which is 0x20
+     * in both the GSM-7bit and ASCII-7bit encodings.
+     */
+    static final byte UNENCODABLE_7_BIT_CHAR = 0x20;
+
+    /**
      * Only elements between these indices in the ASCII table are printable.
      */
     public static final int PRINTABLE_ASCII_MIN_INDEX = 0x20;
diff --git a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
index 6435be5..a15bbdf 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
@@ -739,6 +739,22 @@
         }
     }
 
+    /**
+     * Calculate the number of septets needed to encode the message.
+     *
+     * @param messageBody the message to encode
+     * @param force ignore (but still count) illegal characters if true
+     * @return septet count, or -1 on failure
+     */
+    public static int calc7bitEncodedLength(CharSequence messageBody, boolean force) {
+        try {
+            return GsmAlphabet.countGsmSeptets(messageBody, !force);
+        } catch (EncodeException ex) {
+            /* Just fall through to the -1 error result below. */
+        }
+        return -1;
+    }
+
     /** {@inheritDoc} */
     public int getProtocolIdentifier() {
         return protocolIdentifier;