auto import from //branches/cupcake_rel/...@141571
diff --git a/api/3.xml b/api/3.xml
index 512fef8..c752813 100644
--- a/api/3.xml
+++ b/api/3.xml
@@ -125608,7 +125608,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -125652,7 +125652,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -125665,7 +125665,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
diff --git a/api/current.xml b/api/current.xml
index c9ed3c4..2260abb 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -12120,6 +12120,17 @@
  visibility="public"
 >
 </field>
+<field name="Theme_Light_Panel"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16973914"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="Theme_NoDisplay"
  type="int"
  transient="false"
@@ -12153,6 +12164,17 @@
  visibility="public"
 >
 </field>
+<field name="Theme_Panel"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16973913"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="Theme_Translucent"
  type="int"
  transient="false"
@@ -28390,6 +28412,17 @@
  visibility="public"
 >
 </field>
+<field name="ACTION_PACKAGE_REPLACED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;android.intent.action.PACKAGE_REPLACED&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="ACTION_PACKAGE_RESTARTED"
  type="java.lang.String"
  transient="false"
@@ -64504,6 +64537,23 @@
  visibility="public"
 >
 </method>
+<method name="getMinBufferSize"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="sampleRateInHz" type="int">
+</parameter>
+<parameter name="channelConfig" type="int">
+</parameter>
+<parameter name="audioFormat" type="int">
+</parameter>
+</method>
 <method name="getNotificationMarkerPosition"
  return="int"
  abstract="false"
@@ -64619,19 +64669,6 @@
  visibility="public"
 >
 </method>
-<method name="setMarkerReachedListener"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="listener" type="android.media.AudioRecord.OnMarkerReachedListener">
-</parameter>
-</method>
 <method name="setNotificationMarkerPosition"
  return="int"
  abstract="false"
@@ -64645,19 +64682,6 @@
 <parameter name="markerInFrames" type="int">
 </parameter>
 </method>
-<method name="setPeriodicNotificationListener"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="listener" type="android.media.AudioRecord.OnPeriodicNotificationListener">
-</parameter>
-</method>
 <method name="setPositionNotificationPeriod"
  return="int"
  abstract="false"
@@ -64671,6 +64695,34 @@
 <parameter name="periodInFrames" type="int">
 </parameter>
 </method>
+<method name="setRecordPositionUpdateListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="listener" type="android.media.AudioRecord.OnRecordPositionUpdateListener">
+</parameter>
+</method>
+<method name="setRecordPositionUpdateListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="listener" type="android.media.AudioRecord.OnRecordPositionUpdateListener">
+</parameter>
+<parameter name="handler" type="android.os.Handler">
+</parameter>
+</method>
 <method name="startRecording"
  return="void"
  abstract="false"
@@ -64786,7 +64838,7 @@
 >
 </field>
 </class>
-<interface name="AudioRecord.OnMarkerReachedListener"
+<interface name="AudioRecord.OnRecordPositionUpdateListener"
  abstract="true"
  static="true"
  final="false"
@@ -64806,14 +64858,6 @@
 <parameter name="recorder" type="android.media.AudioRecord">
 </parameter>
 </method>
-</interface>
-<interface name="AudioRecord.OnPeriodicNotificationListener"
- abstract="true"
- static="true"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
 <method name="onPeriodicNotification"
  return="void"
  abstract="true"
@@ -64913,6 +64957,23 @@
  visibility="public"
 >
 </method>
+<method name="getMinBufferSize"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="sampleRateInHz" type="int">
+</parameter>
+<parameter name="channelConfig" type="int">
+</parameter>
+<parameter name="audioFormat" type="int">
+</parameter>
+</method>
 <method name="getMinVolume"
  return="float"
  abstract="false"
@@ -64981,6 +65042,17 @@
  visibility="public"
 >
 </method>
+<method name="getPlaybackRate"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
 <method name="getPositionNotificationPeriod"
  return="int"
  abstract="false"
@@ -66257,6 +66329,19 @@
 <parameter name="listener" type="android.media.MediaPlayer.OnErrorListener">
 </parameter>
 </method>
+<method name="setOnInfoListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="listener" type="android.media.MediaPlayer.OnInfoListener">
+</parameter>
+</method>
 <method name="setOnPreparedListener"
  return="void"
  abstract="false"
@@ -66283,6 +66368,19 @@
 <parameter name="listener" type="android.media.MediaPlayer.OnSeekCompleteListener">
 </parameter>
 </method>
+<method name="setOnVideoSizeChangedListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="listener" type="android.media.MediaPlayer.OnVideoSizeChangedListener">
+</parameter>
+</method>
 <method name="setScreenOnWhilePlaying"
  return="void"
  abstract="false"
@@ -66352,6 +66450,17 @@
 <exception name="IllegalStateException" type="java.lang.IllegalStateException">
 </exception>
 </method>
+<field name="MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="200"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="MEDIA_ERROR_SERVER_DIED"
  type="int"
  transient="false"
@@ -66374,6 +66483,50 @@
  visibility="public"
 >
 </field>
+<field name="MEDIA_INFO_BAD_INTERLEAVING"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="800"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="MEDIA_INFO_NOT_SEEKABLE"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="801"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="MEDIA_INFO_UNKNOWN"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="MEDIA_INFO_VIDEO_TRACK_LAGGING"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="700"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 </class>
 <interface name="MediaPlayer.OnBufferingUpdateListener"
  abstract="true"
@@ -66444,6 +66597,31 @@
 </parameter>
 </method>
 </interface>
+<interface name="MediaPlayer.OnInfoListener"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="onInfo"
+ return="boolean"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="mp" type="android.media.MediaPlayer">
+</parameter>
+<parameter name="what" type="int">
+</parameter>
+<parameter name="extra" type="int">
+</parameter>
+</method>
+</interface>
 <interface name="MediaPlayer.OnPreparedListener"
  abstract="true"
  static="true"
@@ -66486,6 +66664,31 @@
 </parameter>
 </method>
 </interface>
+<interface name="MediaPlayer.OnVideoSizeChangedListener"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="onVideoSizeChanged"
+ return="void"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="mp" type="android.media.MediaPlayer">
+</parameter>
+<parameter name="width" type="int">
+</parameter>
+<parameter name="height" type="int">
+</parameter>
+</method>
+</interface>
 <class name="MediaRecorder"
  extends="java.lang.Object"
  abstract="false"
@@ -110587,6 +110790,36 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<method name="getInitialScrollX"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="widget" type="android.widget.TextView">
+</parameter>
+<parameter name="buffer" type="android.text.Spannable">
+</parameter>
+</method>
+<method name="getInitialScrollY"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="widget" type="android.widget.TextView">
+</parameter>
+<parameter name="buffer" type="android.text.Spannable">
+</parameter>
+</method>
 <method name="onTouchEvent"
  return="boolean"
  abstract="false"
@@ -135168,7 +135401,7 @@
 >
 <parameter name="targetView" type="android.view.View">
 </parameter>
-<parameter name="dummyMode" type="boolean">
+<parameter name="fullEditor" type="boolean">
 </parameter>
 </constructor>
 <method name="beginBatchEdit"
@@ -136598,6 +136831,8 @@
 >
 <parameter name="target" type="android.view.inputmethod.InputConnection">
 </parameter>
+<parameter name="mutable" type="boolean">
+</parameter>
 </constructor>
 <method name="beginBatchEdit"
  return="boolean"
@@ -136843,6 +137078,19 @@
 <parameter name="end" type="int">
 </parameter>
 </method>
+<method name="setTarget"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="android.view.inputmethod.InputConnection">
+</parameter>
+</method>
 </class>
 <interface name="InputMethod"
  abstract="true"
@@ -146396,7 +146644,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -146440,7 +146688,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -146453,7 +146701,7 @@
  native="false"
  synchronized="false"
  static="false"
- final="true"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
@@ -157332,6 +157580,17 @@
  visibility="public"
 >
 </method>
+<method name="moveCursorToVisibleOffset"
+ return="boolean"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
 <method name="onBeginBatchEdit"
  return="void"
  abstract="false"
diff --git a/camera/libcameraservice/Android.mk b/camera/libcameraservice/Android.mk
index 2dfe659..96cc512 100644
--- a/camera/libcameraservice/Android.mk
+++ b/camera/libcameraservice/Android.mk
@@ -42,7 +42,8 @@
 LOCAL_SHARED_LIBRARIES:= \
     libui \
     libutils \
-    libcutils
+    libcutils \
+    libmedia
 
 LOCAL_MODULE:= libcameraservice
 
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp
index 15e3b21..851b213 100644
--- a/camera/libcameraservice/CameraService.cpp
+++ b/camera/libcameraservice/CameraService.cpp
@@ -28,6 +28,8 @@
 #include <utils/MemoryHeapBase.h>
 #include <ui/ICameraService.h>
 
+#include <media/mediaplayer.h>
+#include <media/AudioSystem.h>
 #include "CameraService.h"
 
 namespace android {
@@ -151,6 +153,19 @@
     }
 }
 
+static sp<MediaPlayer> newMediaPlayer(const char *file) 
+{
+    sp<MediaPlayer> mp = new MediaPlayer();
+    if (mp->setDataSource(file) == NO_ERROR) {
+        mp->setAudioStreamType(AudioSystem::ALARM);
+        mp->prepare();
+    } else {
+        mp.clear();
+        LOGE("Failed to load CameraService sounds.");
+    }
+    return mp;
+}
+
 CameraService::Client::Client(const sp<CameraService>& cameraService,
         const sp<ICameraClient>& cameraClient, pid_t clientPid)
 {
@@ -161,6 +176,9 @@
     mHardware = openCameraHardware();
     mUseOverlay = mHardware->useOverlay();
 
+    mMediaPlayerClick = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
+    mMediaPlayerBeep = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
+
     // Callback is disabled by default
     mPreviewCallbackFlag = FRAME_CALLBACK_FLAG_NOOP;
     LOGD("Client X constructor");
@@ -265,6 +283,9 @@
 #endif
     }
 
+    mMediaPlayerBeep.clear();
+    mMediaPlayerClick.clear();
+
     // make sure we tear down the hardware
     mClientPid = IPCThreadState::self()->getCallingPid();
     disconnect();
@@ -464,6 +485,9 @@
 
 status_t CameraService::Client::startRecording()
 {
+    if (mMediaPlayerBeep.get() != NULL) {
+        mMediaPlayerBeep->start();
+    }
     return startCameraMode(CAMERA_RECORDING_MODE);
 }
 
@@ -502,6 +526,9 @@
         return;
     }
 
+    if (mMediaPlayerBeep.get() != NULL) {
+        mMediaPlayerBeep->start();
+    }
     mHardware->stopRecording();
     LOGV("stopRecording(), hardware stopped OK");
     mPreviewBuffer.clear();
@@ -684,6 +711,9 @@
         return INVALID_OPERATION;
     }
 
+    if (mMediaPlayerClick.get() != NULL) {
+        mMediaPlayerClick->start();
+    }
     return mHardware->takePicture(shutterCallback,
                                   yuvPictureCallback,
                                   jpegPictureCallback,
diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h
index d9b7927..6752f26 100644
--- a/camera/libcameraservice/CameraService.h
+++ b/camera/libcameraservice/CameraService.h
@@ -27,6 +27,8 @@
 
 namespace android {
 
+class MediaPlayer;
+
 // ----------------------------------------------------------------------------
 
 #define LIKELY( exp )       (__builtin_expect( (exp) != 0, true  ))
@@ -178,6 +180,9 @@
                     sp<MemoryHeapBase>          mPreviewBuffer;
                     int                         mPreviewCallbackFlag;
 
+                    sp<MediaPlayer>             mMediaPlayerClick;
+                    sp<MediaPlayer>             mMediaPlayerBeep;
+
                     // these are immutable once the object is created,
                     // they don't need to be protected by a lock
                     sp<ICameraClient>           mCameraClient;
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index cb1e903..acf41ee 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -114,6 +114,7 @@
     private static final boolean DEBUG = false;
     private static final boolean localLOGV = DEBUG ? Config.LOGD : Config.LOGV;
     private static final boolean DEBUG_BROADCAST = false;
+    private static final boolean DEBUG_RESULTS = false;
     private static final long MIN_TIME_BETWEEN_GCS = 5*1000;
     private static final Pattern PATTERN_SEMICOLON = Pattern.compile(";");
     private static final int SQLITE_MEM_RELEASED_EVENT_LOG_TAG = 75003;
@@ -2118,6 +2119,8 @@
     public final void sendActivityResult(
             IBinder token, String id, int requestCode,
             int resultCode, Intent data) {
+        if (DEBUG_RESULTS) Log.v(TAG, "sendActivityResult: id=" + id
+                + " req=" + requestCode + " res=" + resultCode + " data=" + data);
         ArrayList<ResultInfo> list = new ArrayList<ResultInfo>();
         list.add(new ResultInfo(id, requestCode, resultCode, data));
         mAppThread.scheduleSendResult(token, list);
@@ -2993,6 +2996,8 @@
                 if (ri.mData != null) {
                     ri.mData.setExtrasClassLoader(r.activity.getClassLoader());
                 }
+                if (DEBUG_RESULTS) Log.v(TAG,
+                        "Delivering result to activity " + r + " : " + ri);
                 r.activity.dispatchActivityResult(ri.mResultWho,
                         ri.mRequestCode, ri.mResultCode, ri.mData);
             } catch (Exception e) {
@@ -3008,7 +3013,7 @@
 
     private final void handleSendResult(ResultData res) {
         ActivityRecord r = mActivities.get(res.token);
-        if (localLOGV) Log.v(TAG, "Handling send result to " + r);
+        if (DEBUG_RESULTS) Log.v(TAG, "Handling send result to " + r);
         if (r != null) {
             final boolean resumed = !r.paused;
             if (!r.activity.mFinished && r.activity.mDecor != null
diff --git a/core/java/android/app/ApplicationContext.java b/core/java/android/app/ApplicationContext.java
index ecef38f..55fce49 100644
--- a/core/java/android/app/ApplicationContext.java
+++ b/core/java/android/app/ApplicationContext.java
@@ -2723,10 +2723,8 @@
                     mTimestamp = mFileStatus.mtime;
                 }
                 
-                // Writing was successful, delete the backup file
-                if (!mBackupFile.delete()) {
-                    Log.e(TAG, "Couldn't delete new backup file " + mBackupFile);
-                }
+                // Writing was successful, delete the backup file if there is one.
+                mBackupFile.delete();
                 return true;
             } catch (XmlPullParserException e) {
                 Log.w(TAG, "writeFileLocked: Got exception:", e);
diff --git a/core/java/android/app/DatePickerDialog.java b/core/java/android/app/DatePickerDialog.java
index ee5e0d5..863cbcc 100644
--- a/core/java/android/app/DatePickerDialog.java
+++ b/core/java/android/app/DatePickerDialog.java
@@ -47,6 +47,7 @@
     private final OnDateSetListener mCallBack;
     private final Calendar mCalendar;
     private final java.text.DateFormat mDateFormat;
+    private final java.text.DateFormat mTitleDateFormat;
     private final String[] mWeekDays;
 
     private int mInitialYear;
@@ -108,6 +109,8 @@
         mWeekDays = symbols.getShortWeekdays();
         
         mDateFormat = DateFormat.getMediumDateFormat(context);
+        mTitleDateFormat = java.text.DateFormat.
+                                getDateInstance(java.text.DateFormat.FULL);
         mCalendar = Calendar.getInstance();
         updateTitle(mInitialYear, mInitialMonth, mInitialDay);
         
@@ -126,7 +129,7 @@
     @Override
     public void show() {
         super.show();
-        
+
         /* Sometimes the full month is displayed causing the title
          * to be very long, in those cases ensure it doesn't wrap to
          * 2 lines (as that looks jumpy) and ensure we ellipsize the end.
@@ -160,8 +163,7 @@
         mCalendar.set(Calendar.YEAR, year);
         mCalendar.set(Calendar.MONTH, month);
         mCalendar.set(Calendar.DAY_OF_MONTH, day);
-        String weekday = mWeekDays[mCalendar.get(Calendar.DAY_OF_WEEK)];
-        setTitle(weekday + ", " + mDateFormat.format(mCalendar.getTime()));
+        setTitle(mTitleDateFormat.format(mCalendar.getTime()));
     }
     
     @Override
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index 25544de..5cc5730 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -172,7 +172,8 @@
 
         public ISyncAdapter getSyncAdapter() {
             checkWritePermission(null);
-            return ContentProvider.this.getSyncAdapter().getISyncAdapter();
+            SyncAdapter sa = ContentProvider.this.getSyncAdapter();
+            return sa != null ? sa.getISyncAdapter() : null;
         }
 
         private void checkReadPermission(Uri uri) {
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 306c02e..c514df7 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1125,7 +1125,8 @@
     public static final String ACTION_PACKAGE_INSTALL = "android.intent.action.PACKAGE_INSTALL";
     /**
      * Broadcast Action: A new application package has been installed on the
-     * device. The data contains the name of the package.
+     * device. The data contains the name of the package.  Note that the
+     * newly installed package does <em>not</em> receive this broadcast.
      * <p>My include the following extras:
      * <ul>
      * <li> {@link #EXTRA_UID} containing the integer uid assigned to the new package.
@@ -1136,6 +1137,17 @@
     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
     public static final String ACTION_PACKAGE_ADDED = "android.intent.action.PACKAGE_ADDED";
     /**
+     * Broadcast Action: A new version of an application package has been
+     * installed, replacing an existing version that was previously installed.
+     * The data contains the name of the package.
+     * <p>My include the following extras:
+     * <ul>
+     * <li> {@link #EXTRA_UID} containing the integer uid assigned to the new package.
+     * </ul>
+     */
+    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+    public static final String ACTION_PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED";
+    /**
      * Broadcast Action: An existing application package has been removed from
      * the device.  The data contains the name of the package.  The package
      * that is being installed does <em>not</em> receive this Intent.
@@ -1163,7 +1175,9 @@
      * Broadcast Action: The user has restarted a package, and all of its
      * processes have been killed.  All runtime state
      * associated with it (processes, alarms, notifications, etc) should
-     * be removed.  The data contains the name of the package.
+     * be removed.  Note that the restarted package does <em>not</em>
+     * receive this broadcast.
+     * The data contains the name of the package.
      * <ul>
      * <li> {@link #EXTRA_UID} containing the integer uid assigned to the package.
      * </ul>
@@ -1173,8 +1187,9 @@
     /**
      * Broadcast Action: The user has cleared the data of a package.  This should
      * be preceded by {@link #ACTION_PACKAGE_RESTARTED}, after which all of
-     * its persistent data is erased and this broadcast sent.  The data contains
-     * the name of the package.
+     * its persistent data is erased and this broadcast sent.
+     * Note that the cleared package does <em>not</em>
+     * receive this broadcast. The data contains the name of the package.
      * <ul>
      * <li> {@link #EXTRA_UID} containing the integer uid assigned to the package.
      * </ul>
diff --git a/core/java/android/net/http/CertificateChainValidator.java b/core/java/android/net/http/CertificateChainValidator.java
index 0edbe5b..91fa900 100644
--- a/core/java/android/net/http/CertificateChainValidator.java
+++ b/core/java/android/net/http/CertificateChainValidator.java
@@ -43,7 +43,8 @@
     /**
      * The singleton instance of the certificate chain validator
      */
-    private static CertificateChainValidator sInstance;
+    private static final CertificateChainValidator sInstance
+            = new CertificateChainValidator();
 
     /**
      * Default trust manager (used to perform CA certificate validation)
@@ -54,10 +55,6 @@
      * @return The singleton instance of the certificator chain validator
      */
     public static CertificateChainValidator getInstance() {
-        if (sInstance == null) {
-            sInstance = new CertificateChainValidator();
-        }
-
         return sInstance;
     }
 
@@ -159,13 +156,11 @@
         // report back to the user.
         //
         try {
-            synchronized (mDefaultTrustManager) {
-                mDefaultTrustManager.checkServerTrusted(
-                    serverCertificates, "RSA");
+            mDefaultTrustManager.checkServerTrusted(
+                serverCertificates, "RSA");
 
-                // no errors!!!
-                return null;
-            }
+            // no errors!!!
+            return null;
         } catch (CertificateException e) {
             if (HttpLog.LOGV) {
                 HttpLog.v(
@@ -191,10 +186,8 @@
         // check if the last certificate in the chain (root) is trusted
         X509Certificate[] rootCertificateChain = { currCertificate };
         try {
-            synchronized (mDefaultTrustManager) {
-                mDefaultTrustManager.checkServerTrusted(
-                    rootCertificateChain, "RSA");
-            }
+            mDefaultTrustManager.checkServerTrusted(
+                rootCertificateChain, "RSA");
         } catch (CertificateExpiredException e) {
             String errorMessage = e.getMessage();
             if (errorMessage == null) {
diff --git a/core/java/android/net/http/HttpsConnection.java b/core/java/android/net/http/HttpsConnection.java
index fe02d3e..55b733f 100644
--- a/core/java/android/net/http/HttpsConnection.java
+++ b/core/java/android/net/http/HttpsConnection.java
@@ -17,61 +17,41 @@
 package android.net.http;
 
 import android.content.Context;
+import android.util.Log;
+import org.apache.harmony.xnet.provider.jsse.FileClientSessionCache;
+import org.apache.harmony.xnet.provider.jsse.SSLClientSessionCache;
+import org.apache.harmony.xnet.provider.jsse.SSLContextImpl;
+import org.apache.http.Header;
+import org.apache.http.HttpException;
+import org.apache.http.HttpHost;
+import org.apache.http.HttpStatus;
+import org.apache.http.ParseException;
+import org.apache.http.ProtocolVersion;
+import org.apache.http.StatusLine;
+import org.apache.http.message.BasicHttpRequest;
+import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.HttpParams;
 
-import junit.framework.Assert;
-
-import java.io.IOException;
-
-import java.security.cert.X509Certificate;
-
-import java.net.Socket;
-import java.net.InetSocketAddress;
-
-import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
-
-import org.apache.http.Header;
-import org.apache.http.HttpClientConnection;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.ParseException;
-import org.apache.http.ProtocolVersion;
-import org.apache.http.StatusLine;
-import org.apache.http.impl.DefaultHttpClientConnection;
-import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpConnectionParams;
-
-/**
- * Simple exception we throw if the SSL connection is closed by the user.
- * 
- * {@hide}
- */
-class SSLConnectionClosedByUserException extends SSLException {
-
-    public SSLConnectionClosedByUserException(String reason) {
-        super(reason);
-    }
-}
+import java.io.File;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.security.KeyManagementException;
+import java.security.cert.X509Certificate;
 
 /**
  * A Connection connecting to a secure http server or tunneling through
  * a http proxy server to a https server.
+ *
+ * @hide
  */
-class HttpsConnection extends Connection {
-
-    /**
-     * SSL context
-     */
-    private static SSLContext mSslContext = null;
+public class HttpsConnection extends Connection {
 
     /**
      * SSL socket factory
@@ -79,42 +59,59 @@
     private static SSLSocketFactory mSslSocketFactory = null;
 
     static {
-        // initialize the socket factory
-        try {
-            mSslContext = SSLContext.getInstance("TLS");
-            if (mSslContext != null) {
-                // here, trust managers is a single trust-all manager
-                TrustManager[] trustManagers = new TrustManager[] {
-                    new X509TrustManager() {
-                        public X509Certificate[] getAcceptedIssuers() {
-                            return null;
-                        }
-
-                        public void checkClientTrusted(
-                            X509Certificate[] certs, String authType) {
-                        }
-
-                        public void checkServerTrusted(
-                            X509Certificate[] certs, String authType) {
-                        }
-                    }
-                };
-
-                mSslContext.init(null, trustManagers, null);
-                mSslSocketFactory = mSslContext.getSocketFactory();
-            }
-        } catch (Exception t) {
-            if (HttpLog.LOGV) {
-                HttpLog.v("HttpsConnection: failed to initialize the socket factory");
-            }
-        }
+        // This intiialization happens in the zygote. It triggers some
+        // lazy initialization that can will benefit later invocations of
+        // initializeEngine().
+        initializeEngine(null);
     }
 
     /**
-     * @return The shared SSL context.
+     * @hide
+     *
+     * @param sessionDir directory to cache SSL sessions
      */
-    /*package*/ static SSLContext getContext() {
-        return mSslContext;
+    public static void initializeEngine(File sessionDir) {
+        try {
+            SSLClientSessionCache cache = null;
+            if (sessionDir != null) {
+                Log.d("HttpsConnection", "Caching SSL sessions in "
+                        + sessionDir + ".");
+                cache = FileClientSessionCache.usingDirectory(sessionDir);
+            }
+
+            SSLContextImpl sslContext = new SSLContextImpl();
+
+            // here, trust managers is a single trust-all manager
+            TrustManager[] trustManagers = new TrustManager[] {
+                new X509TrustManager() {
+                    public X509Certificate[] getAcceptedIssuers() {
+                        return null;
+                    }
+
+                    public void checkClientTrusted(
+                        X509Certificate[] certs, String authType) {
+                    }
+
+                    public void checkServerTrusted(
+                        X509Certificate[] certs, String authType) {
+                    }
+                }
+            };
+
+            sslContext.engineInit(null, trustManagers, null, cache, null);
+
+            synchronized (HttpsConnection.class) {
+                mSslSocketFactory = sslContext.engineGetSocketFactory();
+            }
+        } catch (KeyManagementException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private synchronized static SSLSocketFactory getSocketFactory() {
+        return mSslSocketFactory;
     }
 
     /**
@@ -252,10 +249,8 @@
 
             if (statusCode == HttpStatus.SC_OK) {
                 try {
-                    synchronized (mSslSocketFactory) {
-                        sslSock = (SSLSocket) mSslSocketFactory.createSocket(
+                    sslSock = (SSLSocket) getSocketFactory().createSocket(
                             proxySock, mHost.getHostName(), mHost.getPort(), true);
-                    }
                 } catch(IOException e) {
                     if (sslSock != null) {
                         sslSock.close();
@@ -288,14 +283,11 @@
         } else {
             // if we do not have a proxy, we simply connect to the host
             try {
-                synchronized (mSslSocketFactory) {
-                    sslSock = (SSLSocket) mSslSocketFactory.createSocket();
-                    
-                    sslSock.setSoTimeout(SOCKET_TIMEOUT);
-                    sslSock.connect(new InetSocketAddress(mHost.getHostName(),
-                            mHost.getPort()));
-                    
-                }
+                sslSock = (SSLSocket) getSocketFactory().createSocket();
+
+                sslSock.setSoTimeout(SOCKET_TIMEOUT);
+                sslSock.connect(new InetSocketAddress(mHost.getHostName(),
+                        mHost.getPort()));
             } catch(IOException e) {
                 if (sslSock != null) {
                     sslSock.close();
@@ -371,6 +363,7 @@
         BasicHttpParams params = new BasicHttpParams();
         params.setIntParameter(HttpConnectionParams.SOCKET_BUFFER_SIZE, 8192);
         conn.bind(sslSock, params);
+
         return conn;
     }
 
@@ -425,3 +418,15 @@
         return "https";
     }
 }
+
+/**
+ * Simple exception we throw if the SSL connection is closed by the user.
+ *
+ * {@hide}
+ */
+class SSLConnectionClosedByUserException extends SSLException {
+
+    public SSLConnectionClosedByUserException(String reason) {
+        super(reason);
+    }
+}
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 76c74df..d492b6a 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -292,7 +292,7 @@
      * {@hide}
      */
     public abstract long getPhoneOnTime(long batteryRealtime, int which);
-    
+
     /**
      * Returns the time in milliseconds that wifi has been on while the device was
      * running on battery.
@@ -300,7 +300,15 @@
      * {@hide}
      */
     public abstract long getWifiOnTime(long batteryRealtime, int which);
-    
+
+    /**
+     * Returns the time in milliseconds that wifi has been on and the driver has
+     * been in the running state while the device was running on battery.
+     *
+     * {@hide}
+     */
+    public abstract long getWifiRunningTime(long batteryRealtime, int which);
+
     /**
      * Returns the time in milliseconds that bluetooth has been on while the device was
      * running on battery.
@@ -535,6 +543,7 @@
         final long screenOnTime = getScreenOnTime(batteryRealtime, which);
         final long phoneOnTime = getPhoneOnTime(batteryRealtime, which);
         final long wifiOnTime = getWifiOnTime(batteryRealtime, which);
+        final long wifiRunningTime = getWifiRunningTime(batteryRealtime, which);
         final long bluetoothOnTime = getBluetoothOnTime(batteryRealtime, which);
        
         StringBuilder sb = new StringBuilder(128);
@@ -549,7 +558,8 @@
         
         // Dump misc stats
         dumpLine(pw, 0 /* uid */, category, MISC_DATA,
-                screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000, bluetoothOnTime / 1000);
+                screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000,
+                wifiRunningTime / 1000, bluetoothOnTime / 1000);
         
         if (which == STATS_UNPLUGGED) {
             dumpLine(pw, 0 /* uid */, category, BATTERY_DATA, getUnpluggedStartLevel(), 
@@ -667,7 +677,7 @@
         final long rawUptime = SystemClock.uptimeMillis() * 1000;
         final long rawRealtime = SystemClock.elapsedRealtime() * 1000;
         final long batteryUptime = getBatteryUptime(rawUptime);
-        final long batteryRealtime = getBatteryUptime(rawRealtime);
+        final long batteryRealtime = getBatteryRealtime(rawRealtime);
 
         final long whichBatteryUptime = computeBatteryUptime(rawUptime, which);
         final long whichBatteryRealtime = computeBatteryRealtime(rawRealtime, which);
@@ -692,6 +702,7 @@
         
         final long screenOnTime = getScreenOnTime(batteryRealtime, which);
         final long phoneOnTime = getPhoneOnTime(batteryRealtime, which);
+        final long wifiRunningTime = getWifiRunningTime(batteryRealtime, which);
         final long wifiOnTime = getWifiOnTime(batteryRealtime, which);
         final long bluetoothOnTime = getBluetoothOnTime(batteryRealtime, which);
         pw.println(prefix
@@ -701,6 +712,8 @@
                 + "(" + formatRatioLocked(phoneOnTime, whichBatteryRealtime)
                 + "), time with wifi on: " + formatTimeMs(wifiOnTime / 1000)
                 + "(" + formatRatioLocked(wifiOnTime, whichBatteryRealtime)
+                + "), time with wifi running: " + formatTimeMs(wifiRunningTime / 1000)
+                + "(" + formatRatioLocked(wifiRunningTime, whichBatteryRealtime)
                 + "), time with bluetooth on: " + formatTimeMs(bluetoothOnTime / 1000)
                 + "(" + formatRatioLocked(bluetoothOnTime, whichBatteryRealtime)+ ")");
         
diff --git a/core/java/android/os/LocalPowerManager.java b/core/java/android/os/LocalPowerManager.java
index 55d7972..9e88f5a 100644
--- a/core/java/android/os/LocalPowerManager.java
+++ b/core/java/android/os/LocalPowerManager.java
@@ -20,12 +20,16 @@
 public interface LocalPowerManager {
     public static final int OTHER_EVENT = 0;
     public static final int CHEEK_EVENT = 1;
-    public static final int TOUCH_EVENT = 2;
-    public static final int BUTTON_EVENT = 3;  // Button and trackball events.
+    public static final int TOUCH_EVENT = 2;  // touch events are TOUCH for 300ms, and then either
+                                              // up events or LONG_TOUCH events.
+    public static final int LONG_TOUCH_EVENT = 3;
+    public static final int TOUCH_UP_EVENT = 4;
+    public static final int BUTTON_EVENT = 5;  // Button and trackball events.
 
     public static final int POKE_LOCK_IGNORE_CHEEK_EVENTS = 0x1;
     public static final int POKE_LOCK_SHORT_TIMEOUT = 0x2;
     public static final int POKE_LOCK_MEDIUM_TIMEOUT = 0x4;
+    public static final int POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS = 0x8;
 
     public static final int POKE_LOCK_TIMEOUT_MASK = 0x6;
 
diff --git a/core/java/android/provider/Checkin.java b/core/java/android/provider/Checkin.java
index d11a9c5..a87f5fa 100644
--- a/core/java/android/provider/Checkin.java
+++ b/core/java/android/provider/Checkin.java
@@ -144,6 +144,43 @@
             TEST,
             NETWORK_RX_MOBILE,
             NETWORK_TX_MOBILE,
+            MARKET_DOWNLOAD_REQUESTED,
+            MARKET_DOWNLOAD_SCHEDULED,
+            MARKET_DOWNLOAD_CANCELLED_PENDING,
+            MARKET_DOWNLOAD_CANCELLED,
+            MARKET_DOWNLOAD_OK,
+            MARKET_DOWNLOAD_FAILED,
+            MARKET_DOWNLOAD_DECLINED,
+            MARKET_INSTALL_SCHEDULED,
+            MARKET_INSTALL_FAILED,
+            MARKET_INSTALL_OK,
+            MARKET_REMOVE_SCHEDULED,
+            MARKET_REMOVE_MALICIOUS_SCHEDULED,
+            MARKET_REMOVE_ABORTED,
+            MARKET_REMOVE_FAILED,
+            MARKET_REMOVE_OK,
+            MARKET_UNINSTALL_SCHEDULED,
+            MARKET_REFUND_REQUESTED,
+            MARKET_REFUND_OK,
+            MARKET_REFUND_FAILED,
+            MARKET_REASON_ALREADY_EXISTS,
+            MARKET_REASON_INVALID_APK,
+            MARKET_REASON_INSUFFICIENT_STORAGE,
+            MARKET_REASON_DUPLICATE_PACKAGE,
+            MARKET_REASON_UPDATE_INCOMPATIBLE,
+            MARKET_REASON_MISSING_SHARED_LIBRARY,
+            MARKET_REASON_REPLACE_COULDNT_DELETE,
+            MARKET_REASON_PARSE_NOT_APK,
+            MARKET_REASON_PARSE_BAD_MANIFEST,
+            MARKET_REASON_PARSE_NO_CERTIFICATES,
+            MARKET_REASON_PARSE_INCONSISTENT_CERTIFICATES,
+            MARKET_REASON_PARSE_CERTIFICATE_ENCODING,
+            MARKET_REASON_PARSE_BAD_PACKAGE_NAME,
+            MARKET_REASON_PARSE_BAD_SHARED_USER_ID,
+            MARKET_REASON_PARSE_MANIFEST_MALFORMED,
+            MARKET_REASON_PARSE_MANIFEST_EMPTY,
+            MARKET_REASON_UNKNOWN,
+            MARKET_STALE_INSTALL_ATTEMPT,
         }
     }
 
diff --git a/core/java/android/server/BluetoothDeviceService.java b/core/java/android/server/BluetoothDeviceService.java
index b7e3846..a815e57 100644
--- a/core/java/android/server/BluetoothDeviceService.java
+++ b/core/java/android/server/BluetoothDeviceService.java
@@ -385,13 +385,14 @@
         // Parrot, Zhongshan General K-mate Electronics, Great Well
         // Electronics, Flaircomm Electronics, Jatty Electronics, Delphi,
         // Clarion, Novero, Denso (Lexus, Toyota), Johnson Controls (Acura),
+        // Continental Automotive, Harman/Becker
         private final ArrayList<String>  mAutoPairingBlacklisted =
                 new ArrayList<String>(Arrays.asList(
                         "00:02:C7", "00:16:FE", "00:19:C1", "00:1B:FB", "00:1E:3D", "00:21:4F",
                         "00:23:06", "00:24:33", "00:A0:79", "00:0E:6D", "00:13:E0", "00:21:E8",
                         "00:60:57", "00:0E:9F", "00:12:1C", "00:18:91", "00:18:96", "00:13:04",
                         "00:16:FD", "00:22:A0", "00:0B:4C", "00:60:6F", "00:23:3D", "00:C0:59",
-                        "00:0A:30"
+                        "00:0A:30", "00:1E:AE", "00:1C:D7"
                         ));
 
         public synchronized void loadBondState() {
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 6be8eb9..6eabea4 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -343,7 +343,7 @@
 
     private void onPasskeyAgentCancel(String address) {
         address = address.toUpperCase();
-        mPasskeyAgentRequestData.remove(address);
+        mBluetoothService.cancelPin(address);
         Intent intent = new Intent(BluetoothIntent.PAIRING_CANCEL_ACTION);
         intent.putExtra(BluetoothIntent.ADDRESS, address);
         mContext.sendBroadcast(intent, BLUETOOTH_ADMIN_PERM);
diff --git a/core/java/android/text/Html.java b/core/java/android/text/Html.java
index 6f0be3a..200bbf4 100644
--- a/core/java/android/text/Html.java
+++ b/core/java/android/text/Html.java
@@ -151,26 +151,22 @@
         for (int i = 0; i < text.length(); i = next) {
             next = text.nextSpanTransition(i, len, ParagraphStyle.class);
             ParagraphStyle[] style = text.getSpans(i, next, ParagraphStyle.class);
-            if (style.length > 0) {
-                out.append("<div ");
-            }
+            String elements = " ";
             for(int j = 0; j < style.length; j++) {
                 if (style[j] instanceof AlignmentSpan) {
-                    out.append("align=\"");
                     Layout.Alignment align = 
                         ((AlignmentSpan) style[j]).getAlignment();
                     if (align == Layout.Alignment.ALIGN_CENTER) {
-                        out.append("center");
+                        elements = "align=\"center\" " + elements;
                     } else if (align == Layout.Alignment.ALIGN_OPPOSITE) {
-                        out.append("right");
+                        elements = "align=\"right\" " + elements;
                     } else {
-                        out.append("left");
+                        elements = "align=\"left\" " + elements;
                     }
-                    out.append("\" ");
                 }
             }
             if (style.length > 0) {
-                out.append(">");
+                out.append("<div " + elements + ">");
             }
 
             withinDiv(out, text, i, next);
diff --git a/core/java/android/text/method/ArrowKeyMovementMethod.java b/core/java/android/text/method/ArrowKeyMovementMethod.java
index 17c7a6c..92f6289 100644
--- a/core/java/android/text/method/ArrowKeyMovementMethod.java
+++ b/core/java/android/text/method/ArrowKeyMovementMethod.java
@@ -18,6 +18,7 @@
 
 import android.util.Log;
 import android.view.KeyEvent;
+import android.graphics.Rect;
 import android.text.*;
 import android.widget.TextView;
 import android.view.View;
@@ -202,23 +203,54 @@
     
     public boolean onTouchEvent(TextView widget, Spannable buffer,
                                 MotionEvent event) {
+        int initialScrollX = -1, initialScrollY = -1;
+        if (event.getAction() == MotionEvent.ACTION_UP) {
+            initialScrollX = Touch.getInitialScrollX(widget, buffer);
+            initialScrollY = Touch.getInitialScrollY(widget, buffer);
+        }
+        
         boolean handled = Touch.onTouchEvent(widget, buffer, event);
 
         if (widget.isFocused() && !widget.didTouchFocusSelect()) {
             if (event.getAction() == MotionEvent.ACTION_UP) {
+                // If we have scrolled, then the up shouldn't move the cursor,
+                // but we do need to make sure the cursor is still visible at
+                // the current scroll offset to avoid the scroll jumping later
+                // to show it.
+                if ((initialScrollY >= 0 && initialScrollY != widget.getScrollY()) ||
+                        (initialScrollX >= 0 && initialScrollX != widget.getScrollX())) {
+                    widget.moveCursorToVisibleOffset();
+                    return true;
+                }
+                
                 int x = (int) event.getX();
                 int y = (int) event.getY();
 
                 x -= widget.getTotalPaddingLeft();
                 y -= widget.getTotalPaddingTop();
 
+                // Clamp the position to inside of the view.
+                if (x < 0) {
+                    x = 0;
+                } else if (x >= (widget.getWidth()-widget.getTotalPaddingRight())) {
+                    x = widget.getWidth()-widget.getTotalPaddingRight() - 1;
+                }
+                if (y < 0) {
+                    y = 0;
+                } else if (y >= (widget.getHeight()-widget.getTotalPaddingBottom())) {
+                    y = widget.getHeight()-widget.getTotalPaddingBottom() - 1;
+                }
+                
                 x += widget.getScrollX();
                 y += widget.getScrollY();
 
                 Layout layout = widget.getLayout();
                 int line = layout.getLineForVertical(y);
+                
                 int off = layout.getOffsetForHorizontal(line, x);
 
+                // XXX should do the same adjust for x as we do for the line.
+                
                 boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
                                 KeyEvent.META_SHIFT_ON) == 1) ||
                               (MetaKeyKeyListener.getMetaState(buffer,
diff --git a/core/java/android/text/method/Touch.java b/core/java/android/text/method/Touch.java
index 65036ad..f2fb9cb 100644
--- a/core/java/android/text/method/Touch.java
+++ b/core/java/android/text/method/Touch.java
@@ -21,7 +21,6 @@
 import android.text.Layout.Alignment;
 import android.text.Spannable;
 import android.view.MotionEvent;
-import android.view.View;
 import android.view.ViewConfiguration;
 import android.widget.TextView;
 
@@ -82,8 +81,9 @@
 
         switch (event.getAction()) {
         case MotionEvent.ACTION_DOWN:
-            buffer.setSpan(new DragState(event.getX(), event.getY()),
-                           0, 0, Spannable.SPAN_MARK_MARK);
+            buffer.setSpan(new DragState(event.getX(), event.getY(),
+                            widget.getScrollX(), widget.getScrollY()),
+                    0, 0, Spannable.SPAN_MARK_MARK);
             return true;
 
         case MotionEvent.ACTION_UP:
@@ -142,15 +142,29 @@
         return false;
     }
 
+    public static int getInitialScrollX(TextView widget, Spannable buffer) {
+        DragState[] ds = buffer.getSpans(0, buffer.length(), DragState.class);
+        return ds.length > 0 ? ds[0].mScrollX : -1;
+    }
+    
+    public static int getInitialScrollY(TextView widget, Spannable buffer) {
+        DragState[] ds = buffer.getSpans(0, buffer.length(), DragState.class);
+        return ds.length > 0 ? ds[0].mScrollY : -1;
+    }
+    
     private static class DragState implements NoCopySpan {
         public float mX;
         public float mY;
+        public int mScrollX;
+        public int mScrollY;
         public boolean mFarEnough;
         public boolean mUsed;
 
-        public DragState(float x, float y) {
+        public DragState(float x, float y, int scrollX, int scrollY) {
             mX = x;
             mY = y;
+            mScrollX = scrollX;
+            mScrollY = scrollY;
         }
     }
 }
diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java
index deca910..11de3e2 100644
--- a/core/java/android/view/inputmethod/BaseInputConnection.java
+++ b/core/java/android/view/inputmethod/BaseInputConnection.java
@@ -51,7 +51,6 @@
     static final Object COMPOSING = new ComposingText();
     
     final InputMethodManager mIMM;
-    final Handler mH;
     final View mTargetView;
     final boolean mDummyMode;
     
@@ -60,19 +59,17 @@
     Editable mEditable;
     KeyCharacterMap mKeyCharacterMap;
     
-    BaseInputConnection(InputMethodManager mgr, boolean dummyMode) {
+    BaseInputConnection(InputMethodManager mgr, boolean fullEditor) {
         mIMM = mgr;
         mTargetView = null;
-        mH = null;
-        mDummyMode = dummyMode;
+        mDummyMode = !fullEditor;
     }
     
-    public BaseInputConnection(View targetView, boolean dummyMode) {
+    public BaseInputConnection(View targetView, boolean fullEditor) {
         mIMM = (InputMethodManager)targetView.getContext().getSystemService(
                 Context.INPUT_METHOD_SERVICE);
-        mH = targetView.getHandler();
         mTargetView = targetView;
-        mDummyMode = dummyMode;
+        mDummyMode = !fullEditor;
     }
     
     public static final void removeComposingSpans(Spannable text) {
@@ -403,7 +400,7 @@
      */
     public boolean sendKeyEvent(KeyEvent event) {
         synchronized (mIMM.mH) {
-            Handler h = mH;
+            Handler h = mTargetView != null ? mTargetView.getHandler() : null;
             if (h == null) {
                 if (mIMM.mServedView != null) {
                     h = mIMM.mServedView.getHandler();
diff --git a/core/java/android/view/inputmethod/InputConnectionWrapper.java b/core/java/android/view/inputmethod/InputConnectionWrapper.java
index e3d5e62..210559a 100644
--- a/core/java/android/view/inputmethod/InputConnectionWrapper.java
+++ b/core/java/android/view/inputmethod/InputConnectionWrapper.java
@@ -24,9 +24,21 @@
  * and have fun!
  */
 public class InputConnectionWrapper implements InputConnection {
-    private final InputConnection mTarget;
+    private InputConnection mTarget;
+    final boolean mMutable;
     
-    public InputConnectionWrapper(InputConnection target) {
+    public InputConnectionWrapper(InputConnection target, boolean mutable) {
+        mMutable = mutable;
+        mTarget = target;
+    }
+
+    /**
+     * Change the target of the input connection.
+     */
+    public void setTarget(InputConnection target) {
+        if (mTarget != null && !mMutable) {
+            throw new SecurityException("not mutable");
+        }
         mTarget = target;
     }
     
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 4de9eef..d797890 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -426,7 +426,7 @@
         }
     };    
     
-    final InputConnection mDummyInputConnection = new BaseInputConnection(this, true);
+    final InputConnection mDummyInputConnection = new BaseInputConnection(this, false);
     
     InputMethodManager(IInputMethodManager service, Looper looper) {
         mService = service;
diff --git a/core/java/android/webkit/ContentLoader.java b/core/java/android/webkit/ContentLoader.java
index fb01c8c..f6d7f69 100644
--- a/core/java/android/webkit/ContentLoader.java
+++ b/core/java/android/webkit/ContentLoader.java
@@ -105,6 +105,9 @@
         if (mContentType != null) {
             headers.setContentType("text/html");
         }
+        // override the cache-control header set by StreamLoader as content can
+        // change, we don't want WebKit to cache it
+        headers.setCacheControl("no-store, no-cache");
     }
 
     /**
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 965d900..0563687 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -41,8 +41,10 @@
 import android.view.ViewDebug;
 import android.view.ViewGroup;
 import android.view.ViewTreeObserver;
+import android.view.inputmethod.BaseInputConnection;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputConnection;
+import android.view.inputmethod.InputConnectionWrapper;
 import android.view.inputmethod.InputMethodManager;
 import android.view.ContextMenu.ContextMenuInfo;
 
@@ -429,6 +431,9 @@
 
     private float mDensityScale;
 
+    private InputConnection mDefInputConnection;
+    private InputConnectionWrapper mPublicInputConnection;
+    
     /**
      * Interface definition for a callback to be invoked when the list or grid
      * has been scrolled.
@@ -2932,7 +2937,46 @@
             // InputConnection to proxy to.  Unfortunately this means we pretty
             // much need to make it as soon as a list view gets focus.
             createTextFilter(false);
-            return mTextFilter.onCreateInputConnection(outAttrs);
+            if (mPublicInputConnection == null) {
+                mDefInputConnection = new BaseInputConnection(this, false);
+                mPublicInputConnection = new InputConnectionWrapper(
+                        mTextFilter.onCreateInputConnection(outAttrs), true) {
+                    @Override
+                    public boolean reportFullscreenMode(boolean enabled) {
+                        // Use our own input connection, since it is
+                        // the "real" one the IME is talking with.
+                        return mDefInputConnection.reportFullscreenMode(enabled);
+                    }
+
+                    @Override
+                    public boolean performEditorAction(int editorAction) {
+                        // The editor is off in its own window; we need to be
+                        // the one that does this.
+                        if (editorAction == EditorInfo.IME_ACTION_DONE) {
+                            InputMethodManager imm = (InputMethodManager)
+                                    getContext().getSystemService(
+                                            Context.INPUT_METHOD_SERVICE);
+                            if (imm != null) {
+                                imm.hideSoftInputFromWindow(getWindowToken(), 0);
+                            }
+                            return true;
+                        }
+                        return false;
+                    }
+
+                    @Override
+                    public boolean sendKeyEvent(KeyEvent event) {
+                        // Use our own input connection, since the filter
+                        // text view may not be shown in a window so has
+                        // no ViewRoot to dispatch events with.
+                        return mDefInputConnection.sendKeyEvent(event);
+                    }
+                };
+            }
+            outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT
+                    | EditorInfo.TYPE_TEXT_VARIATION_FILTER;
+            outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
+            return mPublicInputConnection;
         }
         return null;
     }
@@ -3019,14 +3063,16 @@
     }
 
     /**
-     * For our text watcher that associated with the text filter
+     * For our text watcher that is associated with the text filter.  Does
+     * nothing.
      */
     public void beforeTextChanged(CharSequence s, int start, int count, int after) {
     }
 
     /**
-     * For our text watcher that associated with the text filter. Performs the actual
-     * filtering as the text changes.
+     * For our text watcher that is associated with the text filter. Performs
+     * the actual filtering as the text changes, and takes care of hiding and
+     * showing the popup displaying the currently entered filter text.
      */
     public void onTextChanged(CharSequence s, int start, int before, int count) {
         if (mPopup != null && isTextFilterEnabled()) {
@@ -3038,7 +3084,7 @@
                 mFiltered = true;
             } else if (showing && length == 0) {
                 // Remove the filter popup if the user has cleared all text
-                mPopup.dismiss();
+                dismissPopup();
                 mFiltered = false;
             }
             if (mAdapter instanceof Filterable) {
@@ -3055,7 +3101,8 @@
     }
 
     /**
-     * For our text watcher that associated with the text filter
+     * For our text watcher that is associated with the text filter.  Does
+     * nothing.
      */
     public void afterTextChanged(Editable s) {
     }
diff --git a/core/java/android/widget/CursorAdapter.java b/core/java/android/widget/CursorAdapter.java
index 898e501..da90a9f4 100644
--- a/core/java/android/widget/CursorAdapter.java
+++ b/core/java/android/widget/CursorAdapter.java
@@ -127,7 +127,7 @@
     /**
      * @see android.widget.ListAdapter#getCount()
      */
-    public final int getCount() {
+    public int getCount() {
         if (mDataValid && mCursor != null) {
             return mCursor.getCount();
         } else {
@@ -138,7 +138,7 @@
     /**
      * @see android.widget.ListAdapter#getItem(int)
      */
-    public final Object getItem(int position) {
+    public Object getItem(int position) {
         if (mDataValid && mCursor != null) {
             mCursor.moveToPosition(position);
             return mCursor;
@@ -150,7 +150,7 @@
     /**
      * @see android.widget.ListAdapter#getItemId(int)
      */
-    public final long getItemId(int position) {
+    public long getItemId(int position) {
         if (mDataValid && mCursor != null) {
             if (mCursor.moveToPosition(position)) {
                 return mCursor.getLong(mRowIDColumn);
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index 2bb716c..47db6f2 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -56,7 +56,9 @@
     private final Rect mSelfBounds = new Rect();
     private final Rect mOverlayBounds = new Rect();
     private int mForegroundGravity = Gravity.FILL;
-    private boolean mForegroundInPadding = true;
+
+    /** {@hide} */
+    protected boolean mForegroundInPadding = true;
 
     public FrameLayout(Context context) {
         super(context);
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index aced533..4d5032e 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -2054,18 +2054,19 @@
      */
     private boolean handleHorizontalFocusWithinListItem(int direction) {
         if (direction != View.FOCUS_LEFT && direction != View.FOCUS_RIGHT)  {
-            throw new IllegalArgumentException("direction must be one of {View.FOCUS_LEFT, View.FOCUS_RIGHT}");
+            throw new IllegalArgumentException("direction must be one of"
+                    + " {View.FOCUS_LEFT, View.FOCUS_RIGHT}");
         }
 
         final int numChildren = getChildCount();
         if (mItemsCanFocus && numChildren > 0 && mSelectedPosition != INVALID_POSITION) {
             final View selectedView = getSelectedView();
-            if (selectedView.hasFocus() && selectedView instanceof ViewGroup) {
+            if (selectedView != null && selectedView.hasFocus() &&
+                    selectedView instanceof ViewGroup) {
+
                 final View currentFocus = selectedView.findFocus();
                 final View nextFocus = FocusFinder.getInstance().findNextFocus(
-                        (ViewGroup) selectedView,
-                        currentFocus,
-                        direction);
+                        (ViewGroup) selectedView, currentFocus, direction);
                 if (nextFocus != null) {
                     // do the math to get interesting rect in next focus' coordinates
                     currentFocus.getFocusedRect(mTempRect);
@@ -2079,11 +2080,8 @@
                 // if the global result is going to be some other view within this
                 // list.  this is to acheive the overall goal of having
                 // horizontal d-pad navigation remain in the current item.
-                final View globalNextFocus = FocusFinder.getInstance()
-                        .findNextFocus(
-                                (ViewGroup) getRootView(),
-                                currentFocus,
-                                direction);
+                final View globalNextFocus = FocusFinder.getInstance().findNextFocus(
+                        (ViewGroup) getRootView(), currentFocus, direction);
                 if (globalNextFocus != null) {
                     return isViewAncestorOf(globalNextFocus, this);
                 }
@@ -2769,6 +2767,8 @@
             final boolean headerDividers = mHeaderDividersEnabled;
             final boolean footerDividers = mFooterDividersEnabled;
             final int first = mFirstPosition;
+            final boolean areAllItemsSelectable = mAreAllItemsSelectable;
+            final ListAdapter adapter = mAdapter;
 
             if (!mStackFromBottom) {
                 int bottom;
@@ -2779,7 +2779,10 @@
                             (footerDividers || first + i < footerLimit)) {
                         View child = getChildAt(i);
                         bottom = child.getBottom();
-                        if (bottom < listBottom) {
+                        // Don't draw dividers next to items that are not enabled
+                        if (bottom < listBottom && (areAllItemsSelectable ||
+                                (adapter.isEnabled(first + i) && (i == count - 1 ||
+                                        adapter.isEnabled(first + i + 1))))) {
                             bounds.top = bottom;
                             bounds.bottom = bottom + dividerHeight;
                             drawDivider(canvas, bounds, i);
@@ -2795,7 +2798,10 @@
                             (footerDividers || first + i < footerLimit)) {
                         View child = getChildAt(i);
                         top = child.getTop();
-                        if (top > listTop) {
+                        // Don't draw dividers next to items that are not enabled
+                        if (top > listTop && (areAllItemsSelectable ||
+                                (adapter.isEnabled(first + i) && (i == count - 1 ||
+                                        adapter.isEnabled(first + i + 1))))) {
                             bounds.top = top - dividerHeight;
                             bounds.bottom = top;
                             // Give the method the child ABOVE the divider, so we
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 136752b..81516b9 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -727,7 +727,7 @@
                             | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE);
         } else if (phone) {
             mInput = DialerKeyListener.getInstance();
-            inputType = EditorInfo.TYPE_CLASS_PHONE;
+            mInputType = inputType = EditorInfo.TYPE_CLASS_PHONE;
         } else if (numeric != 0) {
             mInput = DigitsKeyListener.getInstance((numeric & SIGNED) != 0,
                                                    (numeric & DECIMAL) != 0);
@@ -5421,6 +5421,62 @@
         return changed;
     }
 
+    /**
+     * Move the cursor, if needed, so that it is at an offset that is visible
+     * to the user.  This will not move the cursor if it represents more than
+     * one character (a selection range).  This will only work if the
+     * TextView contains spannable text; otherwise it will do nothing.
+     */
+    public boolean moveCursorToVisibleOffset() {
+        if (!(mText instanceof Spannable)) {
+            return false;
+        }
+        int start = Selection.getSelectionStart(mText);
+        int end = Selection.getSelectionEnd(mText);
+        if (start != end) {
+            return false;
+        }
+        
+        // First: make sure the line is visible on screen:
+        
+        int line = mLayout.getLineForOffset(start);
+
+        final int top = mLayout.getLineTop(line);
+        final int bottom = mLayout.getLineTop(line+1);
+        final int vspace = mBottom - mTop - getExtendedPaddingTop() - getExtendedPaddingBottom();
+        int vslack = (bottom - top) / 2;
+        if (vslack > vspace / 4)
+            vslack = vspace / 4;
+        final int vs = mScrollY;
+
+        if (top < (vs+vslack)) {
+            line = mLayout.getLineForVertical(vs+vslack+(bottom-top));
+        } else if (bottom > (vspace+vs-vslack)) {
+            line = mLayout.getLineForVertical(vspace+vs-vslack-(bottom-top));
+        }
+        
+        // Next: make sure the character is visible on screen:
+        
+        final int hspace = mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight();
+        final int hs = mScrollX;
+        final int leftChar = mLayout.getOffsetForHorizontal(line, hs);
+        final int rightChar = mLayout.getOffsetForHorizontal(line, hspace+hs);
+        
+        int newStart = start;
+        if (newStart < leftChar) {
+            newStart = leftChar;
+        } else if (newStart > rightChar) {
+            newStart = rightChar;
+        }
+        
+        if (newStart != start) {
+            Selection.setSelection((Spannable)mText, newStart);
+            return true;
+        }
+        
+        return false;
+    }
+
     @Override
     public void computeScroll() {
         if (mScroller != null) {
diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl
index d259756..e0de421 100644
--- a/core/java/com/android/internal/app/IBatteryStats.aidl
+++ b/core/java/com/android/internal/app/IBatteryStats.aidl
@@ -32,6 +32,8 @@
     void notePhoneOff();
     void noteWifiOn();
     void noteWifiOff();
+    void noteWifiRunning();
+    void noteWifiStopped();
     void noteBluetoothOn();
     void noteBluetoothOff();
     void noteFullWifiLockAcquired(int uid);
diff --git a/core/java/com/android/internal/database/SortCursor.java b/core/java/com/android/internal/database/SortCursor.java
index af0efc9..99410bc 100644
--- a/core/java/com/android/internal/database/SortCursor.java
+++ b/core/java/com/android/internal/database/SortCursor.java
@@ -253,7 +253,15 @@
         if (mCursor != null) {
             return mCursor.getColumnNames();
         } else {
-            return new String[0];
+            // All of the cursors may be empty, but they can still return
+            // this information.
+            int length = mCursors.length;
+            for (int i = 0 ; i < length ; i++) {
+                if (mCursors[i] != null) {
+                    return mCursors[i].getColumnNames();
+                }
+            }
+            throw new IllegalStateException("No cursor that can return names");
         }
     }
 
diff --git a/core/java/com/android/internal/logging/AndroidHandler.java b/core/java/com/android/internal/logging/AndroidHandler.java
index d9fcf60..c4a1479 100644
--- a/core/java/com/android/internal/logging/AndroidHandler.java
+++ b/core/java/com/android/internal/logging/AndroidHandler.java
@@ -151,7 +151,7 @@
             Log.e("AndroidHandler", "Error logging message.", e);
         }
     }
-    
+
     /**
      * Converts a {@link java.util.logging.Logger} logging level into an Android one.
      * 
@@ -159,20 +159,16 @@
      * 
      * @return The resulting Android logging level. 
      */
-    static int getAndroidLevel(Level level)
-    {
+    static int getAndroidLevel(Level level) {
         int value = level.intValue();
-        
-        if (value >= Level.SEVERE.intValue()) {
+        if (value >= 1000) { // SEVERE
             return Log.ERROR;
-        } else if (value >= Level.WARNING.intValue()) {
+        } else if (value >= 900) { // WARNING
             return Log.WARN;
-        } else if (value >= Level.INFO.intValue()) {
+        } else if (value >= 800) { // INFO
             return Log.INFO;
-        } else if (value >= Level.CONFIG.intValue()) {
+        } else {
             return Log.DEBUG;
-        }  else {
-            return Log.VERBOSE;
         }
     }
     
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index b3ae0d6..38335b5 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -47,7 +47,7 @@
     private static final int MAGIC = 0xBA757475; // 'BATSTATS' 
 
     // Current on-disk Parcel version
-    private static final int VERSION = 27;
+    private static final int VERSION = 28;
 
     private final File mFile;
     private final File mBackupFile;
@@ -94,6 +94,9 @@
     
     boolean mWifiOn;
     Timer mWifiOnTimer;
+
+    boolean mWifiRunning;
+    Timer mWifiRunningTimer;
     
     boolean mBluetoothOn;
     Timer mBluetoothOnTimer;
@@ -497,6 +500,20 @@
         }
     }
     
+    public void noteWifiRunningLocked() {
+        if (!mWifiRunning) {
+            mWifiRunning = true;
+            mWifiRunningTimer.startRunningLocked(this);
+        }
+    }
+
+    public void noteWifiStoppedLocked() {
+        if (mWifiRunning) {
+            mWifiRunning = false;
+            mWifiRunningTimer.stopRunningLocked(this);
+        }
+    }
+
     public void noteBluetoothOnLocked() {
         if (!mBluetoothOn) {
             mBluetoothOn = true;
@@ -551,6 +568,10 @@
         return mWifiOnTimer.getTotalTime(batteryRealtime, which);
     }
     
+    @Override public long getWifiRunningTime(long batteryRealtime, int which) {
+        return mWifiRunningTimer.getTotalTime(batteryRealtime, which);
+    }
+
     @Override public long getBluetoothOnTime(long batteryRealtime, int which) {
         return mBluetoothOnTimer.getTotalTime(batteryRealtime, which);
     }
@@ -1597,7 +1618,8 @@
         mScreenOnTimer = new Timer(-1, null, mUnpluggables);
         mPhoneOnTimer = new Timer(-2, null, mUnpluggables);
         mWifiOnTimer = new Timer(-3, null, mUnpluggables);
-        mBluetoothOnTimer = new Timer(-4, null, mUnpluggables);
+        mWifiRunningTimer = new Timer(-4, null, mUnpluggables);
+        mBluetoothOnTimer = new Timer(-5, null, mUnpluggables);
         mOnBattery = mOnBatteryInternal = false;
         mTrackBatteryPastUptime = 0;
         mTrackBatteryPastRealtime = 0;
@@ -1935,6 +1957,8 @@
         mPhoneOnTimer.readSummaryFromParcelLocked(in);
         mWifiOn = false;
         mWifiOnTimer.readSummaryFromParcelLocked(in);
+        mWifiRunning = false;
+        mWifiRunningTimer.readSummaryFromParcelLocked(in);
         mBluetoothOn = false;
         mBluetoothOnTimer.readSummaryFromParcelLocked(in);
 
@@ -2038,6 +2062,7 @@
         mScreenOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
         mPhoneOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
         mWifiOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
+        mWifiRunningTimer.writeSummaryFromParcelLocked(out, NOWREAL);
         mBluetoothOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
 
         final int NU = mUidStats.size();
@@ -2163,6 +2188,8 @@
         mPhoneOnTimer = new Timer(-2, null, mUnpluggables, in);
         mWifiOn = false;
         mWifiOnTimer = new Timer(-2, null, mUnpluggables, in);
+        mWifiRunning = false;
+        mWifiRunningTimer = new Timer(-2, null, mUnpluggables, in);
         mBluetoothOn = false;
         mBluetoothOnTimer = new Timer(-2, null, mUnpluggables, in);
         mUptime = in.readLong();
@@ -2217,6 +2244,7 @@
         mScreenOnTimer.writeToParcel(out, batteryRealtime);
         mPhoneOnTimer.writeToParcel(out, batteryRealtime);
         mWifiOnTimer.writeToParcel(out, batteryRealtime);
+        mWifiRunningTimer.writeToParcel(out, batteryRealtime);
         mBluetoothOnTimer.writeToParcel(out, batteryRealtime);
         out.writeLong(mUptime);
         out.writeLong(mUptimeStart);
@@ -2264,6 +2292,8 @@
             mPhoneOnTimer.logState();
             Log.i(TAG, "*** Wifi timer:");
             mWifiOnTimer.logState();
+            Log.i(TAG, "*** WifiRunning timer:");
+            mWifiRunningTimer.logState();
             Log.i(TAG, "*** Bluetooth timer:");
             mBluetoothOnTimer.logState();
         }
diff --git a/core/java/com/android/internal/widget/EditStyledText.java b/core/java/com/android/internal/widget/EditStyledText.java
index 8a4675a..b36707e 100644
--- a/core/java/com/android/internal/widget/EditStyledText.java
+++ b/core/java/com/android/internal/widget/EditStyledText.java
@@ -16,6 +16,8 @@
 
 package com.android.internal.widget;
 
+import java.util.ArrayList;
+
 import android.app.AlertDialog.Builder;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -23,14 +25,21 @@
 import android.os.Bundle;
 import android.text.Editable;
 import android.text.Html;
+import android.text.Layout;
 import android.text.Spannable;
+import android.text.method.ArrowKeyMovementMethod;
 import android.text.style.AbsoluteSizeSpan;
+import android.text.style.AlignmentSpan;
 import android.text.style.ForegroundColorSpan;
 import android.text.style.ImageSpan;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.view.KeyEvent;
 import android.view.MotionEvent;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;
+import android.widget.TextView;
 
 /**
  * EditStyledText extends EditText for managing the flow and status to edit
@@ -57,6 +66,10 @@
     public static final int MODE_COLOR = 4;
     /** The mode of selection. */
     public static final int MODE_SELECT = 5;
+    /** The mode of changing alignment. */
+    public static final int MODE_ALIGN = 6;
+    /** The mode of changing cut. */
+    public static final int MODE_CUT = 7;
 
     /**
      * The state of selection.
@@ -85,6 +98,7 @@
      */
     public interface EditStyledTextNotifier {
         public void notifyHintMsg(int msgId);
+        public void notifyStateChanged(int mode, int state);
     }
 
     private EditStyledTextNotifier mESTInterface;
@@ -167,14 +181,23 @@
                 sizesendints);
     }
 
+    public void setAlignAlertParams(CharSequence aligntitle,
+            CharSequence[] alignnames) {
+        mToast.setAlignAlertParams(aligntitle, alignnames);
+    }
+
     @Override
     public boolean onTouchEvent(MotionEvent event) {
+        if (mManager.isSoftKeyBlocked() &&
+                event.getAction() == MotionEvent.ACTION_UP) {
+            cancelLongPress();
+        }
         final boolean superResult = super.onTouchEvent(event);
         if (event.getAction() == MotionEvent.ACTION_UP) {
             if (DBG) {
                 Log.d(LOG_TAG, "--- onTouchEvent");
             }
-            mManager.onTouchScreen();
+            mManager.onCursorMoved();
         }
         return superResult;
     }
@@ -202,6 +225,13 @@
     }
 
     /**
+     * Start "Cut" action.
+     */
+    public void onStartCut() {
+        mManager.onStartCut();
+    }
+
+    /**
      * Start "Paste" action.
      */
     public void onStartPaste() {
@@ -223,6 +253,13 @@
     }
 
     /**
+     * Start changing "Alignment" action.
+     */
+    public void onStartAlign() {
+        mManager.onStartAlign();
+    }
+
+    /**
      * Start "Select" action.
      */
     public void onStartSelect() {
@@ -237,6 +274,13 @@
     }
 
     /**
+     * Fix Selected Item.
+     */
+    public void onFixSelectedItem() {
+        mManager.onFixSelectedItem();
+    }
+
+    /**
      * InsertImage to TextView by using URI
      * 
      * @param uri
@@ -257,13 +301,6 @@
     }
 
     /**
-     * Fix Selected Item.
-     */
-    public void fixSelectedItem() {
-        mManager.onFixSelectItem();
-    }
-
-    /**
      * Set Size of the Item.
      * 
      * @param size
@@ -283,16 +320,12 @@
         mManager.setItemColor(color);
     }
 
-    public void onShowColorAlert() {
-        mToast.onShowColorAlertDialog();
-    }
-
-    public void onShowSizeAlert() {
-        mToast.onShowSizeAlertDialog();
+    public void setAlignment(Layout.Alignment align) {
+        mManager.setAlignment(align);
     }
 
     /**
-     * Check editing is started.
+     * Check whether editing is started or not.
      * 
      * @return Whether editing is started or not.
      */
@@ -301,6 +334,15 @@
     }
 
     /**
+     * Check whether SoftKey is Blocked or not.
+     * 
+     * @return whether SoftKey is Blocked or not.
+     */
+    public boolean isSoftKeyBlocked() {
+        return mManager.isSoftKeyBlocked();
+    }
+
+    /**
      * Get the mode of the action.
      * 
      * @return The mode of the action.
@@ -318,7 +360,33 @@
         return mManager.getSelectState();
     }
 
-    public String getBody() {
+    @Override
+    public Bundle getInputExtras(boolean create) {
+        Bundle bundle = super.getInputExtras(create);
+        if (bundle != null) {
+            bundle.putBoolean("allowEmoji", true);
+        }
+        return bundle;
+    }
+
+    /**
+     * Get the state of the selection.
+     * 
+     * @return The state of the selection.
+     */
+    public String getHtml() {
+        return mConverter.getConvertedBody();
+    }
+
+    /**
+     * Get the state of the selection.
+     * 
+     * @param uris
+     *            The array of used uris.
+     * @return The state of the selection.
+     */
+    public String getHtml(ArrayList<Uri> uris) {
+        mConverter.getUriArray(uris, this.getText());
         return mConverter.getConvertedBody();
     }
 
@@ -333,6 +401,28 @@
         mManager = new EditorManager(this);
         mConverter = new StyledTextConverter(this);
         mToast = new StyledTextToast(this);
+        setMovementMethod(new StyledTextArrowKeyMethod(mManager));
+    }
+
+    /**
+     * Show Color Selecting Dialog.
+     */
+    private void onShowColorAlert() {
+        mToast.onShowColorAlertDialog();
+    }
+
+    /**
+     * Show Size Selecting Dialog.
+     */
+    private void onShowSizeAlert() {
+        mToast.onShowSizeAlertDialog();
+    }
+
+    /**
+     * Show Alignment Selecting Dialog.
+     */
+    private void onShowAlignAlert() {
+        mToast.onShowAlignAlertDialog();
     }
 
     /**
@@ -347,27 +437,31 @@
         }
     }
 
-    @Override
-    public Bundle getInputExtras(boolean create) {
-        Bundle bundle = super.getInputExtras(create);
-        if (bundle != null) {
-            bundle.putBoolean("allowEmoji", true);
+    /**
+     * Notify the event that the mode and state are changed.
+     * 
+     * @param mode
+     *            Mode of the editing action.
+     * @param state
+     *            Mode of the selection state.
+     */
+    private void notifyStateChanged(int mode, int state) {
+        if (mESTInterface != null) {
+            mESTInterface.notifyStateChanged(mode, state);
         }
-        return bundle;
     }
 
     /**
-     * Object which manages the flow and status of editing actions.
+     * EditorManager manages the flow and status of editing actions.
      */
     private class EditorManager {
         private boolean mEditFlag = false;
+        private boolean mSoftKeyBlockFlag = false;
         private int mMode = 0;
         private int mState = 0;
         private int mCurStart = 0;
         private int mCurEnd = 0;
         private EditStyledText mEST;
-        private Editable mTextSelectBuffer;
-        private CharSequence mTextCopyBufer;
 
         EditorManager(EditStyledText est) {
             mEST = est;
@@ -375,37 +469,133 @@
 
         public void onStartEdit() {
             if (DBG) {
-                Log.d(LOG_TAG, "--- onEdit");
+                Log.d(LOG_TAG, "--- onStartEdit");
             }
+            Log.d(LOG_TAG, "--- onstartedit:" + this.getSelectionStart() + this.getSelectionEnd());
             handleResetEdit();
+            mEST.notifyStateChanged(mMode, mState);
         }
 
         public void onEndEdit() {
             if (DBG) {
-                Log.d(LOG_TAG, "--- onClickCancel");
+                Log.d(LOG_TAG, "--- onEndEdit");
             }
             handleCancel();
+            mEST.notifyStateChanged(mMode, mState);
         }
 
         public void onStartCopy() {
             if (DBG) {
-                Log.d(LOG_TAG, "--- onClickCopy");
+                Log.d(LOG_TAG, "--- onStartCopy");
             }
             handleCopy();
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onStartCut() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onStartCut");
+            }
+            handleCut();
+            mEST.notifyStateChanged(mMode, mState);
         }
 
         public void onStartPaste() {
             if (DBG) {
-                Log.d(LOG_TAG, "--- onClickPaste");
+                Log.d(LOG_TAG, "--- onStartPaste");
             }
             handlePaste();
+            mEST.notifyStateChanged(mMode, mState);
         }
 
         public void onStartSize() {
             if (DBG) {
-                Log.d(LOG_TAG, "--- onClickSize");
+                Log.d(LOG_TAG, "--- onStartSize");
             }
             handleSize();
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onStartAlign() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onStartAlignRight");
+            }
+            handleAlign();
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onStartColor() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onClickColor");
+            }
+            handleColor();
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onStartSelect() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onClickSelect");
+            }
+            mMode = MODE_SELECT;
+            if (mState == STATE_SELECT_OFF) {
+                handleSelect();
+            } else {
+                unsetSelect();
+                handleSelect();
+            }
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onCursorMoved() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onClickView");
+            }
+            if (mState == STATE_SELECT_ON || mState == STATE_SELECTED) {
+                handleSelect();
+                mEST.notifyStateChanged(mMode, mState);
+            }
+        }
+
+        public void onStartSelectAll() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onClickSelectAll");
+            }
+            handleSelectAll();
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onFixSelectedItem() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onClickComplete");
+            }
+            handleComplete();
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onInsertImage(Uri uri) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onInsertImage by URI: " + uri.getPath()
+                        + "," + uri.toString());
+            }
+            int curpos = mEST.getSelectionStart();
+            mEST.getText().insert(curpos, "a");
+            ImageSpan is = new ImageSpan(mEST.getContext(), uri);
+            mEST.getText().setSpan(is,
+                    curpos, curpos + 1,
+                    Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+            mEST.notifyStateChanged(mMode, mState);
+        }
+
+        public void onInsertImage(int resID) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onInsertImage by resID");
+            }
+            int curpos = mEST.getSelectionStart();
+            mEST.getText().insert(curpos, "a");
+            mEST.getText().setSpan(new ImageSpan(mEST.getContext(), resID),
+                    curpos, curpos + 1,
+                    Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+            mEST.notifyStateChanged(mMode, mState);
         }
 
         public void setItemSize(int size) {
@@ -428,75 +618,24 @@
             }
         }
 
-        public void onStartColor() {
+        public void setAlignment(Layout.Alignment align) {
             if (DBG) {
-                Log.d(LOG_TAG, "--- onClickColor");
+                Log.d(LOG_TAG, "--- onClickColorItem");
             }
-            handleColor();
-        }
-
-        public void onStartSelect() {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- onClickSelect");
+            if (mState == STATE_SELECTED || mState == STATE_SELECT_FIX) {
+                changeAlign(align);
+                handleResetEdit();
             }
-            mMode = MODE_SELECT;
-            if (mState == STATE_SELECT_OFF) {
-                handleSelect();
-            } else {
-                offSelect();
-                handleSelect();
-            }
-        }
-
-        public void onStartSelectAll() {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- onClickSelectAll");
-            }
-            handleSelectAll();
-        }
-
-        public void onTouchScreen() {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- onClickView");
-            }
-            if (mState == STATE_SELECT_ON || mState == STATE_SELECTED) {
-                handleSelect();
-            }
-        }
-
-        public void onFixSelectItem() {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- onClickComplete");
-            }
-            handleComplete();
-        }
-
-        public void onInsertImage(Uri uri) {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- onInsertImage by URI: " + uri.getPath()
-                        + "," + uri.toString());
-            }
-
-            mEST.getText().append("a");
-            mEST.getText().setSpan(new ImageSpan(mEST.getContext(), uri),
-                    mEST.getText().length() - 1, mEST.getText().length(),
-                    Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-        }
-
-        public void onInsertImage(int resID) {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- onInsertImage by resID");
-            }
-            mEST.getText().append("b");
-            mEST.getText().setSpan(new ImageSpan(mEST.getContext(), resID),
-                    mEST.getText().length() - 1, mEST.getText().length(),
-                    Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
         }
 
         public boolean isEditting() {
             return mEditFlag;
         }
 
+        public boolean isSoftKeyBlocked() {
+            return this.mSoftKeyBlockFlag;
+        }
+
         public int getEditMode() {
             return mMode;
         }
@@ -505,6 +644,42 @@
             return mState;
         }
 
+        public int getSelectionStart() {
+            return mCurStart;
+        }
+
+        public int getSelectionEnd() {
+            return mCurEnd;
+        }
+
+        private void doNextHandle() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- doNextHandle: " + mMode + "," + mState);
+            }
+            switch (mMode) {
+            case MODE_COPY:
+                handleCopy();
+                break;
+            case MODE_CUT:
+                handleCut();
+                break;
+            case MODE_PASTE:
+                handlePaste();
+                break;
+            case MODE_SIZE:
+                handleSize();
+                break;
+            case MODE_COLOR:
+                handleColor();
+                break;
+            case MODE_ALIGN:
+                handleAlign();
+                break;
+            default:
+                break;
+            }
+        }
+
         private void handleCancel() {
             if (DBG) {
                 Log.d(LOG_TAG, "--- handleCancel");
@@ -512,7 +687,9 @@
             mMode = MODE_NOTHING;
             mState = STATE_SELECT_OFF;
             mEditFlag = false;
-            offSelect();
+            Log.d(LOG_TAG, "--- handleCancel:" + mEST.getInputType());
+            unblockSoftKey();
+            unsetSelect();
         }
 
         private void handleComplete() {
@@ -525,18 +702,32 @@
             if (mState == STATE_SELECTED) {
                 mState = STATE_SELECT_FIX;
             }
-            switch (mMode) {
-            case MODE_COPY:
-                handleCopy();
-                break;
-            case MODE_COLOR:
-                handleColor();
-                break;
-            case MODE_SIZE:
-                handleSize();
-                break;
-            default:
-                break;
+            doNextHandle();
+        }
+
+        private void handleTextViewFunc(int mode, int id) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- handleTextView: " + mMode + "," + mState +
+                        "," + id);
+            }
+            if (!mEditFlag) {
+                return;
+            }
+            if (mMode == MODE_NOTHING || mMode == MODE_SELECT) {
+                mMode = mode;
+                if (mState == STATE_SELECTED) {
+                    mState = STATE_SELECT_FIX;
+                    handleTextViewFunc(mode, id);
+                } else {
+                    handleSelect();
+                }
+            } else if (mMode != mode) {
+                handleCancel();
+                mMode = mode;
+                handleTextViewFunc(mode, id);
+            } else if (mState == STATE_SELECT_FIX) {
+                mEST.onTextContextMenuItem(id);
+                handleResetEdit();
             }
         }
 
@@ -544,26 +735,14 @@
             if (DBG) {
                 Log.d(LOG_TAG, "--- handleCopy: " + mMode + "," + mState);
             }
-            if (!mEditFlag) {
-                return;
+            handleTextViewFunc(MODE_COPY, android.R.id.copy);
+        }
+
+        private void handleCut() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- handleCopy: " + mMode + "," + mState);
             }
-            if (mMode == MODE_NOTHING || mMode == MODE_SELECT) {
-                mMode = MODE_COPY;
-                if (mState == STATE_SELECTED) {
-                    mState = STATE_SELECT_FIX;
-                    storeSelectedText();
-                } else {
-                    handleSelect();
-                }
-            } else if (mMode != MODE_COPY) {
-                handleCancel();
-                mMode = MODE_COPY;
-                handleCopy();
-            } else if (mState == STATE_SELECT_FIX) {
-                mEST.setHintMessage(HINT_MSG_NULL);
-                storeSelectedText();
-                handleResetEdit();
-            }
+            handleTextViewFunc(MODE_CUT, android.R.id.cut);
         }
 
         private void handlePaste() {
@@ -573,72 +752,63 @@
             if (!mEditFlag) {
                 return;
             }
-            if (mTextSelectBuffer != null && mTextCopyBufer.length() > 0) {
-                mTextSelectBuffer.insert(mEST.getSelectionStart(),
-                        mTextCopyBufer);
+            mEST.onTextContextMenuItem(android.R.id.paste);
+        }
+
+        private void handleSetSpan(int mode) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- handleSetSpan:" + mEditFlag + ","
+                        + mState + ',' + mMode);
+            }
+            if (!mEditFlag) {
+                Log.e(LOG_TAG, "--- handleSetSpan: Editing is not started.");
+                return;
+            }
+            if (mMode == MODE_NOTHING || mMode == MODE_SELECT) {
+                mMode = mode;
+                if (mState == STATE_SELECTED) {
+                    mState = STATE_SELECT_FIX;
+                    handleSetSpan(mode);
+                } else {
+                    handleSelect();
+                }
+            } else if (mMode != mode) {
+                handleCancel();
+                mMode = mode;
+                handleSetSpan(mode);
             } else {
-                mEST.setHintMessage(HINT_MSG_COPY_BUF_BLANK);
+                if (mState == STATE_SELECT_FIX) {
+                    mEST.setHintMessage(HINT_MSG_NULL);
+                    switch (mode) {
+                    case MODE_COLOR:
+                        mEST.onShowColorAlert();
+                        break;
+                    case MODE_SIZE:
+                        mEST.onShowSizeAlert();
+                        break;
+                    case MODE_ALIGN:
+                        mEST.onShowAlignAlert();
+                        break;
+                    default:
+                        Log.e(LOG_TAG, "--- handleSetSpan: invalid mode.");
+                        break;
+                    }
+                } else {
+                    Log.d(LOG_TAG, "--- handleSetSpan: do nothing.");
+                }
             }
         }
 
         private void handleSize() {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- handleSize: " + mMode + "," + mState);
-            }
-            if (!mEditFlag) {
-                Log.e(LOG_TAG, "--- Editing is not started for handlesize.");
-                return;
-            }
-            if (mMode == MODE_NOTHING || mMode == MODE_SELECT) {
-                mMode = MODE_SIZE;
-                if (mState == STATE_SELECTED) {
-                    mState = STATE_SELECT_FIX;
-                    handleSize();
-                } else {
-                    handleSelect();
-                }
-            } else if (mMode != MODE_SIZE) {
-                handleCancel();
-                mMode = MODE_SIZE;
-                handleSize();
-            } else {
-                if (mState == STATE_SELECT_FIX) {
-                    mEST.setHintMessage(HINT_MSG_NULL);
-                    mEST.onShowSizeAlert();
-                } else {
-                    Log.d(LOG_TAG, "--- handlesize: do nothing");
-                }
-            }
+            handleSetSpan(MODE_SIZE);
         }
 
         private void handleColor() {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- handleSize: " + mMode + "," + mState);
-            }
-            if (!mEditFlag) {
-                Log.e(LOG_TAG, "--- Editing is not started for handlecolor.");
-                return;
-            }
-            if (mMode == MODE_NOTHING || mMode == MODE_SELECT) {
-                mMode = MODE_COLOR;
-                if (mState == STATE_SELECTED) {
-                    mState = STATE_SELECT_FIX;
-                    handleColor();
-                } else {
-                    handleSelect();
-                }
-            } else if (mMode != MODE_COLOR) {
-                handleCancel();
-                mMode = MODE_COLOR;
-                handleSize();
-            } else {
-                if (mState == STATE_SELECT_FIX) {
-                    mEST.setHintMessage(HINT_MSG_NULL);
-                    mEST.onShowColorAlert();
-                } else {
-                    Log.d(LOG_TAG, "--- handlecolor: do nothing");
-                }
-            }
+            handleSetSpan(MODE_COLOR);
+        }
+
+        private void handleAlign() {
+            handleSetSpan(MODE_ALIGN);
         }
 
         private void handleSelect() {
@@ -653,19 +823,20 @@
                     Log.e(LOG_TAG, "Selection is off, but selected");
                 }
                 setSelectStartPos();
+                blockSoftKey();
                 mEST.setHintMessage(HINT_MSG_SELECT_END);
             } else if (mState == STATE_SELECT_ON) {
                 if (isTextSelected()) {
                     Log.e(LOG_TAG, "Selection now start, but selected");
                 }
-                setSelectEndPos();
+                setSelectedEndPos();
                 mEST.setHintMessage(HINT_MSG_PUSH_COMPETE);
                 doNextHandle();
             } else if (mState == STATE_SELECTED) {
                 if (!isTextSelected()) {
                     Log.e(LOG_TAG, "Selection is done, but not selected");
                 }
-                setSelectEndPos();
+                setSelectedEndPos();
                 doNextHandle();
             }
         }
@@ -678,47 +849,30 @@
                 return;
             }
             mEST.selectAll();
-        }
-
-        private void doNextHandle() {
-            if (DBG) {
-                Log.d(LOG_TAG, "--- doNextHandle: " + mMode + "," + mState);
-            }
-            switch (mMode) {
-            case MODE_COPY:
-                handleCopy();
-                break;
-            case MODE_PASTE:
-                handlePaste();
-                break;
-            case MODE_SIZE:
-                handleSize();
-                break;
-            case MODE_COLOR:
-                handleColor();
-                break;
-            default:
-                break;
-            }
+            mState = STATE_SELECTED;
         }
 
         private void handleResetEdit() {
             if (DBG) {
                 Log.d(LOG_TAG, "Reset Editor");
             }
+            blockSoftKey();
             handleCancel();
             mEditFlag = true;
             mEST.setHintMessage(HINT_MSG_SELECT_START);
         }
 
-        // Methods of selection
-        private void onSelect() {
+        private void setSelection() {
             if (DBG) {
                 Log.d(LOG_TAG, "--- onSelect:" + mCurStart + "," + mCurEnd);
             }
             if (mCurStart >= 0 && mCurStart <= mEST.getText().length()
                     && mCurEnd >= 0 && mCurEnd <= mEST.getText().length()) {
-                mEST.setSelection(mCurStart, mCurEnd);
+                if (mCurStart < mCurEnd) {
+                    mEST.setSelection(mCurStart, mCurEnd);
+                } else {
+                    mEST.setSelection(mCurEnd, mCurStart);
+                }
                 mState = STATE_SELECTED;
             } else {
                 Log.e(LOG_TAG,
@@ -728,7 +882,7 @@
             }
         }
 
-        private void offSelect() {
+        private void unsetSelect() {
             if (DBG) {
                 Log.d(LOG_TAG, "--- offSelect");
             }
@@ -745,22 +899,23 @@
             mState = STATE_SELECT_ON;
         }
 
-        private void setSelectEndPos() {
+        private void setSelectedEndPos() {
             if (DBG) {
-                Log.d(LOG_TAG, "--- setSelectEndPos:"
-                        + mEST.getSelectionStart());
+                Log.d(LOG_TAG, "--- setSelectEndPos:");
             }
-            int curpos = mEST.getSelectionStart();
-            if (curpos < mCurStart) {
-                if (DBG) {
-                    Log.d(LOG_TAG, "--- setSelectEndPos: swap is done.");
-                }
-                mCurEnd = mCurStart;
-                mCurStart = curpos;
+            if (mEST.getSelectionStart() == mCurStart) {
+                setSelectedEndPos(mEST.getSelectionEnd());
             } else {
-                mCurEnd = curpos;
+                setSelectedEndPos(mEST.getSelectionStart());
             }
-            onSelect();
+        }
+
+        public void setSelectedEndPos(int pos) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- setSelectedEndPos:");
+            }
+            mCurEnd = pos;
+            setSelection();
         }
 
         private boolean isTextSelected() {
@@ -773,30 +928,96 @@
                             mState == STATE_SELECT_FIX);
         }
 
-        private void storeSelectedText() {
+        private void setStyledTextSpan(Object span, int start, int end) {
             if (DBG) {
-                Log.d(LOG_TAG, "--- storeSelectedText");
+                Log.d(LOG_TAG, "--- setStyledTextSpan:" + mMode + ","
+                        + start + "," + end);
             }
-            mTextSelectBuffer = mEST.getText();
-            mTextCopyBufer = mTextSelectBuffer.subSequence(mCurStart, mCurEnd);
+            if (start < end) {
+                mEST.getText().setSpan(span, start, end,
+                        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+            } else {
+                mEST.getText().setSpan(span, end, start,
+                        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+            }
         }
 
         private void changeSizeSelectedText(int size) {
             if (DBG) {
-                Log.d(LOG_TAG, "--- changeSizeSelectedText:" + size + ","
-                        + mCurStart + "," + mCurEnd);
+                Log.d(LOG_TAG, "--- changeAlign:" + size);
             }
-            mEST.getText().setSpan(new AbsoluteSizeSpan(size), mCurStart,
-                    mCurEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+            setStyledTextSpan(new AbsoluteSizeSpan(size),
+                mCurStart, mCurEnd);
         }
 
         private void changeColorSelectedText(int color) {
             if (DBG) {
-                Log.d(LOG_TAG, "--- changeCollorSelectedText:" + color + ","
-                        + mCurStart + "," + mCurEnd);
+                Log.d(LOG_TAG, "--- changeAlign:" + color);
             }
-            mEST.getText().setSpan(new ForegroundColorSpan(color), mCurStart,
-                    mCurEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+            setStyledTextSpan(new ForegroundColorSpan(color),
+                mCurStart, mCurEnd);
+        }
+
+        private void changeAlign(Layout.Alignment align) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- changeAlign:" + align);
+            }
+            setStyledTextSpan(new AlignmentSpan.Standard(align),
+                    findLineStart(mEST.getText(), mCurStart),
+                    findLineEnd(mEST.getText(), mCurEnd));
+        }
+
+        private int findLineStart(Editable text, int current) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- findLineStart: curr:" + current +
+                        ", length:" + text.length());
+            }
+            int pos = current;
+            for (; pos > 0; pos--) {
+                if (text.charAt(pos - 1) == '\n') {
+                    break;
+                }
+            }
+            return pos;
+        }
+
+        private int findLineEnd(Editable text, int current) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- findLineEnd: curr:" + current +
+                        ", length:" + text.length());
+            }
+            int pos = current;
+            for (; pos < text.length(); pos++) {
+                if (pos > 0 && text.charAt(pos - 1) == '\n') {
+                    break;
+                }
+            }
+            return pos;
+        }
+
+        private void blockSoftKey() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- blockSoftKey:");
+            }
+            InputMethodManager imm = (InputMethodManager) mEST.getContext().
+            getSystemService(Context.INPUT_METHOD_SERVICE);
+            imm.hideSoftInputFromWindow(mEST.getWindowToken(), 0);
+            mEST.setOnClickListener(
+                    new OnClickListener() {
+                        public void onClick(View v) {
+                            Log.d(LOG_TAG, "--- ontrackballclick:");
+                            onFixSelectedItem();
+                        }
+            });
+            mSoftKeyBlockFlag = true;
+        }
+
+        private void unblockSoftKey() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- unblockSoftKey:");
+            }
+            mEST.setOnClickListener(null);
+            this.mSoftKeyBlockFlag = false;
         }
     }
 
@@ -809,19 +1030,45 @@
 
         public String getConvertedBody() {
             String htmlBody = Html.toHtml(mEST.getText());
+            if (DBG) {
+                Log.d(LOG_TAG, "--- getConvertedBody:" + htmlBody);
+            }
             return htmlBody;
         }
+
+        public void getUriArray(ArrayList<Uri> uris, Editable text) {
+            uris.clear();
+            if (DBG) {
+                Log.d(LOG_TAG, "--- getUriArray:");
+            }
+            int len = text.length();
+            int next;
+            for (int i = 0; i < text.length(); i = next) {
+                next = text.nextSpanTransition(i, len, ImageSpan.class);
+                ImageSpan[] images = text.getSpans(i, next, ImageSpan.class);
+                for (int j = 0; j < images.length; j++) {
+                    if (DBG) {
+                        Log.d(LOG_TAG, "--- getUriArray: foundArray" +
+                                ((ImageSpan) images[j]).getSource());
+                    }
+                    uris.add(Uri.parse(
+                            ((ImageSpan) images[j]).getSource()));
+                }
+            }
+        }
     }
 
     private class StyledTextToast {
         Builder mBuilder;
         CharSequence mColorTitle;
         CharSequence mSizeTitle;
+        CharSequence mAlignTitle;
         CharSequence[] mColorNames;
         CharSequence[] mColorInts;
         CharSequence[] mSizeNames;
         CharSequence[] mSizeDisplayInts;
         CharSequence[] mSizeSendInts;
+        CharSequence[] mAlignNames;
         EditStyledText mEST;
 
         public StyledTextToast(EditStyledText est) {
@@ -848,6 +1095,12 @@
             mSizeSendInts = sizesendints;
         }
 
+        public void setAlignAlertParams(CharSequence aligntitle,
+                CharSequence[] alignnames) {
+            mAlignTitle = aligntitle;
+            mAlignNames = alignnames;
+        }
+
         public boolean checkColorAlertParams() {
             if (DBG) {
                 Log.d(LOG_TAG, "--- checkParams");
@@ -873,13 +1126,30 @@
             }
             if (mBuilder == null) {
                 Log.e(LOG_TAG, "--- builder is null.");
+                return false;
             } else if (mSizeTitle == null || mSizeNames == null
                     || mSizeDisplayInts == null || mSizeSendInts == null) {
                 Log.e(LOG_TAG, "--- size alert params are null.");
+                return false;
             } else if (mSizeNames.length != mSizeDisplayInts.length
                     && mSizeSendInts.length != mSizeDisplayInts.length) {
                 Log.e(LOG_TAG, "--- the length of size alert params are "
                         + "different.");
+                return false;
+            }
+            return true;
+        }
+
+        public boolean checkAlignAlertParams() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- checkAlignAlertParams");
+            }
+            if (mBuilder == null) {
+                Log.e(LOG_TAG, "--- builder is null.");
+                return false;
+            } else if (mAlignTitle == null) {
+                Log.e(LOG_TAG, "--- align alert params are null.");
+                return false;
             }
             return true;
         }
@@ -919,7 +1189,7 @@
             setItems(mSizeNames,
                     new DialogInterface.OnClickListener() {
                 public void onClick(DialogInterface dialog, int which) {
-                    Log.d("EETVM", "mBuilder.onclick:" + which);
+                    Log.d(LOG_TAG, "mBuilder.onclick:" + which);
                     int size = Integer
                     .parseInt((String) mSizeDisplayInts[which]);
                     mEST.setItemSize(size);
@@ -927,5 +1197,165 @@
             });
             mBuilder.show();
         }
+
+        private void onShowAlignAlertDialog() {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- onShowAlertDialog");
+            }
+            if (!checkAlignAlertParams()) {
+                return;
+            }
+            mBuilder.setTitle(mAlignTitle);
+            mBuilder.setIcon(0);
+            mBuilder.
+            setItems(mAlignNames,
+                    new DialogInterface.OnClickListener() {
+                public void onClick(DialogInterface dialog, int which) {
+                    Log.d(LOG_TAG, "mBuilder.onclick:" + which);
+                    Layout.Alignment align = Layout.Alignment.ALIGN_NORMAL;
+                    switch (which) {
+                    case 0:
+                        align = Layout.Alignment.ALIGN_NORMAL;
+                        break;
+                    case 1:
+                        align = Layout.Alignment.ALIGN_CENTER;
+                        break;
+                    case 2:
+                        align = Layout.Alignment.ALIGN_OPPOSITE;
+                        break;
+                    default:
+                        break;
+                    }
+                    mEST.setAlignment(align);
+                }
+            });
+            mBuilder.show();
+        }
+    }
+
+    private class StyledTextArrowKeyMethod extends ArrowKeyMovementMethod {
+        EditorManager mManager;
+        StyledTextArrowKeyMethod(EditorManager manager) {
+            super();
+            mManager = manager;
+        }
+
+        @Override
+        public boolean onKeyDown(TextView widget, Spannable buffer,
+                int keyCode, KeyEvent event) {
+            if (!mManager.isSoftKeyBlocked()) {
+                return super.onKeyDown(widget, buffer, keyCode, event);
+            }
+            if (executeDown(widget, buffer, keyCode)) {
+                return true;
+            }
+            return false;
+        }
+
+        private int getEndPos(TextView widget) {
+            int end;
+            if (widget.getSelectionStart() == mManager.getSelectionStart()) {
+                end = widget.getSelectionEnd();
+            } else {
+                end = widget.getSelectionStart();
+            }
+            return end;
+        }
+
+        private boolean up(TextView widget, Spannable buffer) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- up:");
+            }
+            Layout layout = widget.getLayout();
+            int end = getEndPos(widget);
+            int line = layout.getLineForOffset(end);
+            if (line > 0) {
+                int to;
+                if (layout.getParagraphDirection(line) ==
+                    layout.getParagraphDirection(line - 1)) {
+                    float h = layout.getPrimaryHorizontal(end);
+                    to = layout.getOffsetForHorizontal(line - 1, h);
+                } else {
+                    to = layout.getLineStart(line - 1);
+                }
+                mManager.setSelectedEndPos(to);
+                mManager.onCursorMoved();
+                return true;
+            }
+            return false;
+        }
+
+        private boolean down(TextView widget, Spannable buffer) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- down:");
+            }
+            Layout layout = widget.getLayout();
+            int end = getEndPos(widget);
+            int line = layout.getLineForOffset(end);
+            if (line < layout.getLineCount() - 1) {
+                int to;
+                if (layout.getParagraphDirection(line) ==
+                    layout.getParagraphDirection(line + 1)) {
+                    float h = layout.getPrimaryHorizontal(end);
+                    to = layout.getOffsetForHorizontal(line + 1, h);
+                } else {
+                    to = layout.getLineStart(line + 1);
+                }
+                mManager.setSelectedEndPos(to);
+                mManager.onCursorMoved();
+                return true;
+            }
+            return false;
+        }
+
+        private boolean left(TextView widget, Spannable buffer) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- left:");
+            }
+            Layout layout = widget.getLayout();
+            int to = layout.getOffsetToLeftOf(getEndPos(widget));
+            mManager.setSelectedEndPos(to);
+            mManager.onCursorMoved();
+            return true;
+        }
+
+        private boolean right(TextView widget, Spannable buffer) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- right:");
+            }
+            Layout layout = widget.getLayout();
+            int to = layout.getOffsetToRightOf(getEndPos(widget));
+            mManager.setSelectedEndPos(to);
+            mManager.onCursorMoved();
+            return true;
+        }
+
+        private boolean executeDown(TextView widget, Spannable buffer,
+                int keyCode) {
+            if (DBG) {
+                Log.d(LOG_TAG, "--- executeDown: " + keyCode);
+            }
+            boolean handled = false;
+
+            switch (keyCode) {
+            case KeyEvent.KEYCODE_DPAD_UP:
+                handled |= up(widget, buffer);
+                break;
+            case KeyEvent.KEYCODE_DPAD_DOWN:
+                handled |= down(widget, buffer);
+                break;
+            case KeyEvent.KEYCODE_DPAD_LEFT:
+                handled |= left(widget, buffer);
+                break;
+            case KeyEvent.KEYCODE_DPAD_RIGHT:
+                handled |= right(widget, buffer);
+                break;
+                case KeyEvent.KEYCODE_DPAD_CENTER:
+                    mManager.onFixSelectedItem();
+                    handled = true;
+                    break;
+            }
+            return handled;
+        }
     }
 }
diff --git a/core/java/com/android/internal/widget/EditableInputConnection.java b/core/java/com/android/internal/widget/EditableInputConnection.java
index f2ec064..ad329d1 100644
--- a/core/java/com/android/internal/widget/EditableInputConnection.java
+++ b/core/java/com/android/internal/widget/EditableInputConnection.java
@@ -33,7 +33,7 @@
     private final TextView mTextView;
 
     public EditableInputConnection(TextView textview) {
-        super(textview, false);
+        super(textview, true);
         mTextView = textview;
     }
 
diff --git a/core/java/com/google/android/gdata/client/AndroidGDataClient.java b/core/java/com/google/android/gdata/client/AndroidGDataClient.java
index fe7d860..998f940 100644
--- a/core/java/com/google/android/gdata/client/AndroidGDataClient.java
+++ b/core/java/com/google/android/gdata/client/AndroidGDataClient.java
@@ -51,7 +51,7 @@
     private static final String X_HTTP_METHOD_OVERRIDE =
         "X-HTTP-Method-Override";
 
-    private static final String USER_AGENT_APP_VERSION = "Android-GData/1.0";
+    private static final String DEFAULT_USER_AGENT_APP_VERSION = "Android-GData/1.1";
 
     private static final int MAX_REDIRECTS = 10;
 
@@ -121,7 +121,7 @@
      * @deprecated Use AndroidGDAtaClient(Context) instead.
      */
     public AndroidGDataClient(ContentResolver resolver) {
-        mHttpClient = new GoogleHttpClient(resolver, USER_AGENT_APP_VERSION,
+        mHttpClient = new GoogleHttpClient(resolver, DEFAULT_USER_AGENT_APP_VERSION,
                 true /* gzip capable */);
         mHttpClient.enableCurlLogging(TAG, Log.VERBOSE);
         mResolver = resolver;
@@ -136,7 +136,21 @@
      * SSL session persistence.
      */
     public AndroidGDataClient(Context context) {
-        mHttpClient = new GoogleHttpClient(context, USER_AGENT_APP_VERSION,
+       this(context, DEFAULT_USER_AGENT_APP_VERSION);
+    }
+
+    /**
+     * Creates a new AndroidGDataClient.
+     *
+     * @param context The ContentResolver to get URL rewriting rules from
+     * through the Android proxy server, using null to indicate not using proxy.
+     * The context will also be used by GoogleHttpClient for configuration of
+     * SSL session persistence.
+     * @param appAndVersion The application name and version to be used as the basis of the
+     * User-Agent.  e.g., Android-GData/1.5.0.
+     */
+    public AndroidGDataClient(Context context, String appAndVersion) {
+        mHttpClient = new GoogleHttpClient(context, appAndVersion,
                 true /* gzip capable */);
         mHttpClient.enableCurlLogging(TAG, Log.VERBOSE);
         mResolver = context.getContentResolver();
diff --git a/core/jni/android_media_JetPlayer.cpp b/core/jni/android_media_JetPlayer.cpp
index e345af6..3727f4b 100644
--- a/core/jni/android_media_JetPlayer.cpp
+++ b/core/jni/android_media_JetPlayer.cpp
@@ -14,8 +14,7 @@
  * limitations under the License.
  */
 
-//FIXME: remove log before release
-#define LOG_NDEBUG 0
+//#define LOG_NDEBUG 0
 #define LOG_TAG "JET_JNI"
 
 
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 1b145af..9a569a1 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -797,7 +797,7 @@
     <permission android:name="android.permission.INSTALL_PACKAGES"
         android:label="@string/permlab_installPackages"
         android:description="@string/permdesc_installPackages"
-        android:protectionLevel="signature" />
+        android:protectionLevel="signatureOrSystem" />
 
     <!-- Allows an application to clear user data -->
     <permission android:name="android.permission.CLEAR_APP_USER_DATA"
@@ -815,7 +815,7 @@
     <permission android:name="android.permission.DELETE_PACKAGES"
         android:label="@string/permlab_deletePackages"
         android:description="@string/permdesc_deletePackages"
-        android:protectionLevel="signature" />
+        android:protectionLevel="signatureOrSystem" />
 
     <!-- Allows an application to change whether an application component (other than its own) is
          enabled or not. -->
@@ -909,7 +909,7 @@
     <permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"
         android:label="@string/permlab_checkinProperties"
         android:description="@string/permdesc_checkinProperties"
-        android:protectionLevel="signature" />
+        android:protectionLevel="signatureOrSystem" />
 
     <!-- Allows an application to collect component usage
          statistics -->
diff --git a/core/res/assets/images/android-logo-mask.png b/core/res/assets/images/android-logo-mask.png
new file mode 100644
index 0000000..1e8ab95
--- /dev/null
+++ b/core/res/assets/images/android-logo-mask.png
Binary files differ
diff --git a/core/res/assets/images/android-logo-shine.png b/core/res/assets/images/android-logo-shine.png
new file mode 100644
index 0000000..60144f1
--- /dev/null
+++ b/core/res/assets/images/android-logo-shine.png
Binary files differ
diff --git a/core/res/assets/images/android_320x480.png b/core/res/assets/images/android_320x480.png
deleted file mode 100644
index d2665bb..0000000
--- a/core/res/assets/images/android_320x480.png
+++ /dev/null
Binary files differ
diff --git a/core/res/assets/images/boot_robot.png b/core/res/assets/images/boot_robot.png
deleted file mode 100644
index f4555af..0000000
--- a/core/res/assets/images/boot_robot.png
+++ /dev/null
Binary files differ
diff --git a/core/res/assets/images/boot_robot_glow.png b/core/res/assets/images/boot_robot_glow.png
deleted file mode 100644
index 2a67a3f..0000000
--- a/core/res/assets/images/boot_robot_glow.png
+++ /dev/null
Binary files differ
diff --git a/core/res/assets/images/cylon_dot.png b/core/res/assets/images/cylon_dot.png
deleted file mode 100644
index 150b8b1..0000000
--- a/core/res/assets/images/cylon_dot.png
+++ /dev/null
Binary files differ
diff --git a/core/res/assets/images/cylon_left.png b/core/res/assets/images/cylon_left.png
deleted file mode 100644
index 50c6296..0000000
--- a/core/res/assets/images/cylon_left.png
+++ /dev/null
Binary files differ
diff --git a/core/res/assets/images/cylon_right.png b/core/res/assets/images/cylon_right.png
deleted file mode 100644
index 89b7d71..0000000
--- a/core/res/assets/images/cylon_right.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png
index 326397c..914662d 100644
--- a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png
+++ b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png
Binary files differ
diff --git a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png
index 5583401..3b67c6d 100644
--- a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png
+++ b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png
Binary files differ
diff --git a/core/res/res/drawable/ic_emergency.png b/core/res/res/drawable/ic_emergency.png
index d99abf8..45d0f21 100755
--- a/core/res/res/drawable/ic_emergency.png
+++ b/core/res/res/drawable/ic_emergency.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_down_disabled.9.png b/core/res/res/drawable/timepicker_down_disabled.9.png
index 7d8e0b9..596294b 100755
--- a/core/res/res/drawable/timepicker_down_disabled.9.png
+++ b/core/res/res/drawable/timepicker_down_disabled.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_down_disabled_focused.9.png b/core/res/res/drawable/timepicker_down_disabled_focused.9.png
index 6f2373e..662cffd 100755
--- a/core/res/res/drawable/timepicker_down_disabled_focused.9.png
+++ b/core/res/res/drawable/timepicker_down_disabled_focused.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_down_normal.9.png b/core/res/res/drawable/timepicker_down_normal.9.png
index a946355..f17e8f9 100755
--- a/core/res/res/drawable/timepicker_down_normal.9.png
+++ b/core/res/res/drawable/timepicker_down_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_down_pressed.9.png b/core/res/res/drawable/timepicker_down_pressed.9.png
index fb4d817..777bcf5 100755
--- a/core/res/res/drawable/timepicker_down_pressed.9.png
+++ b/core/res/res/drawable/timepicker_down_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_down_selected.9.png b/core/res/res/drawable/timepicker_down_selected.9.png
index 1db8bc1..b45db62 100755
--- a/core/res/res/drawable/timepicker_down_selected.9.png
+++ b/core/res/res/drawable/timepicker_down_selected.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_up_disabled.9.png b/core/res/res/drawable/timepicker_up_disabled.9.png
index 93d0db4..327b0b5 100755
--- a/core/res/res/drawable/timepicker_up_disabled.9.png
+++ b/core/res/res/drawable/timepicker_up_disabled.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_up_disabled_focused.9.png b/core/res/res/drawable/timepicker_up_disabled_focused.9.png
index b5bf68d..4c96680 100755
--- a/core/res/res/drawable/timepicker_up_disabled_focused.9.png
+++ b/core/res/res/drawable/timepicker_up_disabled_focused.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_up_normal.9.png b/core/res/res/drawable/timepicker_up_normal.9.png
index 978251d..dcd26e0 100755
--- a/core/res/res/drawable/timepicker_up_normal.9.png
+++ b/core/res/res/drawable/timepicker_up_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_up_pressed.9.png b/core/res/res/drawable/timepicker_up_pressed.9.png
index 924b03c..7dac778 100755
--- a/core/res/res/drawable/timepicker_up_pressed.9.png
+++ b/core/res/res/drawable/timepicker_up_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable/timepicker_up_selected.9.png b/core/res/res/drawable/timepicker_up_selected.9.png
index 5c94d0d..35dae8e 100755
--- a/core/res/res/drawable/timepicker_up_selected.9.png
+++ b/core/res/res/drawable/timepicker_up_selected.9.png
Binary files differ
diff --git a/core/res/res/layout/always_use_checkbox.xml b/core/res/res/layout/always_use_checkbox.xml
index 5e6e388..1f8d256 100644
--- a/core/res/res/layout/always_use_checkbox.xml
+++ b/core/res/res/layout/always_use_checkbox.xml
@@ -21,7 +21,8 @@
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:paddingLeft="14dip"
-    android:paddingRight="15dip">
+    android:paddingRight="15dip"
+    android:orientation="vertical">
     
     <CheckBox
         android:id="@+id/alwaysUse"
diff --git a/core/res/res/layout/keyguard_screen_glogin_unlock.xml b/core/res/res/layout/keyguard_screen_glogin_unlock.xml
index 4834b28..74ff3b0 100644
--- a/core/res/res/layout/keyguard_screen_glogin_unlock.xml
+++ b/core/res/res/layout/keyguard_screen_glogin_unlock.xml
@@ -120,7 +120,7 @@
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:drawableLeft="@drawable/ic_emergency"
-        android:drawablePadding="3dip"
+        android:drawablePadding="8dip"
         android:text="@android:string/lockscreen_emergency_call"
         />
 
diff --git a/core/res/res/layout/keyguard_screen_lock.xml b/core/res/res/layout/keyguard_screen_lock.xml
index 952fc5d..b5fbace 100644
--- a/core/res/res/layout/keyguard_screen_lock.xml
+++ b/core/res/res/layout/keyguard_screen_lock.xml
@@ -211,7 +211,7 @@
             android:layout_marginTop="5dip"
             android:layout_gravity="center_horizontal"
             android:drawableLeft="@drawable/ic_emergency"
-            android:drawablePadding="3dip"
+            android:drawablePadding="8dip"
             android:text="@android:string/lockscreen_emergency_call"
            />
 
diff --git a/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml b/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml
index 881652b..4c583d8 100644
--- a/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml
@@ -87,12 +87,7 @@
             android:layout_weight="1.0"
             android:layout_marginBottom="8dip"
             android:layout_marginRight="8dip"
-            android:paddingLeft="4dip"
-            android:paddingRight="4dip"
-            android:paddingTop="8dip"
-            android:paddingBottom="8dip"
             android:textSize="18sp"
-            android:drawablePadding="3dip"
             />
 
         <Button android:id="@+id/emergencyCall"
@@ -104,13 +99,9 @@
             android:layout_weight="1.0"
             android:layout_marginBottom="8dip"
             android:layout_marginLeft="8dip"
-            android:paddingLeft="4dip"
-            android:paddingRight="4dip"
-            android:paddingTop="8dip"
-            android:paddingBottom="8dip"
             android:textSize="18sp"
             android:drawableLeft="@drawable/ic_emergency"
-            android:drawablePadding="3dip"
+            android:drawablePadding="8dip"
         />
     </LinearLayout>
 
diff --git a/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml b/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml
index fc82e3f..ac404f2 100644
--- a/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_sim_pin_portrait.xml
@@ -76,6 +76,7 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_below="@id/topDisplayGroup"
+        android:layout_marginTop="10dip"
         android:orientation="vertical"
         >
 
@@ -249,7 +250,7 @@
         android:layout_centerHorizontal="true"
         android:layout_alignParentBottom="true"
         android:drawableLeft="@android:drawable/ic_emergency"
-        android:drawablePadding="3dip"
+        android:drawablePadding="8dip"
         android:text="@android:string/lockscreen_emergency_call"
         />
 
diff --git a/core/res/res/layout/keyguard_screen_unlock_landscape.xml b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
index d0388a6..929d0a2 100644
--- a/core/res/res/layout/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
@@ -85,7 +85,7 @@
                     android:text="@android:string/lockscreen_emergency_call"
                     android:textSize="14sp"
                     android:drawableLeft="@drawable/ic_emergency"
-                    android:drawablePadding="3dip"
+                    android:drawablePadding="8dip"
                     />
             </RelativeLayout>
 
@@ -108,7 +108,7 @@
                     android:text="@android:string/lockscreen_emergency_call"
                     android:textSize="14sp"
                     android:drawableLeft="@drawable/ic_emergency"
-                    android:drawablePadding="3dip"
+                    android:drawablePadding="8dip"
                     />
             </LinearLayout>
         </FrameLayout>
diff --git a/core/res/res/layout/keyguard_screen_unlock_portrait.xml b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
index 59cd7a3..a6c31b6 100644
--- a/core/res/res/layout/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
@@ -85,7 +85,7 @@
                 android:text="@android:string/lockscreen_emergency_call"
                 android:textSize="14sp"
                 android:drawableLeft="@drawable/ic_emergency"
-                android:drawablePadding="3dip"
+                android:drawablePadding="8dip"
                 />
 
         </RelativeLayout>
@@ -108,7 +108,7 @@
                 android:text="@android:string/lockscreen_emergency_call"
                 android:textSize="14sp"
                 android:drawableLeft="@drawable/ic_emergency"
-                android:drawablePadding="3dip"
+                android:drawablePadding="8dip"
                 />
             <Button android:id="@+id/forgotPattern"
                 android:layout_width="0dip"
diff --git a/core/res/res/layout/time_picker.xml b/core/res/res/layout/time_picker.xml
index c601e0e..6ba5e81 100644
--- a/core/res/res/layout/time_picker.xml
+++ b/core/res/res/layout/time_picker.xml
@@ -49,10 +49,8 @@
         android:id="@+id/amPm"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="46dip"
+        android:layout_marginTop="43dip"
         android:layout_marginLeft="5dip"
-        android:paddingTop="2dip"
-        android:paddingBottom="2dip"
         android:paddingLeft="20dip"
         android:paddingRight="20dip"
         style="?android:attr/textAppearanceLargeInverse"
diff --git a/core/res/res/values-ar-rEG/arrays.xml b/core/res/res/values-ar-rEG/arrays.xml
new file mode 100644
index 0000000..1180cb3
--- /dev/null
+++ b/core/res/res/values-ar-rEG/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>26820553</item>
+        <item>30802498</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-ar-rIL/arrays.xml b/core/res/res/values-ar-rIL/arrays.xml
new file mode 100644
index 0000000..87c1231
--- /dev/null
+++ b/core/res/res/values-ar-rIL/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>31046051</item>
+        <item>34851612</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-bg-rBG/arrays.xml b/core/res/res/values-bg-rBG/arrays.xml
new file mode 100644
index 0000000..3cfcbfd
--- /dev/null
+++ b/core/res/res/values-bg-rBG/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>42733883</item>
+        <item>25485830</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-ca-rES/arrays.xml b/core/res/res/values-ca-rES/arrays.xml
new file mode 100644
index 0000000..7f5667c
--- /dev/null
+++ b/core/res/res/values-ca-rES/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>40413496</item>
+        <item>-3713379</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>6</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-cs-rCZ/arrays.xml b/core/res/res/values-cs-rCZ/arrays.xml
new file mode 100644
index 0000000..484c9b3
--- /dev/null
+++ b/core/res/res/values-cs-rCZ/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>50083333</item>
+        <item>14416667</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-da-rDK/arrays.xml b/core/res/res/values-da-rDK/arrays.xml
new file mode 100644
index 0000000..4d0abd0
--- /dev/null
+++ b/core/res/res/values-da-rDK/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>55679423</item>
+        <item>12577114</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-de-rAT/arrays.xml b/core/res/res/values-de-rAT/arrays.xml
new file mode 100644
index 0000000..e8855cf6
--- /dev/null
+++ b/core/res/res/values-de-rAT/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>48209206</item>
+        <item>16372778</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-de-rCH/arrays.xml b/core/res/res/values-de-rCH/arrays.xml
new file mode 100644
index 0000000..f2982e9
--- /dev/null
+++ b/core/res/res/values-de-rCH/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>46948020</item>
+        <item>7448206</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-de-rDE/arrays.xml b/core/res/res/values-de-rDE/arrays.xml
new file mode 100644
index 0000000..3680fd3
--- /dev/null
+++ b/core/res/res/values-de-rDE/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>55679423</item>
+        <item>9735672</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-de-rLI/arrays.xml b/core/res/res/values-de-rLI/arrays.xml
new file mode 100644
index 0000000..0481b76
--- /dev/null
+++ b/core/res/res/values-de-rLI/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>47141076</item>
+        <item>9521482</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-el-rGR/arrays.xml b/core/res/res/values-el-rGR/arrays.xml
new file mode 100644
index 0000000..0329ca3
--- /dev/null
+++ b/core/res/res/values-el-rGR/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>39074208</item>
+        <item>21824312</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-en-rCA/arrays.xml b/core/res/res/values-en-rCA/arrays.xml
new file mode 100644
index 0000000..00c7ca4
--- /dev/null
+++ b/core/res/res/values-en-rCA/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>49875832</item>
+        <item>-97150726</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-en-rIN/arrays.xml b/core/res/res/values-en-rIN/arrays.xml
new file mode 100644
index 0000000..d5b2889
--- /dev/null
+++ b/core/res/res/values-en-rIN/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>20593684</item>
+        <item>78962880</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-en-rNZ/arrays.xml b/core/res/res/values-en-rNZ/arrays.xml
new file mode 100644
index 0000000..6340b95
--- /dev/null
+++ b/core/res/res/values-en-rNZ/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>-41286480</item>
+        <item>174776217</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 30061e2..a18d2d7 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -830,4 +830,5 @@
     <skip />
     <!-- no translation found for ime_action_default (2840921885558045721) -->
     <skip />
+    
 </resources>
diff --git a/core/res/res/values-fi-rFI/arrays.xml b/core/res/res/values-fi-rFI/arrays.xml
new file mode 100644
index 0000000..2e23953
--- /dev/null
+++ b/core/res/res/values-fi-rFI/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>60169653</item>
+        <item>24939480</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-fr-rBE/arrays.xml b/core/res/res/values-fr-rBE/arrays.xml
new file mode 100644
index 0000000..9e93a09
--- /dev/null
+++ b/core/res/res/values-fr-rBE/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>50854509</item>
+        <item>4376678</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>5</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-fr-rCA/arrays.xml b/core/res/res/values-fr-rCA/arrays.xml
new file mode 100644
index 0000000..00c7ca4
--- /dev/null
+++ b/core/res/res/values-fr-rCA/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>49875832</item>
+        <item>-97150726</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-fr-rCH/arrays.xml b/core/res/res/values-fr-rCH/arrays.xml
new file mode 100644
index 0000000..f2982e9
--- /dev/null
+++ b/core/res/res/values-fr-rCH/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>46948020</item>
+        <item>7448206</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-he-rIL/arrays.xml b/core/res/res/values-he-rIL/arrays.xml
new file mode 100644
index 0000000..87c1231
--- /dev/null
+++ b/core/res/res/values-he-rIL/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>31046051</item>
+        <item>34851612</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-hi-rIN/arrays.xml b/core/res/res/values-hi-rIN/arrays.xml
new file mode 100644
index 0000000..d5b2889
--- /dev/null
+++ b/core/res/res/values-hi-rIN/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>20593684</item>
+        <item>78962880</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-hu-rHU/arrays.xml b/core/res/res/values-hu-rHU/arrays.xml
new file mode 100644
index 0000000..833bb24
--- /dev/null
+++ b/core/res/res/values-hu-rHU/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>47162494</item>
+        <item>19503304</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-id-rID/arrays.xml b/core/res/res/values-id-rID/arrays.xml
new file mode 100644
index 0000000..512cace
--- /dev/null
+++ b/core/res/res/values-id-rID/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>-789275</item>
+        <item>113921327</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-it-rCH/arrays.xml b/core/res/res/values-it-rCH/arrays.xml
new file mode 100644
index 0000000..f2982e9
--- /dev/null
+++ b/core/res/res/values-it-rCH/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>46948020</item>
+        <item>7448206</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 25d906f..dedc019 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -105,7 +105,7 @@
     <string name="screen_lock">"画面をロック"</string>
     <string name="power_off">"電源オフ"</string>
     <string name="shutdown_progress">"シャットダウン中..."</string>
-    <string name="shutdown_confirm">"携帯電話の電源をオフにします。"</string>
+    <string name="shutdown_confirm">"携帯電話の電源を切ります。"</string>
     <string name="no_recent_tasks">"最近使ったアプリケーションはありません。"</string>
     <string name="global_actions">"携帯電話オプション"</string>
     <string name="global_action_lock">"画面ロック"</string>
@@ -401,7 +401,7 @@
     <string name="keyguard_password_wrong_pin_code">"PINコードが正しくありません。"</string>
     <string name="keyguard_label_text">"ロックを解除するにはMENU、0キーの順に押します。"</string>
     <string name="emergency_call_dialog_number_for_display">"緊急通報番号"</string>
-    <string name="lockscreen_carrier_default">"(サービス登録なし)"</string>
+    <string name="lockscreen_carrier_default">"(通信サービスなし)"</string>
     <string name="lockscreen_screen_locked">"画面ロック中"</string>
     <string name="lockscreen_instructions_when_pattern_enabled">"MENUキーでロック解除(または緊急通報)"</string>
     <string name="lockscreen_instructions_when_pattern_disabled">"MENUキーでロック解除"</string>
@@ -448,7 +448,7 @@
     <string name="battery_status_charging">"充電中..."</string>
     <string name="battery_low_title">"充電してください"</string>
     <string name="battery_low_subtitle">"電池が残り少なくなっています:"</string>
-    <string name="battery_low_percent_format">"残り<xliff:g id="NUMBER">%d%%</xliff:g>未満"</string>
+    <string name="battery_low_percent_format">"残量<xliff:g id="NUMBER">%d%%</xliff:g>以下"</string>
     <string name="factorytest_failed">"出荷時試験が失敗"</string>
     <string name="factorytest_not_system">"FACTORY_TEST操作は、/system/appにインストールされたパッケージのみが対象です。"</string>
     <string name="factorytest_no_action">"FACTORY_TEST操作を行うパッケージは見つかりませんでした。"</string>
@@ -595,7 +595,7 @@
     <string name="midnight">"午前0時"</string>
     <string name="Midnight">"午前0時"</string>
     <!-- no translation found for month_day (3693060561170538204) -->
-    <skip />
+    <string name="month_day">"<xliff:g id="MONTH">%B</xliff:g><xliff:g id="DAY">%-d</xliff:g>日"</string>
     <!-- no translation found for month (7026169712234774086) -->
     <skip />
     <string name="month_day_year">"<xliff:g id="YEAR">%Y</xliff:g>年<xliff:g id="MONTH">%B</xliff:g><xliff:g id="DAY">%-d</xliff:g>日"</string>
@@ -630,8 +630,7 @@
     <string name="abbrev_month_day_year">"<xliff:g id="YEAR">%Y</xliff:g>/<xliff:g id="MONTH">%b</xliff:g>/<xliff:g id="DAY">%-d</xliff:g>"</string>
     <!-- no translation found for abbrev_month_year (5966980891147982768) -->
     <skip />
-    <!-- no translation found for abbrev_month_day (3156047263406783231) -->
-    <skip />
+    <string name="abbrev_month_day">"<xliff:g id="MONTH">%b</xliff:g><xliff:g id="DAY">%-d</xliff:g>日"</string>
     <!-- no translation found for abbrev_month (3131032032850777433) -->
     <skip />
     <string name="day_of_week_long_sunday">"日曜日"</string>
@@ -744,18 +743,18 @@
     <string name="force_close">"強制終了"</string>
     <string name="wait">"待機"</string>
     <string name="debug">"デバッグ"</string>
-    <string name="sendText">"テキストの操作"</string>
-    <string name="volume_ringtone">"着信音の音量"</string>
+    <string name="sendText">"アプリケーションを選択"</string>
+    <string name="volume_ringtone">"着信音量"</string>
     <string name="volume_music">"メディアの音量"</string>
     <string name="volume_music_hint_playing_through_bluetooth">"Bluetooth経由で再生中です"</string>
-    <string name="volume_call">"着信音の音量"</string>
-    <string name="volume_bluetooth_call">"Bluetooth着信音の音量"</string>
+    <string name="volume_call">"着信音量"</string>
+    <string name="volume_bluetooth_call">"Bluetooth着信音量"</string>
     <string name="volume_alarm">"アラームの音量"</string>
     <string name="volume_notification">"通知音の音量"</string>
     <string name="volume_unknown">"音量"</string>
     <string name="ringtone_default">"デフォルトの着信音"</string>
-    <string name="ringtone_default_with_actual">"端末既定の着信音(<xliff:g id="ACTUAL_RINGTONE">%1$s</xliff:g>)"</string>
-    <string name="ringtone_silent">"無音"</string>
+    <string name="ringtone_default_with_actual">"端末の基本着信音(<xliff:g id="ACTUAL_RINGTONE">%1$s</xliff:g>)"</string>
+    <string name="ringtone_silent">"サイレント"</string>
     <string name="ringtone_picker_title">"着信音"</string>
     <string name="ringtone_unknown">"不明な着信音"</string>
   <plurals name="wifi_available">
diff --git a/core/res/res/values-ko-rKR/arrays.xml b/core/res/res/values-ko-rKR/arrays.xml
new file mode 100644
index 0000000..e245def
--- /dev/null
+++ b/core/res/res/values-ko-rKR/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>37560908</item>
+        <item>126987705</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-lt-rLT/arrays.xml b/core/res/res/values-lt-rLT/arrays.xml
new file mode 100644
index 0000000..0d5a3aa
--- /dev/null
+++ b/core/res/res/values-lt-rLT/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>55169438</item>
+        <item>23881275</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-lv-rLV/arrays.xml b/core/res/res/values-lv-rLV/arrays.xml
new file mode 100644
index 0000000..d9ba7a4
--- /dev/null
+++ b/core/res/res/values-lv-rLV/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>55879635</item>
+        <item>24603189</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-nl-rBE/arrays.xml b/core/res/res/values-nl-rBE/arrays.xml
new file mode 100644
index 0000000..9e93a09
--- /dev/null
+++ b/core/res/res/values-nl-rBE/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>50854509</item>
+        <item>4376678</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>5</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-nl-rNL/arrays.xml b/core/res/res/values-nl-rNL/arrays.xml
new file mode 100644
index 0000000..fe5422b
--- /dev/null
+++ b/core/res/res/values-nl-rNL/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>51589256</item>
+        <item>4774396</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-no-rNO/arrays.xml b/core/res/res/values-no-rNO/arrays.xml
new file mode 100644
index 0000000..500e8e1
--- /dev/null
+++ b/core/res/res/values-no-rNO/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>59910761</item>
+        <item>10749092</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-pl-rPL/arrays.xml b/core/res/res/values-pl-rPL/arrays.xml
new file mode 100644
index 0000000..950248c
--- /dev/null
+++ b/core/res/res/values-pl-rPL/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>52235474</item>
+        <item>21004057</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-pt-rBR/arrays.xml b/core/res/res/values-pt-rBR/arrays.xml
new file mode 100644
index 0000000..389d0c4
--- /dev/null
+++ b/core/res/res/values-pt-rBR/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>-22863878</item>
+        <item>-43244097</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-pt-rPT/arrays.xml b/core/res/res/values-pt-rPT/arrays.xml
new file mode 100644
index 0000000..a1ba15a
--- /dev/null
+++ b/core/res/res/values-pt-rPT/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>38707163</item>
+        <item>-9135517</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-ro-rRO/arrays.xml b/core/res/res/values-ro-rRO/arrays.xml
new file mode 100644
index 0000000..c5579d0
--- /dev/null
+++ b/core/res/res/values-ro-rRO/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>45943161</item>
+        <item>24966760</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-ru-rRU/arrays.xml b/core/res/res/values-ru-rRU/arrays.xml
new file mode 100644
index 0000000..733fdc0
--- /dev/null
+++ b/core/res/res/values-ru-rRU/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>55750449</item>
+        <item>37621136</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>2</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-sk-rSK/arrays.xml b/core/res/res/values-sk-rSK/arrays.xml
new file mode 100644
index 0000000..b065ba5
--- /dev/null
+++ b/core/res/res/values-sk-rSK/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>48669026</item>
+        <item>19699024</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-sl-rSI/arrays.xml b/core/res/res/values-sl-rSI/arrays.xml
new file mode 100644
index 0000000..4158157
--- /dev/null
+++ b/core/res/res/values-sl-rSI/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>46151241</item>
+        <item>14995463</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-sr-rRS/arrays.xml b/core/res/res/values-sr-rRS/arrays.xml
new file mode 100644
index 0000000..98dc954
--- /dev/null
+++ b/core/res/res/values-sr-rRS/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>44016521</item>
+        <item>21005859</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-sv-rSE/arrays.xml b/core/res/res/values-sv-rSE/arrays.xml
new file mode 100644
index 0000000..988d356
--- /dev/null
+++ b/core/res/res/values-sv-rSE/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>59330650</item>
+        <item>18067360</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-th-rTH/arrays.xml b/core/res/res/values-th-rTH/arrays.xml
new file mode 100644
index 0000000..fe76592
--- /dev/null
+++ b/core/res/res/values-th-rTH/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>15870032</item>
+        <item>100992541</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-tl-rPH/arrays.xml b/core/res/res/values-tl-rPH/arrays.xml
new file mode 100644
index 0000000..2edac64
--- /dev/null
+++ b/core/res/res/values-tl-rPH/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>12879721</item>
+        <item>121774017</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-tr-rTR/arrays.xml b/core/res/res/values-tr-rTR/arrays.xml
new file mode 100644
index 0000000..f045cff
--- /dev/null
+++ b/core/res/res/values-tr-rTR/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>41034435</item>
+        <item>28977556</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-uk-rUA/arrays.xml b/core/res/res/values-uk-rUA/arrays.xml
new file mode 100644
index 0000000..746befd
--- /dev/null
+++ b/core/res/res/values-uk-rUA/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>48379433</item>
+        <item>31165580</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-vi-rVN/arrays.xml b/core/res/res/values-vi-rVN/arrays.xml
new file mode 100644
index 0000000..6b22081
--- /dev/null
+++ b/core/res/res/values-vi-rVN/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>14058324</item>
+        <item>108277199</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>4</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-zh-rCN/arrays.xml b/core/res/res/values-zh-rCN/arrays.xml
new file mode 100644
index 0000000..16da6d9
--- /dev/null
+++ b/core/res/res/values-zh-rCN/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>39937795</item>
+        <item>116387224</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>2</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values-zh-rTW/arrays.xml b/core/res/res/values-zh-rTW/arrays.xml
new file mode 100644
index 0000000..be0795b
--- /dev/null
+++ b/core/res/res/values-zh-rTW/arrays.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/colors.xml
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+<resources>
+
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_lat_lng">
+        <item>25022112</item>
+        <item>121478019</item>
+    </integer-array>
+    <!-- Do not translate. -->
+    <integer-array name="maps_starting_zoom">
+        <item>3</item>
+    </integer-array>
+
+</resources>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index c06c7c4..ed35986 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1069,6 +1069,8 @@
   <public type="style" name="Animation.InputMethod" id="0x01030056" />
   <public type="style" name="Widget.KeyboardView" id="0x01030057" />
   <public type="style" name="ButtonBar" id="0x01030058" />
+  <public type="style" name="Theme.Panel" id="0x01030059" />
+  <public type="style" name="Theme.Light.Panel" id="0x0103005a" />
   
   <public type="string" name="dialog_alert_title" id="0x01040014" />
   <public type="string" name="VideoView_error_text_invalid_progressive_playback" id="0x01040015" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 7aaee1a..6cfdf8f 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2312,4 +2312,14 @@
     <!-- Long label for a button on a full-screen input method for an unknown action. -->
     <string name="ime_action_default">Execute</string>
     
+    <!-- Strings for search suggestions. These are going here because they are referenced by both 
+         ContactsProvider and GoogleContactsProvider -->
+    <skip />
+
+    <!-- This string appears (on two lines) when you type a number into contacts search, to let you dial the phone number you typed.  The first line will be in bigger type than the second. -->
+    <string name="dial_number_using">Dial number\nusing <xliff:g id="number" example="555">%s</xliff:g></string>
+
+    <!-- This string appears (on two lines) when you type a number into contacts search, to let you create a contact whose phone number is the number you typed.  The first line will be in bigger type than the second. -->
+    <string name="create_contact_using">Create contact\nusing <xliff:g id="number" example="555">%s</xliff:g></string>
+    
 </resources>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 76824c3..23e9edb 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -312,19 +312,41 @@
         <item name="windowContentOverlay">@null</item>
     </style>
     
-    <!-- Default theme for input methods, which is used by the
-         {@link android.inputmethodservice.InputMethodService} class.
-         this inherits from Theme.NoTitleBar, but makes the background
-         transparent, the window floating and translucent, and ensures that
-         it does not dim the UI behind it.  This also configures the window
-         with the standard IME animations and visuals. -->
-    <style name="Theme.InputMethod" parent="Theme.NoTitleBar">
+    <!-- Default dark theme for panel windows.  This removes all extraneous
+         window decorations, so you basically have an empty rectangle in which
+         to place your content.  It makes the window floating, with a transparent
+         background, and turns off dimming behind the window. -->
+    <style name="Theme.Panel">
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:windowFrame">@null</item>
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:windowIsFloating">true</item>
         <item name="android:backgroundDimEnabled">false</item>
         <item name="android:windowIsTranslucent">true</item>
+        <item name="android:windowNoTitle">true</item>
+    </style>
+
+    <!-- Default light theme for panel windows.  This removes all extraneous
+         window decorations, so you basically have an empty rectangle in which
+         to place your content.  It makes the window floating, with a transparent
+         background, and turns off dimming behind the window. -->
+    <style name="Theme.Light.Panel">
+        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:windowFrame">@null</item>
+        <item name="android:windowContentOverlay">@null</item>
+        <item name="android:windowIsFloating">true</item>
+        <item name="android:backgroundDimEnabled">false</item>
+        <item name="android:windowIsTranslucent">true</item>
+        <item name="android:windowNoTitle">true</item>
+    </style>
+
+    <!-- Default theme for input methods, which is used by the
+         {@link android.inputmethodservice.InputMethodService} class.
+         this inherits from Theme.NoTitleBar, but makes the background
+         transparent, the window floating and translucent, and ensures that
+         it does not dim the UI behind it.  This also configures the window
+         with the standard IME animations and visuals. -->
+    <style name="Theme.InputMethod" parent="Theme.Panel">
         <item name="android:windowAnimationStyle">@android:style/Animation.InputMethod</item>
         <item name="android:imeFullscreenBackground">@android:drawable/input_method_fullscreen_background</item>
         <item name="android:imeExtractEnterAnimation">@android:anim/input_method_extract_enter</item>
@@ -332,12 +354,10 @@
     </style>
 
     <!-- Theme for the search input bar. -->
-    <style name="Theme.SearchBar" parent="Theme.Translucent.NoTitleBar">
-        <item name="android:windowBackground">@android:color/transparent</item>
-        <item name="android:windowFrame">@null</item>
-        <item name="android:windowIsFloating">true</item>
-        <item name="android:windowIsTranslucent">true</item>
+    <style name="Theme.SearchBar" parent="Theme.Panel">
+        <item name="android:backgroundDimEnabled">true</item>
         <item name="android:windowAnimationStyle">@android:style/Animation.SearchBar</item>
+        <item name="windowContentOverlay">@null</item>        
     </style>
 
     <!-- Menu Themes -->
diff --git a/data/fonts/DroidSansJapanese.ttf b/data/fonts/DroidSansJapanese.ttf
new file mode 100755
index 0000000..ca79221
--- /dev/null
+++ b/data/fonts/DroidSansJapanese.ttf
Binary files differ
diff --git a/data/sounds/AudioPackage2.mk b/data/sounds/AudioPackage2.mk
new file mode 100644
index 0000000..5bd301d
--- /dev/null
+++ b/data/sounds/AudioPackage2.mk
@@ -0,0 +1,92 @@
+#
+# Audio Package 2
+# 
+# Include this file in a product makefile to include these audio files
+#
+# This is a larger package of sounds than the 1.0 release for devices
+# that have larger internal flash.
+# 
+
+local_path:= frameworks/base/data/sounds
+
+PRODUCT_COPY_FILES += \
+	$(local_path)/F1_MissedCall.ogg:system/media/audio/notifications/F1_MissedCall.ogg \
+	$(local_path)/F1_New_MMS.ogg:system/media/audio/notifications/F1_New_MMS.ogg \
+	$(local_path)/F1_New_SMS.ogg:system/media/audio/notifications/F1_New_SMS.ogg \
+	$(local_path)/Alarm_Buzzer.ogg:system/media/audio/alarms/Alarm_Buzzer.ogg \
+	$(local_path)/Alarm_Beep_01.ogg:system/media/audio/alarms/Alarm_Beep_01.ogg \
+	$(local_path)/Alarm_Beep_02.ogg:system/media/audio/alarms/Alarm_Beep_02.ogg \
+	$(local_path)/Alarm_Classic.ogg:system/media/audio/alarms/Alarm_Classic.ogg \
+	$(local_path)/Alarm_Beep_03.ogg:system/media/audio/alarms/Alarm_Beep_03.ogg \
+	$(local_path)/Alarm_Rooster_02.ogg:system/media/audio/alarms/Alarm_Rooster_02.ogg \
+	$(local_path)/Ring_Classic_02.ogg:system/media/audio/ringtones/Ring_Classic_02.ogg \
+	$(local_path)/Ring_Digital_02.ogg:system/media/audio/ringtones/Ring_Digital_02.ogg \
+	$(local_path)/Ring_Synth_04.ogg:system/media/audio/ringtones/Ring_Synth_04.ogg \
+	$(local_path)/Ring_Synth_02.ogg:system/media/audio/ringtones/Ring_Synth_02.ogg \
+	$(local_path)/newwavelabs/BeatPlucker.ogg:system/media/audio/ringtones/BeatPlucker.ogg \
+	$(local_path)/newwavelabs/BentleyDubs.ogg:system/media/audio/ringtones/BentleyDubs.ogg \
+	$(local_path)/newwavelabs/BirdLoop.ogg:system/media/audio/ringtones/BirdLoop.ogg \
+	$(local_path)/newwavelabs/CaribbeanIce.ogg:system/media/audio/ringtones/CaribbeanIce.ogg \
+	$(local_path)/newwavelabs/CurveBall.ogg:system/media/audio/ringtones/CurveBall.ogg \
+	$(local_path)/newwavelabs/EtherShake.ogg:system/media/audio/ringtones/EtherShake.ogg \
+	$(local_path)/newwavelabs/FriendlyGhost.ogg:system/media/audio/ringtones/FriendlyGhost.ogg \
+	$(local_path)/newwavelabs/GameOverGuitar.ogg:system/media/audio/ringtones/GameOverGuitar.ogg \
+	$(local_path)/newwavelabs/Growl.ogg:system/media/audio/ringtones/Growl.ogg \
+	$(local_path)/newwavelabs/InsertCoin.ogg:system/media/audio/ringtones/InsertCoin.ogg \
+	$(local_path)/newwavelabs/LoopyLounge.ogg:system/media/audio/ringtones/LoopyLounge.ogg \
+	$(local_path)/newwavelabs/LoveFlute.ogg:system/media/audio/ringtones/LoveFlute.ogg \
+	$(local_path)/newwavelabs/MidEvilJaunt.ogg:system/media/audio/ringtones/MidEvilJaunt.ogg \
+	$(local_path)/newwavelabs/MildlyAlarming.ogg:system/media/audio/ringtones/MildlyAlarming.ogg \
+	$(local_path)/newwavelabs/NewPlayer.ogg:system/media/audio/ringtones/NewPlayer.ogg \
+	$(local_path)/newwavelabs/Noises1.ogg:system/media/audio/ringtones/Noises1.ogg \
+	$(local_path)/newwavelabs/Noises2.ogg:system/media/audio/ringtones/Noises2.ogg \
+	$(local_path)/newwavelabs/Noises3.ogg:system/media/audio/ringtones/Noises3.ogg \
+	$(local_path)/newwavelabs/OrganDub.ogg:system/media/audio/ringtones/OrganDub.ogg \
+	$(local_path)/newwavelabs/RomancingTheTone.ogg:system/media/audio/ringtones/RomancingTheTone.ogg \
+	$(local_path)/newwavelabs/SitarVsSitar.ogg:system/media/audio/ringtones/SitarVsSitar.ogg \
+	$(local_path)/newwavelabs/SpringyJalopy.ogg:system/media/audio/ringtones/SpringyJalopy.ogg \
+	$(local_path)/newwavelabs/Terminated.ogg:system/media/audio/ringtones/Terminated.ogg \
+	$(local_path)/newwavelabs/TwirlAway.ogg:system/media/audio/ringtones/TwirlAway.ogg \
+	$(local_path)/newwavelabs/VeryAlarmed.ogg:system/media/audio/ringtones/VeryAlarmed.ogg \
+	$(local_path)/newwavelabs/World.ogg:system/media/audio/ringtones/World.ogg \
+	$(local_path)/newwavelabs/CaffeineSnake.ogg:system/media/audio/notifications/CaffeineSnake.ogg \
+	$(local_path)/newwavelabs/DearDeer.ogg:system/media/audio/notifications/DearDeer.ogg \
+	$(local_path)/newwavelabs/DontPanic.ogg:system/media/audio/notifications/DontPanic.ogg \
+	$(local_path)/newwavelabs/Highwire.ogg:system/media/audio/notifications/Highwire.ogg \
+	$(local_path)/newwavelabs/KzurbSonar.ogg:system/media/audio/notifications/KzurbSonar.ogg \
+	$(local_path)/newwavelabs/OnTheHunt.ogg:system/media/audio/notifications/OnTheHunt.ogg \
+	$(local_path)/newwavelabs/Voila.ogg:system/media/audio/notifications/Voila.ogg \
+	$(local_path)/notifications/Beat_Box_Android.ogg:system/media/audio/notifications/Beat_Box_Android.ogg \
+	$(local_path)/notifications/Heaven.ogg:system/media/audio/notifications/Heaven.ogg \
+	$(local_path)/notifications/TaDa.ogg:system/media/audio/notifications/TaDa.ogg \
+	$(local_path)/notifications/Tinkerbell.ogg:system/media/audio/notifications/Tinkerbell.ogg \
+	$(local_path)/effects/Effect_Tick.ogg:system/media/audio/ui/Effect_Tick.ogg \
+	$(local_path)/effects/KeypressStandard.ogg:system/media/audio/ui/KeypressStandard.ogg \
+	$(local_path)/effects/KeypressSpacebar.ogg:system/media/audio/ui/KeypressSpacebar.ogg \
+	$(local_path)/effects/KeypressDelete.ogg:system/media/audio/ui/KeypressDelete.ogg \
+	$(local_path)/effects/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg \
+	$(local_path)/effects/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \
+	$(local_path)/effects/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
+	$(local_path)/newwavelabs/CrazyDream.ogg:system/media/audio/ringtones/CrazyDream.ogg \
+	$(local_path)/newwavelabs/DreamTheme.ogg:system/media/audio/ringtones/DreamTheme.ogg \
+	$(local_path)/newwavelabs/Big_Easy.ogg:system/media/audio/ringtones/Big_Easy.ogg \
+	$(local_path)/newwavelabs/Bollywood.ogg:system/media/audio/ringtones/Bollywood.ogg \
+	$(local_path)/newwavelabs/Cairo.ogg:system/media/audio/ringtones/Cairo.ogg \
+	$(local_path)/newwavelabs/Calypso_Steel.ogg:system/media/audio/ringtones/Calypso_Steel.ogg \
+	$(local_path)/newwavelabs/Champagne_Edition.ogg:system/media/audio/ringtones/Champagne_Edition.ogg \
+	$(local_path)/newwavelabs/Club_Cubano.ogg:system/media/audio/ringtones/Club_Cubano.ogg \
+	$(local_path)/newwavelabs/Eastern_Sky.ogg:system/media/audio/ringtones/Eastern_Sky.ogg \
+	$(local_path)/newwavelabs/Funk_Yall.ogg:system/media/audio/ringtones/Funk_Yall.ogg \
+	$(local_path)/newwavelabs/Savannah.ogg:system/media/audio/ringtones/Savannah.ogg \
+	$(local_path)/newwavelabs/Gimme_Mo_Town.ogg:system/media/audio/ringtones/Gimme_Mo_Town.ogg \
+	$(local_path)/newwavelabs/Glacial_Groove.ogg:system/media/audio/ringtones/Glacial_Groove.ogg \
+	$(local_path)/newwavelabs/Seville.ogg:system/media/audio/ringtones/Seville.ogg \
+	$(local_path)/newwavelabs/No_Limits.ogg:system/media/audio/ringtones/No_Limits.ogg \
+	$(local_path)/newwavelabs/Revelation.ogg:system/media/audio/ringtones/Revelation.ogg \
+	$(local_path)/newwavelabs/Paradise_Island.ogg:system/media/audio/ringtones/Paradise_Island.ogg \
+	$(local_path)/newwavelabs/Road_Trip.ogg:system/media/audio/ringtones/Road_Trip.ogg \
+	$(local_path)/newwavelabs/Shes_All_That.ogg:system/media/audio/ringtones/Shes_All_That.ogg \
+	$(local_path)/newwavelabs/Steppin_Out.ogg:system/media/audio/ringtones/Steppin_Out.ogg \
+	$(local_path)/newwavelabs/Third_Eye.ogg:system/media/audio/ringtones/Third_Eye.ogg \
+	$(local_path)/newwavelabs/Thunderfoot.ogg:system/media/audio/ringtones/Thunderfoot.ogg
+
diff --git a/data/sounds/OriginalAudio.mk b/data/sounds/OriginalAudio.mk
index 8722983..291f0b6 100644
--- a/data/sounds/OriginalAudio.mk
+++ b/data/sounds/OriginalAudio.mk
@@ -64,5 +64,7 @@
 	$(LOCAL_PATH)/effects/KeypressSpacebar.ogg:system/media/audio/ui/KeypressSpacebar.ogg \
 	$(LOCAL_PATH)/effects/KeypressDelete.ogg:system/media/audio/ui/KeypressDelete.ogg \
 	$(LOCAL_PATH)/effects/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg \
+	$(LOCAL_PATH)/effects/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \
+	$(LOCAL_PATH)/effects/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
 	$(LOCAL_PATH)/newwavelabs/CrazyDream.ogg:system/media/audio/ringtones/CrazyDream.ogg \
 	$(LOCAL_PATH)/newwavelabs/DreamTheme.ogg:system/media/audio/ringtones/DreamTheme.ogg
diff --git a/data/sounds/effects/VideoRecord.ogg b/data/sounds/effects/VideoRecord.ogg
new file mode 100644
index 0000000..54febbf
--- /dev/null
+++ b/data/sounds/effects/VideoRecord.ogg
Binary files differ
diff --git a/data/sounds/effects/VideoRecord.wav b/data/sounds/effects/VideoRecord.wav
new file mode 100644
index 0000000..0f70e58
--- /dev/null
+++ b/data/sounds/effects/VideoRecord.wav
Binary files differ
diff --git a/data/sounds/effects/camera_click.ogg b/data/sounds/effects/camera_click.ogg
new file mode 100644
index 0000000..0a769ff
--- /dev/null
+++ b/data/sounds/effects/camera_click.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Big_Easy.ogg b/data/sounds/newwavelabs/Big_Easy.ogg
new file mode 100644
index 0000000..277dd96
--- /dev/null
+++ b/data/sounds/newwavelabs/Big_Easy.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Big_Easy.wav b/data/sounds/newwavelabs/Big_Easy.wav
new file mode 100644
index 0000000..b83926a
--- /dev/null
+++ b/data/sounds/newwavelabs/Big_Easy.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Bollywood.ogg b/data/sounds/newwavelabs/Bollywood.ogg
new file mode 100644
index 0000000..b393dd4
--- /dev/null
+++ b/data/sounds/newwavelabs/Bollywood.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Bollywood.wav b/data/sounds/newwavelabs/Bollywood.wav
new file mode 100644
index 0000000..c6234bd
--- /dev/null
+++ b/data/sounds/newwavelabs/Bollywood.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Cairo.ogg b/data/sounds/newwavelabs/Cairo.ogg
new file mode 100644
index 0000000..d90d3b4
--- /dev/null
+++ b/data/sounds/newwavelabs/Cairo.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Cairo.wav b/data/sounds/newwavelabs/Cairo.wav
new file mode 100644
index 0000000..3a853d8
--- /dev/null
+++ b/data/sounds/newwavelabs/Cairo.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Calypso_Steel.ogg b/data/sounds/newwavelabs/Calypso_Steel.ogg
new file mode 100644
index 0000000..8e07da1
--- /dev/null
+++ b/data/sounds/newwavelabs/Calypso_Steel.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Calypso_Steel.wav b/data/sounds/newwavelabs/Calypso_Steel.wav
new file mode 100644
index 0000000..9c823d2
--- /dev/null
+++ b/data/sounds/newwavelabs/Calypso_Steel.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Champagne_Edition.ogg b/data/sounds/newwavelabs/Champagne_Edition.ogg
new file mode 100644
index 0000000..0ba8be5
--- /dev/null
+++ b/data/sounds/newwavelabs/Champagne_Edition.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Champagne_Edition.wav b/data/sounds/newwavelabs/Champagne_Edition.wav
new file mode 100644
index 0000000..1ccada3
--- /dev/null
+++ b/data/sounds/newwavelabs/Champagne_Edition.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Club_Cubano.ogg b/data/sounds/newwavelabs/Club_Cubano.ogg
new file mode 100644
index 0000000..5d09db1
--- /dev/null
+++ b/data/sounds/newwavelabs/Club_Cubano.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Club_Cubano.wav b/data/sounds/newwavelabs/Club_Cubano.wav
new file mode 100644
index 0000000..08557b8
--- /dev/null
+++ b/data/sounds/newwavelabs/Club_Cubano.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Eastern_Sky.ogg b/data/sounds/newwavelabs/Eastern_Sky.ogg
new file mode 100644
index 0000000..c0cf74c
--- /dev/null
+++ b/data/sounds/newwavelabs/Eastern_Sky.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Eastern_Sky.wav b/data/sounds/newwavelabs/Eastern_Sky.wav
new file mode 100644
index 0000000..c980792
--- /dev/null
+++ b/data/sounds/newwavelabs/Eastern_Sky.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Funk_Yall.ogg b/data/sounds/newwavelabs/Funk_Yall.ogg
new file mode 100644
index 0000000..5b98643
--- /dev/null
+++ b/data/sounds/newwavelabs/Funk_Yall.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Funk_Yall.wav b/data/sounds/newwavelabs/Funk_Yall.wav
new file mode 100644
index 0000000..0f2eebf
--- /dev/null
+++ b/data/sounds/newwavelabs/Funk_Yall.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Gimme_Mo_Town.ogg b/data/sounds/newwavelabs/Gimme_Mo_Town.ogg
new file mode 100644
index 0000000..a196935
--- /dev/null
+++ b/data/sounds/newwavelabs/Gimme_Mo_Town.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Gimme_Mo_Town.wav b/data/sounds/newwavelabs/Gimme_Mo_Town.wav
new file mode 100644
index 0000000..7adaa78
--- /dev/null
+++ b/data/sounds/newwavelabs/Gimme_Mo_Town.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Glacial_Groove.ogg b/data/sounds/newwavelabs/Glacial_Groove.ogg
new file mode 100644
index 0000000..a0e83e6
--- /dev/null
+++ b/data/sounds/newwavelabs/Glacial_Groove.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Glacial_Groove.wav b/data/sounds/newwavelabs/Glacial_Groove.wav
new file mode 100644
index 0000000..da5702f
--- /dev/null
+++ b/data/sounds/newwavelabs/Glacial_Groove.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/No_Limits.ogg b/data/sounds/newwavelabs/No_Limits.ogg
new file mode 100644
index 0000000..346f2fe
--- /dev/null
+++ b/data/sounds/newwavelabs/No_Limits.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/No_Limits.wav b/data/sounds/newwavelabs/No_Limits.wav
new file mode 100644
index 0000000..800f390
--- /dev/null
+++ b/data/sounds/newwavelabs/No_Limits.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Paradise_Island.ogg b/data/sounds/newwavelabs/Paradise_Island.ogg
new file mode 100644
index 0000000..386bbd3
--- /dev/null
+++ b/data/sounds/newwavelabs/Paradise_Island.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Paradise_Island.wav b/data/sounds/newwavelabs/Paradise_Island.wav
new file mode 100644
index 0000000..3a51c7c
--- /dev/null
+++ b/data/sounds/newwavelabs/Paradise_Island.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Revelation.ogg b/data/sounds/newwavelabs/Revelation.ogg
new file mode 100644
index 0000000..4a240e9
--- /dev/null
+++ b/data/sounds/newwavelabs/Revelation.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Revelation.wav b/data/sounds/newwavelabs/Revelation.wav
new file mode 100644
index 0000000..4b4f073
--- /dev/null
+++ b/data/sounds/newwavelabs/Revelation.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Road_Trip.ogg b/data/sounds/newwavelabs/Road_Trip.ogg
new file mode 100644
index 0000000..cd14ef1
--- /dev/null
+++ b/data/sounds/newwavelabs/Road_Trip.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Road_Trip.wav b/data/sounds/newwavelabs/Road_Trip.wav
new file mode 100644
index 0000000..6f17b08
--- /dev/null
+++ b/data/sounds/newwavelabs/Road_Trip.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Savannah.ogg b/data/sounds/newwavelabs/Savannah.ogg
new file mode 100644
index 0000000..779f3dd
--- /dev/null
+++ b/data/sounds/newwavelabs/Savannah.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Savannah.wav b/data/sounds/newwavelabs/Savannah.wav
new file mode 100644
index 0000000..8d8ada2
--- /dev/null
+++ b/data/sounds/newwavelabs/Savannah.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Seville.ogg b/data/sounds/newwavelabs/Seville.ogg
new file mode 100644
index 0000000..bea926a
--- /dev/null
+++ b/data/sounds/newwavelabs/Seville.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Seville.wav b/data/sounds/newwavelabs/Seville.wav
new file mode 100644
index 0000000..c211823
--- /dev/null
+++ b/data/sounds/newwavelabs/Seville.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Shes_All_That.ogg b/data/sounds/newwavelabs/Shes_All_That.ogg
new file mode 100644
index 0000000..86afbb3
--- /dev/null
+++ b/data/sounds/newwavelabs/Shes_All_That.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Shes_All_That.wav b/data/sounds/newwavelabs/Shes_All_That.wav
new file mode 100644
index 0000000..780936d
--- /dev/null
+++ b/data/sounds/newwavelabs/Shes_All_That.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Steppin_Out.ogg b/data/sounds/newwavelabs/Steppin_Out.ogg
new file mode 100644
index 0000000..5ee5fd1
--- /dev/null
+++ b/data/sounds/newwavelabs/Steppin_Out.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Steppin_Out.wav b/data/sounds/newwavelabs/Steppin_Out.wav
new file mode 100644
index 0000000..5fae6bc
--- /dev/null
+++ b/data/sounds/newwavelabs/Steppin_Out.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Third_Eye.ogg b/data/sounds/newwavelabs/Third_Eye.ogg
new file mode 100644
index 0000000..dd5a9fdf
--- /dev/null
+++ b/data/sounds/newwavelabs/Third_Eye.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Third_Eye.wav b/data/sounds/newwavelabs/Third_Eye.wav
new file mode 100644
index 0000000..cd651cc
--- /dev/null
+++ b/data/sounds/newwavelabs/Third_Eye.wav
Binary files differ
diff --git a/data/sounds/newwavelabs/Thunderfoot.ogg b/data/sounds/newwavelabs/Thunderfoot.ogg
new file mode 100644
index 0000000..5f907a8
--- /dev/null
+++ b/data/sounds/newwavelabs/Thunderfoot.ogg
Binary files differ
diff --git a/data/sounds/newwavelabs/Thunderfoot.wav b/data/sounds/newwavelabs/Thunderfoot.wav
new file mode 100644
index 0000000..bd8b0a3
--- /dev/null
+++ b/data/sounds/newwavelabs/Thunderfoot.wav
Binary files differ
diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd
index befb018..1f62f3d 100644
--- a/docs/html/guide/topics/graphics/2d-graphics.jd
+++ b/docs/html/guide/topics/graphics/2d-graphics.jd
@@ -85,7 +85,10 @@
 <p>In other cases, you may want to handle your image resource as a 
 {@link android.graphics.drawable.Drawable} object.
 To do so, create a Drawable from the resource like so:
-<pre>Drawable myImage = Resources.getDrawable(R.drawable.my_image);</pre>
+<pre>
+Resources res = mContext.getResources();
+Drawable myImage = res.getDrawable(R.drawable.my_image);
+</pre>
 
 <p class="caution"><strong>Caution:</strong> Each unique resource in your project can maintain only one
 state, no matter how many different objects you may instantiate for it. For example, if you instantiate two
diff --git a/docs/html/sdk/1.5_r1/index.jd b/docs/html/sdk/1.5_r1/index.jd
new file mode 100644
index 0000000..345489a
--- /dev/null
+++ b/docs/html/sdk/1.5_r1/index.jd
@@ -0,0 +1,62 @@
+page.title=Android 1.5 SDK, Release 1
+
+sdk.version=1.5_r1
+sdk.date=April 2009
+
+sdk.win_download=android-sdk-windows-1.5_r1.zip
+sdk.win_bytes=
+sdk.win_checksum=
+
+sdk.mac_download=android-sdk-mac_x86-1.5_r1.zip
+sdk.mac_bytes=
+sdk.mac_checksum=
+
+sdk.linux_download=android-sdk-linux_x86-1.5_r1.zip
+sdk.linux_bytes=
+sdk.linux_checksum=
+
+
+@jd:body
+
+<h2>SDK Contents</h2>
+
+<h4>Development tools</h4>
+
+<p>The SDK includes a variety of tools for developing and debugging application code and designing an application UI. You can read about the tools in the  
+<a href="{@docRoot}guide/developing/tools/index.html">Dev Guide</a> and access them in the <code>&lt;sdk&gt;/tools/</code> directory. 
+
+<p>The tools package included in this SDK is the same as that included in the Android 1.0, Release 2 SDK. </p>
+
+<h4 id="system_images">System Images</h4>
+
+<p>The Android system images listed below are included in this SDK. For more information about a system image &mdash; features, applications included, localizations, API changes, and so on &mdash; see its Version Notes. </p>
+
+<table style="margin-right:1em;" width="80%">
+<tr>
+<th><nobr>System Image</nobr></th><th><nobr>API Level</nobr></th><th>Notes</th><th>Description</th>
+</tr>
+
+<tr>
+<td width="5%"><nobr>Android 1.5</nobr></td>
+<td  width="5%">3</td>
+<td  width="5%"><nobr><a href="{@docRoot}sdk/android-1.5.html">Version Notes</a></nobr></td>
+<td>Includes com.google.android.maps external library and a set of standard development applications. </td>
+
+</tr>
+
+</table>
+
+<h4>Sample Code and Applications</h4>
+
+<p>You can look at a variety of tutorials and samples in the <a href="{@docRoot}guide/samples/index.html">Dev Guide</a> and access the sample code itself
+in the <code>&lt;sdk&gt;/samples/</code> directory of the SDK package.</p>
+
+<h4>Documentation</h4>
+
+<p>The SDK package includes a full set of local documentation. To view it, open the <code>&lt;sdk&gt;/documentation.html</code> file in a web browser. If you are developing in an IDE such as Eclipse, you can also view the reference documentation directly in the IDE. </p>
+
+<p>The most current documentation is always available on the Android Developers site:</p>
+
+<p style="margin-left:2em;"><a href="http://developer.android.com/index.html">http://developer.android.com/</a></p>
+
+
diff --git a/docs/html/sdk/1.5_r1/installing.jd b/docs/html/sdk/1.5_r1/installing.jd
new file mode 100644
index 0000000..df9ec3a
--- /dev/null
+++ b/docs/html/sdk/1.5_r1/installing.jd
@@ -0,0 +1,312 @@
+page.title=Installing the Android SDK
+sdk.version=1.5_r1
+
+@jd:body
+
+
+<p>This page describes how to install the Android SDK and set up your
+development environment. If you haven't downloaded the SDK, you can
+do so from the 
+<a href="{@docRoot}sdk/1.5_r1/index.html">Download</a> page.</p>
+
+<p>If you encounter any problems during installation, see the 
+<a href="#installnotes">Installation Notes</a> at the bottom of
+this page.</p>
+
+<h4 style="margin-top">Upgrading?</h4>
+<p>If you have already developed applications using an earlier version
+of the SDK, please skip this page and read the 
+<a href="{@docRoot}sdk/1.5_r1/upgrading.html"><strong>Upgrading the
+SDK</strong></a></b> document instead.
+</p>
+
+
+<h2 id="setup">Preparing for Installation</h2>
+
+<p>Before you get started with the Android SDK, take a moment to confirm
+that your development machine meets the <a
+href="{@docRoot}sdk/1.5_r1/requirements.html">system requirements</a>.
+</p>
+
+<p>If you will be developing on Eclipse with the Android Development
+Tools (ADT) Plugin &mdash; the recommended path if you are new to
+Android &mdash; make sure that you have a suitable version of Eclipse
+installed on your computer. If you need to install Eclipse, you can
+download it from this location: </p>
+
+<p style="margin-left:2em;"><a href=
+"http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a
+></p>
+
+<p>A Java or RCP version of Eclipse is recommended. </p>
+
+<h2 id="installingsdk">Installing the SDK</h2>
+
+	<p>After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named  <code>android_sdk_<em>&lt;platform</em>&gt;_<em>&lt;release&gt;</em>_<em>&lt;build&gt;</em></code>. The directory contains a link to a local copy of the documentation and the subdirectories <code>tools/</code>, <code>samples/</code>, and others. </p>
+	
+	<p>Make a note of the name and location of the unpacked SDK directory on your system &mdash; you will need to refer to the SDK directory later, when setting up the Android plugin or using SDK tools. </p>
+
+        <p>Optionally, you can add the path to the SDK <code>tools</code> directory to your path. As mentioned above, the <code>tools/</code> directory is located in the SDK directory. </p>
+     <ul>
+          <li>On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look
+          for a line that sets the PATH environment variable and add the
+          full path to the <code>tools/</code> directory to it. If you don't 
+          see a line setting the path, you can add one:</li>
+
+          <ul><code>export PATH=${PATH}:<em>&lt;your_sdk_dir&gt;</em>/tools</code></ul>
+
+          <li>On a Mac, look in your home directory for .bash_profile and
+          proceed as for Linux. You can create the .bash_profile, if 
+          you haven't already set one up on your machine. </li>
+
+          <li>On Windows, right click on My Computer, and select Properties.  
+        Under the Advanced tab, hit the Environment Variables button, and in the
+        dialog that comes up, double-click on Path under System Variables. Add  the full path to the <code>tools/</code> directory to the path. </li>
+        </ul>
+
+        <p>Adding <code>tools</code> to your path lets you run Android Debug Bridge (adb) and the other command line <a href="{@docRoot}guide/developing/tools/index.html">tools</a> without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.</p>
+
+
+<p>If you will be using the Eclipse IDE as your environment for developing Android applications, continue reading the next
+section in order to install the Android Development Tools plugin and set up Eclipse. If you choose not to use Eclipse, you can 
+develop Android applications using other tools &mdash; read the guide to developing 
+<a href="{@docRoot}guide/developing/other-ide.html">in other IDEs</a>.</p>
+
+
+<h2 id="installingplugin">Installing the ADT Plugin for Eclipse</h2>
+
+<p>Android offers a custom plugin for the Eclipse IDE, called Android
+Development Tools (ADT), that is designed to give you a powerful,
+integrated environment in which to build Android applications. It
+extends the capabilites of Eclipse to let you quickly set up new Android
+projects, create an application UI, add components based on the Android
+Framework API, and debug using the Android SDK tools.</p>
+
+<p>If you are new to Android or want to develop using the Eclipse IDE,
+the ADT plugin will be an essential part of your development
+environment. In general, using Eclipse with ADT is a highly recommended
+approach and is the fastest way to get started. This section describes
+how to install ADT into your Eclipse environment. 
+
+<p>If you prefer to work in a development environment other than Eclipse,
+you do not need to install Eclipse or the ADT Plugin. Instead, you can 
+access the SDK tools directly to build and debug your application. </p>
+
+<p>Once you have Eclipse installed, as described in <a href="#setup">
+Preparing for Installation</a>, follow the steps below to
+download the ADT plugin and install it in your respective Eclipse
+environment. </p>
+
+<table style="font-size:100%">
+<tr><th>Eclipse 3.3 (Europa)</th><th>Eclipse 3.4 (Ganymede)</th></tr>
+<tr>
+<td width="45%">
+<ol>
+    <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Find
+            and Install...</strong>. </li>
+
+    <li>In the dialog that appears, select <strong>Search for new features to install</strong> and click <strong>Next</strong>. </li>
+    <li>Click <strong>New Remote Site</strong>. </li>
+    <li>In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:
+        <pre>https://dl-ssl.google.com/android/eclipse/</pre>
+        <p>Alternatively, you can use http in the Location URL, if you are having 
+         trouble with https (https is preferred for security reasons).</p>
+        <pre>http://dl-ssl.google.com/android/eclipse/</pre>
+        <p>Click <strong>OK</strong>.</p> </li>
+    <li>You should now see the new site added to the search list (and checked).
+        Click <strong>Finish</strong>. </li>
+    <li>In the subsequent Search Results dialog box, select the checkbox for
+    <strong>Android Plugin</strong> &gt; <strong>Developer Tools</strong>.
+    This will check both features:  "Android Developer Tools", and "Android
+    Editors". The Android Editors feature is optional, but recommended.  If
+    you choose to install it, you need the WST plugin mentioned earlier in this
+    page. Click <strong>Next</strong>. </li>
+    <li>Read the license agreement and then select <strong>Accept terms of the license agreement</strong>. 
+     Click <strong>Next</strong>. </li>
+    <li>Click <strong>Finish</strong>. </li>
+
+    <li>The ADT plugin is not signed; you can accept the installation anyway
+        by clicking <strong>Install All</strong>. </li>
+    <li>Restart Eclipse. </li>
+</ol>
+
+</td>
+<td>
+
+<ol>
+    <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Software Updates...</strong>.
+    </li>
+    <li>In the dialog that appears, click the <strong>Available Software</strong> tab.
+    </li>
+    <li>Click <strong>Add Site...</strong>
+    </li>
+    <li>Enter this as the Location:
+      <pre>https://dl-ssl.google.com/android/eclipse/</pre>
+      <p>Alternatively, you can use http in the Location URL, if you are having 
+         trouble with https (https is preferred for security reasons).</p>
+      <pre>http://dl-ssl.google.com/android/eclipse/</pre>
+      <p>Click <strong>OK</strong>.</p></li>
+    <li>Back in the Available Software view, you should see the plugin. Select the checkbox next to 
+      <em>Developer Tools</em>  and click <strong>Install...</strong>
+    </li>
+    <li>On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked. 
+    The Android Editors feature is optional, but recommended.  If
+    you choose to install it, you need the WST plugin mentioned earlier in this
+    page. Click <strong>Next</strong>.
+     </li>
+    <li>Accept the license agreement and click <strong>Finish</strong>.</li>
+    <li>Restart Eclipse. </li>
+</ol>
+
+</td>
+</tr>
+</table>
+
+<p>Now, you just need to modify your Eclipse preferences to point to the Android SDK directory:</p>
+<ol>
+    <li>Select <strong>Window</strong> &gt; <strong>Preferences...</strong> to open the Preferences
+        panel. (Mac OS X: <strong>Eclipse</strong> &gt; <strong>Preferences</strong>) </li>
+    <li>Select <strong>Android</strong> from the left panel. </li>
+    <li>For the SDK Location in the main panel, click <strong>Browse...</strong> and locate the SDK directory. </li>
+    <li>Click <strong>Apply</strong>, then <strong>OK</strong>.</li>
+</ol>
+
+<p>Done! If you haven't encountered any problems, then you're ready to
+begin developing Android applications. See the <a href="#next">After 
+Installation: Next Steps</a> section for suggestions on how to start. </p>
+
+
+<h3 id="troubleshooting">Troubleshooting ADT Installation</h3>
+<p> 
+If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions: </p>
+
+<ul>
+	<li>If Eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use http, rather than https. That is, set the Location for the remote site to:
+        <pre>http://dl-ssl.google.com/android/eclipse/</pre></li>
+	<li>If you are behind a firewall (such as a corporate firewall), make
+        sure that you have properly configured your proxy settings in Eclipse.
+        In Eclipse 3.3/3.4, you can configure proxy information from the main
+        Eclipse menu in <strong>Window</strong> (on Mac, <strong>Eclipse</strong>) &gt; <strong>Preferences</strong> &gt; <strong>General</strong> &gt; <strong>Network Connections</strong>.</li>
+</ul>
+<p> 
+If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT files to your local machine using a browser and the install the files in Eclipse from there:
+</p>
+<ol>
+<li><a href="{@docRoot}sdk/adt_download.html">Download the ADT zip file</a> (do not unpack it).
+<li>Follow steps 1 and 2 in the default install instructions (above).
+<li>In Eclipse 3.3, click <strong>New Archive Site...</strong>. <br/>
+    In Eclipse 3.4, click <strong>Add Site...</strong>, then <strong>Archive...</strong>
+<li>Browse and select the downloaded the zip file.
+<li>Follow the remaining procedures, above, starting from steps 5.
+</ol>
+<p> 
+Note that to update your plugin, you will have to follow these steps again instead of the default update instructions.</p>
+
+<p>Note that the "Android Editors" feature of ADT requires several optional 
+Eclipse components (for example, WST). If you encounter an error when 
+installing ADT, your Eclipse installion might not include those components. 
+For information about how to quickly add the necessary components to your 
+Eclipse installation, see the troubleshooting topic 
+<a href="{@docRoot}guide/appendix/faq/troubleshooting.html#installeclipsecomponents">ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui"</a>.</p>
+
+<h4>For Linux users</h4>
+<p>If you encounter this error when installing the ADT Plugin for Eclipse: 
+<pre>
+An error occurred during provisioning.
+Cannot connect to keystore.
+JKS</pre>
+<p>
+...then your development machine lacks a suitable Java VM. Installing Sun
+Java 6 will resolve this issue and you can then reinstall the ADT
+Plugin.</p>
+
+
+<h2 id="next">After Installation: Next Steps</h2>
+<p>Once you have installed the SDK and the ADT Plugin, you are ready to
+begin developing applications. Here are a few ways you can get started: </p>
+
+<p><strong>Learn about Android</strong></p>
+<ul>
+<li>Take a look at the <a href="{@docRoot}guide/index.html">Dev
+Guide</a> and the types of information it provides</li>
+<li>Read an introduction to Android as a platform in <a
+href="{@docRoot}guide/basics/what-is-android.html">What is
+Android?</a></li>
+<li>Learn about the Android framework and how applications run on it in
+<a href="{@docRoot}guide/topics/fundamentals.html">Application
+Fundamentals</a></li>
+<li>Take a look at the Android framework API specification in the <a
+href="{@docRoot}reference/index.html">Reference</a> tab</li>
+</ul>
+
+<p><strong>Explore the SDK</strong></p>
+<ul>
+<li>Get an overview of the <a
+href="{@docRoot}guide/development/tools/index.html">development
+tools</a> that are available to you</li>
+<li>Read the overviews of how to develop <a
+href="{@docRoot}guide/developing/eclipse-adt.html">in Eclipse/ADT</a> or
+<a href="{@docRoot}guide/developing/other-ide.html">in other IDEs</a>
+</li>
+</ul>
+
+<p><strong>Explore some code</strong></p>
+<ul>
+<li>Set up a <a href="{@docRoot}guide/tutorials/hello-world.html">Hello
+World application</a></li>
+<li>Follow the <a href="{@docRoot}guide/tutorials/notepad/index.html">
+Notepad Tutorial</a> to build a full Android application </li>
+<li>Create a new project for one of the other sample applications
+included in <code>&lt;sdk&gt;/samples</code>, then compile and run it in
+your development environment</li>
+</ul>
+
+<p><strong>Visit the Android developer groups</strong></p>
+<ul>
+<li>Take a look at the <a
+href="{@docRoot}community/index.html">Community</a> tab to see a list of
+Android developers groups. In particular, you might want to look at the
+<a href="http://groups.google.com/group/android-developers">Android
+Developers</a> group to get a sense for what the Android developer
+community is like.</li>
+</ul>
+
+
+<h2 id="installnotes">Installation Notes</h2>
+<h4>Ubuntu Linux Notes</h4>
+<ul>
+    <li>If you need help installing and configuring Java on your
+development machine, you might find these resources helpful: 
+        <ul>
+           <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li>
+           <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation </a></li>
+       </ul>
+   </li>
+<li>Here are the steps to install Java and Eclipse, prior to installing
+the Android SDK and ADT Plugin.
+<ol>
+    <li>If you are running a 64-bit distribution on your development
+machine, you need to install the <code>ia32-libs</code> package using
+<code>apt-get:</code>:
+        <pre>apt-get install ia32-libs</pre></li>
+    <li>Next, install Java:
+        <pre>apt-get install sun-java6-bin</pre></li>
+    <li>The Ubuntu package manager does not currently offer an Eclipse 3.3
+    version for download, so we recommend that you download Eclipse from
+eclipse.org (<a
+href="http://www.eclipse.org/downloads/">http://www.eclipse.org/
+downloads/</a>). A Java or RCP version of Eclipse is recommended.</li>
+<li>Follow the steps given in previous sections to install the SDK 
+and the ADT plugin. </li>
+</ol>
+</ul>
+<h4>Other Linux Notes</h4>
+<ul>
+    <li>If JDK is already installed on your development computer, please
+take a moment to make sure that it meets the version requirements listed
+in the <a href="{@docRoot}sdk/1.5_r1/requirements.html">System Requirements</a>.
+In particular, note that some Linux distributions may include JDK 1.4 or Gnu
+Compiler for Java, both of which are not supported for Android development.</li>
+</ul>
+
+
diff --git a/docs/html/sdk/1.5_r1/requirements.jd b/docs/html/sdk/1.5_r1/requirements.jd
new file mode 100644
index 0000000..3f0deca
--- /dev/null
+++ b/docs/html/sdk/1.5_r1/requirements.jd
@@ -0,0 +1,42 @@
+page.title=System Requirements
+
+sdk.version=1.5_r1
+sdk.date=April 2009
+
+@jd:body
+
+<p>The sections below describe the system and software requirements for developing Android applications using the Android SDK tools included in Android 1.5 SDK, Release 1. </p>
+
+<h3>Supported Operating Systems</h3>
+<ul>
+  <li>Windows XP (32-bit) or Vista (32- or 64-bit)</li>
+  <li>Mac OS X 10.4.8 or later (x86 only)</li>
+  <li>Linux (tested on Linux Ubuntu Dapper Drake)</li>
+</ul>
+
+<h3>Supported Development Environments</h3>
+<ul>
+  <li>Eclipse IDE
+    <ul>
+      <li><a href="http://www.eclipse.org/downloads/">Eclipse</a> 3.3 (Europa), 3.4 (Ganymede)
+        <ul>
+        <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included in most Eclipse IDE packages) </li>
+        <li><a href="http://www.eclipse.org/webtools">WST</a> (optional, but needed for the Android Editors feature; included in <a href="http://www.eclipse.org/downloads/moreinfo/compare.php">most Eclipse IDE packages</a>)</li>
+        </ul>
+      </li>     
+      <li><a href="http://java.sun.com/javase/downloads/index.jsp">JDK 5 or JDK 6</a> (JRE alone is not sufficient)</li>
+      <li><a href="installing.html#installingplugin">Android Development Tools plugin</a> (optional)</li>
+      <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
+    </ul>
+  </li>
+  <li>Other development environments or IDEs
+    <ul>
+      <li><a href="http://java.sun.com/javase/downloads/index.jsp">JDK 5 or JDK 6</a> (JRE alone is not sufficient)</li>
+      <li><a href="http://ant.apache.org/">Apache Ant</a> 1.6.5 or later for Linux and Mac, 1.7 or later for Windows</li>
+      <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
+    </ul>
+  </li>
+</ul>
+
+<p class="note"><strong>Note:</strong> If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed above. In
+particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development. </p>
\ No newline at end of file
diff --git a/docs/html/sdk/1.5_r1/upgrading.jd b/docs/html/sdk/1.5_r1/upgrading.jd
new file mode 100644
index 0000000..23cb82c
--- /dev/null
+++ b/docs/html/sdk/1.5_r1/upgrading.jd
@@ -0,0 +1,150 @@
+page.title=Upgrading the SDK
+sdk.version=1.5_r1
+@jd:body
+
+<!--
+<div class="sidebox-wrapper">
+  <div class="sidebox-inner">
+
+     <h2>Useful Links</h2>
+
+      <ul class="noindent">
+        <li><a href="migrating/0.9-1.0/changes-overview.html">Overview of Changes</a>
+		      <p>A high-level look at what's changed in Android, with 
+		       discussion of how the changes may affect your apps.</p></li>
+
+        <li><a href="migrating/0.9-1.0/changes.html">API Diff Report</a> 
+                <p>A detailed report that lists all the specific changes in the latest SDK.</p></li>
+
+        <li><a href="RELEASENOTES.html">Release Notes</a> 
+                <p>Version details, known issues, and resolved issues. </p></li>
+
+        <li><a href="http://groups.google.com/group/android-developers">Android Developers Group</a> 
+            <p>A forum where you can discuss migration issues and learn from other Android developers. </p></li>
+ 
+        <li><a href="http://code.google.com/p/android/issues/list">Android Issue Tracker</a>
+            <p>If you think you may have found a bug, use the issue tracker to report it.</p></li>
+      </ul>
+
+   </div>
+</div>
+-->
+
+<p>This document describes how to move your development environment and existing
+Android applications from an Android 1.0 SDK to the Android 1.5, Release 1 SDK.
+If you are migrating applications from an earlier SDK, please read the upgrading
+document available in the Android 1.0 SDK package.
+</p>
+
+<p>To ensure that your applications are compliant with the Android 1.5 system available 
+on mobile devices, you need to install the Android 1.5 SDK and port your existing Android 
+applications to it. The sections below will guide you through the process.</p>
+
+<h2 id="install-new">Installing the Latest SDK</h2>
+
+<p><a href="{@docRoot}sdk/1.5_r1/index.html">Download the SDK</a> and unpack it into a safe location.</p>
+
+<p>After unpacking the new SDK and saving it an appropriate location, you should:</p>
+
+<ul>
+  <li>Wipe your emulator data. <p>Some data formats have changed since the last
+  SDK release, so any previously saved data in your emulator must be removed. Open a console/terminal
+  and navigate to the <code>/tools</code> directory of your new SDK. Launch the 
+  emulator with the <code>-wipe-data</code> option. 
+  <p>Windows: <code>emulator -wipe-data</code><br/>
+   Mac/Linux: <code>./emulator -wipe-data</code></p>
+  </li>
+  <li>Update your PATH variable (Mac/Linux; optional). <p>If you had previously setup your 
+  PATH variable to point to the SDK tools directory, then you'll need to update it to 
+  point to the new SDK. For example, for a <code>.bashrc</code> or <code>.bash_profile</code> file:
+  <code>export PATH=$PATH:<em>&lt;your_new_sdk_dir></em>/tools</code></p>
+  </li>
+  <li>If (and only if) you are developing using Ant, you will also need to modify 
+  your build.xml properties to point to the new SDK. 
+  <p>Open the <code>default.properties</code> file associated with your build.xml 
+  file (typically located in the same directory). In the default.properties
+  file, update the <code>sdk-folder</code> property with the full path to
+  the new SDK directory.</p></li>
+</ul>
+
+<a name="Updating_the_ADT_plugin" id="Updating_the_ADT_plugin"></a>
+<h2 id="update-plugin">Update your ADT Eclipse Plugin</h2>
+
+<p>If you develop on Eclipse and are migrating from an Android 1.0
+SDK, no update of the ADT plugin is needed &mdash; skip to <a href="#updateEclipsePrefs">Update your Eclipse SDK Preferences</a>. </p>
+
+<p>If you are migrating from an earlier version of the SDK, you will
+need to update the ADT plugin. <p>You may also want to upgrade your 
+ADT plugin when a new version becomes available for your existing version 
+of the SDK.</p>
+
+<p>The steps below describe how to update the ADT plugin to the latest
+version available. </p>
+
+<table style="font-size:100%">
+<tr><th>Eclipse 3.3 (Europa)</th><th>Eclipse 3.4 (Ganymede)</th></tr>
+<tr>
+<td width="50%">
+<ol>
+    <li> Select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Find and Install...</strong>. </li>
+    <li> Select <strong>Search for updates of the currently installed features</strong> and click <strong>Finish</strong>. </li>
+    <li> If any update for ADT is available, select and install. </li>
+    <li> Restart Eclipse.</li>
+</ol>
+<p> Alternatively, </p>
+<ol>
+    <li> Select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Manage Configuration</strong>. </li>
+
+    <li> Navigate down the tree and select <strong>Android Development Tools &lt;version&gt;</strong> </li>
+    <li> Select <strong>Scan for Updates</strong> under <strong>Available Tasks</strong>.</li>
+</ol>
+</td>
+<td>
+<ol>
+    <li>Select <strong>Help</strong> &gt; <strong>Software Updates...</strong></li>
+    <li>Select the <strong>Installed Software</strong> tab.</li>
+    <li>Click <strong>Update...</strong></li>
+    <li>If an update for ADT is available, select it and click <strong>Finish</strong>.</li>
+    <li>Restart Eclipse.</li>
+</ol>
+</td>
+</tr>
+</table>
+
+<h2 id="updateEclipsePrefs">Update your Eclipse SDK Preferences</h2>
+
+<p>The last step is to update your Eclipse preferences to point to the new SDK directory:</p>
+    <ol>
+      <li>Select <strong>Window</strong> > <strong>Preferences...</strong> to open the Preferences panel. (Mac OSX: <strong>Eclipse</strong> > <strong>Preferences</strong>)</li>
+      <li>Select <strong>Android</strong> from the left panel.</li>
+      <li>For the SDK Location in the main panel, click <strong>Browse...</strong> and locate the SDK directory.</li>
+      <li>Click <strong>Apply</strong>, then <strong>OK</strong>.</li>
+    </ol>
+
+<h2 id="migrate">Migrate Your Applications, if Necessary</h2>
+
+<p>If (and only if) you have written apps in an SDK released previous to
+the Android 1.0 SDK, you will need to migrate your applications. After
+installing the new SDK and updating the ADT Plugin (if applicable), you
+may encounter breakages in your application code, due to 
+framework and API changes. You'll need to update your code to match the
+latest APIs.</p>
+
+<p>One way to start is to open your project in Eclipse and see where the ADT
+identifies errors in your application. From there, you can lookup
+specific API changes in the Android 1.0 APIs in the 
+<a href="http://code.google.com/android/migrating/changes-overview.html">
+Overview of Changes</a> and <a href="http://code.google.com/android/migrating/changes.html">
+API Diffs Report</a>.</p>
+
+<p>If you have additional trouble updating your code, visit the 
+<a href="http://groups.google.com/group/android-developers">Android Developers Group</a>
+to seek help from other Android developers.</p>
+
+<p>If you have modified one of the ApiDemos applications and would like to migrate it 
+to the new SDK, note that you will need to uninstall the version of ApiDemos that comes 
+preinstalled in the emulator. For more information, or if you encounter an "reinstallation" 
+error when running or installing ApiDemos, see the troubleshooting topic 
+<a href="{@docRoot}guide/appendix/faq/troubleshooting.html#apidemosreinstall">I can't install ApiDemos 
+apps in my IDE because of a signing error</a> for information about how to solve the problem.</p>
+
diff --git a/docs/html/sdk/android-1.5.jd b/docs/html/sdk/android-1.5.jd
new file mode 100644
index 0000000..55fc4ba
--- /dev/null
+++ b/docs/html/sdk/android-1.5.jd
@@ -0,0 +1,248 @@
+page.title=Android 1.5 Version Notes
+sdk.version=1.5_r1
+sys.date=April 2009
+@jd:body
+
+<p>
+<em>Date:</em> April 2009<br />
+<em>API Level:</em>&nbsp;<strong>3</strong></p>
+
+
+<p>This document provides version notes for the Android 1.5 system image included in the SDK. </p>
+
+<ul>
+<li><a href="#overview">Overview</a>
+<li><a href="#overview">External Libraries</a>
+<li><a href="#comp">Device Compatibility</a>
+<li><a href="#apps">Built-in Applications</a>
+<li><a href="#locs">UI Localizations</a>
+<li><a href="#resolved-issues">Resolved Issues</a>
+<li><a href="#features">New Features</a>
+<li><a href="#api-changes">API Changes</a>
+</ul>
+
+<h2 id="overview">Overview</h2>
+
+<p>The Android 1.5 system image delivered in the SDK is the development
+counterpart to the Android 1.5 production system image, deployable to
+Android-powered handsets starting in February 2009. </p>
+
+<p>The Android 1.5 system image delivers an updated version of the framework
+API. As with previous versions, the Android 1.5 API 
+is assigned an integer identifier &mdash; <strong>3</strong> &mdash; that is
+stored in the system itself. This identifier, called the "API Level", allows the
+system to correctly determine whether an application is compatible with
+the system, prior to installing the application.</p>
+
+<p>Applications can reference a specific API Level value in their
+manifest files, to indicate the minimum version of the Android system
+required to run the application. To reference a minimum API Level, applications 
+can add a <code>minSdkVersion</code> attribute in their manifest files.
+The value of the attribute is an integer corresponding to an API Level 
+identifier. Prior to installing an application, the system then checks the value of 
+<code>minSdkVersion</code> and allows the install only
+if the referenced integer is less than or equal to the API Level integer stored
+in the system itself. </p>
+
+<p>If you use the Android 1.5 system image to build an application
+compatible with Android-powered devices running the Android 1.5
+platform, please note that you <strong><span
+style="color:red;">must</span></strong> set the the
+<code>android:minSdkVersion</code> attribute in the application's
+manifest to "3", which is the API strictly associated with Android 1.5.
+</p>
+
+<p>Specifically, you define the <code>android:minSdkVersion</code>
+attribute in a <code>&lt;uses-sdk&gt;</code> element as a child of
+<code>&lt;manifest&gt;</code> in the manifest file. When set, the
+attribute looks like this: </p>
+
+<pre>&lt;manifest&gt;
+  ...
+  &lt;uses-sdk minSdkVersion="3" /&gt;
+  ...
+&lt;/manifest&gt;</pre>
+
+<p>By setting <code>android:minSdkVersion</code> in this way, you ensure
+that users will only be able to install your application if their
+devices are running the Android 1.5 platform. In turn, this ensures that
+your application will function properly on their devices, especially if
+it uses <a href="#apichange">APIs introduced in Android 1.5</a>. </p>
+
+<p>If your application uses APIs introduced in Android 1.5 but does not
+declare <code>&lt;uses-sdk minSdkVersion="3" /&gt;</code>, then it will
+run properly on Android 1.5 devices but <em>not</em> on Android 1.0
+devices. In the latter case, the application will crash at runtime when
+it tries to use the Android 1.5 APIs.</p>
+
+<p>If your application does not use any new APIs introduced in Android
+1.5, you can indicate general Android 1.0 compatibility by removing
+<code>minSdkVersion</code> or setting the attribute to "1". However,
+before publishing your application, you must make sure to compile your
+application against the Android 1.0 system image (available in the
+Android SDK), to ensure that it builds and functions properly for
+Android 1.0 devices. You should test the application against system
+images corresponding to the API Levels that the application is designed
+to be compatible with.</p>
+
+<p>If you are sure your application is not using Android 1.5 APIs and
+has no need to use them, you might find it easier to keep working in the
+Android 1.1 SDK, rather than migrating to the Android 1.5 SDK and having
+to do additional testing. </p>
+
+
+<h2 id="extlibs">External Libraries</h2>
+
+<p>The system image includes these external libraries, which you can
+access from your application by adding a <a
+href="{@docRoot}guide/topics/manifest/uses-library-element.html">
+&lt;uses-library&gt;</a>.</p>
+	<ul>
+	<li>com.google.android.maps &mdash; gives your
+application access to Google Maps data. Note that, to use Google Maps
+data, a Maps API Key is required.</li>
+	</ul>
+
+<h2 id="comp">Device Compatibility</h2>
+
+<p>The Android 1.5 system image was tested for compatability with the
+Android-powered devices listed below:</p>
+	<ul>
+	<li><a href="http://www.t-mobileg1.com">T-Mobile G1</a></li>
+	</ul>
+
+<h2 id="apps">Built-in Applications</h2>
+
+<p>The system image includes these built-in applications:</p>
+	<ul>
+	<li>Alarm Clock</li>
+	<li>API Demos</li>
+	<li>Browser</li>
+	<li>Calculator</li>
+	<li>Camera</li>
+	<li>Contacts</li>
+	<li>Dev Tools</li>
+	<li>Dialer</li>
+	<li>Email</li>
+	<li>Maps (and StreetView)</li>
+	<li>Messaging</li>
+	<li>Music</li>
+	<li>Pictures</li>
+	<li>Settings</li>
+	</ul>
+
+<h2 id="locs">UI Localizations</h2>
+
+<p>The system image provides localized UI strings for the languages
+listed below.</p>
+	<ul>
+	<li>English, US (en_US)</li>
+	<li>German (de) </li>
+	</ul>
+
+<p>Localized UI strings match the locales that are displayable in 
+the emulator, accessible through the device Settings application.</p>
+
+<h2 id="resolved-issues">Resolved Issues</h2>
+<ul>
+<li>AlarmClock alert now plays audio/vibe directly, rather than through
+AlarmManager. AlarmClock alert starts playing audio/vibe in its
+IntentReceiver, rather than on activity start. These changes should
+prevent alarms from being blocked by modal dialogs.</li>
+<li>Fixes to device sleep. </li>
+<li>Single tap no longer opens the in-call dialpad; users now need to
+touch and drag it. </li>
+<li>Fixes a bug causing approximately 1 in 25 outbound messages to
+freeze up the IMAP connection (to a Gmail based server) when transferred
+to the Sent folder.</li>
+<li>Removes automatic account setup entries that were broken or not
+testable. Adds minor fixes to a few of the remaining entries. Makes
+improvements to warning dialogs used for a few special cases.	</li>
+<li>Changes default mail checking interval to every 15 minutes (instead
+of defaulting to "never").</li>
+<li>Fixes password-quoting bugs in IMAP, so that users can include
+special characters in passwords (e.g. spaces).</li>
+<li>Fixes various errors in auto and manual account setup	</li>
+<li>Improves reporting for various connection errors, making it easier
+for the user to diagnose failed account setups.</li>
+<li>Fixes new-mail notifications for POP3 accounts.</li>
+<li>Ensures proper auto-checking of accounts marked as "never
+check".</li>
+<li>Now displays date and time using user preference (e.g. 24 hr vs.
+AM/PM).</li>
+<li>Now shows cc: in message view.</li>
+<li>Improves recovery from POP3 connection failures.</li>
+<li>POP3 parser rules loosened, so the application can work with
+non-compliant email servers.</li>
+</ul>
+
+<h2 id="features">New Features</h2>
+
+<ul>
+<li>Maps: Adds details and reviews when a user does a search on Maps and
+clicks on a business to view its details.</li>
+<li>Dialer: In-call screen timeout default is now longer when using the
+speakerphone.</li>
+<li>Dialer: Adds a "Show dialpad" / "Hide dialpad" item to the in-call
+menu, to make it easier to discover the DTMF dialpad. </li>
+<li>Adds support for saving attachments from MMS</li>
+<li>Adds support for marquee in layouts.</li>
+</ul>
+
+<h2 id="api-changes">API Changes</h2>
+
+<h3>Overview</strong></h3>
+
+<ul>
+<li>Adds annotations for test systems, no actual (non-test) API
+changes.</li>
+<li>Adds a method to allow a process to easily determine its UID.
+<li>Adds support for marquee in layouts.</li>
+<li>Adds new methods for determining padding in views. Useful if you are
+writing your own
+subclasses of {@link android.view.View View}.</li>
+<li>Adds new permissions that allow an application to broadcast an SMS
+or WAP Push message. </li>
+<li>API cleanup: removes protected constructor from
+SDK-bound system images. </li>
+</ul>
+
+<h3>API Change Details</h3>
+
+<table>
+<tr>
+<th>Module or Feature</th><th>Change Description</th>
+</tr>
+<tr><td rowspan="4">Annotations for test systems</td></tr>
+    <tr><td>Added {@link android.test.suitebuilder.annotation.LargeTest LargeTest} annotation.</td></tr>
+    <tr><td>Added {@link android.test.suitebuilder.annotation.MediumTest MediumTest} annotation.</td></tr>
+    <tr><td>Added {@link android.test.suitebuilder.annotation.SmallTest SmallTest} annotation.</td></tr>
+
+<tr><td rowspan="2">Allow a process to easily know its UID.</td></tr>
+    <tr><td>Added public method {@link android.os.Process#myUid} to class {@link android.os.Process android.os.Process}</td></tr>
+
+<tr><td rowspan="6">Padding in views</td></tr>
+    <tr><td>Added public method {@link android.view.View#getBottomPaddingOffset} to class {@link android.view.View android.view.View}.</td></tr>
+    <tr><td>Added public method {@link android.view.View#getLeftPaddingOffset} to class {@link android.view.View android.view.View}.</td></tr>
+    <tr><td>Added public method {@link android.view.View#getRightPaddingOffset} to class {@link android.view.View android.view.View}.</td></tr>
+    <tr><td>Added public method {@link android.view.View#getTopPaddingOffset} to class {@link android.view.View android.view.View}.</td></tr>
+    <tr><td>Added public method {@link android.view.View#isPaddingOffsetRequired} to class {@link android.view.View android.view.View}.</td></tr>
+
+<tr><td rowspan="3">Marquee support</td></tr>
+    <tr><td>Added public method {@link android.widget.TextView#setMarqueeRepeatLimit} to class {@link android.widget.TextView}</td></tr>
+    <tr><td>Added public field {@link android.R.attr#marqueeRepeatLimit android.R.attr.marqueeRepeatLimit}</td></tr>
+
+<tr><td rowspan="3">New permissions</td></tr>
+    <tr><td>Added public field {@link android.Manifest.permission#BROADCAST_SMS android.Manifest.permission.BROADCAST_SMS}</td></tr>
+    <tr><td>Added public field {@link android.Manifest.permission#BROADCAST_WAP_PUSH android.Manifest.permission.BROADCAST_WAP_PUSH}</td></tr>
+
+<tr><td rowspan="2">API cleanup</td></tr>
+    <tr><td>Removed protected constructor java.net.ServerSocket.ServerSocket(java.net.SocketImpl).</td></tr>
+
+</table>
+
+
+
+
+
+
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 9a5a18b..8c7a0a7 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -2,7 +2,7 @@
 <ul>
   <li><?cs 
    if:android.whichdoc != "online" ?>
-    <h2>Android 1.1 SDK, r1</h2><?cs 
+    <h2>Android 1.5 SDK, r1</h2><?cs 
    else ?>
     <h2>Current SDK Release</h2><?cs 
    /if ?>
@@ -22,6 +22,7 @@
   <li>
     <h2>Android System Images</h2>
     <ul>
+      <li><a href="<?cs var:toroot ?>sdk/android-1.5.html">Android 1.5 Version Notes</a></li>
       <li><a href="<?cs var:toroot ?>sdk/android-1.1.html">Android 1.1 Version Notes</a></li>
     </ul>
   </li>
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index ff64855..7164b78 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -335,6 +335,7 @@
     uint32_t                mNotificationFrames;
     uint32_t                mRemainingFrames;
     uint32_t                mMarkerPosition;
+    bool                    mMarkerReached;
     uint32_t                mNewPosition;
     uint32_t                mUpdatePeriod;
 };
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 659f5f8..7645978 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -409,6 +409,7 @@
     int                     mLoopCount;
     uint32_t                mRemainingFrames;
     uint32_t                mMarkerPosition;
+    bool                    mMarkerReached;
     uint32_t                mNewPosition;
     uint32_t                mUpdatePeriod;
 };
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index 58906d1..255a67b 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -173,6 +173,7 @@
     };
 
     sp<IMediaPlayer>            mPlayer;
+    thread_id_t                 mLockThreadId;
     Mutex                       mLock;
     Mutex                       mNotifyLock;
     Condition                   mSignal;
diff --git a/libs/surfaceflinger/BootAnimation.cpp b/libs/surfaceflinger/BootAnimation.cpp
index 2b30336..03edbf3 100644
--- a/libs/surfaceflinger/BootAnimation.cpp
+++ b/libs/surfaceflinger/BootAnimation.cpp
@@ -187,44 +187,20 @@
 }
 
 bool BootAnimation::android() {
-    initTexture(&mAndroid[0], mAssets, "images/android_320x480.png");
-    initTexture(&mAndroid[1], mAssets, "images/boot_robot.png");
-    initTexture(&mAndroid[2], mAssets, "images/boot_robot_glow.png");
-
-    // erase screen
-    glDisable(GL_SCISSOR_TEST);
-    glBindTexture(GL_TEXTURE_2D, mAndroid[0].name);
+    initTexture(&mAndroid[0], mAssets, "images/android-logo-mask.png");
+    initTexture(&mAndroid[1], mAssets, "images/android-logo-shine.png");
 
     // clear screen
+    glDisable(GL_DITHER);
+    glDisable(GL_SCISSOR_TEST);
     glClear(GL_COLOR_BUFFER_BIT);
     eglSwapBuffers(mDisplay, mSurface);
 
     // wait ~1s
-    usleep(800000);
 
-    // fade in
-    glEnable(GL_BLEND);
-    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-    glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-    const int steps = 8;
-    for (int i = 1; i < steps; i++) {
-        float fade = i / float(steps);
-        glColor4f(1, 1, 1, fade * fade);
-        glClear(GL_COLOR_BUFFER_BIT);
-        glDrawTexiOES(0, 0, 0, mAndroid[0].w, mAndroid[0].h);
-        eglSwapBuffers(mDisplay, mSurface);
-    }
-
-    // draw last frame
-    glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-    glDisable(GL_BLEND);
-    glDrawTexiOES(0, 0, 0, mAndroid[0].w, mAndroid[0].h);
-    eglSwapBuffers(mDisplay, mSurface);
-
-    // update rect for the robot
-    const int x = mWidth - mAndroid[1].w - 33;
-    const int y = (mHeight - mAndroid[1].h) / 2 - 1;
-    const Rect updateRect(x, y, x + mAndroid[1].w, y + mAndroid[1].h);
+    const GLint xc = (mWidth  - mAndroid[0].w) / 2;
+    const GLint yc = (mHeight - mAndroid[0].h) / 2;
+    const Rect updateRect(xc, yc, xc + mAndroid[0].w, yc + mAndroid[0].h);
 
     // draw and update only what we need
     mNativeWindowSurface->setSwapRectangle(updateRect.left,
@@ -234,166 +210,31 @@
     glScissor(updateRect.left, mHeight - updateRect.bottom, updateRect.width(),
             updateRect.height());
 
+    // Blend state
+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+
     const nsecs_t startTime = systemTime();
     do {
-        // glow speed and shape
-        nsecs_t time = systemTime() - startTime;
-        float t = ((4.0f / (360.0f * us2ns(16667))) * time);
-        t = t - floorf(t);
-        const float fade = 0.5f + 0.5f * sinf(t * 2 * M_PI);
+        double time = systemTime() - startTime;
+        float t = 4.0f * float(time / us2ns(16667)) / mAndroid[1].w;
+        GLint offset = (1 - (t - floorf(t))) * mAndroid[1].w;
+        GLint x = xc - offset;
 
-        // fade the glow in and out
         glDisable(GL_BLEND);
-        glBindTexture(GL_TEXTURE_2D, mAndroid[2].name);
-        glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-        glColor4f(fade, fade, fade, fade);
-        glDrawTexiOES(updateRect.left, mHeight - updateRect.bottom, 0,
-                updateRect.width(), updateRect.height());
-
-        // draw the robot
-        glEnable(GL_BLEND);
         glBindTexture(GL_TEXTURE_2D, mAndroid[1].name);
-        glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-        glDrawTexiOES(updateRect.left, mHeight - updateRect.bottom, 0,
-                updateRect.width(), updateRect.height());
+        glDrawTexiOES(x,                 yc, 0, mAndroid[1].w, mAndroid[1].h);
+        glDrawTexiOES(x + mAndroid[1].w, yc, 0, mAndroid[1].w, mAndroid[1].h);
 
-        // make sure sleep a lot to not take too much CPU away from 
-        // the boot process. With this "glow" animation there is no
-        // visible difference. 
-        usleep(16667 * 4);
+        glEnable(GL_BLEND);
+        glBindTexture(GL_TEXTURE_2D, mAndroid[0].name);
+        glDrawTexiOES(xc, yc, 0, mAndroid[0].w, mAndroid[0].h);
 
         eglSwapBuffers(mDisplay, mSurface);
     } while (!exitPending());
 
     glDeleteTextures(1, &mAndroid[0].name);
     glDeleteTextures(1, &mAndroid[1].name);
-    glDeleteTextures(1, &mAndroid[2].name);
-    return false;
-}
-
-bool BootAnimation::cylon() {
-    // initialize the textures...
-    initTexture(&mLeftTrail, mAssets, "images/cylon_left.png");
-    initTexture(&mRightTrail, mAssets, "images/cylon_right.png");
-    initTexture(&mBrightSpot, mAssets, "images/cylon_dot.png");
-
-    int w = mWidth;
-    int h = mHeight;
-
-    const Point c(w / 2, h / 2);
-    const GLint amplitude = 60;
-    const int scx = c.x - amplitude - mBrightSpot.w / 2;
-    const int scy = c.y - mBrightSpot.h / 2;
-    const int scw = amplitude * 2 + mBrightSpot.w;
-    const int sch = mBrightSpot.h;
-    const Rect updateRect(scx, h - scy - sch, scx + scw, h - scy);
-
-    // erase screen
-    glDisable(GL_SCISSOR_TEST);
-    glClear(GL_COLOR_BUFFER_BIT);
-
-    eglSwapBuffers(mDisplay, mSurface);
-
-    glClear(GL_COLOR_BUFFER_BIT);
-
-    mNativeWindowSurface->setSwapRectangle(updateRect.left,
-            updateRect.top, updateRect.width(), updateRect.height());
-
-    glEnable(GL_SCISSOR_TEST);
-    glEnable(GL_BLEND);
-    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-
-    // clear the screen to white
-    Point p;
-    float t = 0;
-    float alpha = 1.0f;
-    const nsecs_t startTime = systemTime();
-    nsecs_t fadeTime = 0;
-
-    do {
-        // Set scissor in interesting area
-        glScissor(scx, scy, scw, sch);
-
-        // erase screen
-        glClear(GL_COLOR_BUFFER_BIT);
-
-        // compute wave
-        const float a = (t * 2 * M_PI) - M_PI / 2;
-        const float sn = sinf(a);
-        const float cs = cosf(a);
-        GLint x = GLint(amplitude * sn);
-        float derivative = cs;
-
-        glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
-        if (derivative > 0) {
-            // vanishing trail...
-            p.x = (-amplitude + c.x) - mBrightSpot.w / 2;
-            p.y = c.y - mLeftTrail.h / 2;
-            float fade = 2.0f * (0.5f - t);
-            //fade *= fade;
-            glColor4f(fade, fade, fade, fade);
-            glBindTexture(GL_TEXTURE_2D, mLeftTrail.name);
-            glDrawTexiOES(p.x, p.y, 0, mLeftTrail.w, mLeftTrail.h);
-
-            // trail...
-            p.x = (x + c.x) - (mRightTrail.w + mBrightSpot.w / 2) + 16;
-            p.y = c.y - mRightTrail.h / 2;
-            fade = t < 0.25f ? t * 4.0f : 1.0f;
-            fade *= fade;
-            glColor4f(fade, fade, fade, fade);
-            glBindTexture(GL_TEXTURE_2D, mRightTrail.name);
-            glDrawTexiOES(p.x, p.y, 0, mRightTrail.w, mRightTrail.h);
-        } else {
-            // vanishing trail..
-            p.x = (amplitude + c.x) - (mRightTrail.w + mBrightSpot.w / 2) + 16;
-            p.y = c.y - mRightTrail.h / 2;
-            float fade = 2.0f * (0.5f - (t - 0.5f));
-            //fade *= fade;
-            glColor4f(fade, fade, fade, fade);
-            glBindTexture(GL_TEXTURE_2D, mRightTrail.name);
-            glDrawTexiOES(p.x, p.y, 0, mRightTrail.w, mRightTrail.h);
-
-            // trail...
-            p.x = (x + c.x) - mBrightSpot.w / 2;
-            p.y = c.y - mLeftTrail.h / 2;
-            fade = t < 0.5f + 0.25f ? (t - 0.5f) * 4.0f : 1.0f;
-            fade *= fade;
-            glColor4f(fade, fade, fade, fade);
-            glBindTexture(GL_TEXTURE_2D, mLeftTrail.name);
-            glDrawTexiOES(p.x, p.y, 0, mLeftTrail.w, mLeftTrail.h);
-        }
-
-        const Point p(x + c.x - mBrightSpot.w / 2, c.y - mBrightSpot.h / 2);
-        glBindTexture(GL_TEXTURE_2D, mBrightSpot.name);
-        glColor4f(1, 0.5, 0.5, 1);
-        glDrawTexiOES(p.x, p.y, 0, mBrightSpot.w, mBrightSpot.h);
-
-        // update animation
-        nsecs_t time = systemTime() - startTime;
-        t = ((4.0f / (360.0f * us2ns(16667))) * time);
-        t = t - floorf(t);
-
-        eglSwapBuffers(mDisplay, mSurface);
-
-        if (exitPending()) {
-            if (fadeTime == 0) {
-                fadeTime = time;
-            }
-            time -= fadeTime;
-            alpha = 1.0f - ((float(time) * 6.0f) / float(s2ns(1)));
-
-            session()->openTransaction();
-            mFlingerSurface->setAlpha(alpha * alpha);
-            session()->closeTransaction();
-        }
-    } while (alpha > 0);
-
-    // cleanup
-    glFinish();
-    glDeleteTextures(1, &mLeftTrail.name);
-    glDeleteTextures(1, &mRightTrail.name);
-    glDeleteTextures(1, &mBrightSpot.name);
     return false;
 }
 
diff --git a/libs/surfaceflinger/BootAnimation.h b/libs/surfaceflinger/BootAnimation.h
index b20cea0..3fb6670 100644
--- a/libs/surfaceflinger/BootAnimation.h
+++ b/libs/surfaceflinger/BootAnimation.h
@@ -62,16 +62,12 @@
 
     status_t initTexture(Texture* texture, AssetManager& asset, const char* name);
     bool android();
-    bool cylon();
 
     sp<SurfaceComposerClient>       mSession;
     AssetManager mAssets;
-    Texture mLeftTrail;
-    Texture mRightTrail;
-    Texture mBrightSpot;
-    Texture mAndroid[3];
-    int     mWidth;
-    int     mHeight;
+    Texture     mAndroid[2];
+    int         mWidth;
+    int         mHeight;
     EGLDisplay  mDisplay;
     EGLDisplay  mContext;
     EGLDisplay  mSurface;
diff --git a/libs/surfaceflinger/LayerOrientationAnim.cpp b/libs/surfaceflinger/LayerOrientationAnim.cpp
index 2b72d7c..5fec325 100644
--- a/libs/surfaceflinger/LayerOrientationAnim.cpp
+++ b/libs/surfaceflinger/LayerOrientationAnim.cpp
@@ -55,6 +55,7 @@
     mOrientationCompleted = false;
     mFirstRedraw = false;
     mLastNormalizedTime = 0;
+    mLastAngle = 0;
     mLastScale = 0;
     mNeedsBlending = false;
 }
@@ -94,10 +95,6 @@
     transparentRegionScreen.clear();
     mTransformed = true;
     mCanUseCopyBit = false;
-    copybit_device_t* copybit = mFlinger->getBlitEngine();
-    if (copybit) { 
-        mCanUseCopyBit = true;
-    }
 }
 
 void LayerOrientationAnim::onOrientationCompleted()
@@ -109,35 +106,33 @@
     mFlinger->invalidateLayerVisibility(this);
 }
 
+const float ROTATION = M_PI * 0.5f;
+const float ROTATION_FACTOR = 1.0f; // 1.0 or 2.0
+const float DURATION = ms2ns(200);
+const float BOUNCES_PER_SECOND = 1.618f;
+const float BOUNCES_AMPLITUDE = (5.0f/180.f) * M_PI;
+
 void LayerOrientationAnim::onDraw(const Region& clip) const
 {
     // Animation...
-    const float MIN_SCALE = 0.5f;
-    const float DURATION = ms2ns(200);
-    const float BOUNCES_PER_SECOND = 1.618f;
-    const float BOUNCES_AMPLITUDE = 1.0f/32.0f;
 
+    // FIXME: works only for portrait framebuffers
+    const Point size(getPhysicalSize());
+    const float TARGET_SCALE = size.x * (1.0f / size.y);
+    
     const nsecs_t now = systemTime();
-    float scale, alpha;
+    float angle, scale, alpha;
     
     if (mOrientationCompleted) {
         if (mFirstRedraw) {
-            mFirstRedraw = false;
-            
             // make a copy of what's on screen
             copybit_image_t image;
             mBitmapIn.getBitmapSurface(&image);
             const DisplayHardware& hw(graphicPlane(0).displayHardware());
             hw.copyBackToImage(image);
-
-            // and erase the screen for this round
-            glDisable(GL_BLEND);
-            glDisable(GL_DITHER);
-            glDisable(GL_SCISSOR_TEST);
-            glClearColor(0,0,0,0);
-            glClear(GL_COLOR_BUFFER_BIT);
             
             // FIXME: code below is gross
+            mFirstRedraw = false; 
             mNeedsBlending = false;
             LayerOrientationAnim* self(const_cast<LayerOrientationAnim*>(this));
             mFlinger->invalidateLayerVisibility(self);
@@ -148,36 +143,39 @@
         const float normalizedTime = (float(now - mFinishTime) / duration);
         if (normalizedTime <= 1.0f) {
             const float squaredTime = normalizedTime*normalizedTime;
+            angle = (ROTATION*ROTATION_FACTOR - mLastAngle)*squaredTime + mLastAngle;
             scale = (1.0f - mLastScale)*squaredTime + mLastScale;
-            alpha = (1.0f - normalizedTime);
-            alpha *= alpha;
-            alpha *= alpha;
+            alpha = normalizedTime;
         } else {
             mAnim->onAnimationFinished();
+            angle = ROTATION;
+            alpha = 1.0f;
             scale = 1.0f;
-            alpha = 0.0f;
         }
     } else {
         const float normalizedTime = float(now - mStartTime) / DURATION;
         if (normalizedTime <= 1.0f) {
             mLastNormalizedTime = normalizedTime;
             const float squaredTime = normalizedTime*normalizedTime;
-            scale = (MIN_SCALE-1.0f)*squaredTime + 1.0f;
-            alpha = 1.0f;
+            angle = ROTATION * squaredTime;
+            scale = (TARGET_SCALE - 1.0f)*squaredTime + 1.0f;
+            alpha = 0;
         } else {
             mLastNormalizedTime = 1.0f;
             const float to_seconds = DURATION / seconds(1);
             const float phi = BOUNCES_PER_SECOND * 
-                    (((normalizedTime - 1.0f) * to_seconds)*M_PI*2);
-            scale = MIN_SCALE + BOUNCES_AMPLITUDE * (1.0f - cosf(phi));
-            alpha = 1.0f;
+            (((normalizedTime - 1.0f) * to_seconds)*M_PI*2);
+            angle = ROTATION + BOUNCES_AMPLITUDE * sinf(phi);
+            scale = TARGET_SCALE;
+            alpha = 0;
         }
+        mLastAngle = angle;
         mLastScale = scale;
     }
-    drawScaled(scale, alpha);
+    drawScaled(angle, scale, alpha);
 }
 
-void LayerOrientationAnim::drawScaled(float f, float alpha) const
+void LayerOrientationAnim::drawScaled(float f, float s, float alpha) const
 {
     copybit_image_t dst;
     const GraphicPlane& plane(graphicPlane(0));
@@ -187,98 +185,83 @@
     // clear screen
     // TODO: with update on demand, we may be able 
     // to not erase the screen at all during the animation 
-    if (!mOrientationCompleted) {
-        glDisable(GL_BLEND);
-        glDisable(GL_DITHER);
-        glDisable(GL_SCISSOR_TEST);
-        glClearColor(0,0,0,0);
-        glClear(GL_COLOR_BUFFER_BIT);
-    }
+    glDisable(GL_BLEND);
+    glDisable(GL_DITHER);
+    glDisable(GL_SCISSOR_TEST);
+    glClearColor(0,0,0,0);
+    glClear(GL_COLOR_BUFFER_BIT);
     
-    const int w = dst.w*f; 
-    const int h = dst.h*f; 
-    const int xc = uint32_t(dst.w-w)/2;
-    const int yc = uint32_t(dst.h-h)/2;
-    const copybit_rect_t drect = { xc, yc, xc+w, yc+h }; 
+    const int w = dst.w; 
+    const int h = dst.h; 
 
     copybit_image_t src;
     mBitmap.getBitmapSurface(&src);
     const copybit_rect_t srect = { 0, 0, src.w, src.h };
 
-    int err = NO_ERROR;
-    const int can_use_copybit = canUseCopybit();
-    if (can_use_copybit)  {
-        copybit_device_t* copybit = mFlinger->getBlitEngine();
-        copybit->set_parameter(copybit, COPYBIT_TRANSFORM, 0);
-        copybit->set_parameter(copybit, COPYBIT_DITHER, COPYBIT_ENABLE);
 
-        if (alpha < 1.0f) {
-            copybit_image_t srcIn;
-            mBitmapIn.getBitmapSurface(&srcIn);
-            region_iterator it(Region(Rect( drect.l, drect.t, drect.r, drect.b )));
-            copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, 0xFF);
-            err = copybit->stretch(copybit, &dst, &srcIn, &drect, &srect, &it);
-        }
+    GGLSurface t;
+    t.version = sizeof(GGLSurface);
+    t.width  = src.w;
+    t.height = src.h;
+    t.stride = src.w;
+    t.vstride= src.h;
+    t.format = src.format;
+    t.data = (GGLubyte*)(intptr_t(src.base) + src.offset);
 
-        if (!err && alpha > 0.0f) {
-            region_iterator it(Region(Rect( drect.l, drect.t, drect.r, drect.b )));
-            copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, int(alpha*255));
-            err = copybit->stretch(copybit, &dst, &src, &drect, &srect, &it);
-        }
-        LOGE_IF(err != NO_ERROR, "copybit failed (%s)", strerror(err));
+    const int targetOrientation = plane.getOrientation(); 
+    if (!targetOrientation) {
+        f = -f;
     }
-    if (!can_use_copybit || err) {   
-        GGLSurface t;
-        t.version = sizeof(GGLSurface);
-        t.width  = src.w;
-        t.height = src.h;
-        t.stride = src.w;
-        t.vstride= src.h;
-        t.format = src.format;
-        t.data = (GGLubyte*)(intptr_t(src.base) + src.offset);
 
-        Transform tr;
-        tr.set(f,0,0,f);
-        tr.set(xc, yc);
-        
-        // FIXME: we should not access mVertices and mDrawingState like that,
-        // but since we control the animation, we know it's going to work okay.
-        // eventually we'd need a more formal way of doing things like this.
-        LayerOrientationAnim& self(const_cast<LayerOrientationAnim&>(*this));
+    Transform tr;
+    tr.set(f, w*0.5f, h*0.5f);
+    tr.scale(s, w*0.5f, h*0.5f);
+
+    // FIXME: we should not access mVertices and mDrawingState like that,
+    // but since we control the animation, we know it's going to work okay.
+    // eventually we'd need a more formal way of doing things like this.
+    LayerOrientationAnim& self(const_cast<LayerOrientationAnim&>(*this));
+    tr.transform(self.mVertices[0], 0, 0);
+    tr.transform(self.mVertices[1], 0, src.h);
+    tr.transform(self.mVertices[2], src.w, src.h);
+    tr.transform(self.mVertices[3], src.w, 0);
+
+    if (!(mFlags & DisplayHardware::SLOW_CONFIG)) {
+        // Too slow to do this in software
+        self.mDrawingState.flags |= ISurfaceComposer::eLayerFilter;
+    }
+
+    if (UNLIKELY(mTextureName == -1LU)) {
+        mTextureName = createTexture();
+        GLuint w=0, h=0;
+        const Region dirty(Rect(t.width, t.height));
+        loadTexture(dirty, mTextureName, t, w, h);
+    }
+    self.mDrawingState.alpha = 255; //-int(alpha*255);
+    const Region clip(Rect( srect.l, srect.t, srect.r, srect.b ));
+    drawWithOpenGL(clip, mTextureName, t);
+    
+    if (alpha > 0) {
+        const float sign = (!targetOrientation) ? 1.0f : -1.0f;
+        tr.set(f + sign*(M_PI * 0.5f * ROTATION_FACTOR), w*0.5f, h*0.5f);
+        tr.scale(s, w*0.5f, h*0.5f);
         tr.transform(self.mVertices[0], 0, 0);
         tr.transform(self.mVertices[1], 0, src.h);
         tr.transform(self.mVertices[2], src.w, src.h);
         tr.transform(self.mVertices[3], src.w, 0);
-        if (!(mFlags & DisplayHardware::SLOW_CONFIG)) {
-            // Too slow to do this in software
-            self.mDrawingState.flags |= ISurfaceComposer::eLayerFilter;
-        }
 
-        if (alpha < 1.0f) {
-            copybit_image_t src;
-            mBitmapIn.getBitmapSurface(&src);
-            t.data = (GGLubyte*)(intptr_t(src.base) + src.offset);
-            if (UNLIKELY(mTextureNameIn == -1LU)) {
-                mTextureNameIn = createTexture();
-                GLuint w=0, h=0;
-                const Region dirty(Rect(t.width, t.height));
-                loadTexture(dirty, mTextureNameIn, t, w, h);
-            }
-            self.mDrawingState.alpha = 255;
-            const Region clip(Rect( drect.l, drect.t, drect.r, drect.b ));
-            drawWithOpenGL(clip, mTextureName, t);
-        }
-
+        copybit_image_t src;
+        mBitmapIn.getBitmapSurface(&src);
         t.data = (GGLubyte*)(intptr_t(src.base) + src.offset);
-        if (UNLIKELY(mTextureName == -1LU)) {
-            mTextureName = createTexture();
+        if (UNLIKELY(mTextureNameIn == -1LU)) {
+            mTextureNameIn = createTexture();
             GLuint w=0, h=0;
             const Region dirty(Rect(t.width, t.height));
-            loadTexture(dirty, mTextureName, t, w, h);
+            loadTexture(dirty, mTextureNameIn, t, w, h);
         }
         self.mDrawingState.alpha = int(alpha*255);
-        const Region clip(Rect( drect.l, drect.t, drect.r, drect.b ));
-        drawWithOpenGL(clip, mTextureName, t);
+        const Region clip(Rect( srect.l, srect.t, srect.r, srect.b ));
+        drawWithOpenGL(clip, mTextureNameIn, t);
     }
 }
 
diff --git a/libs/surfaceflinger/LayerOrientationAnim.h b/libs/surfaceflinger/LayerOrientationAnim.h
index 73676859..b527c7e 100644
--- a/libs/surfaceflinger/LayerOrientationAnim.h
+++ b/libs/surfaceflinger/LayerOrientationAnim.h
@@ -52,7 +52,7 @@
     virtual bool needsBlending() const;
     virtual bool isSecure() const       { return false; }
 private:
-    void drawScaled(float scale, float alpha) const;
+    void drawScaled(float angle, float scale, float alpha) const;
 
     OrientationAnimation* mAnim;
     LayerBitmap mBitmap;
@@ -62,6 +62,7 @@
     bool mOrientationCompleted;
     mutable bool mFirstRedraw;
     mutable float mLastNormalizedTime;
+    mutable float mLastAngle;
     mutable float mLastScale;
     mutable GLuint  mTextureName;
     mutable GLuint  mTextureNameIn;
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp
index d915a84..8499b67 100644
--- a/libs/surfaceflinger/SurfaceFlinger.cpp
+++ b/libs/surfaceflinger/SurfaceFlinger.cpp
@@ -1804,6 +1804,7 @@
     if (orientation == ISurfaceComposer::eOrientationDefault) {
         // make sure the default orientation is optimal
         mOrientationTransform.reset();
+        mOrientation = orientation;
         mGlobalTransform = mTransform;
         return NO_ERROR;
     }
@@ -1824,7 +1825,7 @@
         GraphicPlane::orientationToTransfrom(orientation, w, h,
                 &mOrientationTransform);
     }
-    
+    mOrientation = orientation;
     mGlobalTransform = mOrientationTransform * mTransform;
     return NO_ERROR;
 }
diff --git a/libs/surfaceflinger/SurfaceFlinger.h b/libs/surfaceflinger/SurfaceFlinger.h
index f7d7764..3c10481 100644
--- a/libs/surfaceflinger/SurfaceFlinger.h
+++ b/libs/surfaceflinger/SurfaceFlinger.h
@@ -122,6 +122,7 @@
         void                    setDisplayHardware(DisplayHardware *);
         void                    setTransform(const Transform& tr);
         status_t                setOrientation(int orientation);
+        int                     getOrientation() const { return mOrientation; }
 
         const DisplayHardware&  displayHardware() const;
         const Transform&        transform() const;
@@ -133,6 +134,7 @@
         Transform               mTransform;
         Transform               mOrientationTransform;
         Transform               mGlobalTransform;
+        int                     mOrientation;
 };
 
 // ---------------------------------------------------------------------------
diff --git a/libs/surfaceflinger/Transform.cpp b/libs/surfaceflinger/Transform.cpp
index bec7a64..e8b0f45 100644
--- a/libs/surfaceflinger/Transform.cpp
+++ b/libs/surfaceflinger/Transform.cpp
@@ -103,6 +103,25 @@
     mType |= 0x80000000;
 }
 
+void Transform::set(float radian, float x, float y)
+{
+    float r00 = cosf(radian);    float r01 = -sinf(radian);
+    float r10 = sinf(radian);    float r11 =  cosf(radian);
+    mTransform.set(SkMatrix::kMScaleX, SkFloatToScalar(r00));
+    mTransform.set(SkMatrix::kMSkewX, SkFloatToScalar(r01));
+    mTransform.set(SkMatrix::kMSkewY, SkFloatToScalar(r10));
+    mTransform.set(SkMatrix::kMScaleY, SkFloatToScalar(r11));
+    mTransform.set(SkMatrix::kMTransX, SkIntToScalar(x - r00*x - r01*y));
+    mTransform.set(SkMatrix::kMTransY, SkIntToScalar(y - r10*x - r11*y));
+    mType |= 0x80000000 | SkMatrix::kTranslate_Mask;
+}
+
+void Transform::scale(float s, float x, float y)
+{
+    mTransform.postScale(s, s, x, y); 
+    mType |= 0x80000000;
+}
+
 void Transform::set(int tx, int ty)
 {
     if (tx | ty) {
diff --git a/libs/surfaceflinger/Transform.h b/libs/surfaceflinger/Transform.h
index 0b4835e..4c4528e 100644
--- a/libs/surfaceflinger/Transform.h
+++ b/libs/surfaceflinger/Transform.h
@@ -60,7 +60,9 @@
             void    reset();
             void    set(float xx, float xy, float yx, float yy);
             void    set(int tx, int ty);
-
+            void    set(float radian, float x, float y);
+            void    scale(float s, float x, float y);
+            
             Rect    makeBounds(int w, int h) const;
             void    transform(GLfixed* point, int x, int y) const;
             Region  transform(const Region& reg) const;
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index 0ef7760..a49bd67 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -165,27 +165,24 @@
      */
     private Object mRecordingStateLock = new Object();
     /**
-     * The listener the AudioRecord notifies when a previously set marker is reached.
-     *  @see #setMarkerReachedListener(OnMarkerReachedListener)
+     * The listener the AudioRecord notifies when the record position reaches a marker
+     * or for periodic updates during the progression of the record head.
+     *  @see #setRecordPositionUpdateListener(OnRecordPositionUpdateListener)
+     *  @see #setRecordPositionUpdateListener(OnRecordPositionUpdateListener, Handler)
      */
-    private OnMarkerReachedListener mMarkerListener = null;
+    private OnRecordPositionUpdateListener mPositionListener = null;
     /**
-     * Lock to protect marker listener updates against event notifications
+     * Lock to protect position listener updates against event notifications
      */
-    private final Object mMarkerListenerLock = new Object();
+    private final Object mPositionListenerLock = new Object();
     /**
-     * The listener the AudioRecord notifies periodically during recording.
-     *  @see #setPeriodicNotificationListener(OnPeriodicNotificationListener)
+     * Handler for marker events coming from the native code
      */
-    private OnPeriodicNotificationListener mPeriodicListener = null;
+    private NativeEventHandler mEventHandler = null;
     /**
-     * Lock to protect periodic listener updates against event notifications
+     * Looper associated with the thread that creates the AudioRecord instance
      */
-    private final Object mPeriodicListenerLock = new Object();
-    /**
-     * Handler for events coming from the native code
-     */
-    private NativeEventHandler mNativeEventHandler = null;
+    private Looper mInitializationLooper = null;
     /**
      * Size of the native audio buffer.
      */
@@ -217,6 +214,11 @@
     throws IllegalArgumentException {   
         mState = STATE_UNINITIALIZED;
         mRecordingState = RECORDSTATE_STOPPED;
+        
+        // remember which looper is associated with the AudioRecord instanciation
+        if ((mInitializationLooper = Looper.myLooper()) == null) {
+            mInitializationLooper = Looper.getMainLooper();
+        }
 
         audioParamCheck(audioSource, sampleRateInHz, channelConfig, audioFormat);
 
@@ -319,21 +321,6 @@
     }    
     
     
-    // Convenience method for the creation of the native event handler
-    // It is called only when a non-null event listener is set.
-    // precondition:
-    //    mNativeEventHandler is null
-    private void createNativeEventHandler() {
-        Looper looper;
-        if ((looper = Looper.myLooper()) != null) {
-            mNativeEventHandler = new NativeEventHandler(this, looper);
-        } else if ((looper = Looper.getMainLooper()) != null) {
-            mNativeEventHandler = new NativeEventHandler(this, looper);
-        } else {
-            mNativeEventHandler = null;
-        }
-    }
-    
 
     /**
      * Releases the native AudioRecord resources.
@@ -433,7 +420,6 @@
     }
     
     /**
-     * {@hide}
      * Returns the minimum buffer size required for the successful creation of an AudioRecord
      * object.
      * @param sampleRateInHz the sample rate expressed in Hertz.
@@ -602,36 +588,40 @@
     // Initialization / configuration
     //--------------------  
     /**
-     * Sets the listener the AudioRecord notifies when a previously set marker is reached.
+     * Sets the listener the AudioRecord notifies when a previously set marker is reached or
+     * for each periodic record head position update.
      * @param listener
      */
-    public void setMarkerReachedListener(OnMarkerReachedListener listener) {
-        synchronized (mMarkerListenerLock) {
-            mMarkerListener = listener;
+    public void setRecordPositionUpdateListener(OnRecordPositionUpdateListener listener) {
+        setRecordPositionUpdateListener(listener, null);
+    }
+    
+
+    public void setRecordPositionUpdateListener(OnRecordPositionUpdateListener listener, 
+                                                    Handler handler) {
+        synchronized (mPositionListenerLock) {
+            
+            mPositionListener = listener;
+            
+            if (listener != null) {
+                if (handler != null) {
+                    mEventHandler = new NativeEventHandler(this, handler.getLooper());
+                } else {
+                    // no given handler, use the looper the AudioRecord was created in
+                    mEventHandler = new NativeEventHandler(this, mInitializationLooper);
+                }
+            } else {
+                mEventHandler = null;
+            }
         }
-        if ((listener != null) && (mNativeEventHandler == null)) {
-            createNativeEventHandler();
-        }
+        
     }
     
     
     /**
-     * Sets the listener the AudioRecord notifies periodically during recording.
-     * @param listener
-     */
-    public void setPeriodicNotificationListener(OnPeriodicNotificationListener listener) {
-        synchronized (mPeriodicListenerLock) {
-            mPeriodicListener = listener;
-        }
-        if ((listener != null) && (mNativeEventHandler == null)) {
-            createNativeEventHandler();
-        }
-    }
-    
-    
-    /**
-     * Sets the marker position at which the listener, if set with 
-     * {@link #setMarkerReachedListener(OnMarkerReachedListener)}, is called.
+     * Sets the marker position at which the listener is called, if set with 
+     * {@link #setRecordPositionUpdateListener(OnRecordPositionUpdateListener)} or 
+     * {@link #setRecordPositionUpdateListener(OnRecordPositionUpdateListener, Handler)}.
      * @param markerInFrames marker position expressed in frames
      * @return error code or success, see {@link #SUCCESS}, {@link #ERROR_BAD_VALUE},
      *  {@link #ERROR_INVALID_OPERATION} 
@@ -642,8 +632,9 @@
     
     
     /**
-     * Sets the period at which the listener, if set with
-     * {@link #setPositionNotificationPeriod(int)}, is called.
+     * Sets the period at which the listener is called, if set with
+     * {@link #setRecordPositionUpdateListener(OnRecordPositionUpdateListener)} or 
+     * {@link #setRecordPositionUpdateListener(OnRecordPositionUpdateListener, Handler)}.
      * @param periodInFrames update period expressed in frames
      * @return error code or success, see {@link #SUCCESS}, {@link #ERROR_INVALID_OPERATION}
      */
@@ -659,70 +650,65 @@
      * Interface definition for a callback to be invoked when an AudioRecord has
      * reached a notification marker set by setNotificationMarkerPosition().
      */
-    public interface OnMarkerReachedListener  {
+    public interface OnRecordPositionUpdateListener  {
         /**
          * Called on the listener to notify it that the previously set marker has been reached
          * by the recording head.
          */
         void onMarkerReached(AudioRecord recorder);
-    }
-
-
-    /**
-     * Interface definition for a callback to be invoked for each periodic AudioRecord 
-     * update during recording. The update interval is set by setPositionNotificationPeriod().
-     */
-    public interface OnPeriodicNotificationListener  {
+        
         /**
-         * Called on the listener to periodically notify it that the recording head has reached
+         * Called on the listener to periodically notify it that the record head has reached
          * a multiple of the notification period.
          */
         void onPeriodicNotification(AudioRecord recorder);
     }
+    
+    
 
     
     //---------------------------------------------------------
     // Inner classes
     //--------------------
+      
     /**
-     * Helper class to handle the forwarding of native events to the appropriate listeners
-     */
-    private class NativeEventHandler extends Handler
-    {
-        private AudioRecord mAudioRecord;
-
-        public NativeEventHandler(AudioRecord ar, Looper looper) {
+     * Helper class to handle the forwarding of native events to the appropriate listener
+     * (potentially) handled in a different thread
+     */  
+    private class NativeEventHandler extends Handler {
+        
+        private final AudioRecord mAudioRecord;
+        
+        NativeEventHandler(AudioRecord recorder, Looper looper) {
             super(looper);
-            mAudioRecord = ar;
+            mAudioRecord = recorder;
         }
-
+        
         @Override
         public void handleMessage(Message msg) {
-            if (mAudioRecord == null) {
-                return;
+            OnRecordPositionUpdateListener listener = null;
+            synchronized (mPositionListenerLock) {
+                listener = mAudioRecord.mPositionListener;
             }
+            
             switch(msg.what) {
             case NATIVE_EVENT_MARKER:
-                synchronized (mMarkerListenerLock) {
-                    if (mAudioRecord.mMarkerListener != null) {
-                        mAudioRecord.mMarkerListener.onMarkerReached(mAudioRecord);
-                    }
+                if (listener != null) {
+                    listener.onMarkerReached(mAudioRecord);
                 }
                 break;
             case NATIVE_EVENT_NEW_POS:
-                synchronized (mPeriodicListenerLock) {
-                    if (mAudioRecord.mPeriodicListener != null) {
-                        mAudioRecord.mPeriodicListener.onPeriodicNotification(mAudioRecord);
-                    }
+                if (listener != null) {
+                    listener.onPeriodicNotification(mAudioRecord);
                 }
                 break;
             default:
                 Log.e(TAG, "[ android.media.AudioRecord.NativeEventHandler ] " +
                         "Unknown event type: " + msg.what);
-                break;
+            break;
             }
         }
-    }
+    };
     
     
     //---------------------------------------------------------
@@ -737,9 +723,10 @@
             return;
         }
         
-        if (recorder.mNativeEventHandler != null) {
-            Message m = recorder.mNativeEventHandler.obtainMessage(what, arg1, arg2, obj);
-            recorder.mNativeEventHandler.sendMessage(m);
+        if (recorder.mEventHandler != null) {
+            Message m = 
+                recorder.mEventHandler.obtainMessage(what, arg1, arg2, obj);
+            recorder.mEventHandler.sendMessage(m);
         }
 
     }
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 83ede0d..2e3e460 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -21,6 +21,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.database.ContentObserver;
 import android.media.MediaPlayer.OnCompletionListener;
 import android.media.MediaPlayer.OnErrorListener;
 import android.os.Binder;
@@ -92,7 +93,8 @@
     private AudioHandler mAudioHandler;
     /** @see VolumeStreamState */
     private VolumeStreamState[] mStreamStates;
-
+    private SettingsObserver mSettingsObserver;
+    
     private boolean mMicMute;
     private int mMode;
     private int[] mRoutes = new int[AudioSystem.NUM_MODES];
@@ -157,9 +159,6 @@
      */
     private int mRingerMode;
 
-    /** @see System#MODE_RINGER_STREAMS_AFFECTED */
-    private int mRingerModeAffectedStreams;
-
     /** @see System#MUTE_STREAMS_AFFECTED */
     private int mMuteAffectedStreams;
 
@@ -181,7 +180,8 @@
         mContext = context;
         mContentResolver = context.getContentResolver();
         mVolumePanel = new VolumePanel(context, this);
-
+        mSettingsObserver = new SettingsObserver();
+        
         createAudioSystemThread();
         createStreamStates();
         readPersistedSettings();
@@ -275,8 +275,6 @@
         final ContentResolver cr = mContentResolver;
 
         mRingerMode = System.getInt(cr, System.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL);
-        mRingerModeAffectedStreams = System.getInt(mContentResolver,
-                System.MODE_RINGER_STREAMS_AFFECTED, 1 << AudioSystem.STREAM_RING);
 
         mVibrateSetting = System.getInt(cr, System.VIBRATE_ON, 0);
 
@@ -494,34 +492,38 @@
     /** @see AudioManager#setRingerMode(int) */
     public void setRingerMode(int ringerMode) {
         if (ringerMode != mRingerMode) {
-            mRingerMode = ringerMode;
-
-            // Adjust volumes via posting message
-            int numStreamTypes = AudioSystem.getNumStreamTypes();
-            if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
-                for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
-                    if (!isStreamAffectedByRingerMode(streamType)) continue;
-                    // Bring back last audible volume
-                    setStreamVolumeInt(streamType, mStreamStates[streamType].mLastAudibleIndex,
-                                       false);
-                }
-            } else {
-                for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
-                    if (!isStreamAffectedByRingerMode(streamType)) continue;
-                    // Either silent or vibrate, either way volume is 0
-                    setStreamVolumeInt(streamType, 0, false);
-                }
-            }
+            setRingerModeInt(ringerMode);
 
             // Send sticky broadcast
             broadcastRingerMode();
-
-            // Post a persist ringer mode msg
-            sendMsg(mAudioHandler, MSG_PERSIST_RINGER_MODE, SHARED_MSG,
-                    SENDMSG_REPLACE, 0, 0, null, PERSIST_DELAY);
         }
     }
 
+    private void setRingerModeInt(int ringerMode) {
+        mRingerMode = ringerMode;
+
+        // Adjust volumes via posting message
+        int numStreamTypes = AudioSystem.getNumStreamTypes();
+        if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
+            for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
+                if (!isStreamAffectedByRingerMode(streamType)) continue;
+                // Bring back last audible volume
+                setStreamVolumeInt(streamType, mStreamStates[streamType].mLastAudibleIndex,
+                                   false);
+            }
+        } else {
+            for (int streamType = numStreamTypes - 1; streamType >= 0; streamType--) {
+                if (!isStreamAffectedByRingerMode(streamType)) continue;
+                // Either silent or vibrate, either way volume is 0
+                setStreamVolumeInt(streamType, 0, false);
+            }
+        }
+        
+        // Post a persist ringer mode msg
+        sendMsg(mAudioHandler, MSG_PERSIST_RINGER_MODE, SHARED_MSG,
+                SENDMSG_REPLACE, 0, 0, null, PERSIST_DELAY);
+    }
+
     /** @see AudioManager#shouldVibrate(int) */
     public boolean shouldVibrate(int vibrateType) {
 
@@ -565,7 +567,6 @@
 
     /**
      * @see #setVibrateSetting(int, int)
-     * @hide
      */
     public static int getValueForVibrateSetting(int existingValue, int vibrateType,
             int vibrateSetting) {
@@ -659,7 +660,6 @@
     }
 
     /** @see AudioManager#playSoundEffect(int, float) */
-    /* @hide FIXME: unhide before release */
     public void playSoundEffectVolume(int effectType, float volume) {
         sendMsg(mAudioHandler, MSG_PLAY_SOUND_EFFECT, SHARED_MSG, SENDMSG_NOOP,
                 effectType, (int) (volume * 1000), null, 0);
@@ -783,7 +783,9 @@
     }
 
     public boolean isStreamAffectedByRingerMode(int streamType) {
-        return (mRingerModeAffectedStreams & (1 << streamType)) != 0;
+        int ringerModeAffectedStreams = Settings.System.getInt(mContentResolver,
+                Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0);
+        return (ringerModeAffectedStreams & (1 << streamType)) != 0;
     }
 
     public boolean isStreamAffectedByMute(int streamType) {
@@ -1233,4 +1235,25 @@
         }
     }
 
+    private class SettingsObserver extends ContentObserver {
+        
+        SettingsObserver() {
+            super(new Handler());
+            mContentResolver.registerContentObserver(Settings.System.getUriFor(
+                Settings.System.MODE_RINGER_STREAMS_AFFECTED), false, this);
+        }
+
+        @Override
+        public void onChange(boolean selfChange) {
+            super.onChange(selfChange);
+            
+            /*
+             * Ensure all stream types that should be affected by ringer mode
+             * are in the proper state.
+             */
+            setRingerModeInt(getRingerMode());
+        }
+        
+    }
+    
 }
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index d2bad93..4196ef3 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -423,7 +423,6 @@
     }
     
     /**
-     * @hide
      * Returns the current playback rate in Hz. Note that this rate may differ from one set using
      * {@link #setPlaybackRate(int)} as the value effectively set is implementation-dependent.
      */
@@ -522,7 +521,6 @@
     }
     
     /**
-     * {@hide}
      * Returns the minimum buffer size required for the successful creation of an AudioTrack
      * object to be created in the {@link #MODE_STREAM} mode.
      * @param sampleRateInHz the sample rate expressed in Hertz.
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 9668efa..19ab0ad 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -1131,8 +1131,6 @@
     /**
      * Interface definition of a callback to be invoked when the
      * video size is first known or updated
-     * FIXME: Unhide this API after approval
-     * @hide
      */
     public interface OnVideoSizeChangedListener
     {
@@ -1142,7 +1140,6 @@
          * @param mp        the MediaPlayer associated with this callback
          * @param width     the width of the video
          * @param height    the height of the video
-         * @hide
          */
         public void onVideoSizeChanged(MediaPlayer mp, int width, int height);
     }
@@ -1152,7 +1149,6 @@
      * known or updated.
      * 
      * @param listener the callback that will be run
-     * @hide
      */
     public void setOnVideoSizeChangedListener(OnVideoSizeChangedListener listener)
     {
@@ -1178,7 +1174,7 @@
     /** The video is streamed and its container is not valid for progressive
      * playback i.e the video's index (e.g moov atom) is not at the start of the
      * file.
-      * @hide pending API council approval. Replace with @see tag after.
+     * @see android.media.MediaPlayer.OnErrorListener
      */
     public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200;
 
@@ -1226,14 +1222,12 @@
      */
     /** Unspecified media player info.
      * @see android.media.MediaPlayer.OnInfoListener
-     * @hide pending API council approval.
      */
     public static final int MEDIA_INFO_UNKNOWN = 1;
 
     /** The video is too complex for the decoder: it can't decode frames fast
      *  enough. Possibly only the audio plays fine at this stage.
      * @see android.media.MediaPlayer.OnInfoListener
-     * @hide pending API council approval.
      */
     public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700;
 
@@ -1241,20 +1235,17 @@
      * not interleaved at all, e.g has all the video samples first then all the
      * audio ones. Video is playing but a lot of disk seeks may be happening.
      * @see android.media.MediaPlayer.OnInfoListener
-     * @hide pending API council approval.
      */
     public static final int MEDIA_INFO_BAD_INTERLEAVING = 800;
 
     /** The media cannot be seeked (e.g live stream)
      * @see android.media.MediaPlayer.OnInfoListener
-     * @hide pending API council approval.
      */
     public static final int MEDIA_INFO_NOT_SEEKABLE = 801;
 
     /**
      * Interface definition of a callback to be invoked to communicate some
      * info and/or warning about the media or its playback.
-     * @hide pending API council approval.
      */
     public interface OnInfoListener
     {
@@ -1282,7 +1273,6 @@
      * Register a callback to be invoked when an info/warning is available.
      * 
      * @param listener the callback that will be run
-     * @hide pending API council approval.
      */
     public void setOnInfoListener(OnInfoListener listener)
     {
diff --git a/media/jni/soundpool/NOTICE b/media/jni/soundpool/NOTICE
new file mode 100644
index 0000000..c5b1efa
--- /dev/null
+++ b/media/jni/soundpool/NOTICE
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2005-2008, The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 7594ff0..5c800c3 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -200,6 +200,7 @@
     // TODO: add audio hardware input latency here
     mLatency = (1000*mFrameCount) / mSampleRate;
     mMarkerPosition = 0;
+    mMarkerReached = false;
     mNewPosition = 0;
     mUpdatePeriod = 0;
 
@@ -293,6 +294,9 @@
 
     if (android_atomic_and(~1, &mActive) == 1) {
         mAudioRecord->stop();
+        // the record head position will reset to 0, so if a marker is set, we need
+        // to activate it again
+        mMarkerReached = false;
         if (t != 0) {
             t->requestExit();
         } else {
@@ -317,6 +321,7 @@
     if (mCbf == 0) return INVALID_OPERATION;
 
     mMarkerPosition = marker;
+    mMarkerReached = false;
 
     return NO_ERROR;
 }
@@ -492,10 +497,10 @@
     size_t readSize;
 
     // Manage marker callback
-    if (mMarkerPosition > 0) {
+    if (!mMarkerReached && (mMarkerPosition > 0)) {
         if (mCblk->user >= mMarkerPosition) {
             mCbf(EVENT_MARKER, mUserData, (void *)&mMarkerPosition);
-            mMarkerPosition = 0;
+            mMarkerReached = true;
         }
     }
 
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 7537ddf..24f7281 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -259,6 +259,7 @@
     mLatency = afLatency + (1000*mFrameCount) / mSampleRate;
     mLoopCount = 0;
     mMarkerPosition = 0;
+    mMarkerReached = false;
     mNewPosition = 0;
     mUpdatePeriod = 0;
 
@@ -360,6 +361,9 @@
         // Cancel loops (If we are in the middle of a loop, playback
         // would not stop until loopCount reaches 0).
         setLoop(0, 0, 0);
+        // the playback head position will reset to 0, so if a marker is set, we need
+        // to activate it again
+        mMarkerReached = false;
         // Force flush if a shared buffer is used otherwise audioflinger
         // will not stop before end of buffer is reached.
         if (mSharedBuffer != 0) {
@@ -385,6 +389,12 @@
 void AudioTrack::flush()
 {
     LOGV("flush");
+    
+    // clear playback marker and periodic update counter
+    mMarkerPosition = 0;
+    mMarkerReached = false;
+    mUpdatePeriod = 0;
+    
 
     if (!mActive) {
         mAudioTrack->flush();
@@ -508,6 +518,7 @@
     if (mCbf == 0) return INVALID_OPERATION;
 
     mMarkerPosition = marker;
+    mMarkerReached = false;
 
     return NO_ERROR;
 }
@@ -755,10 +766,10 @@
     }
 
     // Manage marker callback
-    if(mMarkerPosition > 0) {
+    if (!mMarkerReached && (mMarkerPosition > 0)) {
         if (mCblk->server >= mMarkerPosition) {
             mCbf(EVENT_MARKER, mUserData, (void *)&mMarkerPosition);
-            mMarkerPosition = 0;
+            mMarkerReached = true;
         }
     }
 
diff --git a/media/libmedia/JetPlayer.cpp b/media/libmedia/JetPlayer.cpp
index 77a9013..586aacb 100644
--- a/media/libmedia/JetPlayer.cpp
+++ b/media/libmedia/JetPlayer.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#define LOG_NDEBUG 0
+//#define LOG_NDEBUG 0
 #define LOG_TAG "JetPlayer-C"
 
 #include <utils/Log.h>
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index 6b40412..5841922 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -91,6 +91,7 @@
     mLoop = false;
     mLeftVolume = mRightVolume = 1.0;
     mVideoWidth = mVideoHeight = 0;
+    mLockThreadId = 0;
 }
 
 void MediaPlayer::onFirstRef()
@@ -223,16 +224,24 @@
 {
     LOGV("prepare");
     Mutex::Autolock _l(mLock);
-    if (mPrepareSync) return -EALREADY;
+    mLockThreadId = getThreadId();
+    if (mPrepareSync) {
+        mLockThreadId = 0;
+        return -EALREADY;
+    }
     mPrepareSync = true;
     status_t ret = prepareAsync_l();
-    if (ret != NO_ERROR) return ret;
+    if (ret != NO_ERROR) {
+        mLockThreadId = 0;
+        return ret;
+    }
 
     if (mPrepareSync) {
         mSignal.wait(mLock);  // wait for prepare done
         mPrepareSync = false;
     }
     LOGV("prepare complete - status=%d", mPrepareStatus);
+    mLockThreadId = 0;
     return mPrepareStatus;
 }
 
@@ -485,14 +494,23 @@
 {
     LOGV("message received msg=%d, ext1=%d, ext2=%d", msg, ext1, ext2);
     bool send = true;
+    bool locked = false;
 
     // TODO: In the future, we might be on the same thread if the app is
     // running in the same process as the media server. In that case,
     // this will deadlock.
-    mLock.lock();
+    // 
+    // The threadId hack below works around this for the care of prepare
+    // within the same process.
+
+     if (mLockThreadId != getThreadId()) {
+        mLock.lock();
+        locked = true;
+    } 
+
     if (mPlayer == 0) {
         LOGV("notify(%d, %d, %d) callback on disconnected mediaplayer", msg, ext1, ext2);
-        mLock.unlock();   // release the lock when done.
+        if (locked) mLock.unlock();   // release the lock when done.
         return;
     }
 
@@ -561,7 +579,7 @@
     }
 
     sp<MediaPlayerListener> listener = mListener;
-    mLock.unlock();
+    if (locked) mLock.unlock();
 
     // this prevents re-entrant calls into client code
     if ((listener != 0) && send) {
diff --git a/preloaded-classes b/preloaded-classes
index b91f41b..e3197b41 100644
--- a/preloaded-classes
+++ b/preloaded-classes
@@ -22,6 +22,7 @@
 android.app.ActivityThread$PackageInfo$ServiceDispatcher$InnerConnection
 android.app.ActivityThread$ProviderRecord
 android.app.ActivityThread$ProviderRefCount
+android.app.AlertDialog
 android.app.Application
 android.app.ApplicationContext
 android.app.ApplicationContext$ApplicationContentResolver
@@ -35,28 +36,38 @@
 android.app.ExpandableListActivity
 android.app.IActivityManager
 android.app.IActivityManager$ContentProviderHolder$1
+android.app.IAlarmManager$Stub
 android.app.IAlarmManager$Stub$Proxy
+android.app.IApplicationThread
 android.app.INotificationManager$Stub
 android.app.INotificationManager$Stub$Proxy
+android.app.ISearchManager
+android.app.ISearchManager$Stub
 android.app.ISearchManager$Stub$Proxy
 android.app.Instrumentation
 android.app.IntentReceiverLeaked
 android.app.ListActivity
 android.app.ListActivity$1
 android.app.ListActivity$2
+android.app.LocalActivityManager
 android.app.Notification
 android.app.NotificationManager
 android.app.PendingIntent
 android.app.PendingIntent$1
+android.app.ProgressDialog
 android.app.ReceiverRestrictedContext
 android.app.ResultInfo
 android.app.ResultInfo$1
+android.app.SearchDialog
+android.app.SearchDialog$SearchAutoComplete
+android.app.Service
 android.app.ServiceConnectionLeaked
 android.app.TabActivity
-android.bluetooth.BluetoothAudioGateway
-android.bluetooth.BluetoothDevice
-android.bluetooth.IBluetoothDevice$Stub$Proxy
+android.content.AbstractSyncableContentProvider
+android.content.AbstractTableMerger
 android.content.AsyncQueryHandler$WorkerHandler
+android.content.BroadcastReceiver
+android.content.ComponentCallbacks
 android.content.ComponentName
 android.content.ComponentName$1
 android.content.ContentProvider$Transport
@@ -70,23 +81,36 @@
 android.content.ContentValues
 android.content.Context
 android.content.ContextWrapper
+android.content.DialogInterface
+android.content.DialogInterface$OnCancelListener
+android.content.DialogInterface$OnDismissListener
 android.content.IContentProvider
 android.content.Intent
+android.content.Intent$1
 android.content.IntentFilter
+android.content.SearchRecentSuggestionsProvider
+android.content.ServiceConnection
+android.content.SharedPreferences
 android.content.SyncResult
 android.content.SyncResult$1
 android.content.SyncStats
 android.content.SyncStats$1
+android.content.SyncableContentProvider
 android.content.UriMatcher
 android.content.pm.ActivityInfo
 android.content.pm.ActivityInfo$1
 android.content.pm.ApplicationInfo
+android.content.pm.ApplicationInfo$1
 android.content.pm.ComponentInfo
 android.content.pm.IPackageManager
 android.content.pm.IPackageManager$Stub
 android.content.pm.IPackageManager$Stub$Proxy
+android.content.pm.InstrumentationInfo
+android.content.pm.InstrumentationInfo$1
 android.content.pm.PackageItemInfo
 android.content.pm.PackageManager
+android.content.pm.PackageManager$NameNotFoundException
+android.content.pm.PermissionInfo
 android.content.pm.ProviderInfo
 android.content.pm.ProviderInfo$1
 android.content.pm.ResolveInfo$1
@@ -104,10 +128,13 @@
 android.content.res.XmlBlock$Parser
 android.database.AbstractCursor
 android.database.AbstractCursor$SelfContentObserver
+android.database.AbstractWindowedCursor
+android.database.BulkCursorNative
 android.database.BulkCursorProxy
 android.database.BulkCursorToCursorAdaptor
 android.database.ContentObservable
 android.database.ContentObserver$Transport
+android.database.Cursor
 android.database.CursorToBulkCursorAdaptor
 android.database.CursorToBulkCursorAdaptor$ContentObserverProxy
 android.database.CursorWindow
@@ -117,12 +144,15 @@
 android.database.MergeCursor
 android.database.sqlite.SQLiteCursor
 android.database.sqlite.SQLiteDatabase
+android.database.sqlite.SQLiteDatabase$CursorFactory
 android.database.sqlite.SQLiteDirectCursorDriver
 android.database.sqlite.SQLiteQuery
 android.database.sqlite.SQLiteStatement
 android.ddm.DdmHandleAppName
+android.ddm.DdmHandleExit
 android.ddm.DdmHandleHeap
 android.ddm.DdmHandleHello
+android.ddm.DdmHandleNativeHeap
 android.ddm.DdmHandleThread
 android.ddm.DdmRegister
 android.graphics.Bitmap
@@ -151,6 +181,7 @@
 android.graphics.Shader$TileMode
 android.graphics.Typeface
 android.graphics.Xfermode
+android.graphics.drawable.AnimationDrawable
 android.graphics.drawable.BitmapDrawable
 android.graphics.drawable.BitmapDrawable$BitmapState
 android.graphics.drawable.ColorDrawable
@@ -159,8 +190,8 @@
 android.graphics.drawable.DrawableContainer
 android.graphics.drawable.GradientDrawable
 android.graphics.drawable.LayerDrawable
-android.graphics.drawable.LayerDrawable$LayerState
 android.graphics.drawable.LayerDrawable$ChildDrawable
+android.graphics.drawable.LayerDrawable$LayerState
 android.graphics.drawable.NinePatchDrawable
 android.graphics.drawable.NinePatchDrawable$NinePatchState
 android.graphics.drawable.PaintDrawable
@@ -175,11 +206,14 @@
 android.graphics.drawable.TransitionDrawable
 android.graphics.drawable.TransitionDrawable$TransitionState
 android.graphics.drawable.shapes.RoundRectShape
+android.hardware.SensorManager
+android.inputmethodservice.KeyboardView
 android.location.ILocationManager$Stub
+android.location.Location
 android.media.AudioManager
+android.media.IAudioService$Stub
+android.media.IAudioService$Stub$Proxy
 android.media.MediaPlayer
-android.media.MediaRecorder
-android.media.MediaScanner
 android.net.LocalSocket
 android.net.LocalSocketAddress
 android.net.LocalSocketAddress$Namespace
@@ -188,10 +222,16 @@
 android.net.LocalSocketImpl$SocketOutputStream
 android.net.NetworkConnectivityListener$State
 android.net.NetworkInfo
+android.net.NetworkInfo$DetailedState
+android.net.SSLCertificateSocketFactory
 android.net.Uri
+android.net.Uri$1
+android.net.Uri$AbstractHierarchicalUri
+android.net.Uri$AbstractPart
 android.net.Uri$HierarchicalUri
 android.net.Uri$OpaqueUri
 android.net.Uri$Part
+android.net.Uri$Part$EmptyPart
 android.net.Uri$PathPart
 android.net.Uri$PathSegments
 android.net.Uri$StringUri
@@ -200,14 +240,22 @@
 android.net.http.AndroidHttpClient$1
 android.net.http.AndroidHttpClient$2
 android.net.http.AndroidHttpClient$CurlLogger
+android.net.http.DomainNameChecker
+android.net.http.CertificateChainValidator
 android.net.http.EventHandler
 android.net.http.HttpsConnection
 android.net.http.RequestQueue
+android.net.http.SslError
+android.net.wifi.IWifiManager$Stub
+android.net.wifi.SupplicantState
+android.net.wifi.WifiConfiguration
+android.net.wifi.WifiInfo
 android.opengl.Material
 android.os.Binder
 android.os.BinderProxy
 android.os.Build
 android.os.Bundle
+android.os.Bundle$1
 android.os.Environment
 android.os.FileUtils
 android.os.Handler
@@ -215,7 +263,9 @@
 android.os.IBinder
 android.os.IHardwareService$Stub
 android.os.IHardwareService$Stub$Proxy
+android.os.IPowerManager$Stub
 android.os.IPowerManager$Stub$Proxy
+android.os.IServiceManager
 android.os.Looper
 android.os.Message
 android.os.Message$1
@@ -232,40 +282,24 @@
 android.os.ServiceManagerNative
 android.os.ServiceManagerProxy
 android.os.Vibrator
-android.text.format.DateUtils
-android.text.format.Time
+android.preference.CheckBoxPreference
 android.preference.DialogPreference
+android.preference.EditTextPreference
 android.preference.ListPreference
 android.preference.Preference
 android.preference.PreferenceActivity
 android.preference.PreferenceGroup
 android.preference.PreferenceGroupAdapter
+android.preference.PreferenceManager
 android.preference.PreferenceScreen
-android.provider.Browser
-android.provider.Calendar$CalendarAlerts
-android.provider.Calendar$Instances
-android.provider.Checkin$Events$Tag
-android.provider.Checkin$Stats$Tag
-android.provider.Gmail
-android.provider.Gmail$CursorStatus
-android.provider.Gmail$LabelMap
-android.provider.Gmail$LabelMap$1
-android.provider.Gmail$MessageCursor
-android.provider.Gmail$PersonalLevel
-android.provider.MediaStore$Audio$Artists
-android.provider.MediaStore$Audio$Media
-android.provider.MediaStore$Images$Media
-android.provider.Settings$Gservices
-android.provider.Settings$NameValueCache
-android.provider.Settings$Secure
-android.provider.Settings$System
-android.provider.Sync$Settings$QueryMap
-android.provider.Telephony$MmsSms$PendingMessages
-android.provider.Telephony$Threads
+android.preference.RingtonePreference
+android.sax.RootElement
 android.server.search.SearchableInfo
 android.server.search.SearchableInfo$1
 android.telephony.PhoneNumberUtils
+android.telephony.PhoneStateListener
 android.telephony.ServiceState
+android.telephony.TelephonyManager
 android.telephony.gsm.SmsManager
 android.telephony.gsm.SmsMessage
 android.text.AutoText
@@ -273,25 +307,48 @@
 android.text.BoringLayout$Metrics
 android.text.DynamicLayout
 android.text.DynamicLayout$ChangeWatcher
+android.text.Editable
 android.text.Editable$Factory
+android.text.GetChars
+android.text.GraphicsOperations
 android.text.Html$HtmlParser
+android.text.InputFilter
 android.text.Layout
+android.text.Layout$Alignment
+android.text.Layout$Directions
 android.text.Layout$Ellipsizer
+android.text.NoCopySpan
+android.text.NoCopySpan$Concrete
 android.text.PackedIntVector
 android.text.PackedObjectVector
+android.text.ParcelableSpan
 android.text.Selection
+android.text.Selection$END
+android.text.Selection$START
+android.text.SpanWatcher
+android.text.Spannable
 android.text.Spannable$Factory
 android.text.SpannableString
 android.text.SpannableStringBuilder
+android.text.SpannableStringInternal
+android.text.Spanned
 android.text.SpannedString
 android.text.StaticLayout
 android.text.Styled
 android.text.TextPaint
 android.text.TextUtils
+android.text.TextUtils$1
+android.text.TextUtils$EllipsizeCallback
+android.text.TextUtils$SimpleStringSplitter
 android.text.TextUtils$TruncateAt
+android.text.TextWatcher
+android.text.format.DateUtils
+android.text.format.Time
 android.text.method.ArrowKeyMovementMethod
 android.text.method.BaseKeyListener
+android.text.method.KeyListener
 android.text.method.MetaKeyKeyListener
+android.text.method.MovementMethod
 android.text.method.QwertyKeyListener
 android.text.method.ReplacementTransformationMethod
 android.text.method.ReplacementTransformationMethod$SpannedReplacementCharSequence
@@ -301,29 +358,43 @@
 android.text.method.TextKeyListener$SettingsObserver
 android.text.method.TransformationMethod
 android.text.style.AlignmentSpan
+android.text.style.CharacterStyle
 android.text.style.ForegroundColorSpan
 android.text.style.LeadingMarginSpan
 android.text.style.LineBackgroundSpan
 android.text.style.LineHeightSpan
+android.text.style.MetricAffectingSpan
 android.text.style.ParagraphStyle
 android.text.style.ReplacementSpan
 android.text.style.StyleSpan
+android.text.style.URLSpan
+android.text.style.UpdateAppearance
+android.text.style.UpdateLayout
 android.text.style.WrapTogetherSpan
 android.text.util.Linkify
+android.text.util.Regex
 android.util.AndroidRuntimeException
 android.util.AttributeSet
 android.util.DisplayMetrics
 android.util.FloatMath
 android.util.SparseArray
 android.util.TypedValue
+android.util.Xml$XmlSerializerFactory
 android.view.AbsSavedState
+android.view.ContextMenu
+android.view.ContextMenu$ContextMenuInfo
 android.view.ContextThemeWrapper
 android.view.Display
 android.view.FocusFinder
 android.view.FocusFinder$1
+android.view.GestureDetector$SimpleOnGestureListener
+android.view.Gravity
+android.view.IWindow
 android.view.IWindow$Stub
+android.view.IWindowManager
 android.view.IWindowManager$Stub
 android.view.IWindowManager$Stub$Proxy
+android.view.IWindowSession
 android.view.IWindowSession$Stub
 android.view.IWindowSession$Stub$Proxy
 android.view.KeyCharacterMap
@@ -331,8 +402,12 @@
 android.view.KeyEvent$1
 android.view.KeyEvent$Callback
 android.view.LayoutInflater
+android.view.LayoutInflater$Factory
+android.view.Menu
 android.view.MenuInflater
+android.view.MenuItem
 android.view.MotionEvent
+android.view.MotionEvent$1
 android.view.Surface
 android.view.SurfaceHolder
 android.view.SurfaceView
@@ -341,21 +416,33 @@
 android.view.View
 android.view.View$AttachInfo
 android.view.View$AttachInfo$Callbacks
+android.view.View$BaseSavedState
 android.view.View$BaseSavedState$1
 android.view.View$MeasureSpec
+android.view.View$OnCreateContextMenuListener
 android.view.View$ScrollabilityCache
+android.view.ViewConfiguration
 android.view.ViewGroup
+android.view.ViewGroup$LayoutParams
 android.view.ViewGroup$MarginLayoutParams
+android.view.ViewManager
 android.view.ViewRoot
 android.view.ViewRoot$1
+android.view.ViewRoot$InputMethodCallback
+android.view.ViewRoot$RunQueue
 android.view.ViewRoot$TrackballAxis
 android.view.ViewRoot$W
 android.view.ViewStub
 android.view.ViewTreeObserver
+android.view.ViewTreeObserver$InternalInsetsInfo
+android.view.ViewTreeObserver$OnPreDrawListener
 android.view.Window
+android.view.Window$Callback
 android.view.Window$LocalWindowManager
 android.view.WindowLeaked
+android.view.WindowManager
 android.view.WindowManager$LayoutParams
+android.view.WindowManager$LayoutParams$1
 android.view.WindowManagerImpl
 android.view.animation.AccelerateDecelerateInterpolator
 android.view.animation.AlphaAnimation
@@ -364,41 +451,45 @@
 android.view.animation.LinearInterpolator
 android.view.animation.Transformation
 android.view.inputmethod.BaseInputConnection
-android.view.inputmethod.CompletionInfo$1
 android.view.inputmethod.CompletionInfo
-android.view.inputmethod.EditorInfo$1
+android.view.inputmethod.CompletionInfo$1
 android.view.inputmethod.EditorInfo
-android.view.inputmethod.ExtractedText$1
+android.view.inputmethod.EditorInfo$1
 android.view.inputmethod.ExtractedText
-android.view.inputmethod.ExtractedTextRequest$1
+android.view.inputmethod.ExtractedText$1
 android.view.inputmethod.ExtractedTextRequest
-android.view.inputmethod.InputBinding$1
+android.view.inputmethod.ExtractedTextRequest$1
 android.view.inputmethod.InputBinding
+android.view.inputmethod.InputBinding$1
 android.view.inputmethod.InputConnection
-android.view.inputmethod.InputMethod$SessionCallback
 android.view.inputmethod.InputMethod
-android.view.inputmethod.InputMethodInfo$1
+android.view.inputmethod.InputMethod$SessionCallback
 android.view.inputmethod.InputMethodInfo
+android.view.inputmethod.InputMethodInfo$1
+android.view.inputmethod.InputMethodManager
 android.view.inputmethod.InputMethodManager$1
 android.view.inputmethod.InputMethodManager$2
 android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper
-android.view.inputmethod.InputMethodManager
-android.view.inputmethod.InputMethodSession$EventCallback
+android.view.inputmethod.InputMethodManager$H
 android.view.inputmethod.InputMethodSession
+android.view.inputmethod.InputMethodSession$EventCallback
 android.webkit.BrowserFrame
 android.webkit.CacheManager
 android.webkit.CallbackProxy
 android.webkit.CookieManager
 android.webkit.CookieSyncManager
+android.webkit.HttpDateTime
 android.webkit.JWebCoreJavaBridge
 android.webkit.LoadListener
 android.webkit.MimeTypeMap
 android.webkit.TextDialog
+android.webkit.URLUtil
 android.webkit.WebBackForwardList
 android.webkit.WebHistoryItem
 android.webkit.WebIconDatabase
 android.webkit.WebIconDatabase$EventHandler
 android.webkit.WebIconDatabase$EventHandler$1
+android.webkit.WebIconDatabase$EventHandler$IconResult
 android.webkit.WebSettings
 android.webkit.WebSettings$EventHandler
 android.webkit.WebSettings$EventHandler$1
@@ -408,6 +499,7 @@
 android.webkit.WebSyncManager
 android.webkit.WebSyncManager$SyncHandler
 android.webkit.WebView
+android.webkit.WebView$ExtendedZoomControls
 android.webkit.WebView$FocusNode
 android.webkit.WebView$PrivateHandler
 android.webkit.WebViewCore
@@ -431,6 +523,7 @@
 android.widget.AbsoluteLayout$LayoutParams
 android.widget.AdapterView
 android.widget.AdapterView$AdapterDataSetObserver
+android.widget.ArrayAdapter
 android.widget.AutoCompleteTextView
 android.widget.AutoCompleteTextView$DropDownItemClickListener
 android.widget.AutoCompleteTextView$DropDownListView
@@ -449,7 +542,6 @@
 android.widget.FrameLayout
 android.widget.FrameLayout$LayoutParams
 android.widget.Gallery
-android.widget.GridView
 android.widget.HeaderViewListAdapter
 android.widget.ImageView
 android.widget.ImageView$ScaleType
@@ -459,10 +551,10 @@
 android.widget.ListView$ArrowScrollFocusResult
 android.widget.ListView$SavedState
 android.widget.ListView$SavedState$1
-android.widget.MediaController
 android.widget.PopupWindow
 android.widget.ProgressBar
 android.widget.RadioGroup
+android.widget.RatingBar
 android.widget.RelativeLayout
 android.widget.RelativeLayout$LayoutParams
 android.widget.RemoteViews
@@ -470,7 +562,10 @@
 android.widget.ScrollView
 android.widget.Scroller
 android.widget.SeekBar
+android.widget.SimpleCursorAdapter
+android.widget.SlidingDrawer
 android.widget.Spinner
+android.widget.Spinner$DropDownAdapter
 android.widget.TabHost
 android.widget.TabWidget
 android.widget.TableLayout
@@ -486,15 +581,22 @@
 android.widget.TextView$InputMethodState
 android.widget.TextView$Marquee
 android.widget.TextView$MenuHandler
-android.widget.TextView$SavedState$1
 android.widget.TextView$SavedState
+android.widget.TextView$SavedState$1
 android.widget.ToggleButton
 android.widget.TwoLineListItem
-android.widget.VideoView
 android.widget.ViewAnimator
 android.widget.ViewSwitcher
 android.widget.ZoomButton
 android.widget.ZoomControls
+com.android.internal.database.ArrayListCursor
+com.android.internal.database.SortCursor
+com.android.internal.appwidget.IAppWidgetService$Stub
+com.android.internal.http.multipart.FilePart
+com.android.internal.http.multipart.MultipartEntity
+com.android.internal.http.multipart.Part
+com.android.internal.http.multipart.PartSource
+com.android.internal.http.multipart.StringPart
 com.android.internal.logging.AndroidConfig
 com.android.internal.logging.AndroidHandler
 com.android.internal.os.AndroidPrintStream
@@ -502,55 +604,92 @@
 com.android.internal.os.LoggingPrintStream
 com.android.internal.os.LoggingPrintStream$1
 com.android.internal.os.RuntimeInit
+com.android.internal.os.RuntimeInit$1
 com.android.internal.os.RuntimeInit$UncaughtHandler
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller
+com.android.internal.policy.IPolicy
 com.android.internal.policy.PolicyManager
+com.android.internal.policy.impl.PhoneLayoutInflater
+com.android.internal.policy.impl.PhoneWindow
+com.android.internal.policy.impl.PhoneWindow$1
+com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback
+com.android.internal.policy.impl.PhoneWindow$DecorView
+com.android.internal.policy.impl.PhoneWindow$PanelFeatureState
+com.android.internal.policy.impl.PhoneWindow$PanelFeatureState$SavedState
+com.android.internal.policy.impl.PhoneWindow$PanelFeatureState$SavedState$1
+com.android.internal.policy.impl.Policy
+com.android.internal.telephony.Connection$DisconnectCause
+com.android.internal.telephony.Connection$PostDialState
+com.android.internal.telephony.IPhoneStateListener$Stub
+com.android.internal.telephony.ITelephony$Stub
 com.android.internal.telephony.Phone
 com.android.internal.telephony.Phone$DataActivityState
 com.android.internal.telephony.Phone$DataState
 com.android.internal.telephony.Phone$State
+com.android.internal.telephony.Phone$SuppService
 com.android.internal.telephony.PhoneBase
 com.android.internal.telephony.PhoneStateIntentReceiver
 com.android.internal.telephony.SimCard$State
 com.android.internal.telephony.gsm.BaseCommands
+com.android.internal.telephony.gsm.CallForwardInfo
 com.android.internal.telephony.gsm.CommandsInterface
+com.android.internal.telephony.gsm.DriverCall
+com.android.internal.telephony.gsm.DriverCall$State
+com.android.internal.telephony.gsm.GSMConnection
 com.android.internal.telephony.gsm.GSMPhone
 com.android.internal.telephony.gsm.GsmAlphabet
+com.android.internal.telephony.gsm.GsmMmiCode
 com.android.internal.telephony.gsm.GsmSimCard
 com.android.internal.telephony.gsm.ISms$Stub
 com.android.internal.telephony.gsm.PdpConnection$PdpFailCause
 com.android.internal.telephony.gsm.RIL
 com.android.internal.telephony.gsm.ServiceStateTracker
-com.android.internal.view.menu.MenuDialogHelper
+com.android.internal.telephony.gsm.stk.ComprehensionTlvTag
+com.android.internal.telephony.gsm.stk.ResultCode
+com.android.internal.util.FastXmlSerializer
+com.android.internal.view.IInputConnectionWrapper
 com.android.internal.view.IInputConnectionWrapper$MyHandler
 com.android.internal.view.IInputConnectionWrapper$SomeArgs
-com.android.internal.view.IInputConnectionWrapper
-com.android.internal.view.IInputContext$Stub$Proxy
-com.android.internal.view.IInputContext$Stub
 com.android.internal.view.IInputContext
-com.android.internal.view.IInputContextCallback$Stub$Proxy
-com.android.internal.view.IInputContextCallback$Stub
+com.android.internal.view.IInputContext$Stub
+com.android.internal.view.IInputContext$Stub$Proxy
 com.android.internal.view.IInputContextCallback
-com.android.internal.view.IInputMethod$Stub$Proxy
-com.android.internal.view.IInputMethod$Stub
+com.android.internal.view.IInputContextCallback$Stub
+com.android.internal.view.IInputContextCallback$Stub$Proxy
 com.android.internal.view.IInputMethod
-com.android.internal.view.IInputMethodCallback$Stub$Proxy
-com.android.internal.view.IInputMethodCallback$Stub
+com.android.internal.view.IInputMethod$Stub
+com.android.internal.view.IInputMethod$Stub$Proxy
 com.android.internal.view.IInputMethodCallback
-com.android.internal.view.IInputMethodClient$Stub$Proxy
-com.android.internal.view.IInputMethodClient$Stub
+com.android.internal.view.IInputMethodCallback$Stub
+com.android.internal.view.IInputMethodCallback$Stub$Proxy
 com.android.internal.view.IInputMethodClient
-com.android.internal.view.IInputMethodManager$Stub$Proxy
-com.android.internal.view.IInputMethodManager$Stub
+com.android.internal.view.IInputMethodClient$Stub
+com.android.internal.view.IInputMethodClient$Stub$Proxy
 com.android.internal.view.IInputMethodManager
-com.android.internal.view.IInputMethodSession$Stub$Proxy
-com.android.internal.view.IInputMethodSession$Stub
+com.android.internal.view.IInputMethodManager$Stub
+com.android.internal.view.IInputMethodManager$Stub$Proxy
 com.android.internal.view.IInputMethodSession
-com.android.internal.view.InputBindResult$1
+com.android.internal.view.IInputMethodSession$Stub
+com.android.internal.view.IInputMethodSession$Stub$Proxy
 com.android.internal.view.InputBindResult
-com.android.internal.view.InputConnectionWrapper$InputContextCallback
+com.android.internal.view.InputBindResult$1
 com.android.internal.view.InputConnectionWrapper
+com.android.internal.view.InputConnectionWrapper$InputContextCallback
+com.android.internal.view.menu.ExpandedMenuView
+com.android.internal.view.menu.IconMenuItemView
+com.android.internal.view.menu.IconMenuView
+com.android.internal.view.menu.ListMenuItemView
+com.android.internal.view.menu.MenuBuilder
+com.android.internal.view.menu.MenuBuilder$Callback
+com.android.internal.view.menu.MenuDialogHelper
+com.android.internal.view.menu.MenuItemImpl
+com.android.internal.view.menu.SubMenuBuilder
+com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
 com.android.internal.widget.LockPatternView
+com.android.internal.widget.NumberPicker
+com.android.internal.widget.NumberPickerButton
+com.google.android.gdata.client.AndroidGDataClient
+com.google.android.gdata.client.AndroidGDataClient$PostRequestCreator
 com.google.android.gles_jni.EGLImpl
 com.google.android.gles_jni.GLImpl
 com.google.android.mms.ContentType
@@ -560,9 +699,15 @@
 com.google.android.net.GoogleHttpClient
 com.google.android.net.UrlRules
 com.google.android.net.UrlRules$Rule
+com.google.android.util.SimplePullParser
+com.google.common.Config
+com.google.common.io.protocol.ProtoBuf
+com.google.common.io.protocol.ProtoBufType
+com.google.common.util.text.TextUtil
 com.ibm.icu4jni.charset.CharsetDecoderICU
 com.ibm.icu4jni.charset.CharsetEncoderICU
 com.ibm.icu4jni.charset.CharsetICU
+com.ibm.icu4jni.text.CollationAttribute
 com.ibm.icu4jni.text.DecimalFormat
 com.ibm.icu4jni.text.DecimalFormatSymbols
 com.ibm.icu4jni.text.NativeDecimalFormat$UNumberFormatAttribute
@@ -570,6 +715,9 @@
 com.ibm.icu4jni.text.RuleBasedCollator
 dalvik.system.DexFile
 dalvik.system.PathClassLoader
+java.beans.PropertyChangeEvent
+java.beans.PropertyChangeListener
+java.beans.PropertyChangeSupport
 java.io.BufferedInputStream
 java.io.ByteArrayInputStream
 java.io.ByteArrayOutputStream
@@ -578,24 +726,36 @@
 java.io.FileInputStream
 java.io.FileInputStream$RepositioningLock
 java.io.FileNotFoundException
+java.io.FilterInputStream
+java.io.IOException
+java.io.ObjectStreamClass
 java.io.PrintWriter
 java.io.RandomAccessFile
 java.io.RandomAccessFile$RepositionLock
 java.io.StringWriter
+java.io.Writer
 java.lang.Character$valueOfCache
 java.lang.Class
 java.lang.ClassCache
+java.lang.ClassNotFoundException
+java.lang.IllegalArgumentException
 java.lang.IllegalStateException
 java.lang.Integer
 java.lang.Integer$valueOfCache
+java.lang.LinkageError
 java.lang.Long
 java.lang.Long$valueOfCache
+java.lang.NoClassDefFoundError
+java.lang.NumberFormatException
 java.lang.Object
 java.lang.Runtime
+java.lang.RuntimeException
+java.lang.Short$valueOfCache
 java.lang.String
 java.lang.StringBuffer
 java.lang.StringBuilder
 java.lang.Thread
+java.lang.ThreadLocal
 java.lang.ThreadLocal$Values
 java.lang.Throwable
 java.lang.VMThread
@@ -609,12 +769,16 @@
 java.math.BigInt
 java.math.BigInteger
 java.math.Multiplication
+java.net.ContentHandler
 java.net.InetAddress
 java.net.InetAddress$CacheElement
 java.net.InetAddress$WaitReachable
 java.net.JarURLConnection
 java.net.NegativeCache
+java.net.NetPermission
+java.net.ProxySelectorImpl
 java.net.Socket$ConnectLock
+java.net.URI
 java.net.URL
 java.net.URLConnection
 java.net.URLConnection$DefaultContentHandler
@@ -625,17 +789,23 @@
 java.nio.ReadWriteDirectByteBuffer
 java.nio.ReadWriteIntArrayBuffer
 java.nio.ReadWriteShortArrayBuffer
+java.nio.ShortBuffer
 java.nio.ShortToByteBufferAdapter
 java.nio.charset.CharsetEncoder
 java.security.AccessControlContext
+java.security.GeneralSecurityException
 java.security.KeyStore
+java.security.MessageDigest
 java.security.ProtectionDomain
+java.security.Provider
 java.security.SecureRandom
 java.security.Security
 java.security.cert.CertPathValidator
 java.security.cert.CertificateFactory
 java.security.cert.PKIXParameters
 java.security.cert.TrustAnchor
+java.security.cert.X509CertSelector
+java.security.cert.X509Certificate
 java.text.Collator
 java.text.DateFormat
 java.text.DateFormat$Field
@@ -652,18 +822,30 @@
 java.util.Arrays$ArrayList
 java.util.Calendar
 java.util.Collections$SynchronizedCollection
+java.util.Collections$UnmodifiableList
 java.util.Collections$UnmodifiableMap
+java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1
 java.util.Date
+java.util.EnumMap
+java.util.EventListener
+java.util.EventObject
 java.util.Formatter
 java.util.GregorianCalendar
 java.util.HashMap
 java.util.HashMap$1
 java.util.HashMap$2
+java.util.HashMap$2$1
 java.util.HashMap$Entry
+java.util.HashMap$HashMapEntrySet
+java.util.HashMap$HashMapEntrySet$1
 java.util.HashSet
 java.util.Hashtable
+java.util.Hashtable$4
+java.util.Hashtable$4$1
 java.util.Hashtable$Entry
+java.util.Hashtable$HashEnumerator
 java.util.Hashtable$HashIterator
+java.util.IdentityHashMap
 java.util.LinkedHashMap
 java.util.LinkedHashMap$LinkedHashMapEntry
 java.util.LinkedList
@@ -671,6 +853,7 @@
 java.util.List
 java.util.Locale
 java.util.Properties
+java.util.Random
 java.util.ResourceBundle
 java.util.SimpleTimeZone
 java.util.TimeZone
@@ -680,45 +863,91 @@
 java.util.Vector
 java.util.WeakHashMap
 java.util.WeakHashMap$Entry
+java.util.concurrent.ConcurrentHashMap
+java.util.concurrent.ConcurrentLinkedQueue
+java.util.concurrent.DelayQueue
+java.util.concurrent.LinkedBlockingQueue
+java.util.concurrent.ScheduledThreadPoolExecutor
+java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue
 java.util.concurrent.TimeUnit
 java.util.concurrent.atomic.AtomicBoolean
 java.util.concurrent.atomic.AtomicInteger
+java.util.concurrent.atomic.UnsafeAccess
 java.util.concurrent.locks.AbstractQueuedSynchronizer
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node
+java.util.concurrent.locks.Lock
 java.util.concurrent.locks.LockSupport
 java.util.concurrent.locks.ReentrantLock
 java.util.concurrent.locks.ReentrantLock$FairSync
 java.util.concurrent.locks.ReentrantLock$NonfairSync
 java.util.concurrent.locks.ReentrantLock$Sync
+java.util.concurrent.locks.ReentrantReadWriteLock
+java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync
+java.util.concurrent.locks.UnsafeAccess
 java.util.jar.Attributes
 java.util.jar.Attributes$Name
+java.util.jar.InitManifest
+java.util.jar.JarEntry
 java.util.jar.JarFile
+java.util.jar.JarFile$1JarFileEnumerator
+java.util.jar.JarFile$JarFileInputStream
+java.util.jar.JarVerifier
 java.util.jar.Manifest
 java.util.logging.ErrorManager
+java.util.logging.Formatter
+java.util.logging.Handler
 java.util.logging.Level
 java.util.logging.LogManager
+java.util.logging.LogManager$1
+java.util.logging.LogManager$2
+java.util.logging.LogManager$2$1
+java.util.logging.LogManager$3
 java.util.logging.LogRecord
 java.util.logging.Logger
 java.util.logging.LoggingPermission
 java.util.logging.SimpleFormatter
 java.util.regex.Matcher
 java.util.regex.Pattern
+java.util.zip.DeflaterOutputStream
+java.util.zip.Inflater
+java.util.zip.InflaterInputStream
+java.util.zip.ZipConstants
 java.util.zip.ZipEntry
+java.util.zip.ZipEntry$LittleEndianReader
 java.util.zip.ZipFile
+java.util.zip.ZipFile$2
+java.util.zip.ZipFile$RAFStream
 javax.microedition.khronos.egl.EGLContext
 javax.net.ssl.HttpsURLConnection
+javax.net.ssl.SSLHandshakeException
 javax.security.auth.x500.X500Principal
+javax.security.cert.X509Certificate
 javax.security.cert.X509Certificate$2
 junit.framework.Assert
+org.apache.commons.codec.binary.Base64
+org.apache.commons.codec.binary.Hex
+org.apache.commons.logging.LogFactory
 org.apache.commons.logging.impl.Jdk14Logger
+org.apache.harmony.archive.util.Util
 org.apache.harmony.dalvik.ddmc.Chunk
 org.apache.harmony.dalvik.ddmc.ChunkHandler
 org.apache.harmony.dalvik.ddmc.DdmServer
+org.apache.harmony.dalvik.ddmc.DdmVmInternal
+org.apache.harmony.luni.internal.net.www.protocol.file.FileURLConnection
+org.apache.harmony.luni.internal.net.www.protocol.file.Handler
+org.apache.harmony.luni.internal.net.www.protocol.http.Handler
+org.apache.harmony.luni.internal.net.www.protocol.https.Handler
 org.apache.harmony.luni.internal.net.www.protocol.jar.Handler
 org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
+org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection$1
+org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection$CacheEntry
+org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection$JarURLConnectionInputStream
+org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection$LRUComparator
+org.apache.harmony.luni.internal.util.TimezoneGetter
 org.apache.harmony.luni.internal.util.ZoneInfo
 org.apache.harmony.luni.internal.util.ZoneInfoDB
+org.apache.harmony.luni.net.PlainSocketImpl
 org.apache.harmony.luni.net.PlainSocketImpl2
 org.apache.harmony.luni.platform.PlatformAddress
 org.apache.harmony.luni.util.TwoKeyHashMap
@@ -735,6 +964,7 @@
 org.apache.harmony.security.asn1.ASN1Integer
 org.apache.harmony.security.asn1.ASN1OctetString
 org.apache.harmony.security.asn1.ASN1SetOf
+org.apache.harmony.security.asn1.ASN1StringType
 org.apache.harmony.security.asn1.ASN1StringType$1
 org.apache.harmony.security.asn1.ASN1StringType$2
 org.apache.harmony.security.asn1.ASN1StringType$3
@@ -745,14 +975,18 @@
 org.apache.harmony.security.asn1.ASN1UTCTime
 org.apache.harmony.security.asn1.BitString
 org.apache.harmony.security.fortress.Engine
+org.apache.harmony.security.fortress.SecurityUtils
 org.apache.harmony.security.fortress.Services
+org.apache.harmony.security.pkcs7.ContentInfo
 org.apache.harmony.security.provider.cert.X509CertFactoryImpl
 org.apache.harmony.security.provider.cert.X509CertImpl
 org.apache.harmony.security.provider.cert.X509CertPathImpl
+org.apache.harmony.security.provider.crypto.RandomBitsSupplier
 org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl
 org.apache.harmony.security.utils.AlgNameMapper
 org.apache.harmony.security.x501.AttributeTypeAndValue
 org.apache.harmony.security.x501.AttributeValue
+org.apache.harmony.security.x501.DirectoryString
 org.apache.harmony.security.x501.DirectoryString$1
 org.apache.harmony.security.x501.Name
 org.apache.harmony.security.x501.Name$1
@@ -767,36 +1001,45 @@
 org.apache.harmony.security.x509.Extension$2
 org.apache.harmony.security.x509.Extensions
 org.apache.harmony.security.x509.Extensions$1
+org.apache.harmony.security.x509.GeneralName
+org.apache.harmony.security.x509.GeneralNames
 org.apache.harmony.security.x509.KeyUsage
+org.apache.harmony.security.x509.ORAddress
 org.apache.harmony.security.x509.SubjectPublicKeyInfo
 org.apache.harmony.security.x509.SubjectPublicKeyInfo$1
 org.apache.harmony.security.x509.TBSCertificate
 org.apache.harmony.security.x509.TBSCertificate$1
+org.apache.harmony.security.x509.Time
 org.apache.harmony.security.x509.Time$1
 org.apache.harmony.security.x509.Validity
 org.apache.harmony.security.x509.Validity$1
 org.apache.harmony.xml.ExpatParser
 org.apache.harmony.xml.ExpatPullParser
 org.apache.harmony.xml.ExpatReader
+org.apache.harmony.xnet.provider.jsse.ClientSessionContext
 org.apache.harmony.xnet.provider.jsse.OpenSSLSessionImpl
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
+org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$Finalizer
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream
+org.apache.harmony.xnet.provider.jsse.SSLContextImpl
 org.apache.harmony.xnet.provider.jsse.SSLParameters
-org.apache.harmony.xnet.provider.jsse.ClientSessionContext
 org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl
 org.apache.harmony.xnet.provider.jsse.TrustManagerImpl
 org.apache.http.HttpHost
+org.apache.http.HttpRequestInterceptor
 org.apache.http.HttpVersion
 org.apache.http.auth.AuthSchemeRegistry
 org.apache.http.client.HttpClient
 org.apache.http.client.RequestDirector
+org.apache.http.client.methods.HttpRequestBase
 org.apache.http.client.protocol.RequestAddCookies
 org.apache.http.client.protocol.RequestDefaultHeaders
 org.apache.http.client.protocol.RequestProxyAuthentication
 org.apache.http.client.protocol.RequestTargetAuthentication
 org.apache.http.client.protocol.ResponseProcessCookies
 org.apache.http.conn.params.ConnManagerParams$1
+org.apache.http.conn.params.ConnRouteParams
 org.apache.http.conn.routing.HttpRoute
 org.apache.http.conn.routing.RouteInfo$LayerType
 org.apache.http.conn.routing.RouteInfo$TunnelType
@@ -808,11 +1051,13 @@
 org.apache.http.conn.ssl.BrowserCompatHostnameVerifier
 org.apache.http.conn.ssl.SSLSocketFactory
 org.apache.http.conn.ssl.StrictHostnameVerifier
+org.apache.http.conn.util.InetAddressUtils
 org.apache.http.cookie.CookieSpecRegistry
 org.apache.http.impl.DefaultConnectionReuseStrategy
 org.apache.http.impl.DefaultHttpResponseFactory
 org.apache.http.impl.EnglishReasonPhraseCatalog
 org.apache.http.impl.HttpConnectionMetricsImpl
+org.apache.http.impl.SocketHttpClientConnection
 org.apache.http.impl.auth.BasicSchemeFactory
 org.apache.http.impl.auth.DigestSchemeFactory
 org.apache.http.impl.client.AbstractAuthenticationHandler
@@ -824,6 +1069,8 @@
 org.apache.http.impl.client.DefaultRedirectHandler
 org.apache.http.impl.client.DefaultTargetAuthenticationHandler
 org.apache.http.impl.client.DefaultUserTokenHandler
+org.apache.http.impl.client.EntityEnclosingRequestWrapper
+org.apache.http.impl.conn.AbstractClientConnAdapter
 org.apache.http.impl.conn.DefaultClientConnection
 org.apache.http.impl.conn.DefaultClientConnectionOperator
 org.apache.http.impl.conn.DefaultHttpRoutePlanner
@@ -835,8 +1082,10 @@
 org.apache.http.impl.conn.tsccm.RefQueueWorker
 org.apache.http.impl.conn.tsccm.RouteSpecificPool
 org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
+org.apache.http.impl.cookie.BasicClientCookie
 org.apache.http.impl.cookie.BestMatchSpecFactory
 org.apache.http.impl.cookie.BrowserCompatSpecFactory
+org.apache.http.impl.cookie.DateUtils
 org.apache.http.impl.cookie.NetscapeDraftSpecFactory
 org.apache.http.impl.cookie.RFC2109SpecFactory
 org.apache.http.impl.cookie.RFC2965SpecFactory
@@ -849,10 +1098,13 @@
 org.apache.http.impl.io.SocketInputBuffer
 org.apache.http.impl.io.SocketOutputBuffer
 org.apache.http.message.BasicHeaderValueParser
+org.apache.http.message.BasicHttpEntityEnclosingRequest
+org.apache.http.message.BasicHttpResponse
 org.apache.http.message.BasicLineFormatter
 org.apache.http.message.BasicLineParser
 org.apache.http.params.BasicHttpParams
 org.apache.http.protocol.BasicHttpProcessor
+org.apache.http.protocol.HTTP
 org.apache.http.protocol.HttpRequestExecutor
 org.apache.http.protocol.HttpRequestInterceptorList
 org.apache.http.protocol.HttpResponseInterceptorList
@@ -863,9 +1115,12 @@
 org.apache.http.protocol.RequestUserAgent
 org.apache.http.util.ByteArrayBuffer
 org.apache.http.util.CharArrayBuffer
+org.apache.http.util.EntityUtils
+org.apache.http.util.VersionInfo
 org.bouncycastle.asn1.DERBitString
 org.bouncycastle.asn1.DERIA5String
 org.bouncycastle.asn1.DERInteger
+org.bouncycastle.asn1.DERObject
 org.bouncycastle.asn1.DERObjectIdentifier
 org.bouncycastle.asn1.DEROctetString
 org.bouncycastle.asn1.DERPrintableString
@@ -875,8 +1130,10 @@
 org.bouncycastle.asn1.DERUTCTime
 org.bouncycastle.asn1.DERUTF8String
 org.bouncycastle.asn1.OrderedTable
+org.bouncycastle.asn1.nist.NISTObjectIdentifiers
 org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers
 org.bouncycastle.asn1.x509.AlgorithmIdentifier
+org.bouncycastle.asn1.x509.RSAPublicKeyStructure
 org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
 org.bouncycastle.asn1.x509.TBSCertificateStructure
 org.bouncycastle.asn1.x509.Time
@@ -886,15 +1143,25 @@
 org.bouncycastle.asn1.x509.X509Name
 org.bouncycastle.asn1.x509.X509NameElementList
 org.bouncycastle.asn1.x9.X9ObjectIdentifiers
+org.bouncycastle.crypto.engines.AESFastEngine
+org.bouncycastle.jce.provider.CertPathValidatorUtilities
+org.bouncycastle.jce.provider.JCEBlockCipher$AES
 org.bouncycastle.jce.provider.JCERSAPublicKey
 org.bouncycastle.jce.provider.JDKKeyFactory$RSA
 org.bouncycastle.jce.provider.JDKKeyStore
 org.bouncycastle.jce.provider.JDKKeyStore$StoreEntry
 org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi
+org.bouncycastle.jce.provider.RSAUtil
 org.bouncycastle.jce.provider.X509CertificateObject
 org.ccil.cowan.tagsoup.HTMLScanner
 org.ccil.cowan.tagsoup.Parser
+org.json.JSONArray
+org.json.JSONObject
+org.json.JSONStringer
 org.kxml2.io.KXmlParser
+org.kxml2.io.KXmlSerializer
 org.xml.sax.helpers.DefaultHandler
 org.xml.sax.helpers.NewInstance
+org.xmlpull.v1.XmlPullParserFactory
 org.xmlpull.v1.sax2.Driver
+sun.misc.Unsafe
diff --git a/services/java/com/android/server/HardwareService.java b/services/java/com/android/server/HardwareService.java
index 7466a37..42367ef 100755
--- a/services/java/com/android/server/HardwareService.java
+++ b/services/java/com/android/server/HardwareService.java
@@ -21,8 +21,10 @@
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.pm.PackageManager;
+import android.os.Handler;
 import android.os.Hardware;
 import android.os.IHardwareService;
+import android.os.Message;
 import android.os.Power;
 import android.os.PowerManager;
 import android.os.Process;
@@ -45,6 +47,9 @@
     static final int LIGHT_FLASH_NONE = 0;
     static final int LIGHT_FLASH_TIMED = 1;
 
+    private boolean mAttentionLightOn;
+    private boolean mPulsing;
+
     HardwareService(Context context) {
         // Reset the hardware to a default state, in case this is a runtime
         // restart instead of a fresh boot.
@@ -217,10 +222,48 @@
 
     public void setAttentionLight(boolean on) {
         // Not worthy of a permission.  We shouldn't have a flashlight permission.
-        setLight_native(mNativePointer, LIGHT_ID_ATTENTION, on ? 0xffffffff : 0,
-                LIGHT_FLASH_NONE, 0, 0);
+        synchronized (this) {
+            mAttentionLightOn = on;
+            mPulsing = false;
+            setLight_native(mNativePointer, LIGHT_ID_ATTENTION, on ? 0xffffffff : 0,
+                    LIGHT_FLASH_NONE, 0, 0);
+        }
     }
 
+    public void pulseBreathingLight() {
+        synchronized (this) {
+            // HACK: Added at the last minute of cupcake -- design this better;
+            // Don't reuse the attention light -- make another one.
+            if (false) {
+                Log.d(TAG, "pulseBreathingLight mAttentionLightOn=" + mAttentionLightOn
+                        + " mPulsing=" + mPulsing);
+            }
+            if (!mAttentionLightOn && !mPulsing) {
+                mPulsing = true;
+                setLight_native(mNativePointer, LIGHT_ID_ATTENTION, 0xff101010,
+                        LIGHT_FLASH_NONE, 0, 0);
+                mH.sendMessageDelayed(Message.obtain(mH, 1), 3000);
+            }
+        }
+    }
+
+    private Handler mH = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            synchronized (this) {
+                if (false) {
+                    Log.d(TAG, "pulse cleanup handler firing mPulsing=" + mPulsing);
+                }
+                if (mPulsing) {
+                    mPulsing = false;
+                    setLight_native(mNativePointer, LIGHT_ID_ATTENTION,
+                            mAttentionLightOn ? 0xffffffff : 0,
+                            LIGHT_FLASH_NONE, 0, 0);
+                }
+            }
+        }
+    };
+
     private void doCancelVibrate() {
         synchronized (this) {
             if (mThread != null) {
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index c4b0587..6ed8b4c 100644
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -588,6 +588,7 @@
                     long identity = Binder.clearCallingIdentity();
                     try {
                         r.statusBarKey = mStatusBarService.addIcon(icon, n);
+                        mHardware.pulseBreathingLight();
                     }
                     finally {
                         Binder.restoreCallingIdentity(identity);
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 2cf47df..7fffcb9 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -3248,12 +3248,18 @@
                     res.removedInfo.sendBroadcast(false, true);
                     Bundle extras = new Bundle(1);
                     extras.putInt(Intent.EXTRA_UID, res.uid);
-                    if (res.removedInfo.removedPackage != null) {
+                    final boolean update = res.removedInfo.removedPackage != null;
+                    if (update) {
                         extras.putBoolean(Intent.EXTRA_REPLACING, true);
                     }
                     sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED,
                                          res.pkg.applicationInfo.packageName,
                                          extras);
+                    if (update) {
+                        sendPackageBroadcast(Intent.ACTION_PACKAGE_REPLACED,
+                                res.pkg.applicationInfo.packageName,
+                                extras);
+                    }
                 }
                 Runtime.getRuntime().gc();
             }
@@ -3894,14 +3900,26 @@
     private boolean deletePackageX(String packageName, boolean sendBroadCast,
                                    boolean deleteCodeAndResources, int flags) {
         PackageRemovedInfo info = new PackageRemovedInfo();
-        boolean res = false;
+        boolean res;
 
         synchronized (mInstallLock) {
             res = deletePackageLI(packageName, deleteCodeAndResources, flags, info);
         }
         
         if(res && sendBroadCast) {
-            info.sendBroadcast(deleteCodeAndResources, false);
+            boolean systemUpdate = info.isRemovedPackageSystemUpdate;
+            info.sendBroadcast(deleteCodeAndResources, systemUpdate);
+
+            // If the removed package was a system update, the old system packaged
+            // was re-enabled; we need to broadcast this information
+            if (systemUpdate) {
+                Bundle extras = new Bundle(1);
+                extras.putInt(Intent.EXTRA_UID, info.removedUid >= 0 ? info.removedUid : info.uid);
+                extras.putBoolean(Intent.EXTRA_REPLACING, true);
+
+                sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName, extras);
+                sendPackageBroadcast(Intent.ACTION_PACKAGE_REPLACED, packageName, extras);
+            }
         }
         return res;
     }
@@ -3910,7 +3928,8 @@
         String removedPackage;
         int uid = -1;
         int removedUid = -1;
-        
+        boolean isRemovedPackageSystemUpdate = false;
+
         void sendBroadcast(boolean fullRemove, boolean replacing) {
             Bundle extras = new Bundle(1);
             extras.putInt(Intent.EXTRA_UID, removedUid >= 0 ? removedUid : uid);
@@ -3996,6 +4015,7 @@
             Log.i(TAG, "Deleting system pkg from data partition");
         }
         // Delete the updated package
+        outInfo.isRemovedPackageSystemUpdate = true;
         boolean ret = deleteInstalledPackageLI(p, deleteCodeAndResources, flags, outInfo);
         if (!ret) {
             return false;
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 5c7ab93..a900b3e 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -135,8 +135,8 @@
 
     private boolean mDoneBooting = false;
     private int mStayOnConditions = 0;
-    private int mNotificationQueue = -1;
-    private int mNotificationWhy;
+    private int[] mBroadcastQueue = new int[] { -1, -1, -1 };
+    private int[] mBroadcastWhy = new int[3];
     private int mPartialCount = 0;
     private int mPowerState;
     private boolean mOffBecauseOfUser;
@@ -170,6 +170,7 @@
             = new BrightnessState(KEYBOARD_BRIGHT_BIT);
     private final BrightnessState mButtonBrightness
             = new BrightnessState(BUTTON_BRIGHT_BIT);
+    private boolean mStillNeedSleepNotification;
     private boolean mIsPowered = false;
     private IActivityManager mActivityService;
     private IBatteryStats mBatteryStats;
@@ -390,7 +391,7 @@
         mHandler = new Handler();
 
         mBroadcastWakeLock = new UnsynchronizedWakeLock(
-                                PowerManager.PARTIAL_WAKE_LOCK, "sleep_notification", true);
+                                PowerManager.PARTIAL_WAKE_LOCK, "sleep_broadcast", true);
         mStayOnWhilePluggedInScreenDimLock = new UnsynchronizedWakeLock(
                                 PowerManager.SCREEN_DIM_WAKE_LOCK, "StayOnWhilePluggedIn Screen Dim", false);
         mStayOnWhilePluggedInPartialLock = new UnsynchronizedWakeLock(
@@ -798,8 +799,10 @@
                 + " mStayOnConditions=" + mStayOnConditions);
         pw.println("  mOffBecauseOfUser=" + mOffBecauseOfUser
                 + " mUserState=" + mUserState);
-        pw.println("  mNotificationQueue=" + mNotificationQueue
-                + " mNotificationWhy=" + mNotificationWhy);
+        pw.println("  mBroadcastQueue={" + mBroadcastQueue[0] + ',' + mBroadcastQueue[1]
+                + ',' + mBroadcastQueue[2] + "}");
+        pw.println("  mBroadcastWhy={" + mBroadcastWhy[0] + ',' + mBroadcastWhy[1]
+                + ',' + mBroadcastWhy[2] + "}");
         pw.println("  mPokey=" + mPokey + " mPokeAwakeonSet=" + mPokeAwakeOnSet);
         pw.println("  mKeyboardVisible=" + mKeyboardVisible
                 + " mUserActivityAllowed=" + mUserActivityAllowed);
@@ -840,6 +843,8 @@
             pw.println("    poke lock '" + p.tag + "':"
                     + ((p.pokey & POKE_LOCK_IGNORE_CHEEK_EVENTS) != 0
                             ? " POKE_LOCK_IGNORE_CHEEK_EVENTS" : "")
+                    + ((p.pokey & POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS) != 0
+                            ? " POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS" : "")
                     + ((p.pokey & POKE_LOCK_SHORT_TIMEOUT) != 0
                             ? " POKE_LOCK_SHORT_TIMEOUT" : "")
                     + ((p.pokey & POKE_LOCK_MEDIUM_TIMEOUT) != 0
@@ -924,29 +929,56 @@
 
     private void sendNotificationLocked(boolean on, int why)
     {
-                    
         if (!on) {
-            mNotificationWhy = why;
+            mStillNeedSleepNotification = false;
         }
 
-        int value = on ? 1 : 0;
-        if (mNotificationQueue == -1) {
-            // empty
-            // Acquire the broadcast wake lock before changing the power
-            // state. It will be release after the broadcast is sent.
-            mBroadcastWakeLock.acquire();
-            EventLog.writeEvent(LOG_POWER_SCREEN_BROADCAST_SEND, mBroadcastWakeLock.mCount);
-            mNotificationQueue = value;
-            mHandler.post(mNotificationTask);
-        } else if (mNotificationQueue != value) {
-            // it's a pair, so cancel it
-            mNotificationQueue = -1;
-            mHandler.removeCallbacks(mNotificationTask);
+        // Add to the queue.
+        int index = 0;
+        while (mBroadcastQueue[index] != -1) {
+            index++;
+        }
+        mBroadcastQueue[index] = on ? 1 : 0;
+        mBroadcastWhy[index] = why;
+
+        // If we added it position 2, then there is a pair that can be stripped.
+        // If we added it position 1 and we're turning the screen off, we can strip
+        // the pair and do nothing, because the screen is already off, and therefore
+        // keyguard has already been enabled.
+        // However, if we added it at position 1 and we're turning it on, then position
+        // 0 was to turn it off, and we can't strip that, because keyguard needs to come
+        // on, so have to run the queue then.
+        if (index == 2) {
+            // Also, while we're collapsing them, if it's going to be an "off," and one
+            // is off because of user, then use that, regardless of whether it's the first
+            // or second one.
+            if (!on && why == WindowManagerPolicy.OFF_BECAUSE_OF_USER) {
+                mBroadcastWhy[0] = WindowManagerPolicy.OFF_BECAUSE_OF_USER;
+            }
+            mBroadcastQueue[0] = on ? 1 : 0;
+            mBroadcastQueue[1] = -1;
+            mBroadcastQueue[2] = -1;
+            index = 0;
+        }
+        if (index == 1 && !on) {
+            mBroadcastQueue[0] = -1;
+            mBroadcastQueue[1] = -1;
+            index = -1;
+            // The wake lock was being held, but we're not actually going to do any
+            // broadcasts, so release the wake lock.
             EventLog.writeEvent(LOG_POWER_SCREEN_BROADCAST_STOP, 1, mBroadcastWakeLock.mCount);
             mBroadcastWakeLock.release();
-        } else {
-            // else, same so do nothing -- maybe we should warn?
-            Log.w(TAG, "Duplicate notification: on=" + on + " why=" + why);
+        }
+
+        // Now send the message.
+        if (index >= 0) {
+            // Acquire the broadcast wake lock before changing the power
+            // state. It will be release after the broadcast is sent.
+            // We always increment the ref count for each notification in the queue
+            // and always decrement when that notification is handled.
+            mBroadcastWakeLock.acquire();
+            EventLog.writeEvent(LOG_POWER_SCREEN_BROADCAST_SEND, mBroadcastWakeLock.mCount);
+            mHandler.post(mNotificationTask);
         }
     }
 
@@ -954,64 +986,69 @@
     {
         public void run()
         {
-            int value;
-            int why;
-            WindowManagerPolicy policy;
-            synchronized (mLocks) {
-                policy = getPolicyLocked();
-                value = mNotificationQueue;
-                why = mNotificationWhy;
-                mNotificationQueue = -1;
-            }
-            if (value == 1) {
-                mScreenOnStart = SystemClock.uptimeMillis();
-                
-                policy.screenTurnedOn();
-                try {
-                    ActivityManagerNative.getDefault().wakingUp();
-                } catch (RemoteException e) {
-                    // ignore it
+            while (true) {
+                int value;
+                int why;
+                WindowManagerPolicy policy;
+                synchronized (mLocks) {
+                    value = mBroadcastQueue[0];
+                    why = mBroadcastWhy[0];
+                    for (int i=0; i<2; i++) {
+                        mBroadcastQueue[i] = mBroadcastQueue[i+1];
+                        mBroadcastWhy[i] = mBroadcastWhy[i+1];
+                    }
+                    policy = getPolicyLocked();
                 }
+                if (value == 1) {
+                    mScreenOnStart = SystemClock.uptimeMillis();
+                    
+                    policy.screenTurnedOn();
+                    try {
+                        ActivityManagerNative.getDefault().wakingUp();
+                    } catch (RemoteException e) {
+                        // ignore it
+                    }
 
-                if (mSpew) {
-                    Log.d(TAG, "mBroadcastWakeLock=" + mBroadcastWakeLock);
-                }
-                if (mContext != null && ActivityManagerNative.isSystemReady()) {
-                    mContext.sendOrderedBroadcast(mScreenOnIntent, null,
-                            mScreenOnBroadcastDone, mHandler, 0, null, null);
-                } else {
-                    synchronized (mLocks) {
-                        EventLog.writeEvent(LOG_POWER_SCREEN_BROADCAST_STOP, 2,
-                                mBroadcastWakeLock.mCount);
-                        mBroadcastWakeLock.release();
+                    if (mSpew) {
+                        Log.d(TAG, "mBroadcastWakeLock=" + mBroadcastWakeLock);
+                    }
+                    if (mContext != null && ActivityManagerNative.isSystemReady()) {
+                        mContext.sendOrderedBroadcast(mScreenOnIntent, null,
+                                mScreenOnBroadcastDone, mHandler, 0, null, null);
+                    } else {
+                        synchronized (mLocks) {
+                            EventLog.writeEvent(LOG_POWER_SCREEN_BROADCAST_STOP, 2,
+                                    mBroadcastWakeLock.mCount);
+                            mBroadcastWakeLock.release();
+                        }
                     }
                 }
-            }
-            else if (value == 0) {
-                mScreenOffStart = SystemClock.uptimeMillis();
-                
-                policy.screenTurnedOff(why);
-                try {
-                    ActivityManagerNative.getDefault().goingToSleep();
-                } catch (RemoteException e) {
-                    // ignore it.
-                }
+                else if (value == 0) {
+                    mScreenOffStart = SystemClock.uptimeMillis();
+                    
+                    policy.screenTurnedOff(why);
+                    try {
+                        ActivityManagerNative.getDefault().goingToSleep();
+                    } catch (RemoteException e) {
+                        // ignore it.
+                    }
 
-                if (mContext != null && ActivityManagerNative.isSystemReady()) {
-                    mContext.sendOrderedBroadcast(mScreenOffIntent, null,
-                            mScreenOffBroadcastDone, mHandler, 0, null, null);
-                } else {
-                    synchronized (mLocks) {
-                        EventLog.writeEvent(LOG_POWER_SCREEN_BROADCAST_STOP, 3,
-                                mBroadcastWakeLock.mCount);
-                        mBroadcastWakeLock.release();
+                    if (mContext != null && ActivityManagerNative.isSystemReady()) {
+                        mContext.sendOrderedBroadcast(mScreenOffIntent, null,
+                                mScreenOffBroadcastDone, mHandler, 0, null, null);
+                    } else {
+                        synchronized (mLocks) {
+                            EventLog.writeEvent(LOG_POWER_SCREEN_BROADCAST_STOP, 3,
+                                    mBroadcastWakeLock.mCount);
+                            mBroadcastWakeLock.release();
+                        }
                     }
                 }
-            }
-            else {
-                // If we're in this case, then this handler is running for a previous
-                // paired transaction.  mBroadcastWakeLock will already have been released
-                // in sendNotificationLocked.
+                else {
+                    // If we're in this case, then this handler is running for a previous
+                    // paired transaction.  mBroadcastWakeLock will already have been released.
+                    break;
+                }
             }
         }
     };
@@ -1235,6 +1272,14 @@
 
             if (oldScreenOn != newScreenOn) {
                 if (newScreenOn) {
+                    // When the user presses the power button, we need to always send out the
+                    // notification that it's going to sleep so the keyguard goes on.  But
+                    // we can't do that until the screen fades out, so we don't show the keyguard
+                    // too early.
+                    if (mStillNeedSleepNotification) {
+                        sendNotificationLocked(false, WindowManagerPolicy.OFF_BECAUSE_OF_USER);
+                    }
+
                     // Turn on the screen UNLESS there was a prior
                     // preventScreenOn(true) request.  (Note that the lifetime
                     // of a single preventScreenOn() request is limited to 5
@@ -1290,7 +1335,7 @@
                     }
                     mPowerState &= ~SCREEN_ON_BIT;
                     if (!mScreenBrightness.animating) {
-                        err = screenOffFinishedAnimating(becauseOfUser);
+                        err = screenOffFinishedAnimatingLocked(becauseOfUser);
                     } else {
                         mOffBecauseOfUser = becauseOfUser;
                         err = 0;
@@ -1301,7 +1346,7 @@
         }
     }
     
-    private int screenOffFinishedAnimating(boolean becauseOfUser) {
+    private int screenOffFinishedAnimatingLocked(boolean becauseOfUser) {
         // I don't think we need to check the current state here because all of these
         // Power.setScreenState and sendNotificationLocked can both handle being 
         // called multiple times in the same state. -joeo
@@ -1345,10 +1390,12 @@
             if (ANIMATE_KEYBOARD_LIGHTS) {
                 if ((newState & KEYBOARD_BRIGHT_BIT) == 0) {
                     mKeyboardBrightness.setTargetLocked(Power.BRIGHTNESS_OFF,
-                            ANIM_STEPS, INITIAL_KEYBOARD_BRIGHTNESS);
+                            ANIM_STEPS, INITIAL_KEYBOARD_BRIGHTNESS,
+                            preferredBrightness);
                 } else {
                     mKeyboardBrightness.setTargetLocked(preferredBrightness,
-                            ANIM_STEPS, INITIAL_KEYBOARD_BRIGHTNESS);
+                            ANIM_STEPS, INITIAL_KEYBOARD_BRIGHTNESS,
+                            Power.BRIGHTNESS_OFF);
                 }
                 startAnimation = true;
             } else {
@@ -1364,10 +1411,12 @@
             if (ANIMATE_BUTTON_LIGHTS) {
                 if ((newState & BUTTON_BRIGHT_BIT) == 0) {
                     mButtonBrightness.setTargetLocked(Power.BRIGHTNESS_OFF,
-                            ANIM_STEPS, INITIAL_BUTTON_BRIGHTNESS);
+                            ANIM_STEPS, INITIAL_BUTTON_BRIGHTNESS,
+                            preferredBrightness);
                 } else {
                     mButtonBrightness.setTargetLocked(preferredBrightness,
-                            ANIM_STEPS, INITIAL_BUTTON_BRIGHTNESS);
+                            ANIM_STEPS, INITIAL_BUTTON_BRIGHTNESS,
+                            Power.BRIGHTNESS_OFF);
                 }
                 startAnimation = true;
             } else {
@@ -1381,6 +1430,23 @@
 
         if ((difference & (SCREEN_ON_BIT | SCREEN_BRIGHT_BIT)) != 0) {
             if (ANIMATE_SCREEN_LIGHTS) {
+                int nominalCurrentValue;
+                switch (oldState & (SCREEN_BRIGHT_BIT|SCREEN_ON_BIT)) {
+                    case SCREEN_BRIGHT_BIT | SCREEN_ON_BIT:
+                        nominalCurrentValue = preferredBrightness;
+                        break;
+                    case SCREEN_ON_BIT:
+                        nominalCurrentValue = Power.BRIGHTNESS_DIM;
+                        break;
+                    case 0:
+                        nominalCurrentValue = Power.BRIGHTNESS_OFF;
+                        break;
+                    case SCREEN_BRIGHT_BIT:
+                    default:
+                        // not possible
+                        nominalCurrentValue = (int)mScreenBrightness.curValue;
+                        break;
+                }
                 if ((newState & SCREEN_BRIGHT_BIT) == 0) {
                     // dim or turn off backlight, depending on if the screen is on
                     // the scale is because the brightness ramp isn't linear and this biases
@@ -1398,7 +1464,7 @@
                             steps = (int)(ANIM_STEPS*ratio*scale);
                         }
                         mScreenBrightness.setTargetLocked(Power.BRIGHTNESS_OFF,
-                                steps, INITIAL_SCREEN_BRIGHTNESS);
+                                steps, INITIAL_SCREEN_BRIGHTNESS, nominalCurrentValue);
                     } else {
                         int steps;
                         if ((oldState & SCREEN_ON_BIT) != 0) {
@@ -1417,11 +1483,11 @@
                             mScreenOffTime = SystemClock.elapsedRealtime();
                         }
                         mScreenBrightness.setTargetLocked(Power.BRIGHTNESS_DIM,
-                                steps, INITIAL_SCREEN_BRIGHTNESS);
+                                steps, INITIAL_SCREEN_BRIGHTNESS, nominalCurrentValue);
                     }
                 } else {
                     mScreenBrightness.setTargetLocked(preferredBrightness,
-                            ANIM_STEPS, INITIAL_SCREEN_BRIGHTNESS);
+                            ANIM_STEPS, INITIAL_SCREEN_BRIGHTNESS, nominalCurrentValue);
                 }
                 startAnimation = true;
             } else {
@@ -1502,16 +1568,20 @@
                     + " delta=" + delta);
         }
         
-        void setTargetLocked(int target, int stepsToTarget, int initialValue) {
+        void setTargetLocked(int target, int stepsToTarget, int initialValue,
+                int nominalCurrentValue) {
             if (!initialized) {
                 initialized = true;
                 curValue = (float)initialValue;
             }
             targetValue = target;
-            delta = (targetValue-curValue) / stepsToTarget;
+            delta = (targetValue-nominalCurrentValue) / stepsToTarget;
             if (mSpew) {
+                String noticeMe = nominalCurrentValue == curValue ? "" : "  ******************";
                 Log.i(TAG, "Setting target " + mask + ": cur=" + curValue
-                        + " target=" + targetValue + " delta=" + delta);
+                        + " target=" + targetValue + " delta=" + delta
+                        + " nominalCurrentValue=" + nominalCurrentValue
+                        + noticeMe);
             }
             animating = true;
         }
@@ -1543,7 +1613,7 @@
             animating = more;
             if (!more) {
                 if (mask == SCREEN_BRIGHT_BIT && curIntValue == Power.BRIGHTNESS_OFF) {
-                    screenOffFinishedAnimating(mOffBecauseOfUser);
+                    screenOffFinishedAnimatingLocked(mOffBecauseOfUser);
                 }
             }
             return more;
@@ -1611,13 +1681,23 @@
         //mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null);
 
         if (((mPokey & POKE_LOCK_IGNORE_CHEEK_EVENTS) != 0)
-            && !((eventType == OTHER_EVENT) || (eventType == BUTTON_EVENT))) {
+                && (eventType == CHEEK_EVENT || eventType == TOUCH_EVENT)) {
             if (false) {
-                Log.d(TAG, "dropping mPokey=0x" + Integer.toHexString(mPokey));
+                Log.d(TAG, "dropping cheek or short event mPokey=0x" + Integer.toHexString(mPokey));
             }
             return;
         }
 
+        if (((mPokey & POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS) != 0)
+                && (eventType == TOUCH_EVENT || eventType == TOUCH_UP_EVENT
+                    || eventType == LONG_TOUCH_EVENT || eventType == CHEEK_EVENT)) {
+            if (false) {
+                Log.d(TAG, "dropping touch mPokey=0x" + Integer.toHexString(mPokey));
+            }
+            return;
+        }
+
+
         if (false) {
             if (((mPokey & POKE_LOCK_IGNORE_CHEEK_EVENTS) != 0)) {
                 Log.d(TAG, "userActivity !!!");//, new RuntimeException());
@@ -1695,6 +1775,7 @@
                 }
             }
             EventLog.writeEvent(LOG_POWER_SLEEP_REQUESTED, numCleared);
+            mStillNeedSleepNotification = true;
             mUserState = SCREEN_OFF;
             setPowerState(SCREEN_OFF, false, true);
             cancelTimerLocked();
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index ddf92e2..6323e2f 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -50,7 +50,6 @@
 import android.os.RemoteException;
 import android.provider.Settings;
 import android.util.Log;
-import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 
 import java.util.ArrayList;
@@ -64,7 +63,6 @@
 import java.io.PrintWriter;
 
 import com.android.internal.app.IBatteryStats;
-import com.android.internal.os.BatteryStatsImpl;
 import com.android.server.am.BatteryStatsService;
 
 /**
@@ -1874,24 +1872,26 @@
     }
 
     private boolean releaseWifiLockLocked(IBinder lock) {
-        boolean result;
+        boolean hadLock;
         
         WifiLock wifiLock = mLocks.removeLock(lock);
-        result = (wifiLock != null);
-        
-        int uid = Binder.getCallingUid();
-        long ident = Binder.clearCallingIdentity();
-        try {
-            switch(wifiLock.mLockMode) {
-            case (WifiManager.WIFI_MODE_FULL): mBatteryStats.noteFullWifiLockReleased(uid);
-            case (WifiManager.WIFI_MODE_SCAN_ONLY): mBatteryStats.noteScanWifiLockReleased(uid);
+        hadLock = (wifiLock != null);
+
+        if (hadLock) {
+            int uid = Binder.getCallingUid();
+            long ident = Binder.clearCallingIdentity();
+            try {
+                switch(wifiLock.mLockMode) {
+                    case (WifiManager.WIFI_MODE_FULL): mBatteryStats.noteFullWifiLockReleased(uid);
+                    case (WifiManager.WIFI_MODE_SCAN_ONLY): mBatteryStats.noteScanWifiLockReleased(uid);
+                }
+            } catch (RemoteException e) {
+            } finally {
+                Binder.restoreCallingIdentity(ident);
             }
-        } catch (RemoteException e) {
-        } finally {
-            Binder.restoreCallingIdentity(ident);
         }
         
         updateWifiState();
-        return result;
+        return hadLock;
     }
 }
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 5623b02..18fd74f 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -19,6 +19,8 @@
 import static android.os.LocalPowerManager.CHEEK_EVENT;
 import static android.os.LocalPowerManager.OTHER_EVENT;
 import static android.os.LocalPowerManager.TOUCH_EVENT;
+import static android.os.LocalPowerManager.LONG_TOUCH_EVENT;
+import static android.os.LocalPowerManager.TOUCH_UP_EVENT;
 import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
 import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
 import static android.view.WindowManager.LayoutParams.FLAG_BLUR_BEHIND;
@@ -2363,6 +2365,7 @@
                         ttoken.startingWindow = null;
                         ttoken.startingMoved = true;
                         startingWindow.mToken = wtoken;
+                        startingWindow.mRootToken = wtoken;
                         startingWindow.mAppToken = wtoken;
                         mWindows.remove(startingWindow);
                         ttoken.windows.remove(startingWindow);
@@ -3678,6 +3681,7 @@
     private static final float CHEEK_THRESHOLD = 0.6f;
     private int mEventState = EVENT_NONE;
     private float mEventSize;
+
     private int eventType(MotionEvent ev) {
         float size = ev.getSize();
         switch (ev.getAction()) {
@@ -3686,7 +3690,7 @@
             return (mEventSize > CHEEK_THRESHOLD) ? CHEEK_EVENT : TOUCH_EVENT;
         case MotionEvent.ACTION_UP:
             if (size > mEventSize) mEventSize = size;
-            return (mEventSize > CHEEK_THRESHOLD) ? CHEEK_EVENT : OTHER_EVENT;
+            return (mEventSize > CHEEK_THRESHOLD) ? CHEEK_EVENT : TOUCH_UP_EVENT;
         case MotionEvent.ACTION_MOVE:
             final int N = ev.getHistorySize();
             if (size > mEventSize) mEventSize = size;
@@ -3699,7 +3703,7 @@
             if (ev.getEventTime() < ev.getDownTime() + EVENT_IGNORE_DURATION) {
                 return TOUCH_EVENT;
             } else {
-                return OTHER_EVENT;
+                return LONG_TOUCH_EVENT;
             }
         default:
             // not good
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 9e2ecba..a7dac61 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -3427,7 +3427,7 @@
      */
     private final boolean requestFinishActivityLocked(IBinder token, int resultCode,
             Intent resultData, String reason) {
-        if (localLOGV) Log.v(
+        if (DEBUG_RESULTS) Log.v(
             TAG, "Finishing activity: token=" + token
             + ", result=" + resultCode + ", data=" + resultData);
 
@@ -3490,7 +3490,9 @@
         // send the result
         HistoryRecord resultTo = r.resultTo;
         if (resultTo != null) {
-            if (DEBUG_RESULTS) Log.v(TAG, "Adding result to " + resultTo);
+            if (DEBUG_RESULTS) Log.v(TAG, "Adding result to " + resultTo
+                    + " who=" + r.resultWho + " req=" + r.requestCode
+                    + " res=" + resultCode + " data=" + resultData);
             if (r.info.applicationInfo.uid > 0) {
                 grantUriPermissionFromIntentLocked(r.info.applicationInfo.uid,
                         r.packageName, resultData, r);
@@ -3499,6 +3501,7 @@
                                      resultData);
             r.resultTo = null;
         }
+        else if (DEBUG_RESULTS) Log.v(TAG, "No result destination from " + r);
 
         // Make sure this HistoryRecord is not holding on to other resources,
         // because clients have remote IPC references to this object so we
@@ -10142,11 +10145,7 @@
             // this decision.
             boolean skip = false;
             if (intent.ACTION_PACKAGE_ADDED.equals(intent.getAction())) {
-                // If this is replacing an existing package, then we allow it
-                // to see the broadcast for it to restart itself.
-                if (!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
-                    skip = true;
-                }
+                skip = true;
             } else if (intent.ACTION_PACKAGE_RESTARTED.equals(intent.getAction())) {
                 skip = true;
             } else if (intent.ACTION_PACKAGE_DATA_CLEARED.equals(intent.getAction())) {
diff --git a/services/java/com/android/server/am/BatteryStatsService.java b/services/java/com/android/server/am/BatteryStatsService.java
index cc9a0af..ee89c09 100644
--- a/services/java/com/android/server/am/BatteryStatsService.java
+++ b/services/java/com/android/server/am/BatteryStatsService.java
@@ -162,7 +162,21 @@
             mStats.noteWifiOffLocked();
         }
     }
-    
+
+    public void noteWifiRunning() {
+        enforceCallingPermission();
+        synchronized (mStats) {
+            mStats.noteWifiRunningLocked();
+        }
+    }
+
+    public void noteWifiStopped() {
+        enforceCallingPermission();
+        synchronized (mStats) {
+            mStats.noteWifiStoppedLocked();
+        }
+    }
+
     public void noteBluetoothOn() {
         enforceCallingPermission();
         synchronized (mStats) {
diff --git a/services/java/com/android/server/status/DateView.java b/services/java/com/android/server/status/DateView.java
index 7c44d67..78bfd5e 100644
--- a/services/java/com/android/server/status/DateView.java
+++ b/services/java/com/android/server/status/DateView.java
@@ -4,12 +4,12 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.text.format.DateFormat;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.widget.TextView;
 import android.view.MotionEvent;
 
+import java.text.DateFormat;
 import java.util.Date;
 
 public final class DateView extends TextView {
@@ -51,7 +51,7 @@
 
     private final void updateClock() {
         Date now = new Date();
-        setText(DateFormat.getLongDateFormat(getContext()).format(now));
+        setText(DateFormat.getDateInstance(DateFormat.LONG).format(now));
     }
 
     void setUpdates(boolean update) {
diff --git a/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java b/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java
index 2f91411..3ca39de65 100644
--- a/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java
+++ b/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java
@@ -32,11 +32,15 @@
     String user;
     String password;
     String[] types;
+    int id;
+    String numeric;
 
 
-    ApnSetting(String carrier, String apn, String proxy, String port,
+    ApnSetting(int id, String numeric, String carrier, String apn, String proxy, String port,
             String mmsc, String mmsProxy, String mmsPort,
             String user, String password, String[] types) {
+        this.id = id;
+        this.numeric = numeric;
         this.carrier = carrier;
         this.apn = apn;
         this.proxy = proxy;
@@ -52,6 +56,8 @@
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append(carrier)
+        .append(", ").append(id)
+        .append(", ").append(numeric)
         .append(", ").append(apn)
         .append(", ").append(proxy)
         .append(", ").append(mmsc)
diff --git a/telephony/java/com/android/internal/telephony/gsm/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/DataConnectionTracker.java
index 30b1be8..999a508 100644
--- a/telephony/java/com/android/internal/telephony/gsm/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/DataConnectionTracker.java
@@ -20,6 +20,7 @@
 import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
 import android.content.ContentResolver;
+import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
@@ -28,6 +29,7 @@
 import android.database.Cursor;
 import android.net.NetworkInfo;
 import android.net.wifi.WifiManager;
+import android.net.Uri;
 import android.os.AsyncResult;
 import android.os.Handler;
 import android.os.INetStatService;
@@ -149,6 +151,8 @@
      */
     private ArrayList<ApnSetting> waitingApns = null;
 
+    private ApnSetting preferredApn = null;
+
     /**
      * pdpList holds all the PDP connection, i.e. IP Link in GPRS
      */
@@ -255,6 +259,10 @@
     static final int EVENT_PS_RESTRICT_ENABLED = 30;
     static final int EVENT_PS_RESTRICT_DISABLED = 31;
 
+    static final Uri PREFERAPN_URI = Uri.parse("content://telephony/carriers/preferapn");
+    static final String APN_ID = "apn_id";
+    private boolean canSetPreferApn = false;
+
     BroadcastReceiver mIntentReceiver = new BroadcastReceiver ()
     {
         @Override
@@ -787,6 +795,8 @@
                 String[] types = parseTypes(
                         cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.TYPE)));
                 ApnSetting apn = new ApnSetting(
+                        cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers._ID)),
+                        cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.NUMERIC)),
                         cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.NAME)),
                         cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.APN)),
                         cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.PROXY)),
@@ -1459,6 +1469,11 @@
                     }
                     if (isApnTypeActive(Phone.APN_TYPE_DEFAULT)) {
                         SystemProperties.set("gsm.defaultpdpcontext.active", "true");
+                        if (canSetPreferApn && preferredApn == null) {
+                            Log.d(LOG_TAG, "PREFERED APN is null");
+                            preferredApn = mActiveApn;
+                            setPreferredApn(preferredApn.id);
+                        }
                     } else {
                         SystemProperties.set("gsm.defaultpdpcontext.active", "false");
                     }
@@ -1679,6 +1694,13 @@
         if (allApns.isEmpty()) {
             if (DBG) log("No APN found for carrier: " + operator);
             notifyNoData(PdpConnection.PdpFailCause.BAD_APN);
+        } else {
+            preferredApn = getPreferredApn();
+            Log.d(LOG_TAG, "Get PreferredAPN");
+            if (preferredApn != null && !preferredApn.numeric.equals(operator)) {
+                preferredApn = null;
+                setPreferredApn(-1);
+            }
         }
     }
 
@@ -1699,6 +1721,22 @@
      */
     private ArrayList<ApnSetting> buildWaitingApns() {
         ArrayList<ApnSetting> apnList = new ArrayList<ApnSetting>();
+        String operator = phone.mSIMRecords.getSIMOperatorNumeric();
+
+        if (mRequestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
+            if (canSetPreferApn && preferredApn != null) {
+                Log.i(LOG_TAG, "Preferred APN:" + operator + ":"
+                        + preferredApn.numeric + ":" + preferredApn);
+                if (preferredApn.numeric.equals(operator)) {
+                    Log.i(LOG_TAG, "Waiting APN set to preferred APN");
+                    apnList.add(preferredApn);
+                    return apnList;
+                } else {
+                    setPreferredApn(-1);
+                    preferredApn = null;
+                }
+            }
+        }
 
         if (allApns != null) {
             for (ApnSetting apn : allApns) {
@@ -1745,4 +1783,53 @@
             reconnectAfterFail(cause, reason);
         }
     }
+
+    private void setPreferredApn(int pos) {
+        if (!canSetPreferApn) {
+            return;
+        }
+
+        ContentResolver resolver = phone.getContext().getContentResolver();
+        resolver.delete(PREFERAPN_URI, null, null);
+
+        if (pos >= 0) {            
+            ContentValues values = new ContentValues();
+            values.put(APN_ID, pos);
+            resolver.insert(PREFERAPN_URI, values);
+        }
+    }
+
+    private ApnSetting getPreferredApn() {
+        if (allApns.isEmpty()) {
+            return null;
+        }
+
+        Cursor cursor = phone.getContext().getContentResolver().query(
+                PREFERAPN_URI, new String[] { "_id", "name", "apn" }, 
+                null, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
+
+        if (cursor != null) {
+            canSetPreferApn = true;
+        } else {
+            canSetPreferApn = false;
+        }
+
+        if (canSetPreferApn && cursor.getCount() > 0) {
+            int pos;
+            cursor.moveToFirst();
+            pos = cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers._ID));
+            for(ApnSetting p:allApns) {
+                if (p.id == pos) {
+                    cursor.close();
+                    return p;
+                }
+            }
+        }
+
+        if (cursor != null) {
+            cursor.close();
+        }
+
+        return null;
+    }
 }
diff --git a/telephony/java/com/android/internal/telephony/gsm/RIL.java b/telephony/java/com/android/internal/telephony/gsm/RIL.java
index b210868..e2d0f72 100644
--- a/telephony/java/com/android/internal/telephony/gsm/RIL.java
+++ b/telephony/java/com/android/internal/telephony/gsm/RIL.java
@@ -2347,9 +2347,7 @@
             dc.als = p.readInt();
             dc.isVoice = (0 == p.readInt()) ? false : true;
             dc.number = p.readString();
-            
-            // TODO get presentation from p.readInt() after checkin new RIL
-            dc.numberPresentation = DriverCall.presentationFromCLIP(0);
+            dc.numberPresentation = DriverCall.presentationFromCLIP(p.readInt());
             
             // Make sure there's a leading + on addresses with a TOA
             // of 145
diff --git a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
index f236a4b..f778cab 100644
--- a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
+++ b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
@@ -62,7 +62,7 @@
         return mTests;
     }
     private Test[] mTests = new Test[] {
-        new Test("Touch events don't poke") {
+        new Test("Cheek events don't poke") {
             public void run() {
                 mPokeState |= LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
                 try {
@@ -72,7 +72,7 @@
                 }
             }
         },
-        new Test("Touch events poke") {
+        new Test("Cheek events poke") {
             public void run() {
                 mPokeState &= ~LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
                 try {
@@ -82,6 +82,26 @@
                 }
             }
         },
+        new Test("Touch and Cheek events don't poke") {
+            public void run() {
+                mPokeState |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
+                try {
+                    mPowerManager.setPokeLock(mPokeState, mPokeToken, TAG);
+                } catch (RemoteException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        },
+        new Test("Touch and Cheek events poke") {
+            public void run() {
+                mPokeState &= ~LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
+                try {
+                    mPowerManager.setPokeLock(mPokeState, mPokeToken, TAG);
+                } catch (RemoteException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        },
         new Test("Short timeout") {
             public void run() {
                 mPokeState &= ~LocalPowerManager.POKE_LOCK_TIMEOUT_MASK;
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java
index 452a8fa..f7a9677 100644
--- a/wifi/java/android/net/wifi/WifiStateTracker.java
+++ b/wifi/java/android/net/wifi/WifiStateTracker.java
@@ -30,6 +30,8 @@
 import android.os.HandlerThread;
 import android.os.SystemProperties;
 import android.os.Looper;
+import android.os.RemoteException;
+import android.os.ServiceManager;
 import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.EventLog;
@@ -43,6 +45,7 @@
 import android.content.Intent;
 import android.content.Context;
 import android.database.ContentObserver;
+import com.android.internal.app.IBatteryStats;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -244,12 +247,12 @@
     private static final int RUN_STATE_STOPPED  = 4;
     private int mRunState;
 
+    private final IBatteryStats mBatteryStats;
+
     private boolean mIsScanOnly;
 
     private BluetoothA2dp mBluetoothA2dp;
 
-    private boolean mBluetoothScanMode;
-    
     private String mInterfaceName;
     private static String LS = System.getProperty("line.separator");
 
@@ -316,6 +319,8 @@
             "dhcp." + mInterfaceName + ".dns1",
             "dhcp." + mInterfaceName + ".dns2"
         };
+        mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService("batteryinfo"));
+
     }
 
     /**
@@ -501,7 +506,7 @@
      * Send the tracker a notification that the Wi-Fi driver has been stopped.
      */
     void notifyDriverStopped() {
-       mRunState = RUN_STATE_STOPPED;
+        mRunState = RUN_STATE_STOPPED;
 
         // Send a driver stopped message to our handler
         Message.obtain(this, EVENT_DRIVER_STATE_CHANGED, 0, 0).sendToTarget();
@@ -530,6 +535,17 @@
         return mRunState == RUN_STATE_STOPPED || mRunState == RUN_STATE_STOPPING;
     }
 
+    private void noteRunState() {
+        try {
+            if (mRunState == RUN_STATE_RUNNING) {
+                mBatteryStats.noteWifiRunning();
+            } else if (mRunState == RUN_STATE_STOPPED) {
+                mBatteryStats.noteWifiStopped();
+            }
+        } catch (RemoteException ignore) {
+        }
+    }
+
     /**
      * Set the number of allowed radio frequency channels from the system
      * setting value, if any.
@@ -654,6 +670,7 @@
         switch (msg.what) {
             case EVENT_SUPPLICANT_CONNECTION:
                 mRunState = RUN_STATE_RUNNING;
+                noteRunState();
                 checkUseStaticIp();
                 /*
                  * DHCP requests are blocking, so run them in a separate thread.
@@ -721,6 +738,8 @@
                 break;
 
             case EVENT_SUPPLICANT_DISCONNECT:
+                mRunState = RUN_STATE_STOPPED;
+                noteRunState();
                 int wifiState = mWM.getWifiState();
                 boolean died = wifiState != WifiManager.WIFI_STATE_DISABLED &&
                         wifiState != WifiManager.WIFI_STATE_DISABLING;
@@ -1079,6 +1098,7 @@
                         }
                     }
                 }
+                noteRunState();
                 break;
 
             case EVENT_PASSWORD_KEY_MAY_BE_INCORRECT: