Merge "Add missing resume() call"
diff --git a/api/current.txt b/api/current.txt
index 7ebabe4..42b1e18 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -11637,6 +11637,12 @@
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_AVAILABLE_TEST_PATTERN_MODES;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_BASE_GAIN_FACTOR;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_BLACK_LEVEL_PATTERN;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_CALIBRATION_TRANSFORM1;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_CALIBRATION_TRANSFORM2;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_COLOR_TRANSFORM1;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_COLOR_TRANSFORM2;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FORWARD_MATRIX1;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FORWARD_MATRIX2;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_ACTIVE_ARRAY_SIZE;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_COLOR_FILTER_ARRANGEMENT;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_EXPOSURE_TIME_RANGE;
@@ -11648,6 +11654,8 @@
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_MAX_ANALOG_SENSITIVITY;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_ORIENTATION;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_REFERENCE_ILLUMINANT1;
+    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_REFERENCE_ILLUMINANT2;
     field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES;
     field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES;
     field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_MAX_FACE_COUNT;
@@ -11841,25 +11849,25 @@
     field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1; // 0x1
     field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4; // 0x4
     field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB = 0; // 0x0
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_CLOUDY_WEATHER = 10; // 0xa
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_COOL_WHITE_FLUORESCENT = 14; // 0xe
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_D50 = 23; // 0x17
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_D55 = 20; // 0x14
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_D65 = 21; // 0x15
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_D75 = 22; // 0x16
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT = 1; // 0x1
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT_FLUORESCENT = 12; // 0xc
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_DAY_WHITE_FLUORESCENT = 13; // 0xd
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_FINE_WEATHER = 9; // 0x9
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_FLASH = 4; // 0x4
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_FLUORESCENT = 2; // 0x2
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_ISO_STUDIO_TUNGSTEN = 24; // 0x18
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_SHADE = 11; // 0xb
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_STANDARD_A = 17; // 0x11
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_STANDARD_B = 18; // 0x12
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_STANDARD_C = 19; // 0x13
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_TUNGSTEN = 3; // 0x3
-    field public static final int SENSOR_REFERENCE_ILLUMINANT_WHITE_FLUORESCENT = 15; // 0xf
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10; // 0xa
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14; // 0xe
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D50 = 23; // 0x17
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D55 = 20; // 0x14
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D65 = 21; // 0x15
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D75 = 22; // 0x16
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1; // 0x1
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12; // 0xc
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13; // 0xd
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9; // 0x9
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4; // 0x4
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2; // 0x2
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24; // 0x18
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11; // 0xb
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17; // 0x11
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18; // 0x12
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19; // 0x13
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3; // 0x3
+    field public static final int SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15; // 0xf
     field public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2; // 0x2
     field public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3; // 0x3
     field public static final int SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256; // 0x100
@@ -12009,16 +12017,12 @@
     field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_FRAME_COUNT;
     field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_PIPELINE_DEPTH;
     field public static final android.hardware.camera2.CameraMetadata.Key SCALER_CROP_REGION;
-    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_CALIBRATION_TRANSFORM;
-    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_COLOR_TRANSFORM;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_EXPOSURE_TIME;
-    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FORWARD_MATRIX;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FRAME_DURATION;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_GREEN_SPLIT;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_NEUTRAL_COLOR_POINT;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_PROFILE_HUE_SAT_MAP;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_PROFILE_TONE_CURVE;
-    field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_REFERENCE_ILLUMINANT;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_SENSITIVITY;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_TEMPERATURE;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_TEST_PATTERN_MODE;
@@ -19102,6 +19106,7 @@
     field public static final int JELLY_BEAN_MR1 = 17; // 0x11
     field public static final int JELLY_BEAN_MR2 = 18; // 0x12
     field public static final int KITKAT = 19; // 0x13
+    field public static final int KITKAT_WATCH = 10000; // 0x2710
     field public static final int L = 10000; // 0x2710
   }
 
@@ -25202,6 +25207,18 @@
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
+  public class DataConnectionRealTimeInfo implements android.os.Parcelable {
+    method public int describeContents();
+    method public int getDcPowerState();
+    method public long getTime();
+    method public void writeToParcel(android.os.Parcel, int);
+    field public static final android.os.Parcelable.Creator CREATOR;
+    field public static int DC_POWER_STATE_HIGH;
+    field public static int DC_POWER_STATE_LOW;
+    field public static int DC_POWER_STATE_MEDIUM;
+    field public static int DC_POWER_STATE_UNKNOWN;
+  }
+
   public class NeighboringCellInfo implements android.os.Parcelable {
     ctor public deprecated NeighboringCellInfo();
     ctor public deprecated NeighboringCellInfo(int, int);
@@ -30946,6 +30963,7 @@
     method public boolean hasInsets();
     method public boolean hasSystemWindowInsets();
     method public boolean hasWindowDecorInsets();
+    method public boolean isRound();
   }
 
   public abstract interface WindowManager implements android.view.ViewManager {
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 9f1b56e..44c74d8 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -2029,7 +2029,7 @@
             data.enforceInterface(IActivityManager.descriptor);
             IBinder parentActivityToken = data.readStrongBinder();
             IActivityContainerCallback callback =
-                    (IActivityContainerCallback) data.readStrongBinder();
+                    IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
             IActivityContainer activityContainer =
                     createActivityContainer(parentActivityToken, callback);
             reply.writeNoException();
@@ -4744,7 +4744,7 @@
         Parcel reply = Parcel.obtain();
         data.writeInterfaceToken(IActivityManager.descriptor);
         data.writeStrongBinder(parentActivityToken);
-        data.writeStrongBinder((IBinder)callback);
+        data.writeStrongBinder(callback == null ? null : callback.asBinder());
         mRemote.transact(CREATE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
         reply.readException();
         final int result = reply.readInt();
diff --git a/core/java/android/app/ActivityView.java b/core/java/android/app/ActivityView.java
index 113f123..51cb12a 100644
--- a/core/java/android/app/ActivityView.java
+++ b/core/java/android/app/ActivityView.java
@@ -92,8 +92,8 @@
         super.onAttachedToWindow();
         try {
             final IBinder token = mActivity.getActivityToken();
-            mActivityContainer =
-                    ActivityManagerNative.getDefault().createActivityContainer(token, null);
+            mActivityContainer = ActivityManagerNative.getDefault().createActivityContainer(token,
+                      new ActivityContainerCallback());
         } catch (RemoteException e) {
             throw new IllegalStateException("ActivityView: Unable to create ActivityContainer. "
                     + e);
@@ -282,4 +282,14 @@
         }
 
     }
+
+    private class ActivityContainerCallback extends IActivityContainerCallback.Stub {
+        @Override
+        public void setVisible(IBinder container, boolean visible) {
+            if (DEBUG) Log.v(TAG, "setVisible(): container=" + container + " visible=" + visible);
+            if (visible) {
+            } else {
+            }
+        }
+    }
 }
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index f444680..77b5485 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -72,6 +72,7 @@
 import android.net.IConnectivityManager;
 import android.net.INetworkPolicyManager;
 import android.net.NetworkPolicyManager;
+import android.net.NetworkScoreManager;
 import android.net.Uri;
 import android.net.nsd.INsdManager;
 import android.net.nsd.NsdManager;
@@ -654,6 +655,12 @@
                 ITvInputManager service = ITvInputManager.Stub.asInterface(iBinder);
                 return new TvInputManager(service, UserHandle.myUserId());
             }});
+
+        registerService(NETWORK_SCORE_SERVICE, new ServiceFetcher() {
+            public Object createService(ContextImpl ctx) {
+                return new NetworkScoreManager(ctx);
+            }
+        });
     }
 
     static ContextImpl getImpl(Context context) {
diff --git a/core/java/android/app/IActivityContainerCallback.aidl b/core/java/android/app/IActivityContainerCallback.aidl
index 55c2001..7f6d2c3 100644
--- a/core/java/android/app/IActivityContainerCallback.aidl
+++ b/core/java/android/app/IActivityContainerCallback.aidl
@@ -20,5 +20,5 @@
 
 /** @hide */
 interface IActivityContainerCallback {
-    oneway void onLastActivityRemoved(IBinder container);
+    oneway void setVisible(IBinder container, boolean visible);
 }
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index 9911467..bb6eeda 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -31,7 +31,7 @@
 
     void enqueueToast(String pkg, ITransientNotification callback, int duration);
     void cancelToast(String pkg, ITransientNotification callback);
-    void enqueueNotificationWithTag(String pkg, String basePkg, String tag, int id,
+    void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
             in Notification notification, inout int[] idReceived, int userId);
     void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
 
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 15cb9e9..ff92d82 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -2643,6 +2643,14 @@
     public static final String TV_INPUT_SERVICE = "tv_input";
 
     /**
+     * {@link android.net.NetworkScoreManager} for managing network scoring.
+     * @see #getSystemService
+     * @see android.net.NetworkScoreManager
+     * @hide
+     */
+    public static final String NETWORK_SCORE_SERVICE = "network_score";
+
+    /**
      * Determine whether the given permission is allowed for a particular
      * process and user ID running in the system.
      *
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index 9852776..528e119 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -1030,6 +1030,195 @@
             new Key<Integer>("android.sensor.info.whiteLevel", int.class);
 
     /**
+     * <p>The standard reference illuminant used as the scene light source when
+     * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
+     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
+     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
+     * <p>The values in this tag correspond to the values defined for the
+     * EXIF LightSource tag. These illuminants are standard light sources
+     * that are often used calibrating camera devices.</p>
+     * <p>If this tag is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
+     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
+     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
+     * <p>Some devices may choose to provide a second set of calibration
+     * information for improved quality, including
+     * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
+     * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
+     * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
+     * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
+     */
+    public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
+            new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
+
+    /**
+     * <p>The standard reference illuminant used as the scene light source when
+     * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
+     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
+     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
+     * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.
+     * Valid values for this are the same as those given for the first
+     * reference illuminant.</p>
+     * <p>If this tag is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
+     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
+     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
+     * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
+     * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
+            new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
+
+    /**
+     * <p>A per-device calibration transform matrix that maps from the
+     * reference sensor colorspace to the actual device sensor colorspace.</p>
+     * <p>This matrix is used to correct for per-device variations in the
+     * sensor colorspace, and is used for processing raw buffer data.</p>
+     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
+     * contains a per-device calibration transform that maps colors
+     * from reference sensor color space (i.e. the "golden module"
+     * colorspace) into this camera device's native sensor color
+     * space under the first reference illuminant
+     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
+     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final Key<Rational[]> SENSOR_CALIBRATION_TRANSFORM1 =
+            new Key<Rational[]>("android.sensor.calibrationTransform1", Rational[].class);
+
+    /**
+     * <p>A per-device calibration transform matrix that maps from the
+     * reference sensor colorspace to the actual device sensor colorspace
+     * (this is the colorspace of the raw buffer data).</p>
+     * <p>This matrix is used to correct for per-device variations in the
+     * sensor colorspace, and is used for processing raw buffer data.</p>
+     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
+     * contains a per-device calibration transform that maps colors
+     * from reference sensor color space (i.e. the "golden module"
+     * colorspace) into this camera device's native sensor color
+     * space under the second reference illuminant
+     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
+     * <p>This matrix will only be present if the second reference
+     * illuminant is present.</p>
+     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
+     */
+    public static final Key<Rational[]> SENSOR_CALIBRATION_TRANSFORM2 =
+            new Key<Rational[]>("android.sensor.calibrationTransform2", Rational[].class);
+
+    /**
+     * <p>A matrix that transforms color values from CIE XYZ color space to
+     * reference sensor color space.</p>
+     * <p>This matrix is used to convert from the standard CIE XYZ color
+     * space to the reference sensor colorspace, and is used when processing
+     * raw buffer data.</p>
+     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
+     * contains a color transform matrix that maps colors from the CIE
+     * XYZ color space to the reference sensor color space (i.e. the
+     * "golden module" colorspace) under the first reference illuminant
+     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
+     * <p>The white points chosen in both the reference sensor color space
+     * and the CIE XYZ colorspace when calculating this transform will
+     * match the standard white point for the first reference illuminant
+     * (i.e. no chromatic adaptation will be applied by this transform).</p>
+     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final Key<Rational[]> SENSOR_COLOR_TRANSFORM1 =
+            new Key<Rational[]>("android.sensor.colorTransform1", Rational[].class);
+
+    /**
+     * <p>A matrix that transforms color values from CIE XYZ color space to
+     * reference sensor color space.</p>
+     * <p>This matrix is used to convert from the standard CIE XYZ color
+     * space to the reference sensor colorspace, and is used when processing
+     * raw buffer data.</p>
+     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
+     * contains a color transform matrix that maps colors from the CIE
+     * XYZ color space to the reference sensor color space (i.e. the
+     * "golden module" colorspace) under the second reference illuminant
+     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
+     * <p>The white points chosen in both the reference sensor color space
+     * and the CIE XYZ colorspace when calculating this transform will
+     * match the standard white point for the second reference illuminant
+     * (i.e. no chromatic adaptation will be applied by this transform).</p>
+     * <p>This matrix will only be present if the second reference
+     * illuminant is present.</p>
+     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
+     */
+    public static final Key<Rational[]> SENSOR_COLOR_TRANSFORM2 =
+            new Key<Rational[]>("android.sensor.colorTransform2", Rational[].class);
+
+    /**
+     * <p>A matrix that transforms white balanced camera colors from the reference
+     * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
+     * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
+     * is used when processing raw buffer data.</p>
+     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
+     * a color transform matrix that maps white balanced colors from the
+     * reference sensor color space to the CIE XYZ color space with a D50 white
+     * point.</p>
+     * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
+     * this matrix is chosen so that the standard white point for this reference
+     * illuminant in the reference sensor colorspace is mapped to D50 in the
+     * CIE XYZ colorspace.</p>
+     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final Key<Rational[]> SENSOR_FORWARD_MATRIX1 =
+            new Key<Rational[]>("android.sensor.forwardMatrix1", Rational[].class);
+
+    /**
+     * <p>A matrix that transforms white balanced camera colors from the reference
+     * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
+     * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
+     * is used when processing raw buffer data.</p>
+     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
+     * a color transform matrix that maps white balanced colors from the
+     * reference sensor color space to the CIE XYZ color space with a D50 white
+     * point.</p>
+     * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
+     * this matrix is chosen so that the standard white point for this reference
+     * illuminant in the reference sensor colorspace is mapped to D50 in the
+     * CIE XYZ colorspace.</p>
+     * <p>This matrix will only be present if the second reference
+     * illuminant is present.</p>
+     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
+     *
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
+     */
+    public static final Key<Rational[]> SENSOR_FORWARD_MATRIX2 =
+            new Key<Rational[]>("android.sensor.forwardMatrix2", Rational[].class);
+
+    /**
      * <p>Gain factor from electrons to raw units when
      * ISO=100</p>
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 9b1bc53..ba8db3a 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -457,6 +457,110 @@
     public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4;
 
     //
+    // Enumeration values for CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+    //
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2;
+
+    /**
+     * <p>Incandescent light</p>
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11;
+
+    /**
+     * <p>D 5700 - 7100K</p>
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12;
+
+    /**
+     * <p>N 4600 - 5400K</p>
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13;
+
+    /**
+     * <p>W 3900 - 4500K</p>
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14;
+
+    /**
+     * <p>WW 3200 - 3700K</p>
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_D55 = 20;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_D65 = 21;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_D75 = 22;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_D50 = 23;
+
+    /**
+     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
+     */
+    public static final int SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24;
+
+    //
     // Enumeration values for CameraCharacteristics#LED_AVAILABLE_LEDS
     //
 
@@ -1731,110 +1835,6 @@
     public static final int LENS_STATE_MOVING = 1;
 
     //
-    // Enumeration values for CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-    //
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT = 1;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_FLUORESCENT = 2;
-
-    /**
-     * <p>Incandescent light</p>
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_TUNGSTEN = 3;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_FLASH = 4;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_FINE_WEATHER = 9;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_CLOUDY_WEATHER = 10;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_SHADE = 11;
-
-    /**
-     * <p>D 5700 - 7100K</p>
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT_FLUORESCENT = 12;
-
-    /**
-     * <p>N 4600 - 5400K</p>
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_DAY_WHITE_FLUORESCENT = 13;
-
-    /**
-     * <p>W 3900 - 4500K</p>
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_COOL_WHITE_FLUORESCENT = 14;
-
-    /**
-     * <p>WW 3200 - 3700K</p>
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_WHITE_FLUORESCENT = 15;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_STANDARD_A = 17;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_STANDARD_B = 18;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_STANDARD_C = 19;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_D55 = 20;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_D65 = 21;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_D75 = 22;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_D50 = 23;
-
-    /**
-     * @see CaptureResult#SENSOR_REFERENCE_ILLUMINANT
-     */
-    public static final int SENSOR_REFERENCE_ILLUMINANT_ISO_STUDIO_TUNGSTEN = 24;
-
-    //
     // Enumeration values for CaptureResult#STATISTICS_SCENE_FLICKER
     //
 
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index b3bce3b..70d3c63 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -1607,77 +1607,14 @@
             new Key<Float>("android.sensor.temperature", float.class);
 
     /**
-     * <p>A reference illumination source roughly matching the current scene
-     * illumination, which is used to describe the sensor color space
-     * transformations.</p>
-     * <p>The values in this tag correspond to the values defined for the
-     * EXIF LightSource tag. These illuminants are standard light sources
-     * that are often used for calibrating camera devices.</p>
-     * @see #SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT
-     * @see #SENSOR_REFERENCE_ILLUMINANT_FLUORESCENT
-     * @see #SENSOR_REFERENCE_ILLUMINANT_TUNGSTEN
-     * @see #SENSOR_REFERENCE_ILLUMINANT_FLASH
-     * @see #SENSOR_REFERENCE_ILLUMINANT_FINE_WEATHER
-     * @see #SENSOR_REFERENCE_ILLUMINANT_CLOUDY_WEATHER
-     * @see #SENSOR_REFERENCE_ILLUMINANT_SHADE
-     * @see #SENSOR_REFERENCE_ILLUMINANT_DAYLIGHT_FLUORESCENT
-     * @see #SENSOR_REFERENCE_ILLUMINANT_DAY_WHITE_FLUORESCENT
-     * @see #SENSOR_REFERENCE_ILLUMINANT_COOL_WHITE_FLUORESCENT
-     * @see #SENSOR_REFERENCE_ILLUMINANT_WHITE_FLUORESCENT
-     * @see #SENSOR_REFERENCE_ILLUMINANT_STANDARD_A
-     * @see #SENSOR_REFERENCE_ILLUMINANT_STANDARD_B
-     * @see #SENSOR_REFERENCE_ILLUMINANT_STANDARD_C
-     * @see #SENSOR_REFERENCE_ILLUMINANT_D55
-     * @see #SENSOR_REFERENCE_ILLUMINANT_D65
-     * @see #SENSOR_REFERENCE_ILLUMINANT_D75
-     * @see #SENSOR_REFERENCE_ILLUMINANT_D50
-     * @see #SENSOR_REFERENCE_ILLUMINANT_ISO_STUDIO_TUNGSTEN
-     */
-    public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT =
-            new Key<Integer>("android.sensor.referenceIlluminant", int.class);
-
-    /**
-     * <p>A per-device calibration transform matrix to be applied after the
-     * color space transform when rendering the raw image buffer.</p>
-     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and
-     * contains a per-device calibration transform that maps colors
-     * from reference camera color space (i.e. the "golden module"
-     * colorspace) into this camera device's linear native sensor color
-     * space for the current scene illumination and white balance choice.</p>
-     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
-     */
-    public static final Key<Rational[]> SENSOR_CALIBRATION_TRANSFORM =
-            new Key<Rational[]>("android.sensor.calibrationTransform", Rational[].class);
-
-    /**
-     * <p>A matrix that transforms color values from CIE XYZ color space to
-     * reference camera color space when rendering the raw image buffer.</p>
-     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and
-     * contains a color transform matrix that maps colors from the CIE
-     * XYZ color space to the reference camera raw color space (i.e. the
-     * "golden module" colorspace) for the current scene illumination and
-     * white balance choice.</p>
-     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
-     */
-    public static final Key<Rational[]> SENSOR_COLOR_TRANSFORM =
-            new Key<Rational[]>("android.sensor.colorTransform", Rational[].class);
-
-    /**
-     * <p>A matrix that transforms white balanced camera colors to the CIE XYZ
-     * colorspace with a D50 whitepoint.</p>
-     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
-     * a color transform matrix that maps a unit vector in the linear native
-     * sensor color space to the D50 whitepoint in CIE XYZ color space.</p>
-     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
-     */
-    public static final Key<Rational[]> SENSOR_FORWARD_MATRIX =
-            new Key<Rational[]>("android.sensor.forwardMatrix", Rational[].class);
-
-    /**
-     * <p>The estimated white balance at the time of capture.</p>
-     * <p>The estimated white balance encoded as the RGB values of the
-     * perfectly neutral color point in the linear native sensor color space.
-     * The order of the values is R, G, B; where R is in the lowest index.</p>
+     * <p>The estimated camera neutral color in the native sensor colorspace at
+     * the time of capture.</p>
+     * <p>This value gives the neutral color point encoded as an RGB value in the
+     * native sensor color space.  The neutral color point indicates the
+     * currently estimated white point of the scene illumination.  It can be
+     * used to interpolate between the provided color transforms when
+     * processing raw sensor data.</p>
+     * <p>The order of the values is R, G, B; where R is in the lowest index.</p>
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
      */
     public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java
index 0c0dfe9..b5efa8e 100644
--- a/core/java/android/hardware/input/InputManager.java
+++ b/core/java/android/hardware/input/InputManager.java
@@ -857,7 +857,7 @@
          * @hide
          */
         @Override
-        public void vibrate(int owningUid, String owningPackage, long milliseconds,
+        public void vibrate(int uid, String opPkg, long milliseconds,
                 int streamHint) {
             vibrate(new long[] { 0, milliseconds}, -1);
         }
@@ -866,7 +866,7 @@
          * @hide
          */
         @Override
-        public void vibrate(int owningUid, String owningPackage, long[] pattern, int repeat,
+        public void vibrate(int uid, String opPkg, long[] pattern, int repeat,
                 int streamHint) {
             if (repeat >= pattern.length) {
                 throw new ArrayIndexOutOfBoundsException();
diff --git a/core/java/android/net/NetworkKey.aidl b/core/java/android/net/NetworkKey.aidl
new file mode 100644
index 0000000..637075f
--- /dev/null
+++ b/core/java/android/net/NetworkKey.aidl
@@ -0,0 +1,19 @@
+/**
+ * Copyright (c) 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net;
+
+parcelable NetworkKey;
diff --git a/core/java/android/net/NetworkKey.java b/core/java/android/net/NetworkKey.java
new file mode 100644
index 0000000..cc3ad3e
--- /dev/null
+++ b/core/java/android/net/NetworkKey.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Information which identifies a specific network.
+ *
+ * @hide
+ */
+public class NetworkKey implements Parcelable {
+
+    /** A wifi network, for which {@link #wifiKey} will be populated. */
+    public static final int TYPE_WIFI = 1;
+
+    /**
+     * The type of this network.
+     * @see #TYPE_WIFI
+     */
+    public final int type;
+
+    /**
+     * Information identifying a Wi-Fi network. Only set when {@link #type} equals
+     * {@link #TYPE_WIFI}.
+     */
+    public final WifiKey wifiKey;
+
+    /**
+     * Construct a new {@link NetworkKey} for a Wi-Fi network.
+     * @param wifiKey the {@link WifiKey} identifying this Wi-Fi network.
+     */
+    public NetworkKey(WifiKey wifiKey) {
+        this.type = TYPE_WIFI;
+        this.wifiKey = wifiKey;
+    }
+
+    private NetworkKey(Parcel in) {
+        type = in.readInt();
+        switch (type) {
+            case TYPE_WIFI:
+                wifiKey = WifiKey.CREATOR.createFromParcel(in);
+                break;
+            default:
+                throw new IllegalArgumentException("Parcel has unknown type: " + type);
+        }
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel out, int flags) {
+        out.writeInt(type);
+        switch (type) {
+            case TYPE_WIFI:
+                wifiKey.writeToParcel(out, flags);
+                break;
+            default:
+                throw new IllegalStateException("NetworkKey has unknown type " + type);
+        }
+    }
+
+    @Override
+    public String toString() {
+        switch (type) {
+            case TYPE_WIFI:
+                return wifiKey.toString();
+            default:
+                // Don't throw an exception here in case someone is logging this object in a catch
+                // block for debugging purposes.
+                return "InvalidKey";
+        }
+    }
+
+    public static final Parcelable.Creator<NetworkKey> CREATOR =
+            new Parcelable.Creator<NetworkKey>() {
+                @Override
+                public NetworkKey createFromParcel(Parcel in) {
+                    return new NetworkKey(in);
+                }
+
+                @Override
+                public NetworkKey[] newArray(int size) {
+                    return new NetworkKey[size];
+                }
+            };
+}
diff --git a/core/java/android/net/NetworkScoreManager.java b/core/java/android/net/NetworkScoreManager.java
new file mode 100644
index 0000000..3430547
--- /dev/null
+++ b/core/java/android/net/NetworkScoreManager.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.annotation.SdkConstant;
+import android.annotation.SdkConstant.SdkConstantType;
+import android.content.Context;
+
+/**
+ * Class that manages communication between network subsystems and a network scorer.
+ *
+ * <p>You can get an instance of this class by calling
+ * {@link android.content.Context#getSystemService(String)}:
+ *
+ * <pre>NetworkScoreManager manager =
+ *     (NetworkScoreManager) getSystemService(Context.NETWORK_SCORE_SERVICE)</pre>
+ *
+ * <p>A network scorer is any application which:
+ * <ul>
+ * <li>Declares the {@link android.Manifest.permission#SCORE_NETWORKS} permission.
+ * <li>Includes a receiver for {@link #ACTION_SCORE_NETWORKS} guarded by the
+ *     {@link android.Manifest.permission#BROADCAST_SCORE_NETWORKS} permission which scores networks
+ *     and (eventually) calls {@link #updateScores} with the results.
+ * </ul>
+ *
+ * <p>The system keeps track of a default scorer application; at any time, only this application
+ * will receive {@link #ACTION_SCORE_NETWORKS} broadcasts and will be permitted to call
+ * {@link #updateScores}. Applications may determine the current default scorer with
+ * {@link #getDefaultScorerPackage()} and request to change the default scorer by sending an
+ * {@link #ACTION_CHANGE_DEFAULT} broadcast with another scorer.
+ *
+ * @hide
+ */
+public class NetworkScoreManager {
+    /**
+     * Activity action: ask the user to change the default network scorer. This will show a dialog
+     * that asks the user whether they want to replace the current default scorer with the one
+     * specified in {@link #EXTRA_PACKAGE_NAME}. The activity will finish with RESULT_OK if the
+     * default was changed or RESULT_CANCELED if it failed for any reason.
+     */
+    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+    public static final String ACTION_CHANGE_DEFAULT = "android.net.scoring.CHANGE_DEFAULT";
+
+    /**
+     * Extra used with {@link #ACTION_CHANGE_DEFAULT} to specify the new scorer package. Set with
+     * {@link android.content.Intent#putExtra(String, String)}.
+     */
+    public static final String EXTRA_PACKAGE_NAME = "packageName";
+
+    /**
+     * Broadcast action: new network scores are being requested. This intent will only be delivered
+     * to the current default scorer app. That app is responsible for scoring the networks and
+     * calling {@link #updateScores} when complete. The networks to score are specified in
+     * {@link #EXTRA_NETWORKS_TO_SCORE}, and will generally consist of all networks which have been
+     * configured by the user as well as any open networks.
+     *
+     * <p class="note">This is a protected intent that can only be sent by the system.
+     */
+    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+    public static final String ACTION_SCORE_NETWORKS = "android.net.scoring.SCORE_NETWORKS";
+
+    /**
+     * Extra used with {@link #ACTION_SCORE_NETWORKS} to specify the networks to be scored, as an
+     * array of {@link NetworkKey}s. Can be obtained with
+     * {@link android.content.Intent#getParcelableArrayExtra(String)}}.
+     */
+    public static final String EXTRA_NETWORKS_TO_SCORE = "networksToScore";
+
+    private final Context mContext;
+
+    /** @hide */
+    public NetworkScoreManager(Context context) {
+        mContext = context;
+    }
+
+    /**
+     * Obtain the package name of the current default network scorer.
+     *
+     * At any time, only one scorer application will receive {@link #ACTION_SCORE_NETWORKS}
+     * broadcasts and be allowed to call {@link #updateScores}. Applications may use this method to
+     * determine the current scorer and offer the user the ability to select a different scorer via
+     * the {@link #ACTION_CHANGE_DEFAULT} intent.
+     * @return the full package name of the current default scorer, or null if there is no active
+     *     scorer.
+     */
+    public String getDefaultScorerPackage() {
+        // TODO: Implement.
+        return null;
+    }
+
+    /**
+     * Update network scores.
+     *
+     * This may be called at any time to re-score active networks. Scores will generally be updated
+     * quickly, but if this method is called too frequently, the scores may be held and applied at
+     * a later time.
+     *
+     * @param networks the networks which have been scored by the scorer.
+     * @throws SecurityException if the caller is not the default scorer.
+     */
+    public void updateScores(ScoredNetwork[] networks) throws SecurityException {
+        // TODO: Implement.
+    }
+}
diff --git a/core/java/android/net/NetworkScorerApplication.java b/core/java/android/net/NetworkScorerApplication.java
new file mode 100644
index 0000000..b137ad3
--- /dev/null
+++ b/core/java/android/net/NetworkScorerApplication.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.Manifest.permission;
+import android.app.AppOpsManager;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.provider.Settings;
+import android.provider.Settings.Global;
+import android.text.TextUtils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Internal class for managing the primary network scorer application.
+ *
+ * @hide
+ */
+public final class NetworkScorerApplication {
+
+    private static final Intent SCORE_INTENT =
+            new Intent(NetworkScoreManager.ACTION_SCORE_NETWORKS);
+
+    /** This class cannot be instantiated. */
+    private NetworkScorerApplication() {}
+
+    /**
+     * Returns the list of available scorer app package names.
+     *
+     * <p>A network scorer is any application which:
+     * <ul>
+     * <li>Declares the {@link android.Manifest.permission#SCORE_NETWORKS} permission.
+     * <li>Includes a receiver for {@link NetworkScoreManager#ACTION_SCORE_NETWORKS} guarded by the
+     *     {@link android.Manifest.permission#BROADCAST_SCORE_NETWORKS} permission.
+     * </ul>
+     *
+     * @return the list of scorers, or the empty list if there are no valid scorers.
+     */
+    public static Collection<String> getAllValidScorers(Context context) {
+        List<String> scorers = new ArrayList<>();
+
+        PackageManager pm = context.getPackageManager();
+        List<ResolveInfo> receivers = pm.queryBroadcastReceivers(SCORE_INTENT, 0 /* flags */);
+        for (ResolveInfo receiver : receivers) {
+            // This field is a misnomer, see android.content.pm.ResolveInfo#activityInfo
+            final ActivityInfo receiverInfo = receiver.activityInfo;
+            if (receiverInfo == null) {
+                // Should never happen with queryBroadcastReceivers, but invalid nonetheless.
+                continue;
+            }
+            if (!permission.BROADCAST_SCORE_NETWORKS.equals(receiverInfo.permission)) {
+                // Receiver doesn't require the BROADCAST_SCORE_NETWORKS permission, which means
+                // anyone could trigger network scoring and flood the framework with score requests.
+                continue;
+            }
+            if (pm.checkPermission(permission.SCORE_NETWORKS, receiverInfo.packageName) !=
+                    PackageManager.PERMISSION_GRANTED) {
+                // Application doesn't hold the SCORE_NETWORKS permission, so the user never
+                // approved it as a network scorer.
+                continue;
+            }
+            scorers.add(receiverInfo.packageName);
+        }
+
+        return scorers;
+    }
+
+    /**
+     * Get the application package name to use for scoring networks.
+     *
+     * @return the scorer package or null if scoring is disabled (including if no scorer was ever
+     *     selected) or if the previously-set scorer is no longer a valid scorer app (e.g. because
+     *     it was disabled or uninstalled).
+     */
+    public static String getActiveScorer(Context context) {
+        String scorerPackage = Settings.Global.getString(context.getContentResolver(),
+                Global.NETWORK_SCORER_APP);
+        Collection<String> applications = getAllValidScorers(context);
+        if (isPackageValidScorer(applications, scorerPackage)) {
+            return scorerPackage;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Set the specified package as the default scorer application.
+     *
+     * <p>The caller must have permission to write to {@link Settings.Global}.
+     *
+     * @param context the context of the calling application
+     * @param packageName the packageName of the new scorer to use. If null, scoring will be
+     *     disabled. Otherwise, the scorer will only be set if it is a valid scorer application.
+     */
+    public static void setActiveScorer(Context context, String packageName) {
+        String oldPackageName = Settings.Global.getString(context.getContentResolver(),
+                Settings.Global.NETWORK_SCORER_APP);
+        if (TextUtils.equals(oldPackageName, packageName)) {
+            // No change.
+            return;
+        }
+
+        if (packageName == null) {
+            Settings.Global.putString(context.getContentResolver(), Global.NETWORK_SCORER_APP,
+                    null);
+        } else {
+            // We only make the change if the new package is valid.
+            Collection<String> applications = getAllValidScorers(context);
+            if (isPackageValidScorer(applications, packageName)) {
+                Settings.Global.putString(context.getContentResolver(),
+                        Settings.Global.NETWORK_SCORER_APP, packageName);
+            }
+        }
+    }
+
+    /** Determine whether the application with the given UID is the enabled scorer. */
+    public static boolean isCallerDefaultScorer(Context context, int callingUid) {
+        String defaultApp = getActiveScorer(context);
+        if (defaultApp == null) {
+            return false;
+        }
+        AppOpsManager appOpsMgr = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
+        try {
+            appOpsMgr.checkPackage(callingUid, defaultApp);
+            return true;
+        } catch (SecurityException e) {
+            return false;
+        }
+    }
+
+    /** Returns true if the given package is a valid scorer. */
+    private static boolean isPackageValidScorer(Collection<String> scorerPackageNames,
+            String packageName) {
+        return packageName != null && scorerPackageNames.contains(packageName);
+    }
+}
diff --git a/core/java/android/net/RssiCurve.java b/core/java/android/net/RssiCurve.java
new file mode 100644
index 0000000..7af7998
--- /dev/null
+++ b/core/java/android/net/RssiCurve.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * A curve defining the network score over a range of RSSI values.
+ *
+ * <p>For each RSSI bucket, the score may be any byte. Scores have no absolute meaning and are only
+ * considered relative to other scores assigned by the same scorer. Networks with no score are all
+ * considered equivalent and ranked below any network with a score.
+ *
+ * <p>For example, consider a curve starting at -110 dBm with a bucket width of 10 and the
+ * following buckets: {@code [-20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]}.
+ * This represents a linear curve between -110 dBm and 30 dBm. It scores progressively higher at
+ * stronger signal strengths.
+ *
+ * <p>A network can be assigned a fixed score independent of RSSI by setting
+ * {@link #rssiBuckets} to a one-byte array whose element is the fixed score. {@link #start}
+ * should be set to the lowest RSSI value at which this fixed score should apply, and
+ * {@link #bucketWidth} should be set such that {@code start + bucketWidth} is equal to the
+ * highest RSSI value at which this fixed score should apply.
+ *
+ * <p>Note that RSSI values below -110 dBm or above 30 dBm are unlikely to cause any difference
+ * in connectivity behavior from those endpoints. That is, the connectivity framework will treat
+ * a network with a -120 dBm signal exactly as it would treat one with a -110 dBm signal.
+ * Therefore, graphs which specify scores outside this range may be truncated to this range by
+ * the system.
+ *
+ * @see ScoredNetwork
+ * @hide
+ */
+public class RssiCurve implements Parcelable {
+
+    /** The starting dBm of the curve. */
+    public final int start;
+
+    /** The width of each RSSI bucket, in dBm. */
+    public final int bucketWidth;
+
+    /** The score for each RSSI bucket. */
+    public final byte[] rssiBuckets;
+
+    /**
+     * Construct a new {@link RssiCurve}.
+     *
+     * @param start the starting dBm of the curve.
+     * @param bucketWidth the width of each RSSI bucket, in dBm.
+     * @param rssiBuckets the score for each RSSI bucket.
+     */
+    public RssiCurve(int start, int bucketWidth, byte[] rssiBuckets) {
+        this.start = start;
+        this.bucketWidth = bucketWidth;
+        if (rssiBuckets == null || rssiBuckets.length == 0) {
+            throw new IllegalArgumentException("rssiBuckets must be at least one element large.");
+        }
+        this.rssiBuckets = rssiBuckets;
+    }
+
+    private RssiCurve(Parcel in) {
+        start = in.readInt();
+        bucketWidth = in.readInt();
+        int bucketCount = in.readInt();
+        rssiBuckets = new byte[bucketCount];
+        in.readByteArray(rssiBuckets);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel out, int flags) {
+        out.writeInt(start);
+        out.writeInt(bucketWidth);
+        out.writeInt(rssiBuckets.length);
+        out.writeByteArray(rssiBuckets);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("RssiCurve[start=")
+                .append(start)
+                .append(",bucketWidth=")
+                .append(bucketWidth);
+
+        sb.append(",buckets=");
+        for (int i = 0; i < rssiBuckets.length; i++) {
+            sb.append(rssiBuckets[i]);
+            if (i < rssiBuckets.length - 1) {
+                sb.append(",");
+            }
+        }
+        sb.append("]");
+
+        return sb.toString();
+    }
+
+    public static final Creator<RssiCurve> CREATOR =
+            new Creator<RssiCurve>() {
+                @Override
+                public RssiCurve createFromParcel(Parcel in) {
+                    return new RssiCurve(in);
+                }
+
+                @Override
+                public RssiCurve[] newArray(int size) {
+                    return new RssiCurve[size];
+                }
+            };
+}
diff --git a/core/java/android/net/ScoredNetwork.aidl b/core/java/android/net/ScoredNetwork.aidl
new file mode 100644
index 0000000..f83db11
--- /dev/null
+++ b/core/java/android/net/ScoredNetwork.aidl
@@ -0,0 +1,19 @@
+/**
+ * Copyright (c) 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net;
+
+parcelable ScoredNetwork;
diff --git a/core/java/android/net/ScoredNetwork.java b/core/java/android/net/ScoredNetwork.java
new file mode 100644
index 0000000..8af3c3c
--- /dev/null
+++ b/core/java/android/net/ScoredNetwork.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * A network identifier along with a score for the quality of that network.
+ *
+ * @hide
+ */
+public class ScoredNetwork implements Parcelable {
+
+    /** A {@link NetworkKey} uniquely identifying this network. */
+    public final NetworkKey networkKey;
+
+    /**
+     * The {@link RssiCurve} representing the scores for this network based on the RSSI.
+     *
+     * <p>This field is optional and may be set to null to indicate that no score is available for
+     * this network at this time. Such networks, along with networks for which the scorer has not
+     * responded, are always prioritized below scored networks, regardless of the score.
+     */
+    public final RssiCurve rssiCurve;
+
+    /**
+     * Construct a new {@link ScoredNetwork}.
+     *
+     * @param networkKey the {@link NetworkKey} uniquely identifying this network.
+     * @param rssiCurve the {@link RssiCurve} representing the scores for this network based on the
+     *     RSSI. This field is optional, and may be skipped to represent a network which the scorer
+     *     has opted not to score at this time. Passing a null value here is strongly preferred to
+     *     not returning any {@link ScoredNetwork} for a given {@link NetworkKey} because it
+     *     indicates to the system not to request scores for this network in the future, although
+     *     the scorer may choose to issue an out-of-band update at any time.
+     */
+    public ScoredNetwork(NetworkKey networkKey, RssiCurve rssiCurve) {
+        this.networkKey = networkKey;
+        this.rssiCurve = rssiCurve;
+    }
+
+    private ScoredNetwork(Parcel in) {
+        networkKey = NetworkKey.CREATOR.createFromParcel(in);
+        if (in.readByte() == 1) {
+            rssiCurve = RssiCurve.CREATOR.createFromParcel(in);
+        } else {
+            rssiCurve = null;
+        }
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel out, int flags) {
+        networkKey.writeToParcel(out, flags);
+        if (rssiCurve != null) {
+            out.writeByte((byte) 1);
+            rssiCurve.writeToParcel(out, flags);
+        } else {
+            out.writeByte((byte) 0);
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "ScoredNetwork[key=" + networkKey + ",score=" + rssiCurve + "]";
+    }
+
+    public static final Parcelable.Creator<ScoredNetwork> CREATOR =
+            new Parcelable.Creator<ScoredNetwork>() {
+                @Override
+                public ScoredNetwork createFromParcel(Parcel in) {
+                    return new ScoredNetwork(in);
+                }
+
+                @Override
+                public ScoredNetwork[] newArray(int size) {
+                    return new ScoredNetwork[size];
+                }
+            };
+}
diff --git a/core/java/android/net/WifiKey.java b/core/java/android/net/WifiKey.java
new file mode 100644
index 0000000..ffcd85a
--- /dev/null
+++ b/core/java/android/net/WifiKey.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.regex.Pattern;
+
+/**
+ * Information identifying a Wi-Fi network.
+ * @see NetworkKey
+ *
+ * @hide
+ */
+public class WifiKey implements Parcelable {
+
+    // Patterns used for validation.
+    private static final Pattern SSID_PATTERN = Pattern.compile("(\".*\")|(0x[\\p{XDigit}]+)");
+    private static final Pattern BSSID_PATTERN =
+            Pattern.compile("([\\p{XDigit}]{2}:){5}[\\p{XDigit}]{2}");
+
+    /**
+     * The service set identifier (SSID) of an 802.11 network. If the SSID can be decoded as
+     * UTF-8, it will be surrounded by double quotation marks. Otherwise, it will be a string of
+     * hex digits starting with 0x.
+     */
+    public final String ssid;
+
+    /**
+     * The basic service set identifier (BSSID) of an access point for this network. This will
+     * be in the form of a six-byte MAC address: {@code XX:XX:XX:XX:XX:XX}, where each X is a
+     * hexadecimal digit.
+     */
+    public final String bssid;
+
+    /**
+     * Construct a new {@link WifiKey} for the given Wi-Fi SSID/BSSID pair.
+     *
+     * @param ssid the service set identifier (SSID) of an 802.11 network. If the SSID can be
+     *         decoded as UTF-8, it should be surrounded by double quotation marks. Otherwise,
+     *         it should be a string of hex digits starting with 0x.
+     * @param bssid the basic service set identifier (BSSID) of this network's access point.
+     *         This should be in the form of a six-byte MAC address: {@code XX:XX:XX:XX:XX:XX},
+     *         where each X is a hexadecimal digit.
+     * @throws IllegalArgumentException if either the SSID or BSSID is invalid.
+     */
+    public WifiKey(String ssid, String bssid) {
+        if (!SSID_PATTERN.matcher(ssid).matches()) {
+            throw new IllegalArgumentException("Invalid ssid: " + ssid);
+        }
+        if (!BSSID_PATTERN.matcher(bssid).matches()) {
+            throw new IllegalArgumentException("Invalid bssid: " + bssid);
+        }
+        this.ssid = ssid;
+        this.bssid = bssid;
+    }
+
+    private WifiKey(Parcel in) {
+        ssid = in.readString();
+        bssid = in.readString();
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel out, int flags) {
+        out.writeString(ssid);
+        out.writeString(bssid);
+    }
+
+    @Override
+    public String toString() {
+        return "WifiKey[SSID=" + ssid + ",BSSID=" + bssid + "]";
+    }
+
+    public static final Creator<WifiKey> CREATOR =
+            new Creator<WifiKey>() {
+                @Override
+                public WifiKey createFromParcel(Parcel in) {
+                    return new WifiKey(in);
+                }
+
+                @Override
+                public WifiKey[] newArray(int size) {
+                    return new WifiKey[size];
+                }
+            };
+}
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 7f1a2e4..63e15a9 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -476,6 +476,11 @@
         public static final int KITKAT = 19;
 
         /**
+         * Android 4.5: KitKat for watches, snacks on the run.
+         */
+        public static final int KITKAT_WATCH = CUR_DEVELOPMENT; // STOPSHIP: update API level
+
+        /**
          * L!
          *
          * <p>Applications targeting this or a later release will get these
diff --git a/core/java/android/os/IVibratorService.aidl b/core/java/android/os/IVibratorService.aidl
index 4854bc0..4d05e2d 100644
--- a/core/java/android/os/IVibratorService.aidl
+++ b/core/java/android/os/IVibratorService.aidl
@@ -20,8 +20,8 @@
 interface IVibratorService
 {
     boolean hasVibrator();
-    void vibrate(int uid, String packageName, long milliseconds, int streamHint, IBinder token);
-    void vibratePattern(int uid, String packageName, in long[] pattern, int repeat, int streamHint, IBinder token);
+    void vibrate(int uid, String opPkg, long milliseconds, int streamHint, IBinder token);
+    void vibratePattern(int uid, String opPkg, in long[] pattern, int repeat, int streamHint, IBinder token);
     void cancelVibrate(IBinder token);
 }
 
diff --git a/core/java/android/os/NullVibrator.java b/core/java/android/os/NullVibrator.java
index 536da32..7b870ac 100644
--- a/core/java/android/os/NullVibrator.java
+++ b/core/java/android/os/NullVibrator.java
@@ -40,7 +40,7 @@
      * @hide
      */
     @Override
-    public void vibrate(int owningUid, String owningPackage, long milliseconds, int streamHint) {
+    public void vibrate(int uid, String opPkg, long milliseconds, int streamHint) {
         vibrate(milliseconds);
     }
 
@@ -48,7 +48,7 @@
      * @hide
      */
     @Override
-    public void vibrate(int owningUid, String owningPackage, long[] pattern, int repeat,
+    public void vibrate(int uid, String opPkg, long[] pattern, int repeat,
             int streamHint) {
         if (repeat >= pattern.length) {
             throw new ArrayIndexOutOfBoundsException();
diff --git a/core/java/android/os/SystemVibrator.java b/core/java/android/os/SystemVibrator.java
index 13bc4f6..8d9cf54 100644
--- a/core/java/android/os/SystemVibrator.java
+++ b/core/java/android/os/SystemVibrator.java
@@ -58,13 +58,13 @@
      * @hide
      */
     @Override
-    public void vibrate(int owningUid, String owningPackage, long milliseconds, int streamHint) {
+    public void vibrate(int uid, String opPkg, long milliseconds, int streamHint) {
         if (mService == null) {
             Log.w(TAG, "Failed to vibrate; no vibrator service.");
             return;
         }
         try {
-            mService.vibrate(owningUid, owningPackage, milliseconds, streamHint, mToken);
+            mService.vibrate(uid, opPkg, milliseconds, streamHint, mToken);
         } catch (RemoteException e) {
             Log.w(TAG, "Failed to vibrate.", e);
         }
@@ -74,7 +74,7 @@
      * @hide
      */
     @Override
-    public void vibrate(int owningUid, String owningPackage, long[] pattern, int repeat,
+    public void vibrate(int uid, String opPkg, long[] pattern, int repeat,
             int streamHint) {
         if (mService == null) {
             Log.w(TAG, "Failed to vibrate; no vibrator service.");
@@ -85,7 +85,7 @@
         // anyway
         if (repeat < pattern.length) {
             try {
-                mService.vibratePattern(owningUid, owningPackage, pattern, repeat, streamHint,
+                mService.vibratePattern(uid, opPkg, pattern, repeat, streamHint,
                         mToken);
             } catch (RemoteException e) {
                 Log.w(TAG, "Failed to vibrate.", e);
diff --git a/core/java/android/os/Vibrator.java b/core/java/android/os/Vibrator.java
index 8845ba3..c1d4d4c 100644
--- a/core/java/android/os/Vibrator.java
+++ b/core/java/android/os/Vibrator.java
@@ -135,7 +135,7 @@
      * Like {@link #vibrate(long, int)}, but allowing the caller to specify that
      * the vibration is owned by someone else.
      */
-    public abstract void vibrate(int owningUid, String owningPackage,
+    public abstract void vibrate(int uid, String opPkg,
             long milliseconds, int streamHint);
 
     /**
@@ -143,7 +143,7 @@
      * Like {@link #vibrate(long[], int, int)}, but allowing the caller to specify that
      * the vibration is owned by someone else.
      */
-    public abstract void vibrate(int owningUid, String owningPackage,
+    public abstract void vibrate(int uid, String opPkg,
             long[] pattern, int repeat, int streamHint);
 
     /**
diff --git a/core/java/android/preference/PreferenceFragment.java b/core/java/android/preference/PreferenceFragment.java
index 11d8878..325b2e6 100644
--- a/core/java/android/preference/PreferenceFragment.java
+++ b/core/java/android/preference/PreferenceFragment.java
@@ -337,6 +337,26 @@
         return mList;
     }
 
+    /** @hide */
+    public boolean hasListView() {
+        if (mList != null) {
+            return true;
+        }
+        View root = getView();
+        if (root == null) {
+            return false;
+        }
+        View rawListView = root.findViewById(android.R.id.list);
+        if (!(rawListView instanceof ListView)) {
+            return false;
+        }
+        mList = (ListView)rawListView;
+        if (mList == null) {
+            return false;
+        }
+        return true;
+    }
+
     private void ensureList() {
         if (mList != null) {
             return;
diff --git a/core/java/android/preference/PreferenceGroupAdapter.java b/core/java/android/preference/PreferenceGroupAdapter.java
index c2e1f51..9b41ff0 100644
--- a/core/java/android/preference/PreferenceGroupAdapter.java
+++ b/core/java/android/preference/PreferenceGroupAdapter.java
@@ -20,6 +20,8 @@
 import java.util.Collections;
 import java.util.List;
 
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
 import android.os.Handler;
 import android.preference.Preference.OnPreferenceChangeInternalListener;
 import android.view.View;
@@ -91,7 +93,8 @@
         }
     };
 
-    private int mActivatedPosition = -1;
+    private int mHighlightedPosition = -1;
+    private Drawable mHighlightedDrawable;
 
     private static class PreferenceLayout implements Comparable<PreferenceLayout> {
         private int resId;
@@ -212,8 +215,18 @@
         return this.getItem(position).getId();
     }
 
-    public void setActivated(int position) {
-        mActivatedPosition = position;
+    /**
+     * @hide
+     */
+    public void setHighlighted(int position) {
+        mHighlightedPosition = position;
+    }
+
+    /**
+     * @hide
+     */
+    public void setHighlightedDrawable(Drawable drawable) {
+        mHighlightedDrawable = drawable;
     }
 
     public View getView(int position, View convertView, ViewGroup parent) {
@@ -227,7 +240,9 @@
             convertView = null;
         }
         View result = preference.getView(convertView, parent);
-        result.setActivated(position == mActivatedPosition);
+        if (position == mHighlightedPosition && mHighlightedDrawable != null) {
+            result.setBackgroundDrawable(mHighlightedDrawable);
+        }
         return result;
     }
 
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 7062933..1e202ca 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5097,6 +5097,13 @@
        public static final String NETWORK_PREFERENCE = "network_preference";
 
        /**
+        * Which package name to use for network scoring. If null, or if the package is not a valid
+        * scorer app, external network scores will neither be requested nor accepted.
+        * @hide
+        */
+       public static final String NETWORK_SCORER_APP = "network_scorer_app";
+
+       /**
         * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
         * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
         * exceeded.
diff --git a/core/java/android/service/notification/StatusBarNotification.java b/core/java/android/service/notification/StatusBarNotification.java
index 0f74169..2c0b76d 100644
--- a/core/java/android/service/notification/StatusBarNotification.java
+++ b/core/java/android/service/notification/StatusBarNotification.java
@@ -32,7 +32,7 @@
     private final String key;
 
     private final int uid;
-    private final String basePkg;
+    private final String opPkg;
     private final int initialPid;
     private final Notification notification;
     private final UserHandle user;
@@ -41,26 +41,20 @@
     private final int score;
 
     /** @hide */
-    public StatusBarNotification(String pkg, int id, String tag, int uid, int initialPid, int score,
-            Notification notification, UserHandle user) {
-        this(pkg, null, id, tag, uid, initialPid, score, notification, user);
-    }
-
-    /** @hide */
-    public StatusBarNotification(String pkg, String basePkg, int id, String tag, int uid,
+    public StatusBarNotification(String pkg, String opPkg, int id, String tag, int uid,
             int initialPid, int score, Notification notification, UserHandle user) {
-        this(pkg, basePkg, id, tag, uid, initialPid, score, notification, user,
+        this(pkg, opPkg, id, tag, uid, initialPid, score, notification, user,
                 System.currentTimeMillis());
     }
 
-    public StatusBarNotification(String pkg, String basePkg, int id, String tag, int uid,
+    public StatusBarNotification(String pkg, String opPkg, int id, String tag, int uid,
             int initialPid, int score, Notification notification, UserHandle user,
             long postTime) {
         if (pkg == null) throw new NullPointerException();
         if (notification == null) throw new NullPointerException();
 
         this.pkg = pkg;
-        this.basePkg = pkg;
+        this.opPkg = opPkg;
         this.id = id;
         this.tag = tag;
         this.uid = uid;
@@ -75,7 +69,7 @@
 
     public StatusBarNotification(Parcel in) {
         this.pkg = in.readString();
-        this.basePkg = in.readString();
+        this.opPkg = in.readString();
         this.id = in.readInt();
         if (in.readInt() != 0) {
             this.tag = in.readString();
@@ -93,12 +87,12 @@
     }
 
     private String key() {
-        return pkg + '|' + basePkg + '|' + id + '|' + tag + '|' + uid;
+        return pkg + '|' + opPkg + '|' + id + '|' + tag + '|' + uid;
     }
 
     public void writeToParcel(Parcel out, int flags) {
         out.writeString(this.pkg);
-        out.writeString(this.basePkg);
+        out.writeString(this.opPkg);
         out.writeInt(this.id);
         if (this.tag != null) {
             out.writeInt(1);
@@ -139,14 +133,14 @@
     public StatusBarNotification cloneLight() {
         final Notification no = new Notification();
         this.notification.cloneInto(no, false); // light copy
-        return new StatusBarNotification(this.pkg, this.basePkg,
+        return new StatusBarNotification(this.pkg, this.opPkg,
                 this.id, this.tag, this.uid, this.initialPid,
                 this.score, no, this.user, this.postTime);
     }
 
     @Override
     public StatusBarNotification clone() {
-        return new StatusBarNotification(this.pkg, this.basePkg,
+        return new StatusBarNotification(this.pkg, this.opPkg,
                 this.id, this.tag, this.uid, this.initialPid,
                 this.score, this.notification.clone(), this.user, this.postTime);
     }
@@ -205,9 +199,9 @@
         return uid;
     }
 
-    /** The notifying app's base package. @hide */
-    public String getBasePkg() {
-        return basePkg;
+    /** The package used for AppOps tracking. @hide */
+    public String getOpPkg() {
+        return opPkg;
     }
 
     /** @hide */
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index ef22def..eec4354 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1171,6 +1171,11 @@
         m.preTranslate(-attachInfo.mWindowLeft, -attachInfo.mWindowTop);
     }
 
+    void dispatchApplyInsets(View host) {
+        mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets);
+        host.dispatchApplyWindowInsets(new WindowInsets(mFitSystemWindowsInsets));
+    }
+
     private void performTraversals() {
         // cache mView since it is used so much below...
         final View host = mView;
@@ -1257,8 +1262,7 @@
             }
             host.dispatchAttachedToWindow(attachInfo, 0);
             attachInfo.mTreeObserver.dispatchOnWindowAttachedChange(true);
-            mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets);
-            host.fitSystemWindows(mFitSystemWindowsInsets);
+            dispatchApplyInsets(host);
             //Log.i(TAG, "Screen on initialized: " + attachInfo.mKeepScreenOn);
 
         } else {
@@ -1383,9 +1387,8 @@
 
         if (mFitSystemWindowsRequested) {
             mFitSystemWindowsRequested = false;
-            mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets);
             mLastOverscanRequested = mAttachInfo.mOverscanRequested;
-            host.fitSystemWindows(mFitSystemWindowsInsets);
+            dispatchApplyInsets(host);
             if (mLayoutRequested) {
                 // Short-circuit catching a new layout request here, so
                 // we don't need to go through two layout passes when things
@@ -1559,8 +1562,7 @@
                     mLastSystemUiVisibility = mAttachInfo.mSystemUiVisibility;
                     mLastOverscanRequested = mAttachInfo.mOverscanRequested;
                     mFitSystemWindowsRequested = false;
-                    mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets);
-                    host.fitSystemWindows(mFitSystemWindowsInsets);
+                    dispatchApplyInsets(host);
                 }
                 if (visibleInsetsChanged) {
                     mAttachInfo.mVisibleInsets.set(mPendingVisibleInsets);
diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java
index cdfcb43..f8cc793 100644
--- a/core/java/android/view/WindowInsets.java
+++ b/core/java/android/view/WindowInsets.java
@@ -33,6 +33,7 @@
     private Rect mSystemWindowInsets;
     private Rect mWindowDecorInsets;
     private Rect mTempRect;
+    private boolean mIsRound;
 
     private static final Rect EMPTY_RECT = new Rect(0, 0, 0, 0);
 
@@ -46,8 +47,14 @@
 
     /** @hide */
     public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets) {
+        this(systemWindowInsets, windowDecorInsets, false);
+    }
+
+    /** @hide */
+    public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets, boolean isRound) {
         mSystemWindowInsets = systemWindowInsets;
         mWindowDecorInsets = windowDecorInsets;
+        mIsRound = isRound;
     }
 
     /**
@@ -58,12 +65,12 @@
     public WindowInsets(WindowInsets src) {
         mSystemWindowInsets = src.mSystemWindowInsets;
         mWindowDecorInsets = src.mWindowDecorInsets;
+        mIsRound = src.mIsRound;
     }
 
     /** @hide */
     public WindowInsets(Rect systemWindowInsets) {
-        mSystemWindowInsets = systemWindowInsets;
-        mWindowDecorInsets = EMPTY_RECT;
+        this(systemWindowInsets, EMPTY_RECT);
     }
 
     /**
@@ -220,6 +227,20 @@
         return hasSystemWindowInsets() || hasWindowDecorInsets();
     }
 
+    /**
+     * Returns true if the associated window has a round shape.
+     *
+     * <p>A round window's left, top, right and bottom edges reach all the way to the
+     * associated edges of the window but the corners may not be visible. Views responding
+     * to round insets should take care to not lay out critical elements within the corners
+     * where they may not be accessible.</p>
+     *
+     * @return True if the window is round
+     */
+    public boolean isRound() {
+        return mIsRound;
+    }
+
     public WindowInsets cloneWithSystemWindowInsetsConsumed() {
         final WindowInsets result = new WindowInsets(this);
         result.mSystemWindowInsets = new Rect(0, 0, 0, 0);
@@ -273,6 +294,6 @@
     @Override
     public String toString() {
         return "WindowInsets{systemWindowInsets=" + mSystemWindowInsets + " windowDecorInsets=" +
-                mWindowDecorInsets + "}";
+                mWindowDecorInsets + (isRound() ? "round}" : "}");
     }
 }
diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp
index 67f3879..af6cc72 100644
--- a/core/jni/android_database_CursorWindow.cpp
+++ b/core/jni/android_database_CursorWindow.cpp
@@ -17,6 +17,7 @@
 #undef LOG_TAG
 #define LOG_TAG "CursorWindow"
 
+#include <inttypes.h>
 #include <jni.h>
 #include <JNIHelp.h>
 #include <android_runtime/AndroidRuntime.h>
@@ -225,7 +226,7 @@
     } else if (type == CursorWindow::FIELD_TYPE_INTEGER) {
         int64_t value = window->getFieldSlotValueLong(fieldSlot);
         char buf[32];
-        snprintf(buf, sizeof(buf), "%lld", value);
+        snprintf(buf, sizeof(buf), "%" PRId64, value);
         return env->NewStringUTF(buf);
     } else if (type == CursorWindow::FIELD_TYPE_FLOAT) {
         double value = window->getFieldSlotValueDouble(fieldSlot);
@@ -314,7 +315,7 @@
     } else if (type == CursorWindow::FIELD_TYPE_INTEGER) {
         int64_t value = window->getFieldSlotValueLong(fieldSlot);
         char buf[32];
-        snprintf(buf, sizeof(buf), "%lld", value);
+        snprintf(buf, sizeof(buf), "%" PRId64, value);
         fillCharArrayBufferUTF(env, bufferObj, buf, strlen(buf));
     } else if (type == CursorWindow::FIELD_TYPE_FLOAT) {
         double value = window->getFieldSlotValueDouble(fieldSlot);
diff --git a/core/jni/android_net_TrafficStats.cpp b/core/jni/android_net_TrafficStats.cpp
index f904b62..031637f 100644
--- a/core/jni/android_net_TrafficStats.cpp
+++ b/core/jni/android_net_TrafficStats.cpp
@@ -19,6 +19,7 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
@@ -85,9 +86,9 @@
     uint64_t rxBytes, rxPackets, txBytes, txPackets, tcpRxPackets, tcpTxPackets;
 
     while (fgets(buffer, sizeof(buffer), fp) != NULL) {
-        int matched = sscanf(buffer, "%31s %llu %llu %llu %llu "
-                "%*u %llu %*u %*u %*u %*u "
-                "%*u %llu %*u %*u %*u %*u", cur_iface, &rxBytes,
+        int matched = sscanf(buffer, "%31s %" SCNu64 " %" SCNu64 " %" SCNu64
+                " %" SCNu64 " " "%*u %" SCNu64 " %*u %*u %*u %*u "
+                "%*u %" SCNu64 " %*u %*u %*u %*u", cur_iface, &rxBytes,
                 &rxPackets, &txBytes, &txPackets, &tcpRxPackets, &tcpTxPackets);
         if (matched >= 5) {
             if (matched == 7) {
@@ -129,9 +130,11 @@
     uint64_t tag, rxBytes, rxPackets, txBytes, txPackets;
 
     while (fgets(buffer, sizeof(buffer), fp) != NULL) {
-        if (sscanf(buffer, "%d %31s 0x%llx %u %u %llu %llu %llu %llu", &idx,
-                iface, &tag, &cur_uid, &set, &rxBytes, &rxPackets, &txBytes,
-                &txPackets) == 9) {
+        if (sscanf(buffer,
+                "%" SCNu32 " %31s 0x%" SCNx64 " %u %u %" SCNu64 " %" SCNu64
+                " %" SCNu64 " %" SCNu64 "",
+                &idx, iface, &tag, &cur_uid, &set, &rxBytes, &rxPackets,
+                &txBytes, &txPackets) == 9) {
             if (uid == cur_uid && tag == 0L) {
                 stats->rxBytes += rxBytes;
                 stats->rxPackets += rxPackets;
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index d4873d6..86207f0 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -24,6 +24,7 @@
 
 #include <cutils/log.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -824,9 +825,9 @@
                 break;
             } else {
 #ifdef __LP64__
-                fprintf(fp, " %016x", backtrace[bt]);
+                fprintf(fp, " %016" PRIxPTR, backtrace[bt]);
 #else
-                fprintf(fp, " %08x", backtrace[bt]);
+                fprintf(fp, " %08" PRIxPTR, backtrace[bt]);
 #endif
             }
         }
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index b2709af..606a4b1 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -234,6 +234,7 @@
     <protected-broadcast android:name="android.net.conn.NETWORK_CONDITIONS_MEASURED" />
     <protected-broadcast
             android:name="android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED" />
+    <protected-broadcast android:name="android.net.scoring.SCORE_NETWORKS" />
     <protected-broadcast android:name="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE" />
     <protected-broadcast android:name="android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE" />
     <protected-broadcast android:name="android.intent.action.AIRPLANE_MODE" />
@@ -762,6 +763,13 @@
         android:description="@string/permdesc_changeWimaxState"
         android:label="@string/permlab_changeWimaxState" />
 
+    <!-- Allows applications to act as network scorers. @hide -->
+    <permission android:name="android.permission.SCORE_NETWORKS"
+        android:permissionGroup="android.permission-group.NETWORK"
+        android:protectionLevel="normal"
+        android:description="@string/permdesc_scoreNetworks"
+        android:label="@string/permlab_scoreNetworks" />
+
     <!-- ======================================= -->
     <!-- Permissions for short range, peripheral networks -->
     <!-- ======================================= -->
@@ -2290,6 +2298,13 @@
         android:description="@string/permdesc_broadcastWapPush"
         android:protectionLevel="signature" />
 
+    <!-- Allows an application to broadcast a SCORE_NETWORKS request.
+         <p>Not for use by third-party applications. @hide -->
+    <permission android:name="android.permission.BROADCAST_SCORE_NETWORKS"
+        android:label="@string/permlab_broadcastScoreNetworks"
+        android:description="@string/permdesc_broadcastScoreNetworks"
+        android:protectionLevel="signature|system" />
+
     <!-- Not for use by third-party applications. -->
     <permission android:name="android.permission.MASTER_CLEAR"
         android:label="@string/permlab_masterClear"
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index d5e78a5..f549290 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1340,10 +1340,10 @@
          Example: com.google.android.myapp/.resolver.MyResolverActivity  -->
     <string name="config_customResolverActivity"></string>
 
-    <!-- Name of the activity that prompts the user to reject, accept, or whitelist
+    <!-- Name of the activity or service that prompts the user to reject, accept, or whitelist
          an adb host's public key, when an unwhitelisted host connects to the local adbd.
          Can be customized for other product types -->
-    <string name="config_customAdbPublicKeyActivity"
+    <string name="config_customAdbPublicKeyConfirmationComponent"
             >com.android.systemui/com.android.systemui.usb.UsbDebuggingActivity</string>
 
     <!-- Apps that are authorized to access shared accounts, overridden by product overlays -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 35f761b..b0e1150 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -906,6 +906,14 @@
         silently replace the content of any webpage with malicious variants.</string>
 
     <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permlab_broadcastScoreNetworks">send score networks broadcast</string>
+    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permdesc_broadcastScoreNetworks">Allows the app
+        to broadcast a notification that networks need to be scored.
+        Never needed for normal apps.
+    </string>
+
+    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permlab_setProcessLimit">limit number of running processes</string>
     <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permdesc_setProcessLimit">Allows the app
@@ -1881,6 +1889,15 @@
       connect the phone to and disconnect the phone from WiMAX networks.</string>
 
     <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permlab_scoreNetworks">score networks</string>
+    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permdesc_scoreNetworks" product="tablet">Allows the app to
+      rank networks and influence which networks the tablet should prefer.</string>
+    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+    <string name="permdesc_scoreNetworks" product="default">Allows the app to
+        rank networks and influence which networks the phone should prefer.</string>
+
+    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permlab_bluetooth">pair with Bluetooth devices</string>
     <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permdesc_bluetooth" product="tablet">Allows the app to view the
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index ac708b8..563272b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1623,7 +1623,7 @@
   <java-symbol type="string" name="enable_explore_by_touch_warning_message" />
   <java-symbol type="bool" name="config_powerDecoupleAutoSuspendModeFromDisplay" />
   <java-symbol type="bool" name="config_powerDecoupleInteractiveModeFromDisplay" />
-  <java-symbol type="string" name="config_customAdbPublicKeyActivity" />
+  <java-symbol type="string" name="config_customAdbPublicKeyConfirmationComponent" />
 
   <java-symbol type="layout" name="resolver_list" />
   <java-symbol type="id" name="resolver_list" />
diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk
index 73a53cb..6bdeaf0 100644
--- a/core/tests/coretests/Android.mk
+++ b/core/tests/coretests/Android.mk
@@ -23,7 +23,7 @@
 
 LOCAL_DX_FLAGS := --core-library
 LOCAL_AAPT_FLAGS = -0 dat -0 gld
-LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support android-common frameworks-core-util-lib mockwebserver guava littlemock
+LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support android-common frameworks-core-util-lib mockwebserver guava littlemock mockito-target
 LOCAL_JAVA_LIBRARIES := android.test.runner conscrypt telephony-common
 LOCAL_PACKAGE_NAME := FrameworksCoreTests
 
diff --git a/core/tests/coretests/src/android/net/NetworkKeyTest.java b/core/tests/coretests/src/android/net/NetworkKeyTest.java
new file mode 100644
index 0000000..9005188
--- /dev/null
+++ b/core/tests/coretests/src/android/net/NetworkKeyTest.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.os.Parcel;
+
+import junit.framework.TestCase;
+
+public class NetworkKeyTest extends TestCase {
+    public void testValidWifiKey_utf8() {
+        new WifiKey("\"quotedSsid\"", "AB:CD:01:EF:23:03");
+        new WifiKey("\"\"", "AB:CD:01:EF:23:03");
+    }
+
+    public void testValidWifiKey_hex() {
+        new WifiKey("0x1234abcd", "AB:CD:01:EF:23:03");
+    }
+
+    public void testInvalidWifiKey_empty() {
+        try {
+            new WifiKey("", "AB:CD:01:EF:23:03");
+            fail("Should have thrown IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // expected - empty SSID
+        }
+    }
+
+    public void testInvalidWifiKey_unquotedUtf8() {
+        try {
+            new WifiKey("unquotedSsid", "AB:CD:01:EF:23:03");
+            fail("Should have thrown IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // expected - empty SSID
+        }
+    }
+
+    public void testInvalidWifiKey_invalidHex() {
+        try {
+            new WifiKey("0x\"nothex\"", "AB:CD:01:EF:23:03");
+            fail("Should have thrown IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // expected - empty SSID
+        }
+    }
+
+    public void testInvalidWifiKey_shortBssid() {
+        try {
+            new WifiKey("\"quotedSsid\"", "AB:CD:01:EF:23");
+            fail("Should have thrown IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // expected - BSSID too short
+        }
+    }
+
+    public void testInvalidWifiKey_longBssid() {
+        try {
+            new WifiKey("\"quotedSsid\"", "AB:CD:01:EF:23:03:11");
+            fail("Should have thrown IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // expected - BSSID too long
+        }
+    }
+
+    public void testParceling() {
+        WifiKey wifiKey = new WifiKey("\"ssid\"", "00:00:00:00:00:00");
+        NetworkKey networkKey = new NetworkKey(wifiKey);
+        Parcel parcel = null;
+        try {
+            parcel = Parcel.obtain();
+            parcel.writeParcelable(networkKey, 0);
+            parcel.setDataPosition(0);
+            networkKey = parcel.readParcelable(getClass().getClassLoader());
+        } finally {
+            if (parcel != null) {
+                parcel.recycle();
+            }
+        }
+
+        assertEquals(NetworkKey.TYPE_WIFI, networkKey.type);
+        assertEquals("\"ssid\"", networkKey.wifiKey.ssid);
+        assertEquals("00:00:00:00:00:00", networkKey.wifiKey.bssid);
+    }
+}
diff --git a/core/tests/coretests/src/android/net/NetworkScorerApplicationTest.java b/core/tests/coretests/src/android/net/NetworkScorerApplicationTest.java
new file mode 100644
index 0000000..6d5ede8
--- /dev/null
+++ b/core/tests/coretests/src/android/net/NetworkScorerApplicationTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.Manifest.permission;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.test.InstrumentationTestCase;
+
+import com.google.android.collect.Lists;
+
+import org.mockito.ArgumentMatcher;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+
+import java.util.Iterator;
+
+public class NetworkScorerApplicationTest extends InstrumentationTestCase {
+    @Mock private Context mMockContext;
+    @Mock private PackageManager mMockPm;
+
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+
+        // Configuration needed to make mockito/dexcache work.
+        System.setProperty("dexmaker.dexcache",
+                getInstrumentation().getTargetContext().getCacheDir().getPath());
+        ClassLoader newClassLoader = getInstrumentation().getClass().getClassLoader();
+        Thread.currentThread().setContextClassLoader(newClassLoader);
+
+        MockitoAnnotations.initMocks(this);
+        Mockito.when(mMockContext.getPackageManager()).thenReturn(mMockPm);
+    }
+
+    public void testGetAllValidScorers() throws Exception {
+        // Package 1 - Valid scorer.
+        ResolveInfo package1 = buildResolveInfo("package1", true, true);
+
+        // Package 2 - Receiver does not have BROADCAST_SCORE_NETWORKS permission.
+        ResolveInfo package2 = buildResolveInfo("package2", false, true);
+
+        // Package 3 - App does not have SCORE_NETWORKS permission.
+        ResolveInfo package3 = buildResolveInfo("package3", true, false);
+
+        setScorers(package1, package2, package3);
+
+        Iterator<String> result =
+                NetworkScorerApplication.getAllValidScorers(mMockContext).iterator();
+
+        assertTrue(result.hasNext());
+        assertEquals("package1", result.next());
+
+        assertFalse(result.hasNext());
+    }
+
+    private void setScorers(ResolveInfo... scorers) {
+        Mockito.when(mMockPm.queryBroadcastReceivers(
+                Mockito.argThat(new ArgumentMatcher<Intent>() {
+                    @Override
+                    public boolean matches(Object object) {
+                        Intent intent = (Intent) object;
+                        return NetworkScoreManager.ACTION_SCORE_NETWORKS.equals(intent.getAction());
+                    }
+                }), Mockito.eq(0)))
+                .thenReturn(Lists.newArrayList(scorers));
+    }
+
+    private ResolveInfo buildResolveInfo(String packageName,
+            boolean hasReceiverPermission, boolean hasScorePermission) throws Exception {
+        Mockito.when(mMockPm.checkPermission(permission.SCORE_NETWORKS, packageName))
+                .thenReturn(hasScorePermission ?
+                        PackageManager.PERMISSION_GRANTED : PackageManager.PERMISSION_DENIED);
+
+        ResolveInfo resolveInfo = new ResolveInfo();
+        resolveInfo.activityInfo = new ActivityInfo();
+        resolveInfo.activityInfo.packageName = packageName;
+        if (hasReceiverPermission) {
+            resolveInfo.activityInfo.permission = permission.BROADCAST_SCORE_NETWORKS;
+        }
+        return resolveInfo;
+    }
+}
diff --git a/core/tests/coretests/src/android/net/ScoredNetworkTest.java b/core/tests/coretests/src/android/net/ScoredNetworkTest.java
new file mode 100644
index 0000000..7ab69ad
--- /dev/null
+++ b/core/tests/coretests/src/android/net/ScoredNetworkTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.net;
+
+import android.os.Parcel;
+
+import junit.framework.TestCase;
+
+import java.util.Arrays;
+
+public class ScoredNetworkTest extends TestCase {
+    private static final RssiCurve CURVE =
+            new RssiCurve(-110, 10, new byte[] {0, 1, 2, 3, 4, 5, 6, 7});
+
+    public void testInvalidCurve_nullBuckets() {
+        try {
+            new RssiCurve(-110, 10, null);
+            fail("Should have thrown IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // expected
+        }
+    }
+
+    public void testInvalidCurve_emptyBuckets() {
+        try {
+            new RssiCurve(-110, 10, new byte[] {});
+            fail("Should have thrown IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // expected
+        }
+    }
+
+    public void testParceling() {
+        NetworkKey key = new NetworkKey(new WifiKey("\"ssid\"", "00:00:00:00:00:00"));
+        ScoredNetwork network = new ScoredNetwork(key, CURVE);
+        Parcel parcel = null;
+        try {
+            parcel = Parcel.obtain();
+            parcel.writeParcelable(network, 0);
+            parcel.setDataPosition(0);
+            network = parcel.readParcelable(getClass().getClassLoader());
+        } finally {
+            if (parcel != null) {
+                parcel.recycle();
+            }
+        }
+        assertEquals(CURVE.start, network.rssiCurve.start);
+        assertEquals(CURVE.bucketWidth, network.rssiCurve.bucketWidth);
+        assertTrue(Arrays.equals(CURVE.rssiBuckets, network.rssiCurve.rssiBuckets));
+    }
+}
diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java
index 493e276..736b143 100644
--- a/graphics/java/android/graphics/drawable/VectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/VectorDrawable.java
@@ -49,24 +49,24 @@
 import java.util.HashSet;
 
 /**
- * This lets you create a drawable based on an XML vector graphic
- * It can be defined in an XML file with the <code>&lt;vector></code> element.
+ * This lets you create a drawable based on an XML vector graphic It can be
+ * defined in an XML file with the <code>&lt;vector></code> element.
  * <p/>
  * The vector drawable has 6 elements:
  * <p/>
  * <dl>
  * <dt><code>&lt;vector></code></dt>
  * <dd>The attribute <code>android:trigger</code> defines a state change that
- * will drive the animation </dd>
+ * will drive the animation</dd>
  * <dd>The attribute <code>android:versionCode</code> defines the version of
- * VectorDrawable </dd>
+ * VectorDrawable</dd>
  * <dt><code>&lt;size></code></dt>
  * <dd>Used to defined the intrinsic Width Height size of the drawable using
- * <code>android:width</code> and <code>android:height</code> </dd>
+ * <code>android:width</code> and <code>android:height</code></dd>
  * <dt><code>&lt;viewport></code></dt>
  * <dd>Used to defined the size of the virtual canvas the paths are drawn on.
- * The size is defined using the attributes <code>android:viewportHeight
- * </code> <code>android:viewportWidth</code></dd>
+ * The size is defined using the attributes <code>android:viewportHeight</code>
+ * <code>android:viewportWidth</code></dd>
  * <dt><code>&lt;group></code></dt>
  * <dd>Defines a "key frame" in the animation if there is only one group the
  * drawable is static 2D image that has no animation.</dd>
@@ -80,7 +80,8 @@
  * <dt><code>android:fill</code>
  * <dd>Defines the color to fill the path (none if not present).</dd></dt>
  * <dt><code>android:stroke</code>
- * <dd>Defines the color to draw the path outline (none if not present).</dd></dt>
+ * <dd>Defines the color to draw the path outline (none if not present).</dd>
+ * </dt>
  * <dt><code>android:strokeWidth</code>
  * <dd>The width a path stroke</dd></dt>
  * <dt><code>android:strokeOpacity</code>
@@ -98,7 +99,8 @@
  * <dt><code>android:trimPathEnd</code>
  * <dd>The fraction of the path to trim from the end from 0 to 1</dd></dt>
  * <dt><code>android:trimPathOffset</code>
- * <dd>Shift trim region (allows showed region to include the start and end) from 0 to 1</dd></dt>
+ * <dd>Shift trim region (allows showed region to include the start and end)
+ * from 0 to 1</dd></dt>
  * <dt><code>android:clipToPath</code>
  * <dd>Path will set the clip path</dd></dt>
  * <dt><code>android:strokeLineCap</code>
@@ -135,19 +137,20 @@
  * <dt><code>android:sequence</code>
  * <dd>Configures this animation sequence between the named paths.</dd></dt>
  * <dt><code>android:limitTo</code>
- * <dd>Limits an animation to only interpolate the selected variable
- * unlimited, path, rotation, trimPathStart, trimPathEnd, trimPathOffset</dd></dt>
+ * <dd>Limits an animation to only interpolate the selected variable unlimited,
+ * path, rotation, trimPathStart, trimPathEnd, trimPathOffset</dd></dt>
  * <dt><code>android:repeatCount</code>
  * <dd>Number of times to loop this aspect of the animation</dd></dt>
  * <dt><code>android:durations</code>
- * <dd>The duration of each step in the animation in milliseconds
- * Must contain the number of named paths - 1</dd></dt>
+ * <dd>The duration of each step in the animation in milliseconds Must contain
+ * the number of named paths - 1</dd></dt>
  * <dt><code>android:startDelay</code>
  * <dd></dd></dt>
  * <dt><code>android:repeatStyle</code>
- *  <dd>when repeating how does it repeat back and forth or a to b: forward, inAndOut</dd></dt>
+ * <dd>when repeating how does it repeat back and forth or a to b: forward,
+ * inAndOut</dd></dt>
  * <dt><code>android:animate</code>
- *  <dd>linear, accelerate, decelerate, easing</dd></dt>
+ * <dd>linear, accelerate, decelerate, easing</dd></dt>
  * </dl>
  * </dd>
  */
@@ -193,8 +196,10 @@
         }
 
         long duration = mVectorState.mVAnimatedPath.getTotalAnimationDuration();
-        if (duration == -1) { // if it set to infinite set to 1 hour
-            duration = DEFAULT_INFINITE_DURATION; // TODO define correct approach for infinite
+        if (duration == -1) {
+            // If duration is infinite, set to 1 hour.
+            // TODO: Define correct approach for infinite.
+            duration = DEFAULT_INFINITE_DURATION;
             mVectorState.mBasicAnimator.setFloatValues(0, duration / 1000);
             mVectorState.mBasicAnimator.setInterpolator(new LinearInterpolator());
         }
@@ -206,6 +211,11 @@
         return mVectorState;
     }
 
+    @Override
+    public void jumpToCurrentState() {
+        mVectorState.mBasicAnimator.end();
+    }
+
     /**
      * Starts the animation.
      */
@@ -214,7 +224,7 @@
     }
 
     /**
-     * Stops the animation.
+     * Stops the animation and moves to the end state.
      */
     public void stop() {
         mVectorState.mBasicAnimator.end();
@@ -250,11 +260,11 @@
 
     /**
      * Defines what this animation should do when it reaches the end. This
-     * setting is applied only when the repeat count is either greater than
-     * 0 or {@link ValueAnimator#INFINITE}.
+     * setting is applied only when the repeat count is either greater than 0 or
+     * {@link ValueAnimator#INFINITE}.
      *
-     * @param mode the animation mode, either {@link ValueAnimator#RESTART}
-     *        or {@link ValueAnimator#REVERSE}
+     * @param mode the animation mode, either {@link ValueAnimator#RESTART} or
+     *            {@link ValueAnimator#REVERSE}
      */
     public void setRepeatMode(int mode) {
         mVectorState.mBasicAnimator.setRepeatMode(mode);
@@ -299,16 +309,16 @@
         return true;
     }
 
-    private void animateForward(){
+    private void animateForward() {
         if (!mVectorState.mBasicAnimator.isStarted()) {
-            mVectorState.mBasicAnimator.setFloatValues(0,1);
+            mVectorState.mBasicAnimator.setFloatValues(0, 1);
             start();
         }
     }
 
-    private void animateBackward(){
+    private void animateBackward() {
         if (!mVectorState.mBasicAnimator.isStarted()) {
-            mVectorState.mBasicAnimator.setFloatValues(.99f,0);
+            mVectorState.mBasicAnimator.setFloatValues(.99f, 0);
             start();
         }
     }
@@ -342,8 +352,8 @@
     }
 
     /**
-     * Sets padding for this shape, defined by a Rect object. Define the padding in the Rect object
-     * as: left, top, right, bottom.
+     * Sets padding for this shape, defined by a Rect object. Define the padding
+     * in the Rect object as: left, top, right, bottom.
      */
     public void setPadding(Rect padding) {
         setPadding(padding.left, padding.top, padding.right, padding.bottom);
@@ -467,13 +477,14 @@
                     currentGroup = new VGroup();
                     animatedPath.mGroupList.add(currentGroup);
                     noGroupTag = false;
-                }  else if (SHAPE_VECTOR.equals(tagName)) {
+                } else if (SHAPE_VECTOR.equals(tagName)) {
                     final TypedArray a = res.obtainAttributes(attrs, R.styleable.VectorDrawable);
                     animatedPath.setTrigger(a.getInteger(R.styleable.VectorDrawable_trigger, 0));
 
                     // Parsing the version information.
                     // Right now, we only support version "1".
-                    // If the xml didn't specify the version number, the default version is "1".
+                    // If the xml didn't specify the version number, the default
+                    // version is "1".
                     final int versionCode = a.getInt(R.styleable.VectorDrawable_versionCode, 1);
                     if (versionCode != 1) {
                         throw new IllegalArgumentException(
@@ -494,22 +505,22 @@
                 tag.append(SHAPE_SIZE);
             }
 
-            if  (noViewportTag){
-                if (tag.length()>0) {
+            if (noViewportTag) {
+                if (tag.length() > 0) {
                     tag.append(" & ");
                 }
                 tag.append(SHAPE_SIZE);
             }
 
-            if  (noGroupTag){
-                if (tag.length()>0) {
+            if (noGroupTag) {
+                if (tag.length() > 0) {
                     tag.append(" & ");
                 }
                 tag.append(SHAPE_GROUP);
             }
 
-            if  (noPathTag){
-                if (tag.length()>0) {
+            if (noPathTag) {
+                if (tag.length() > 0) {
                     tag.append(" or ");
                 }
                 tag.append(SHAPE_PATH);
@@ -528,7 +539,8 @@
 
         long duration = mVectorState.mVAnimatedPath.getTotalAnimationDuration();
         if (duration == -1) { // if it set to infinite set to 1 hour
-            duration = DEFAULT_INFINITE_DURATION; // TODO define correct approach for infinite
+            duration = DEFAULT_INFINITE_DURATION; // TODO define correct
+                                                  // approach for infinite
             mVectorState.mBasicAnimator.setFloatValues(0, duration / 1000);
             mVectorState.mBasicAnimator.setInterpolator(new LinearInterpolator());
         }
diff --git a/media/java/android/media/WebVttRenderer.java b/media/java/android/media/WebVttRenderer.java
index 58d3520..1c9730f 100644
--- a/media/java/android/media/WebVttRenderer.java
+++ b/media/java/android/media/WebVttRenderer.java
@@ -558,7 +558,11 @@
     }
 }
 
-/** @hide */
+/**
+ *  Supporting July 10 2013 draft version
+ *
+ *  @hide
+ */
 class WebVttParser {
     private static final String TAG = "WebVttParser";
     private Phase mPhase;
@@ -726,15 +730,15 @@
                                 "has invalid value", e.getMessage(), value);
                     }
                 } else if (name.equals("lines")) {
-                    try {
-                        int lines = Integer.parseInt(value);
-                        if (lines >= 0) {
-                            region.mLines = lines;
-                        } else {
-                            log_warning("region setting", name, "is negative", value);
+                    if (value.matches(".*[^0-9].*")) {
+                        log_warning("lines", name, "contains an invalid character", value);
+                    } else {
+                        try {
+                            region.mLines = Integer.parseInt(value);
+                            assert(region.mLines >= 0); // lines contains only digits
+                        } catch (NumberFormatException e) {
+                            log_warning("region setting", name, "is not numeric", value);
                         }
-                    } catch (NumberFormatException e) {
-                        log_warning("region setting", name, "is not numeric", value);
                     }
                 } else if (name.equals("regionanchor") ||
                            name.equals("viewportanchor")) {
@@ -872,26 +876,23 @@
                     }
                 } else if (name.equals("line")) {
                     try {
-                        int linePosition;
                         /* TRICKY: we know that there are no spaces in value */
                         assert(value.indexOf(' ') < 0);
                         if (value.endsWith("%")) {
-                            linePosition = Integer.parseInt(
-                                    value.substring(0, value.length() - 1));
-                            if (linePosition < 0 || linePosition > 100) {
-                                log_warning("cue setting", name, "is out of range", value);
-                                continue;
-                            }
                             mCue.mSnapToLines = false;
-                            mCue.mLinePosition = linePosition;
+                            mCue.mLinePosition = parseIntPercentage(value);
+                        } else if (value.matches(".*[^0-9].*")) {
+                            log_warning("cue setting", name,
+                                    "contains an invalid character", value);
                         } else {
                             mCue.mSnapToLines = true;
                             mCue.mLinePosition = Integer.parseInt(value);
                         }
                     } catch (NumberFormatException e) {
                         log_warning("cue setting", name,
-                               "is not numeric or percentage", value);
+                                "is not numeric or percentage", value);
                     }
+                    // TODO: add support for optional alignment value [,start|middle|end]
                 } else if (name.equals("position")) {
                     try {
                         mCue.mTextPosition = parseIntPercentage(value);
diff --git a/media/jni/android_media_MediaRecorder.cpp b/media/jni/android_media_MediaRecorder.cpp
index fd69cad..1685a44 100644
--- a/media/jni/android_media_MediaRecorder.cpp
+++ b/media/jni/android_media_MediaRecorder.cpp
@@ -14,6 +14,13 @@
  * limitations under the License.
  */
 
+#include <assert.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <stdio.h>
+#include <unistd.h>
+
 //#define LOG_NDEBUG 0
 #define LOG_TAG "MediaRecorderJNI"
 #include <utils/Log.h>
@@ -22,11 +29,6 @@
 #include <camera/ICameraService.h>
 #include <camera/Camera.h>
 #include <media/mediarecorder.h>
-#include <stdio.h>
-#include <assert.h>
-#include <limits.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <utils/threads.h>
 
 #include "jni.h"
@@ -303,7 +305,7 @@
     sp<MediaRecorder> mr = getMediaRecorder(env, thiz);
 
     char params[64];
-    sprintf(params, "max-filesize=%lld", max_filesize_bytes);
+    sprintf(params, "max-filesize=%" PRId64, max_filesize_bytes);
 
     process_media_recorder_call(env, mr->setParameters(String8(params)), "java/lang/RuntimeException", "setMaxFileSize failed.");
 }
diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp
index c0f6a95..0894d74 100644
--- a/media/jni/mediaeditor/VideoEditorMain.cpp
+++ b/media/jni/mediaeditor/VideoEditorMain.cpp
@@ -16,6 +16,7 @@
 #define LOG_NDEBUG 1
 #define LOG_TAG "VideoEditorMain"
 #include <dlfcn.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <utils/Log.h>
@@ -3371,7 +3372,7 @@
     err = M4OSA_fileReadOpen (&inputFileHandle, pInputFileURL, M4OSA_kFileRead);
     if (inputFileHandle == M4OSA_NULL) {
         VIDEOEDIT_LOG_ERROR(ANDROID_LOG_INFO, "VIDEO_EDITOR",
-            "M4MA_generateAudioGraphFile: Cannot open input file 0x%lx", err);
+            "M4MA_generateAudioGraphFile: Cannot open input file 0x%" PRIx32, err);
         return err;
     }
 
@@ -3405,7 +3406,7 @@
         bufferIn.m_bufferSize = samplesCountInBytes*sizeof(M4OSA_UInt16);
     } else {
         VIDEOEDIT_LOG_ERROR(ANDROID_LOG_INFO, "VIDEO_EDITOR",
-            "M4MA_generateAudioGraphFile: Malloc failed for bufferIn.m_dataAddress 0x%lx",
+            "M4MA_generateAudioGraphFile: Malloc failed for bufferIn.m_dataAddress 0x%" PRIx32,
             M4ERR_ALLOC);
         return M4ERR_ALLOC;
     }
@@ -3445,7 +3446,7 @@
         if (err != M4NO_ERROR) {
             // if out value of bytes-read is 0, break
             if ( numBytesToRead == 0) {
-                VIDEOEDIT_LOG_ERROR(ANDROID_LOG_INFO, "VIDEO_EDITOR", "numBytesToRead 0x%lx",
+                VIDEOEDIT_LOG_ERROR(ANDROID_LOG_INFO, "VIDEO_EDITOR", "numBytesToRead 0x%" PRIx32,
                 numBytesToRead);
                 break; /* stop if file is empty or EOF */
             }
@@ -3497,7 +3498,7 @@
 
     } while (numBytesToRead != 0);
 
-    VIDEOEDIT_LOG_ERROR(ANDROID_LOG_INFO, "VIDEO_EDITOR", "loop 0x%lx", volumeValuesCount);
+    VIDEOEDIT_LOG_ERROR(ANDROID_LOG_INFO, "VIDEO_EDITOR", "loop 0x%" PRIx32, volumeValuesCount);
 
     /* if some error occured in fwrite */
     if (numBytesToRead != 0) {
diff --git a/packages/Keyguard/res/values-af/activitystrings.xml b/packages/Keyguard/res/values-af/activitystrings.xml
deleted file mode 100644
index f6e8d5e..0000000
--- a/packages/Keyguard/res/values-af/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardToetsAktiwiteit"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"VerenigdeKamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Geen sekuriteit nie"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Wagwoord"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Patroon"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Kies legstuk…"</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"opSkermAfgeskakel"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"opSkermAangeskakel"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doenKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifieerOntsluit"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-am/activitystrings.xml b/packages/Keyguard/res/values-am/activitystrings.xml
deleted file mode 100644
index a6c7449..0000000
--- a/packages/Keyguard/res/values-am/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"ምንም ደህንነት የለም"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"ፒን"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"የይለፍ ቃል"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"ሥርዓተ ጥለት"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"የሲም ፒን"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"የሲም ፒዩኬ"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"ንዑስ ፕሮግራም ይምረጡ..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-ar/activitystrings.xml b/packages/Keyguard/res/values-ar/activitystrings.xml
deleted file mode 100644
index f77d8f00..0000000
--- a/packages/Keyguard/res/values-ar/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"بدون تأمين"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"رقم التعريف الشخصي"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"كلمة المرور"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"نقش"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"رقم التعريف الشخصي لبطاقة SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"رمز PUK لبطاقة SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"جارٍ اختيار أداة..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-bg/activitystrings.xml b/packages/Keyguard/res/values-bg/activitystrings.xml
deleted file mode 100644
index 807bcf2..0000000
--- a/packages/Keyguard/res/values-bg/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Без защита"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"ПИН код"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Парола"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Фигура"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"ПИН код за SIM карта"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK код за SIM карта"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Избиране на приспособление..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-ca/activitystrings.xml b/packages/Keyguard/res/values-ca/activitystrings.xml
deleted file mode 100644
index c18b9bb..0000000
--- a/packages/Keyguard/res/values-ca/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"No hi ha seguretat"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Contrasenya"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Patró"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN de la SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK de la SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Tria un widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-cs/activitystrings.xml b/packages/Keyguard/res/values-cs/activitystrings.xml
deleted file mode 100644
index 354176e..0000000
--- a/packages/Keyguard/res/values-cs/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Žádné zabezpečení"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Heslo"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Gesto"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN SIM karty"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK SIM karty"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Zvolte widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-da/activitystrings.xml b/packages/Keyguard/res/values-da/activitystrings.xml
deleted file mode 100644
index af07ba5..0000000
--- a/packages/Keyguard/res/values-da/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Ingen sikkerhed"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"Pinkode"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Adgangskode"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Mønster"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"Pinkode til SIM-kort"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK-kode til SIM-kort"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Vælg widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-de/activitystrings.xml b/packages/Keyguard/res/values-de/activitystrings.xml
deleted file mode 100644
index d8e9272..0000000
--- a/packages/Keyguard/res/values-de/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Keine Sicherheit"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Passwort"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Muster"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN für SIM-Karte"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK für SIM-Karte"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Widget auswählen..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-el/activitystrings.xml b/packages/Keyguard/res/values-el/activitystrings.xml
deleted file mode 100644
index 3941f4f..0000000
--- a/packages/Keyguard/res/values-el/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Χωρίς ασφάλεια"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Κωδικός πρόσβασης"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Μοτίβο"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"Κωδικός PIN κάρτας SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"Κωδικός PUK κάρτας SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Επιλογή γραφικού στοιχείου…"</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-en-rGB/activitystrings.xml b/packages/Keyguard/res/values-en-rGB/activitystrings.xml
deleted file mode 100644
index 88e806e..0000000
--- a/packages/Keyguard/res/values-en-rGB/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"No security"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Password"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Pattern"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Choose widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-es-rUS/activitystrings.xml b/packages/Keyguard/res/values-es-rUS/activitystrings.xml
deleted file mode 100644
index 20117c4..0000000
--- a/packages/Keyguard/res/values-es-rUS/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Sin seguridad"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Contraseña"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Patrón"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN de tarjeta SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK de tarjeta SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Elegir widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-es/activitystrings.xml b/packages/Keyguard/res/values-es/activitystrings.xml
deleted file mode 100644
index 34899cc..0000000
--- a/packages/Keyguard/res/values-es/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Sin seguridad"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Contraseña"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Patrón"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN de tarjeta SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK de tarjeta SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Seleccionar widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-fa/activitystrings.xml b/packages/Keyguard/res/values-fa/activitystrings.xml
deleted file mode 100644
index 735af8d..0000000
--- a/packages/Keyguard/res/values-fa/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"عدم وجود امنیت"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"پین"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"گذرواژه"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"الگو"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"پین سیم کارت"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK سیم کارت"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"انتخاب ابزارک..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-fi/activitystrings.xml b/packages/Keyguard/res/values-fi/activitystrings.xml
deleted file mode 100644
index 6e0a5a9..0000000
--- a/packages/Keyguard/res/values-fi/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Ei suojausta"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN-koodi"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Salasana"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Kuvio"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM-kortin PIN-koodi"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM-kortin PUK-koodi"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Valitse widget…"</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-fr/activitystrings.xml b/packages/Keyguard/res/values-fr/activitystrings.xml
deleted file mode 100644
index dc79842..0000000
--- a/packages/Keyguard/res/values-fr/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Aucune sécurité"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"Code PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Mot de passe"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Schéma"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"Code PIN de la carte SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"Clé PUK de la carte SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Sélectionner un widget"</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-hi/activitystrings.xml b/packages/Keyguard/res/values-hi/activitystrings.xml
deleted file mode 100644
index 4b0a082..0000000
--- a/packages/Keyguard/res/values-hi/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"कोई सुरक्षा नहीं"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"पासवर्ड"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"प्रतिमान"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM पिन"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"विजेट चुनें..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-hr/activitystrings.xml b/packages/Keyguard/res/values-hr/activitystrings.xml
deleted file mode 100644
index d2b8e92..0000000
--- a/packages/Keyguard/res/values-hr/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Nema zaštite"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Zaporka"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Uzorak"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN za SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK za SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Odaberite widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-hu/activitystrings.xml b/packages/Keyguard/res/values-hu/activitystrings.xml
deleted file mode 100644
index 30d2951..0000000
--- a/packages/Keyguard/res/values-hu/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Nincs védelem"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN kód"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Jelszó"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Minta"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM kártya PIN kódja"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM kártya PUK kódja"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Modul kiválasztása..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-in/activitystrings.xml b/packages/Keyguard/res/values-in/activitystrings.xml
deleted file mode 100644
index ec9774d..0000000
--- a/packages/Keyguard/res/values-in/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Tanpa pengamanan"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Sandi"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Pola"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Pilih widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-it/activitystrings.xml b/packages/Keyguard/res/values-it/activitystrings.xml
deleted file mode 100644
index 34ad96497..0000000
--- a/packages/Keyguard/res/values-it/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Nessuna sicurezza"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Password"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Sequenza"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN della SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK della SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Scegli widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-iw/activitystrings.xml b/packages/Keyguard/res/values-iw/activitystrings.xml
deleted file mode 100644
index 84e351a2..0000000
--- a/packages/Keyguard/res/values-iw/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"ללא אבטחה"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"סיסמה"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"קו ביטול נעילה"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN של SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK של SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"בחר Widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-ja/activitystrings.xml b/packages/Keyguard/res/values-ja/activitystrings.xml
deleted file mode 100644
index b0e77f1..0000000
--- a/packages/Keyguard/res/values-ja/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"セキュリティなし"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"パスワード"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"パターン"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"ウィジェットを選択..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-ko/activitystrings.xml b/packages/Keyguard/res/values-ko/activitystrings.xml
deleted file mode 100644
index 3aab225..0000000
--- a/packages/Keyguard/res/values-ko/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"보안 사용 안함"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"비밀번호"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"패턴"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"위젯 선택..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-lt/activitystrings.xml b/packages/Keyguard/res/values-lt/activitystrings.xml
deleted file mode 100644
index 9ec21e4..0000000
--- a/packages/Keyguard/res/values-lt/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Neapsaugota"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN kodas"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Slaptažodis"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Šablonas"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM kortelės PIN kodas"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM kortelės PUK kodas"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Pasirinkite valdiklį..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-lv/activitystrings.xml b/packages/Keyguard/res/values-lv/activitystrings.xml
deleted file mode 100644
index 96807de..0000000
--- a/packages/Keyguard/res/values-lv/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Drošība nav iespējota"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Parole"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Kombinācija"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Izvēlēties logrīku..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-nb/activitystrings.xml b/packages/Keyguard/res/values-nb/activitystrings.xml
deleted file mode 100644
index 015df15..0000000
--- a/packages/Keyguard/res/values-nb/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Ingen sikkerhet"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Passord"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Mønster"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"Personlig kode for SIM-kort"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK-kode for SIM-kort"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Velg modul"</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-nl/activitystrings.xml b/packages/Keyguard/res/values-nl/activitystrings.xml
deleted file mode 100644
index fcb0be9..0000000
--- a/packages/Keyguard/res/values-nl/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Geen beveiliging"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"Pincode"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Wachtwoord"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Patroon"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"Pincode van simkaart"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK-code van simkaart"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Widget kiezen…"</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-pl/activitystrings.xml b/packages/Keyguard/res/values-pl/activitystrings.xml
deleted file mode 100644
index f04170e..0000000
--- a/packages/Keyguard/res/values-pl/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Bez zabezpieczeń"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Hasło"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Wzór"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN do karty SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK do karty SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Wybierz widżet..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-pt-rPT/activitystrings.xml b/packages/Keyguard/res/values-pt-rPT/activitystrings.xml
deleted file mode 100644
index 470865d..0000000
--- a/packages/Keyguard/res/values-pt-rPT/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Sem segurança"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Palavra-passe"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Sequência"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN do SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK do SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Escolher widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-pt/activitystrings.xml b/packages/Keyguard/res/values-pt/activitystrings.xml
deleted file mode 100644
index 7a63708..0000000
--- a/packages/Keyguard/res/values-pt/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Sem segurança"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Senha"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Padrão"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN do SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK do SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Escolher widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-ro/activitystrings.xml b/packages/Keyguard/res/values-ro/activitystrings.xml
deleted file mode 100644
index 6d3447d..0000000
--- a/packages/Keyguard/res/values-ro/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Fără securitate"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Parolă"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Model"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Alegeți un widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-ru/activitystrings.xml b/packages/Keyguard/res/values-ru/activitystrings.xml
deleted file mode 100644
index 002cd56..0000000
--- a/packages/Keyguard/res/values-ru/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Защита отключена"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN-код"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Пароль"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Графический ключ"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN-код SIM-карты"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK-код SIM-карты"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Выбор виджета..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-sk/activitystrings.xml b/packages/Keyguard/res/values-sk/activitystrings.xml
deleted file mode 100644
index 33f2228..0000000
--- a/packages/Keyguard/res/values-sk/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Bez zabezpečenia"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"Kód PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Heslo"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Vzor"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN karty SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK karty SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Vyberte miniaplikáciu..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-sl/activitystrings.xml b/packages/Keyguard/res/values-sl/activitystrings.xml
deleted file mode 100644
index 2c60219..0000000
--- a/packages/Keyguard/res/values-sl/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Brez varnosti"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Geslo"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Vzorec"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN za kartico SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK za kartico SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Izberite pripomoček ..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-sr/activitystrings.xml b/packages/Keyguard/res/values-sr/activitystrings.xml
deleted file mode 100644
index 34802df..0000000
--- a/packages/Keyguard/res/values-sr/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Без заштите"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Лозинка"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Шаблон"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN SIM картице"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK SIM картице"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Изабери виџет..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-sv/activitystrings.xml b/packages/Keyguard/res/values-sv/activitystrings.xml
deleted file mode 100644
index e664383..0000000
--- a/packages/Keyguard/res/values-sv/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Ingen säkerhet"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN-kod"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Lösenord"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Grafiskt lösenord"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN-kod för SIM-kort"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK-kod för SIM-kort"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Välj widget ..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-sw/activitystrings.xml b/packages/Keyguard/res/values-sw/activitystrings.xml
deleted file mode 100644
index 357b911..0000000
--- a/packages/Keyguard/res/values-sw/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Hakuna usalama"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Nenosiri"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Ruwaza"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN ya SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK ya SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Chagua wijeti..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-th/activitystrings.xml b/packages/Keyguard/res/values-th/activitystrings.xml
deleted file mode 100644
index 64f50cc..0000000
--- a/packages/Keyguard/res/values-th/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"ไม่มีการรักษาความปลอดภัย"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"รหัสผ่าน"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"รูปแบบ"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN ของซิม"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK ของซิม"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"เลือกวิดเจ็ต..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-tl/activitystrings.xml b/packages/Keyguard/res/values-tl/activitystrings.xml
deleted file mode 100644
index 71f3564..0000000
--- a/packages/Keyguard/res/values-tl/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Walang seguridad"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Password"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Pattern"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Pumili ng widget..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenNaka-off"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenNaka-on"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-tr/activitystrings.xml b/packages/Keyguard/res/values-tr/activitystrings.xml
deleted file mode 100644
index 7f5a958..0000000
--- a/packages/Keyguard/res/values-tr/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Güvenlik yok"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Şifre"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Desen"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN\'i"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK\'u"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Widget seç..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-uk/activitystrings.xml b/packages/Keyguard/res/values-uk/activitystrings.xml
deleted file mode 100644
index d4d0a4d..0000000
--- a/packages/Keyguard/res/values-uk/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Без захисту"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN-код"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Пароль"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Ключ"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"PIN-код SIM-карти"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"PUK-код SIM-карти"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Вибрати віджет…"</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-vi/activitystrings.xml b/packages/Keyguard/res/values-vi/activitystrings.xml
deleted file mode 100644
index 009c3bd..0000000
--- a/packages/Keyguard/res/values-vi/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Không có bảo mật"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"Mã PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Mật khẩu"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Hình"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"Mã PIN của SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"Mã PUK của SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Chọn tiện ích..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-zh-rCN/activitystrings.xml b/packages/Keyguard/res/values-zh-rCN/activitystrings.xml
deleted file mode 100644
index d9b99e0..0000000
--- a/packages/Keyguard/res/values-zh-rCN/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"无安全措施"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"密码"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"图案"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM 卡 PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM 卡 PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"选择小部件..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-zh-rTW/activitystrings.xml b/packages/Keyguard/res/values-zh-rTW/activitystrings.xml
deleted file mode 100644
index 42c2a51..0000000
--- a/packages/Keyguard/res/values-zh-rTW/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"Keyguard 測試活動"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"整合式相機"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"無安全性設定"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"密碼"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"圖形"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"SIM PIN"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"SIM PUK"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"選擇小工具..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"在螢幕上關閉"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"在螢幕上開啟"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"執行 Keyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"驗證解鎖"</string>
-</resources>
diff --git a/packages/Keyguard/res/values-zu/activitystrings.xml b/packages/Keyguard/res/values-zu/activitystrings.xml
deleted file mode 100644
index 0031a8b..0000000
--- a/packages/Keyguard/res/values-zu/activitystrings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-/* //device/apps/common/assets/res/any/strings.xml
-**
-** Copyright 2006, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="3352888186674981593">"I-KeyguardTestActivity"</string>
-    <string name="secure_app_name" msgid="7955498742816868049">"I-UnifiedCamera"</string>
-    <string name="none_menu_item" msgid="6156747285687551424">"Akukho ukuphepha"</string>
-    <string name="pin_menu_item" msgid="1179756433268962311">"I-PIN"</string>
-    <string name="password_menu_item" msgid="1959980499662153160">"Iphasiwedi"</string>
-    <string name="pattern_menu_item" msgid="2987798152175140249">"Iphethini"</string>
-    <string name="sim_pin_menu_item" msgid="3962286639645084880">"I-PIN ye-SIM"</string>
-    <string name="sim_puk_menu_item" msgid="6190044133008392974">"I-PUK YE-SIM"</string>
-    <string name="add_widget_item" msgid="279702152366857415">"Khetha iwijethi..."</string>
-    <string name="on_screen_turned_off" msgid="8761396329770508367">"I-onScreenTurnedOff"</string>
-    <string name="on_screen_turned_on" msgid="9222926818030728999">"I-onScreenTurnedOn"</string>
-    <string name="do_keyguard" msgid="9210936977823118796">"I-doKeyguard"</string>
-    <string name="verify_unlock" msgid="8508722273329306968">"I-verifyUnlock"</string>
-</resources>
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
index 7cfd684..f85e29f 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
@@ -22,10 +22,8 @@
 import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
 import com.android.keyguard.KeyguardUpdateMonitor.DisplayClientState;
 
-import android.app.Activity;
 import android.app.ActivityManager;
 import android.app.ActivityOptions;
-import android.app.SearchManager;
 import android.app.admin.DevicePolicyManager;
 import android.appwidget.AppWidgetHost;
 import android.appwidget.AppWidgetHostView;
@@ -36,7 +34,6 @@
 import android.content.Intent;
 import android.content.IntentSender;
 import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.UserInfo;
 import android.content.res.Resources;
 import android.graphics.Rect;
 import android.media.RemoteControlClient;
@@ -44,7 +41,6 @@
 import android.os.Looper;
 import android.os.Parcel;
 import android.os.Parcelable;
-import android.os.SystemClock;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
@@ -55,9 +51,7 @@
 import android.view.View;
 import android.widget.RemoteViews.OnClickHandler;
 
-import java.io.File;
 import java.lang.ref.WeakReference;
-import java.util.List;
 
 public class KeyguardHostView extends KeyguardViewBase {
     private static final String TAG = "KeyguardHostView";
@@ -595,16 +589,16 @@
     };
 
     @Override
-    public void onScreenTurnedOn() {
-        super.onScreenTurnedOn();
+    public void onResume() {
+        super.onResume();
         if (mViewStateManager != null) {
             mViewStateManager.showUsabilityHints();
         }
     }
 
     @Override
-    public void onScreenTurnedOff() {
-        super.onScreenTurnedOff();
+    public void onPause() {
+        super.onPause();
         // We use mAppWidgetToShow to show a particular widget after you add it-- once the screen
         // turns off we reset that behavior
         clearAppWidgetToShow();
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java
index da6482a..2d492db 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java
@@ -28,7 +28,7 @@
      * The different types of security available for {@link Mode#UnlockScreen}.
      * @see com.android.internal.policy.impl.LockPatternKeyguardView#getUnlockMode()
      */
-    enum SecurityMode {
+    public enum SecurityMode {
         Invalid, // NULL state
         None, // No security enabled
         Pattern, // Unlock by drawing a pattern.
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
index bc0f364..d8e5b8a 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
@@ -217,9 +217,9 @@
     }
 
     /**
-     * Called when the screen turned off.
+     * Called when the Keyguard is not actively shown anymore on the screen.
      */
-    public void onScreenTurnedOff() {
+    public void onPause() {
         if (DEBUG) Log.d(TAG, String.format("screen off, instance %s at %s",
                 Integer.toHexString(hashCode()), SystemClock.uptimeMillis()));
         // Once the screen turns off, we no longer consider this to be first boot and we want the
@@ -231,9 +231,9 @@
     }
 
     /**
-     * Called when the screen turned on.
+     * Called when the Keyguard is actively shown on the screen.
      */
-    public void onScreenTurnedOn() {
+    public void onResume() {
         if (DEBUG) Log.d(TAG, "screen on, instance " + Integer.toHexString(hashCode()));
         mSecurityContainer.showPrimarySecurityScreen(false);
         mSecurityContainer.onResume(KeyguardSecurityView.SCREEN_ON);
@@ -476,6 +476,10 @@
         mSecurityContainer.setLockPatternUtils(utils);
     }
 
+    public SecurityMode getSecurityMode() {
+        return mSecurityContainer.getSecurityMode();
+    }
+
     protected abstract void onUserSwitching(boolean switching);
 
     protected abstract void onCreateOptions(Bundle options);
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index bb39d36..cbfc266 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1285,6 +1285,9 @@
                     flags |= StatusBarManager.DISABLE_SEARCH;
                 }
             }
+            if (isShowingAndNotOccluded()) {
+                flags |= StatusBarManager.DISABLE_HOME;
+            }
 
             if (DEBUG) {
                 Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
index 7cbde36..f2054a2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
@@ -17,20 +17,18 @@
 package com.android.systemui.statusbar.phone;
 
 import android.content.Context;
-import android.os.RemoteException;
-import android.util.Slog;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 
-import com.android.internal.policy.IKeyguardShowCallback;
 import com.android.internal.widget.LockPatternUtils;
-import com.android.keyguard.KeyguardHostView;
 import com.android.keyguard.KeyguardViewBase;
 import com.android.keyguard.R;
 import com.android.keyguard.ViewMediatorCallback;
 import com.android.systemui.keyguard.KeyguardViewMediator;
 
+import static com.android.keyguard.KeyguardSecurityModel.*;
+
 /**
  * A class which manages the bouncer on the lockscreen.
  */
@@ -66,6 +64,7 @@
         if (!mKeyguardView.dismiss()) {
             mRoot.setVisibility(View.VISIBLE);
             mKeyguardView.requestFocus();
+            mKeyguardView.onResume();
         }
     }
 
@@ -84,14 +83,8 @@
     }
 
     public void onScreenTurnedOff() {
-        if (mKeyguardView != null) {
-            mKeyguardView.onScreenTurnedOff();
-        }
-    }
-
-    public void onScreenTurnedOn() {
-        if (mKeyguardView != null) {
-            mKeyguardView.onScreenTurnedOn();
+        if (mKeyguardView != null && mRoot.getVisibility() == View.VISIBLE) {
+            mKeyguardView.onPause();
         }
     }
 
@@ -136,4 +129,31 @@
     public boolean onBackPressed() {
         return mKeyguardView != null && mKeyguardView.handleBackKey();
     }
+
+    /**
+     * @return True if and only if the current security method should be shown before showing
+     *         the notifications on Keyguard, like SIM PIN/PUK.
+     */
+    public boolean needsFullscreenBouncer() {
+        if (mKeyguardView != null) {
+            SecurityMode mode = mKeyguardView.getSecurityMode();
+            return mode == SecurityMode.SimPin
+                    || mode == SecurityMode.SimPuk;
+        }
+        return false;
+    }
+
+    public boolean onMenuPressed() {
+        ensureView();
+        if (mKeyguardView.handleMenuKey()) {
+
+            // We need to show it in case it is secure. If not, it will get dismissed in any case.
+            mRoot.setVisibility(View.VISIBLE);
+            mKeyguardView.requestFocus();
+            mKeyguardView.onResume();
+            return true;
+        } else {
+            return false;
+        }
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index e89544c..5f71516 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -2945,7 +2945,6 @@
         if (isFlippedToSettings()) {
             flipToNotifications();
         }
-        mStatusBarWindow.setSystemUiVisibility(View.STATUS_BAR_DISABLE_HOME);
         mKeyguardStatusView.setVisibility(View.VISIBLE);
         mNotificationPanelHeader.setVisibility(View.GONE);
         if (mKeyguardSettingsFlipButton == null) {
@@ -2962,11 +2961,13 @@
 
     public void hideKeyguard() {
         mOnKeyguard = false;
-        mStatusBarWindow.setSystemUiVisibility(0);
         mKeyguardStatusView.setVisibility(View.GONE);
         mNotificationPanelHeader.setVisibility(View.VISIBLE);
-        mKeyguardSettingsFlipButton.setVisibility(View.GONE);
+        if (mKeyguardSettingsFlipButton != null) {
+            mKeyguardSettingsFlipButton.setVisibility(View.GONE);
+        }
         updateRowStates();
+        instantCollapseNotificationPanel();
     }
 
     public void userActivity() {
@@ -2975,6 +2976,10 @@
         }
     }
 
+    public boolean onMenuPressed() {
+        return mOnKeyguard && mStatusBarKeyguardViewManager.onMenuPressed();
+    }
+
     public boolean onBackPressed() {
         if (mOnKeyguard) {
             return mStatusBarKeyguardViewManager.onBackPressed();
@@ -2995,6 +3000,10 @@
         mNotificationPanel.setExpandedFraction(1);
     }
 
+    private void instantCollapseNotificationPanel() {
+        mNotificationPanel.setExpandedFraction(0);
+    }
+
     @Override
     public void onActivated(View view) {
         userActivity();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index b8592c3..41b5b7c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -80,11 +80,27 @@
     public void show(Bundle options) {
         mShowing = true;
         mStatusBarWindowManager.setKeyguardShowing(true);
-        mPhoneStatusBar.showKeyguard();
-        mBouncer.prepare();
+        showBouncerOrKeyguard();
         updateBackButtonState();
     }
 
+    /**
+     * Shows the notification keyguard or the bouncer depending on
+     * {@link KeyguardBouncer#needsFullscreenBouncer()}.
+     */
+    private void showBouncerOrKeyguard() {
+        if (mBouncer.needsFullscreenBouncer()) {
+
+            // The keyguard might be showing (already). So we need to hide it.
+            mPhoneStatusBar.hideKeyguard();
+            mBouncer.show();
+        } else {
+            mPhoneStatusBar.showKeyguard();
+            mBouncer.hide();
+            mBouncer.prepare();
+        }
+    }
+
     public void showBouncer() {
         mBouncer.show();
         updateBackButtonState();
@@ -94,8 +110,7 @@
      * Reset the state of the view.
      */
     public void reset() {
-        mBouncer.reset();
-        mPhoneStatusBar.showKeyguard();
+        showBouncerOrKeyguard();
         updateBackButtonState();
     }
 
@@ -106,7 +121,6 @@
 
     public void onScreenTurnedOn(final IKeyguardShowCallback callback) {
         mScreenOn = true;
-        mBouncer.onScreenTurnedOn();
         if (callback != null) {
             callbackAfterDraw(callback);
         }
@@ -185,10 +199,15 @@
 
     private void updateBackButtonState() {
         int vis = mContainer.getSystemUiVisibility();
-        if (mBouncer.isShowing()) {
+        boolean bouncerDismissable = mBouncer.isShowing() && !mBouncer.needsFullscreenBouncer();
+        if (bouncerDismissable || !mShowing) {
             mContainer.setSystemUiVisibility(vis & ~View.STATUS_BAR_DISABLE_BACK);
         } else {
             mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK);
         }
     }
+
+    public boolean onMenuPressed() {
+        return mBouncer.onMenuPressed();
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
index 6153cde..716e326 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
@@ -128,6 +128,10 @@
         }
     }
 
+    private void applyFitsSystemWindows(State state) {
+        mStatusBarView.setFitsSystemWindows(!state.isKeyguardShowingAndNotOccluded());
+    }
+
     private void applyUserActivityTimeout(State state) {
         if (state.isKeyguardShowingAndNotOccluded()) {
             mLp.userActivityTimeout = state.keyguardUserActivityTimeout;
@@ -151,6 +155,7 @@
         applyHeight(state);
         applyUserActivityTimeout(state);
         applyInputFeatures(state);
+        applyFitsSystemWindows(state);
         mWindowManager.updateViewLayout(mStatusBarView, mLp);
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index dd89f47..1d675bd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -77,11 +77,15 @@
     public boolean dispatchKeyEvent(KeyEvent event) {
         boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
         switch (event.getKeyCode()) {
-        case KeyEvent.KEYCODE_BACK:
-            if (!down) {
-                mService.onBackPressed();
-            }
-            return true;
+            case KeyEvent.KEYCODE_BACK:
+                if (!down) {
+                    mService.onBackPressed();
+                }
+                return true;
+            case KeyEvent.KEYCODE_MENU:
+                if (!down) {
+                    return mService.onMenuPressed();
+                }
         }
         return super.dispatchKeyEvent(event);
     }
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 77f5182..037a744 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -32,6 +32,7 @@
 import android.os.RemoteException;
 import android.os.UserHandle;
 import android.telephony.CellLocation;
+import android.telephony.DataConnectionRealTimeInfo;
 import android.telephony.PhoneStateListener;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
@@ -129,6 +130,8 @@
 
     private List<CellInfo> mCellInfo = null;
 
+    private DataConnectionRealTimeInfo mDcRtInfo = new DataConnectionRealTimeInfo();
+
     private int mRingingCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
 
     private int mForegroundCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
@@ -324,6 +327,13 @@
                             remove(r.binder);
                         }
                     }
+                    if ((events & PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO) != 0) {
+                        try {
+                            r.callback.onDataConnectionRealTimeInfoChanged(mDcRtInfo);
+                        } catch (RemoteException ex) {
+                            remove(r.binder);
+                        }
+                    }
                     if ((events & PhoneStateListener.LISTEN_PRECISE_CALL_STATE) != 0) {
                         try {
                             r.callback.onPreciseCallStateChanged(mPreciseCallState);
@@ -451,6 +461,31 @@
         }
     }
 
+    public void notifyDataConnectionRealTimeInfo(DataConnectionRealTimeInfo dcRtInfo) {
+        if (!checkNotifyPermission("notifyDataConnectionRealTimeInfo()")) {
+            return;
+        }
+
+        synchronized (mRecords) {
+            mDcRtInfo = dcRtInfo;
+            for (Record r : mRecords) {
+                if (validateEventsAndUserLocked(r,
+                        PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO)) {
+                    try {
+                        if (DBG_LOC) {
+                            Slog.d(TAG, "notifyDataConnectionRealTimeInfo: mDcRtInfo="
+                                    + mDcRtInfo + " r=" + r);
+                        }
+                        r.callback.onDataConnectionRealTimeInfoChanged(mDcRtInfo);
+                    } catch (RemoteException ex) {
+                        mRemoveList.add(r.binder);
+                    }
+                }
+            }
+            handleRemoveListLocked();
+        }
+    }
+
     public void notifyMessageWaitingChanged(boolean mwi) {
         if (!checkNotifyPermission("notifyMessageWaitingChanged()")) {
             return;
@@ -754,6 +789,7 @@
             pw.println("  mDataConnectionLinkCapabilities=" + mDataConnectionLinkCapabilities);
             pw.println("  mCellLocation=" + mCellLocation);
             pw.println("  mCellInfo=" + mCellInfo);
+            pw.println("  mDcRtInfo=" + mDcRtInfo);
             pw.println("registrations: count=" + recordCount);
             for (Record r : mRecords) {
                 pw.println("  " + r.pkgForDebug + " 0x" + Integer.toHexString(r.events));
diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java
index aa756a1..132ca00 100644
--- a/services/core/java/com/android/server/VibratorService.java
+++ b/services/core/java/com/android/server/VibratorService.java
@@ -86,19 +86,19 @@
         private final int     mRepeat;
         private final int     mStreamHint;
         private final int     mUid;
-        private final String  mPackageName;
+        private final String  mOpPkg;
 
-        Vibration(IBinder token, long millis, int streamHint, int uid, String packageName) {
-            this(token, millis, null, 0, streamHint, uid, packageName);
+        Vibration(IBinder token, long millis, int streamHint, int uid, String opPkg) {
+            this(token, millis, null, 0, streamHint, uid, opPkg);
         }
 
         Vibration(IBinder token, long[] pattern, int repeat, int streamHint, int uid,
-                String packageName) {
-            this(token, 0, pattern, repeat, streamHint, uid, packageName);
+                String opPkg) {
+            this(token, 0, pattern, repeat, streamHint, uid, opPkg);
         }
 
         private Vibration(IBinder token, long millis, long[] pattern,
-                int repeat, int streamHint, int uid, String packageName) {
+                int repeat, int streamHint, int uid, String opPkg) {
             mToken = token;
             mTimeout = millis;
             mStartTime = SystemClock.uptimeMillis();
@@ -106,7 +106,7 @@
             mRepeat = repeat;
             mStreamHint = streamHint;
             mUid = uid;
-            mPackageName = packageName;
+            mOpPkg = opPkg;
         }
 
         public void binderDied() {
@@ -194,7 +194,7 @@
                 Binder.getCallingPid(), Binder.getCallingUid(), null);
     }
 
-    public void vibrate(int uid, String packageName, long milliseconds, int streamHint,
+    public void vibrate(int uid, String opPkg, long milliseconds, int streamHint,
             IBinder token) {
         if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.VIBRATE)
                 != PackageManager.PERMISSION_GRANTED) {
@@ -211,7 +211,7 @@
             return;
         }
 
-        Vibration vib = new Vibration(token, milliseconds, streamHint, uid, packageName);
+        Vibration vib = new Vibration(token, milliseconds, streamHint, uid, opPkg);
 
         final long ident = Binder.clearCallingIdentity();
         try {
@@ -347,10 +347,10 @@
     private void startVibrationLocked(final Vibration vib) {
         try {
             int mode = mAppOpsService.checkAudioOperation(AppOpsManager.OP_VIBRATE,
-                    vib.mStreamHint, vib.mUid, vib.mPackageName);
+                    vib.mStreamHint, vib.mUid, vib.mOpPkg);
             if (mode == AppOpsManager.MODE_ALLOWED) {
                 mode = mAppOpsService.startOperation(AppOpsManager.getToken(mAppOpsService),
-                    AppOpsManager.OP_VIBRATE, vib.mUid, vib.mPackageName);
+                    AppOpsManager.OP_VIBRATE, vib.mUid, vib.mOpPkg);
             }
             if (mode != AppOpsManager.MODE_ALLOWED) {
                 if (mode == AppOpsManager.MODE_ERRORED) {
@@ -377,7 +377,7 @@
             try {
                 mAppOpsService.finishOperation(AppOpsManager.getToken(mAppOpsService),
                         AppOpsManager.OP_VIBRATE, mCurrentVibration.mUid,
-                        mCurrentVibration.mPackageName);
+                        mCurrentVibration.mOpPkg);
             } catch (RemoteException e) {
             }
             mCurrentVibration = null;
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index b894724..8dd4317 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1063,6 +1063,16 @@
         return mStackSupervisor.isFrontStack(this);
     }
 
+    private void setVisibile(ActivityRecord r, boolean visible) {
+        r.visible = visible;
+        mWindowManager.setAppVisibility(r.appToken, visible);
+        final ArrayList<ActivityStack> containers = r.mChildContainers;
+        for (int containerNdx = containers.size() - 1; containerNdx >= 0; --containerNdx) {
+            ActivityContainer container = containers.get(containerNdx).mActivityContainer;
+            container.setVisible(visible);
+        }
+    }
+
     /**
      * Version of ensureActivitiesVisible that can easily be called anywhere.
      */
@@ -1141,8 +1151,7 @@
                             if (!r.visible) {
                                 if (DEBUG_VISBILITY) Slog.v(
                                         TAG, "Starting and making visible: " + r);
-                                r.visible = true;
-                                mWindowManager.setAppVisibility(r.appToken, true);
+                                setVisibile(r, true);
                             }
                             if (r != starting) {
                                 mStackSupervisor.startSpecificActivityLocked(r, false, false);
@@ -1168,7 +1177,7 @@
                                 if (mTranslucentActivityWaiting != null) {
                                     mUndrawnActivitiesBelowTopTranslucent.add(r);
                                 }
-                                mWindowManager.setAppVisibility(r.appToken, true);
+                                setVisibile(r, true);
                                 r.sleeping = false;
                                 r.app.pendingUiClean = true;
                                 r.app.thread.scheduleWindowVisibility(r.appToken, true);
@@ -1204,9 +1213,8 @@
                     // sure they no longer are keeping the screen frozen.
                     if (r.visible) {
                         if (DEBUG_VISBILITY) Slog.v(TAG, "Making invisible: " + r);
-                        r.visible = false;
                         try {
-                            mWindowManager.setAppVisibility(r.appToken, false);
+                            setVisibile(r, false);
                             switch (r.state) {
                                 case STOPPING:
                                 case STOPPED:
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 47b4d0a..63f9d09 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -127,6 +127,7 @@
     static final int HANDLE_DISPLAY_ADDED = FIRST_SUPERVISOR_STACK_MSG + 5;
     static final int HANDLE_DISPLAY_CHANGED = FIRST_SUPERVISOR_STACK_MSG + 6;
     static final int HANDLE_DISPLAY_REMOVED = FIRST_SUPERVISOR_STACK_MSG + 7;
+    static final int CONTAINER_CALLBACK_VISIBILITY = FIRST_SUPERVISOR_STACK_MSG + 8;
 
     private final static String VIRTUAL_DISPLAY_BASE_NAME = "ActivityViewVirtualDisplay";
 
@@ -3015,6 +3016,14 @@
                 case HANDLE_DISPLAY_REMOVED: {
                     handleDisplayRemovedLocked(msg.arg1);
                 } break;
+                case CONTAINER_CALLBACK_VISIBILITY: {
+                    final ActivityContainer container = (ActivityContainer) msg.obj;
+                    try {
+                        // We only send this message if mCallback is non-null.
+                        container.mCallback.setVisible(container.asBinder(), msg.arg1 == 1);
+                    } catch (RemoteException e) {
+                    }
+                }
             }
         }
     }
@@ -3026,6 +3035,8 @@
         final ActivityRecord mParentActivity;
         final String mIdString;
 
+        boolean mVisible = true;
+
         /** Display this ActivityStack is currently on. Null if not attached to a Display. */
         ActivityDisplay mActivityDisplay;
 
@@ -3173,6 +3184,16 @@
             }
         }
 
+        void setVisible(boolean visible) {
+            if (mVisible != visible) {
+                mVisible = visible;
+                if (mCallback != null) {
+                    mHandler.obtainMessage(CONTAINER_CALLBACK_VISIBILITY, visible ? 1 : 0,
+                            0 /* unused */, this).sendToTarget();
+                }
+            }
+        }
+
         @Override
         public String toString() {
             return mIdString + (mActivityDisplay == null ? "N" : "A");
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 5c14de1..5b597a3 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1497,9 +1497,9 @@
         }
 
         @Override
-        public void enqueueNotificationWithTag(String pkg, String basePkg, String tag, int id,
+        public void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
                 Notification notification, int[] idOut, int userId) throws RemoteException {
-            enqueueNotificationInternal(pkg, basePkg, Binder.getCallingUid(),
+            enqueueNotificationInternal(pkg, opPkg, Binder.getCallingUid(),
                     Binder.getCallingPid(), tag, id, notification, idOut, userId);
         }
 
@@ -1849,14 +1849,14 @@
      */
     private final NotificationManagerInternal mInternalService = new NotificationManagerInternal() {
         @Override
-        public void enqueueNotification(String pkg, String basePkg, int callingUid, int callingPid,
+        public void enqueueNotification(String pkg, String opPkg, int callingUid, int callingPid,
                 String tag, int id, Notification notification, int[] idReceived, int userId) {
-            enqueueNotificationInternal(pkg, basePkg, callingUid, callingPid, tag, id, notification,
+            enqueueNotificationInternal(pkg, opPkg, callingUid, callingPid, tag, id, notification,
                     idReceived, userId);
         }
     };
 
-    void enqueueNotificationInternal(final String pkg, String basePkg, final int callingUid,
+    void enqueueNotificationInternal(final String pkg, final String opPkg, final int callingUid,
             final int callingPid, final String tag, final int id, final Notification notification,
             int[] idOut, int incomingUserId) {
         if (DBG) {
@@ -1981,7 +1981,8 @@
                 if (DBG) Slog.v(TAG, "canInterrupt=" + canInterrupt + " intercept=" + intercept);
                 synchronized (mNotificationList) {
                     final StatusBarNotification n = new StatusBarNotification(
-                            pkg, id, tag, callingUid, callingPid, score, notification, user);
+                            pkg, opPkg, id, tag, callingUid, callingPid, score, notification,
+                            user);
                     NotificationRecord r = new NotificationRecord(n);
                     NotificationRecord old = null;
 
@@ -2157,7 +2158,7 @@
                                 // notifying app does not have the VIBRATE permission.
                                 long identity = Binder.clearCallingIdentity();
                                 try {
-                                    mVibrator.vibrate(r.sbn.getUid(), r.sbn.getBasePkg(),
+                                    mVibrator.vibrate(r.sbn.getUid(), r.sbn.getOpPkg(),
                                         useDefaultVibrate ? mDefaultVibrationPattern
                                             : mFallbackVibrationPattern,
                                         ((notification.flags & Notification.FLAG_INSISTENT) != 0)
@@ -2168,7 +2169,7 @@
                             } else if (notification.vibrate.length > 1) {
                                 // If you want your own vibration pattern, you need the VIBRATE
                                 // permission
-                                mVibrator.vibrate(r.sbn.getUid(), r.sbn.getBasePkg(),
+                                mVibrator.vibrate(r.sbn.getUid(), r.sbn.getOpPkg(),
                                         notification.vibrate,
                                     ((notification.flags & Notification.FLAG_INSISTENT) != 0)
                                             ? 0: -1, notification.audioStreamType);
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 7d8b5af..f17b2f4 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -17,6 +17,7 @@
 package com.android.server.wm;
 
 import android.content.Context;
+import android.content.res.Configuration;
 import android.graphics.Bitmap;
 import android.graphics.Point;
 import android.graphics.Rect;
@@ -147,6 +148,9 @@
     private int mNextAppTransitionStartWidth;
     private int mNextAppTransitionStartHeight;
 
+    private Rect mTmpFromClipRect = new Rect();
+    private Rect mTmpToClipRect = new Rect();
+
     private final static int APP_STATE_IDLE = 0;
     private final static int APP_STATE_READY = 1;
     private final static int APP_STATE_RUNNING = 2;
@@ -485,7 +489,7 @@
      * activity that is leaving, and the activity that is entering.
      */
     Animation createAlternateThumbnailEnterExitAnimationLocked(int thumbTransitState, int appWidth,
-                                                    int appHeight, int transit,
+                                                    int appHeight, int orientation, int transit,
                                                     Rect containingFrame, Rect contentInsets) {
         Animation a;
         final int thumbWidthI = mNextAppTransitionThumbnail.getWidth();
@@ -493,21 +497,36 @@
         final int thumbHeightI = mNextAppTransitionThumbnail.getHeight();
         final float thumbHeight = thumbHeightI > 0 ? thumbHeightI : 1;
 
+        // Used for the ENTER_SCALE_UP and EXIT_SCALE_DOWN transitions
+        float scale = 1f;
+        int scaledTopDecor = 0;
+
         switch (thumbTransitState) {
             case THUMBNAIL_TRANSITION_ENTER_SCALE_UP: {
                 // Entering app scales up with the thumbnail
-                float scale = thumbWidth / appWidth;
-                int unscaledThumbHeight = (int) (thumbHeight / scale);
-                int scaledTopDecor = (int) (scale * contentInsets.top);
-                Rect fromClipRect = new Rect(containingFrame);
-                fromClipRect.bottom = (fromClipRect.top + unscaledThumbHeight);
-                Rect toClipRect = new Rect(containingFrame);
+                if (orientation == Configuration.ORIENTATION_PORTRAIT) {
+                    // In portrait, we scale the width and clip to the top/left square
+                    scale = thumbWidth / appWidth;
+                    scaledTopDecor = (int) (scale * contentInsets.top);
+                    int unscaledThumbHeight = (int) (thumbHeight / scale);
+                    mTmpFromClipRect.set(containingFrame);
+                    mTmpFromClipRect.bottom = (mTmpFromClipRect.top + unscaledThumbHeight);
+                    mTmpToClipRect.set(containingFrame);
+                } else {
+                    // In landscape, we scale the height and clip to the top/left square
+                    scale = thumbHeight / (appHeight - contentInsets.top);
+                    scaledTopDecor = (int) (scale * contentInsets.top);
+                    int unscaledThumbWidth = (int) (thumbWidth / scale);
+                    mTmpFromClipRect.set(containingFrame);
+                    mTmpFromClipRect.right = (mTmpFromClipRect.left + unscaledThumbWidth);
+                    mTmpToClipRect.set(containingFrame);
+                }
 
                 Animation scaleAnim = new ScaleAnimation(scale, 1, scale, 1,
                         computePivot(mNextAppTransitionStartX, scale),
                         computePivot(mNextAppTransitionStartY, scale));
                 Animation alphaAnim = new AlphaAnimation(1, 1);
-                Animation clipAnim = new ClipRectAnimation(fromClipRect, toClipRect);
+                Animation clipAnim = new ClipRectAnimation(mTmpFromClipRect, mTmpToClipRect);
                 Animation translateAnim = new TranslateAnimation(0, 0, -scaledTopDecor, 0);
 
                 AnimationSet set = new AnimationSet(true);
@@ -539,18 +558,29 @@
             }
             case THUMBNAIL_TRANSITION_EXIT_SCALE_DOWN: {
                 // Exiting the current app, the app should scale down with the thumbnail
-                float scale = thumbWidth / appWidth;
-                int unscaledThumbHeight = (int) (thumbHeight / scale);
-                int scaledTopDecor = (int) (scale * contentInsets.top);
-                Rect fromClipRect = new Rect(containingFrame);
-                Rect toClipRect = new Rect(containingFrame);
-                toClipRect.bottom = (toClipRect.top + unscaledThumbHeight);
+                if (orientation == Configuration.ORIENTATION_PORTRAIT) {
+                    // In portrait, we scale the width and clip to the top/left square
+                    scale = thumbWidth / appWidth;
+                    scaledTopDecor = (int) (scale * contentInsets.top);
+                    int unscaledThumbHeight = (int) (thumbHeight / scale);
+                    mTmpFromClipRect.set(containingFrame);
+                    mTmpToClipRect.set(containingFrame);
+                    mTmpToClipRect.bottom = (mTmpToClipRect.top + unscaledThumbHeight);
+                } else {
+                    // In landscape, we scale the height and clip to the top/left square
+                    scale = thumbHeight / (appHeight - contentInsets.top);
+                    scaledTopDecor = (int) (scale * contentInsets.top);
+                    int unscaledThumbWidth = (int) (thumbWidth / scale);
+                    mTmpFromClipRect.set(containingFrame);
+                    mTmpToClipRect.set(containingFrame);
+                    mTmpToClipRect.right = (mTmpToClipRect.left + unscaledThumbWidth);
+                }
 
                 Animation scaleAnim = new ScaleAnimation(1, scale, 1, scale,
                         computePivot(mNextAppTransitionStartX, scale),
                         computePivot(mNextAppTransitionStartY, scale));
                 Animation alphaAnim = new AlphaAnimation(1, 1);
-                Animation clipAnim = new ClipRectAnimation(fromClipRect, toClipRect);
+                Animation clipAnim = new ClipRectAnimation(mTmpFromClipRect, mTmpToClipRect);
                 Animation translateAnim = new TranslateAnimation(0, 0, 0, -scaledTopDecor);
 
                 AnimationSet set = new AnimationSet(true);
@@ -637,7 +667,8 @@
 
 
     Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter,
-                            int appWidth, int appHeight, Rect containingFrame, Rect contentInsets) {
+                            int appWidth, int appHeight, int orientation,
+                            Rect containingFrame, Rect contentInsets) {
         Animation a;
         if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
             a = loadAnimation(mNextAppTransitionPackage, enter ?
@@ -660,8 +691,8 @@
                     (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP);
             if (mUseAlternateThumbnailAnimation) {
                 a = createAlternateThumbnailEnterExitAnimationLocked(
-                        getThumbnailTransitionState(enter), appWidth, appHeight, transit,
-                        containingFrame, contentInsets);
+                        getThumbnailTransitionState(enter), appWidth, appHeight, orientation,
+                        transit, containingFrame, contentInsets);
             } else {
                 a = createThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter),
                         appWidth, appHeight, transit);
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index ad256c8f..524d78b 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -3192,7 +3192,7 @@
             }
 
             Animation a = mAppTransition.loadAnimation(lp, transit, enter, width, height,
-                    containingFrame, contentInsets);
+                    mCurConfiguration.orientation, containingFrame, contentInsets);
             if (a != null) {
                 if (DEBUG_ANIM) {
                     RuntimeException e = null;
diff --git a/services/usb/java/com/android/server/usb/UsbDebuggingManager.java b/services/usb/java/com/android/server/usb/UsbDebuggingManager.java
index f73d425..0946c5a 100644
--- a/services/usb/java/com/android/server/usb/UsbDebuggingManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDebuggingManager.java
@@ -20,6 +20,8 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
 import android.net.LocalSocket;
 import android.net.LocalSocketAddress;
@@ -210,7 +212,7 @@
                 case MESSAGE_ADB_CONFIRM: {
                     String key = (String)msg.obj;
                     mFingerprints = getFingerprints(key);
-                    showConfirmationDialog(key, mFingerprints);
+                    startConfirmation(key, mFingerprints);
                     break;
                 }
 
@@ -245,22 +247,60 @@
         return sb.toString();
     }
 
-    private void showConfirmationDialog(String key, String fingerprints) {
-        Intent intent = new Intent();
+    private void startConfirmation(String key, String fingerprints) {
+        String nameString = Resources.getSystem().getString(
+                com.android.internal.R.string.config_customAdbPublicKeyConfirmationComponent);
+        ComponentName componentName = ComponentName.unflattenFromString(nameString);
+        if (startConfirmationActivity(componentName, key, fingerprints)
+                || startConfirmationService(componentName, key, fingerprints)) {
+            return;
+        }
+        Slog.e(TAG, "unable to start customAdbPublicKeyConfirmationComponent "
+                + nameString + " as an Activity or a Service");
+    }
 
-        ComponentName componentName = ComponentName.unflattenFromString(
-                Resources.getSystem().getString(
-                        com.android.internal.R.string.config_customAdbPublicKeyActivity));
-        intent.setClassName(componentName.getPackageName(),
-                componentName.getClassName());
+    /**
+     * @returns true if the componentName led to an Activity that was started.
+     */
+    private boolean startConfirmationActivity(ComponentName componentName, String key,
+            String fingerprints) {
+        PackageManager packageManager = mContext.getPackageManager();
+        Intent intent = createConfirmationIntent(componentName, key, fingerprints);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        if (packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
+            try {
+                mContext.startActivity(intent);
+                return true;
+            } catch (ActivityNotFoundException e) {
+                Slog.e(TAG, "unable to start adb whitelist activity: " + componentName, e);
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @returns true if the componentName led to a Service that was started.
+     */
+    private boolean startConfirmationService(ComponentName componentName, String key,
+            String fingerprints) {
+        Intent intent = createConfirmationIntent(componentName, key, fingerprints);
+        try {
+            if (mContext.startService(intent) != null) {
+                return true;
+            }
+        } catch (SecurityException e) {
+            Slog.e(TAG, "unable to start adb whitelist service: " + componentName, e);
+        }
+        return false;
+    }
+
+    private Intent createConfirmationIntent(ComponentName componentName, String key,
+            String fingerprints) {
+        Intent intent = new Intent();
+        intent.setClassName(componentName.getPackageName(), componentName.getClassName());
         intent.putExtra("key", key);
         intent.putExtra("fingerprints", fingerprints);
-        try {
-            mContext.startActivity(intent);
-        } catch (ActivityNotFoundException e) {
-            Slog.e(TAG, "unable to start UsbDebuggingActivity");
-        }
+        return intent;
     }
 
     private File getUserKeyFile() {
diff --git a/telephony/java/android/telephony/DataConnectionRealTimeInfo.aidl b/telephony/java/android/telephony/DataConnectionRealTimeInfo.aidl
new file mode 100644
index 0000000..70fbb11
--- /dev/null
+++ b/telephony/java/android/telephony/DataConnectionRealTimeInfo.aidl
@@ -0,0 +1,20 @@
+/*
+**
+** Copyright 2007, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+package android.telephony;
+
+parcelable DataConnectionRealTimeInfo;
diff --git a/telephony/java/android/telephony/DataConnectionRealTimeInfo.java b/telephony/java/android/telephony/DataConnectionRealTimeInfo.java
new file mode 100644
index 0000000..4a9ae39
--- /dev/null
+++ b/telephony/java/android/telephony/DataConnectionRealTimeInfo.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.telephony;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Data connection real time information
+ *
+ * TODO: How to handle multiple subscriptions?
+ */
+public class DataConnectionRealTimeInfo implements Parcelable {
+    private long mTime;             // Time the info was collected since boot in nanos;
+
+    public static int DC_POWER_STATE_LOW       = 1;
+    public static int DC_POWER_STATE_MEDIUM    = 2;
+    public static int DC_POWER_STATE_HIGH      = 3;
+    public static int DC_POWER_STATE_UNKNOWN   = Integer.MAX_VALUE;
+
+    private int mDcPowerState;      // DC_POWER_STATE_[LOW | MEDIUM | HIGH | UNKNOWN]
+
+    /**
+     * Constructor
+     *
+     * @hide
+     */
+    public DataConnectionRealTimeInfo(long time, int dcPowerState) {
+        mTime = time;
+        mDcPowerState = dcPowerState;
+    }
+
+    /**
+     * Constructor
+     *
+     * @hide
+     */
+    public DataConnectionRealTimeInfo() {
+        mTime = Long.MAX_VALUE;
+        mDcPowerState = DC_POWER_STATE_UNKNOWN;
+    }
+
+    /**
+     * Construct a PreciseCallState object from the given parcel.
+     */
+    private DataConnectionRealTimeInfo(Parcel in) {
+        mTime = in.readLong();
+        mDcPowerState = in.readInt();
+    }
+
+    /**
+     * @return time the information was collected or Long.MAX_VALUE if unknown
+     */
+    public long getTime() {
+        return mTime;
+    }
+
+    /**
+     * @return DC_POWER_STATE_[LOW | MEDIUM | HIGH | UNKNOWN]
+     */
+    public int getDcPowerState() {
+        return mDcPowerState;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel out, int flags) {
+        out.writeLong(mTime);
+        out.writeInt(mDcPowerState);
+    }
+
+    public static final Parcelable.Creator<DataConnectionRealTimeInfo> CREATOR
+            = new Parcelable.Creator<DataConnectionRealTimeInfo>() {
+
+        @Override
+        public DataConnectionRealTimeInfo createFromParcel(Parcel in) {
+            return new DataConnectionRealTimeInfo(in);
+        }
+
+        @Override
+        public DataConnectionRealTimeInfo[] newArray(int size) {
+            return new DataConnectionRealTimeInfo[size];
+        }
+    };
+
+    @Override
+    public int hashCode() {
+        final long prime = 17;
+        long result = 1;
+        result = (prime * result) + mTime;
+        result += (prime * result) + mDcPowerState;
+        return (int)result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        DataConnectionRealTimeInfo other = (DataConnectionRealTimeInfo) obj;
+        return (mTime == other.mTime)
+                && (mDcPowerState == other.mDcPowerState);
+    }
+
+    @Override
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("mTime=").append(mTime);
+        sb.append(" mDcPowerState=").append(mDcPowerState);
+
+        return sb.toString();
+    }
+}
diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java
index bb3f132..7c5c648 100644
--- a/telephony/java/android/telephony/PhoneStateListener.java
+++ b/telephony/java/android/telephony/PhoneStateListener.java
@@ -188,6 +188,17 @@
      */
     public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE            = 0x00001000;
 
+    /**
+     * Listen for real time info for all data connections (cellular)).
+     * {@more}
+     * Requires Permission: {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE
+     * READ_PRECISE_PHONE_STATE}
+     *
+     * @see #onDataConnectionRealTimeInfoChanged(DataConnectionRealTimeInfo)
+     * @hide
+     */
+    public static final int LISTEN_DATA_CONNECTION_REAL_TIME_INFO           = 0x00002000;
+
     public PhoneStateListener() {
     }
 
@@ -335,6 +346,16 @@
     }
 
     /**
+     * Callback invoked when data connection state changes with precise information.
+     *
+     * @hide
+     */
+    public void onDataConnectionRealTimeInfoChanged(
+            DataConnectionRealTimeInfo dcRtInfo) {
+        // default implementation empty
+    }
+
+    /**
      * The callback methods need to be called on the handler thread where
      * this object was created.  If the binder did that for us it'd be nice.
      */
@@ -396,6 +417,12 @@
             Message.obtain(mHandler, LISTEN_PRECISE_DATA_CONNECTION_STATE, 0, 0,
                     dataConnectionState).sendToTarget();
         }
+
+        public void onDataConnectionRealTimeInfoChanged(
+                DataConnectionRealTimeInfo dcRtInfo) {
+            Message.obtain(mHandler, LISTEN_DATA_CONNECTION_REAL_TIME_INFO, 0, 0,
+                    dcRtInfo).sendToTarget();
+        }
     };
 
     Handler mHandler = new Handler() {
@@ -441,6 +468,11 @@
                     break;
                 case LISTEN_PRECISE_DATA_CONNECTION_STATE:
                     PhoneStateListener.this.onPreciseDataConnectionStateChanged((PreciseDataConnectionState)msg.obj);
+                    break;
+                case LISTEN_DATA_CONNECTION_REAL_TIME_INFO:
+                    PhoneStateListener.this.onDataConnectionRealTimeInfoChanged(
+                            (DataConnectionRealTimeInfo)msg.obj);
+                    break;
             }
         }
     };
diff --git a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
index f228d4e..3f36645 100644
--- a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
+++ b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
@@ -20,6 +20,7 @@
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
 import android.telephony.CellInfo;
+import android.telephony.DataConnectionRealTimeInfo;
 import android.telephony.PreciseCallState;
 import android.telephony.PreciseDataConnectionState;
 
@@ -39,5 +40,6 @@
     void onCellInfoChanged(in List<CellInfo> cellInfo);
     void onPreciseCallStateChanged(in PreciseCallState callState);
     void onPreciseDataConnectionStateChanged(in PreciseDataConnectionState dataConnectionState);
+    void onDataConnectionRealTimeInfoChanged(in DataConnectionRealTimeInfo dcRtInfo);
 }
 
diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
index 546ce17..8ea9b0d 100644
--- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
@@ -20,9 +20,10 @@
 import android.net.LinkProperties;
 import android.net.LinkCapabilities;
 import android.os.Bundle;
+import android.telephony.CellInfo;
+import android.telephony.DataConnectionRealTimeInfo;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
-import android.telephony.CellInfo;
 import com.android.internal.telephony.IPhoneStateListener;
 
 interface ITelephonyRegistry {
@@ -46,4 +47,5 @@
     void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause);
     void notifyPreciseDataConnectionFailed(String reason, String apnType, String apn,
             String failCause);
+    void notifyDataConnectionRealTimeInfo(in DataConnectionRealTimeInfo dcRtInfo);
 }