Merge "Starting point for User Restrictions API"
diff --git a/Android.mk b/Android.mk
index af3b37e..d6d01d88 100644
--- a/Android.mk
+++ b/Android.mk
@@ -218,6 +218,7 @@
 	telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
 	telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
 	telephony/java/com/android/internal/telephony/ITelephony.aidl \
+	telephony/java/com/android/internal/telephony/ISms.aidl \
 	telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
 	telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
 	wifi/java/android/net/wifi/IWifiManager.aidl \
@@ -733,6 +734,33 @@
 # explicitly specify that ds depends on framework-res and any generated docs
 $(full_target): framework-res-package-target
 
+
+#==== reference docs for GCM =======================
+
+include $(CLEAR_VARS)
+#
+gcm_docs_src_files += \
+        $(call all-java-files-under, ../../vendor/unbundled_google/libs/gcm/gcm-client/src) \
+        $(call all-java-files-under, ../../vendor/unbundled_google/libs/gcm/gcm-server/src) \
+        $(call all-html-files-under, ../../vendor/unbundled_google/libs/gcm/gcm-client/src) \
+        $(call all-html-files-under, ../../vendor/unbundled_google/libs/gcm/gcm-server/src) \
+
+LOCAL_SRC_FILES := $(gcm_docs_src_files)
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE:= online-gcm-ref
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+LOCAL_IS_HOST_MODULE := false
+
+LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-sdk
+
+LOCAL_DROIDDOC_OPTIONS := \
+        -toroot / \
+        -gcmref \
+        -hdf android.whichdoc online \
+        -hdf template.showLanguageMenu true
+
+include $(BUILD_DROIDDOC)
+
 # ==== docs that have all of the stuff that's @hidden =======================
 include $(CLEAR_VARS)
 
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 5634b43..b87fa48 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -155,6 +155,7 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/lib/librtp_jni.so)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/symbols/system/lib/librtp_jni.so)
 $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/telephony/java/com/android/internal/telephony/SmsRawData.*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates)
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
diff --git a/api/current.txt b/api/current.txt
index 0569b9d..c8f999f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -9376,7 +9376,7 @@
 
   public class BitmapDrawable extends android.graphics.drawable.Drawable {
     ctor public deprecated BitmapDrawable();
-    ctor public BitmapDrawable(android.content.res.Resources);
+    ctor public deprecated BitmapDrawable(android.content.res.Resources);
     ctor public deprecated BitmapDrawable(android.graphics.Bitmap);
     ctor public BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap);
     ctor public deprecated BitmapDrawable(java.lang.String);
@@ -12805,16 +12805,16 @@
     method public static long getTotalTxPackets();
     method public static long getUidRxBytes(int);
     method public static long getUidRxPackets(int);
-    method public static long getUidTcpRxBytes(int);
-    method public static long getUidTcpRxSegments(int);
-    method public static long getUidTcpTxBytes(int);
-    method public static long getUidTcpTxSegments(int);
+    method public static deprecated long getUidTcpRxBytes(int);
+    method public static deprecated long getUidTcpRxSegments(int);
+    method public static deprecated long getUidTcpTxBytes(int);
+    method public static deprecated long getUidTcpTxSegments(int);
     method public static long getUidTxBytes(int);
     method public static long getUidTxPackets(int);
-    method public static long getUidUdpRxBytes(int);
-    method public static long getUidUdpRxPackets(int);
-    method public static long getUidUdpTxBytes(int);
-    method public static long getUidUdpTxPackets(int);
+    method public static deprecated long getUidUdpRxBytes(int);
+    method public static deprecated long getUidUdpRxPackets(int);
+    method public static deprecated long getUidUdpTxBytes(int);
+    method public static deprecated long getUidUdpTxPackets(int);
     method public static void incrementOperationCount(int);
     method public static void incrementOperationCount(int, int);
     method public static void setThreadStatsTag(int);
@@ -20098,6 +20098,7 @@
     method protected android.renderscript.Script.FieldID createFieldID(int, android.renderscript.Element);
     method protected android.renderscript.Script.KernelID createKernelID(int, int, android.renderscript.Element, android.renderscript.Element);
     method protected void forEach(int, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.FieldPacker);
+    method protected void forEach(int, android.renderscript.Allocation, android.renderscript.Allocation, android.renderscript.FieldPacker, android.renderscript.Script.LaunchOptions);
     method protected void invoke(int);
     method protected void invoke(int, android.renderscript.FieldPacker);
     method public void setTimeZone(java.lang.String);
@@ -20138,13 +20139,18 @@
     method public int getXStart();
     method public int getYEnd();
     method public int getYStart();
-    method public void setX(int, int);
-    method public void setY(int, int);
+    method public int getZEnd();
+    method public int getZStart();
+    method public android.renderscript.Script.LaunchOptions setX(int, int);
+    method public android.renderscript.Script.LaunchOptions setY(int, int);
+    method public android.renderscript.Script.LaunchOptions setZ(int, int);
     field protected int strategy;
     field protected int xend;
     field protected int xstart;
     field protected int yend;
     field protected int ystart;
+    field protected int zend;
+    field protected int zstart;
   }
 
   public class ScriptC extends android.renderscript.Script {
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index f0e3370..da398ef 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -1522,8 +1522,9 @@
         System.err.println("");
         System.err.println("pm clear: deletes all data associated with a package.");
         System.err.println("");
-        System.err.println("pm enable, disable, disable-user: these commands change the enabled state");
-        System.err.println("  of a given package or component (written as \"package/class\").");
+        System.err.println("pm enable, disable, disable-user, disable-until-used: these commands");
+        System.err.println("  change the enabled state of a given package or component (written");
+        System.err.println("  as \"package/class\").");
         System.err.println("");
         System.err.println("pm grant, revoke: these commands either grant or revoke permissions");
         System.err.println("  to applications.  Only optional permissions the application has");
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index 033a598..d82b9a3 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -399,6 +399,13 @@
     }
 
     /**
+     * @hide
+     */
+    public void setComponentName(ComponentName component) {
+        mId = component.flattenToShortString();
+    }
+
+    /**
      * The accessibility service id.
      * <p>
      *   <strong>Generated by the system.</strong>
@@ -515,6 +522,33 @@
     }
 
     @Override
+    public int hashCode() {
+        return 31 * 1 + ((mId == null) ? 0 : mId.hashCode());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        AccessibilityServiceInfo other = (AccessibilityServiceInfo) obj;
+        if (mId == null) {
+            if (other.mId != null) {
+                return false;
+            }
+        } else if (!mId.equals(other.mId)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
     public String toString() {
         StringBuilder stringBuilder = new StringBuilder();
         appendEventTypes(stringBuilder, eventTypes);
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 241a9ae..34708ab 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -40,6 +40,10 @@
     public static final int MODE_IGNORED = 1;
     public static final int MODE_ERRORED = 2;
 
+    // when adding one of these:
+    //  - increment _NUM_OP
+    //  - add rows to sOpToSwitch, sOpNames, sOpPerms
+    //  - add descriptive strings to Settings/res/values/arrays.xml
     public static final int OP_NONE = -1;
     public static final int OP_COARSE_LOCATION = 0;
     public static final int OP_FINE_LOCATION = 1;
@@ -66,8 +70,9 @@
     public static final int OP_WRITE_ICC_SMS = 22;
     public static final int OP_WRITE_SETTINGS = 23;
     public static final int OP_SYSTEM_ALERT_WINDOW = 24;
+    public static final int OP_ACCESS_NOTIFICATIONS = 25;
     /** @hide */
-    public static final int _NUM_OP = 25;
+    public static final int _NUM_OP = 26;
 
     /**
      * This maps each operation to the operation that serves as the
@@ -103,6 +108,7 @@
             OP_WRITE_SMS,
             OP_WRITE_SETTINGS,
             OP_SYSTEM_ALERT_WINDOW,
+            OP_ACCESS_NOTIFICATIONS,
     };
 
     /**
@@ -135,6 +141,7 @@
             "WRITE_ICC_SMS",
             "WRITE_SETTINGS",
             "SYSTEM_ALERT_WINDOW",
+            "ACCESS_NOTIFICATIONS",
     };
 
     /**
@@ -167,6 +174,7 @@
             android.Manifest.permission.WRITE_SMS,
             android.Manifest.permission.WRITE_SETTINGS,
             android.Manifest.permission.SYSTEM_ALERT_WINDOW,
+            android.Manifest.permission.ACCESS_NOTIFICATIONS,
     };
 
     public static int opToSwitch(int op) {
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index d400eba..bb10f62 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -21,6 +21,8 @@
 import android.app.Notification;
 import android.content.Intent;
 
+import com.android.internal.statusbar.StatusBarNotification;
+
 /** {@hide} */
 interface INotificationManager
 {
@@ -34,5 +36,7 @@
 
     void setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled);
     boolean areNotificationsEnabledForPackage(String pkg, int uid);
+
+    StatusBarNotification[] getActiveNotifications(String callingPkg);
 }
 
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index 94d27ec..fefd343 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -193,6 +193,23 @@
         return SYNC_ERROR_NAMES[error - 1];
     }
 
+    /** @hide */
+    public static int syncErrorStringToInt(String error) {
+        for (int i = 0, n = SYNC_ERROR_NAMES.length; i < n; i++) {
+            if (SYNC_ERROR_NAMES[i].equals(error)) {
+                return i + 1;
+            }
+        }
+        if (error != null) {
+            try {
+                return Integer.parseInt(error);
+            } catch (NumberFormatException e) {
+                Log.d(TAG, "error parsing sync error: " + error);
+            }
+        }
+        return 0;
+    }
+
     public static final int SYNC_OBSERVER_TYPE_SETTINGS = 1<<0;
     public static final int SYNC_OBSERVER_TYPE_PENDING = 1<<1;
     public static final int SYNC_OBSERVER_TYPE_ACTIVE = 1<<2;
diff --git a/core/java/android/content/SyncStatusInfo.java b/core/java/android/content/SyncStatusInfo.java
index 49e3e35..ff628d9 100644
--- a/core/java/android/content/SyncStatusInfo.java
+++ b/core/java/android/content/SyncStatusInfo.java
@@ -51,14 +51,13 @@
     }
 
     public int getLastFailureMesgAsInt(int def) {
-        try {
-            if (lastFailureMesg != null) {
-                return Integer.parseInt(lastFailureMesg);
-            }
-        } catch (NumberFormatException e) {
-            Log.d(TAG, "error parsing lastFailureMesg of " + lastFailureMesg, e);
+        final int i = ContentResolver.syncErrorStringToInt(lastFailureMesg);
+        if (i > 0) {
+            return i;
+        } else {
+            Log.d(TAG, "Unknown lastFailureMesg:" + lastFailureMesg);
+            return def;
         }
-        return def;
     }
 
     public int describeContents() {
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 0a03e8c..7775293 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -77,7 +77,7 @@
 
     private static final int ID_OTHER = 0x01000004;
 
-    private static final Object mSync = new Object();
+    private static final Object sSync = new Object();
     /*package*/ static Resources mSystem = null;
     
     // Information about preloaded resources.  Note that they are not
@@ -92,17 +92,18 @@
     private static boolean sPreloaded;
     private static int sPreloadedDensity;
 
-    /*package*/ final TypedValue mTmpValue = new TypedValue();
-    /*package*/ final Configuration mTmpConfig = new Configuration();
+    // These are protected by mAccessLock.
 
-    // These are protected by the mTmpValue lock.
-    private final LongSparseArray<WeakReference<Drawable.ConstantState> > mDrawableCache
+    /*package*/ final Object mAccessLock = new Object();
+    /*package*/ final Configuration mTmpConfig = new Configuration();
+    /*package*/ TypedValue mTmpValue = new TypedValue();
+    /*package*/ final LongSparseArray<WeakReference<Drawable.ConstantState> > mDrawableCache
             = new LongSparseArray<WeakReference<Drawable.ConstantState> >();
-    private final LongSparseArray<WeakReference<ColorStateList> > mColorStateListCache
+    /*package*/ final LongSparseArray<WeakReference<ColorStateList> > mColorStateListCache
             = new LongSparseArray<WeakReference<ColorStateList> >();
-    private final LongSparseArray<WeakReference<Drawable.ConstantState> > mColorDrawableCache
+    /*package*/ final LongSparseArray<WeakReference<Drawable.ConstantState> > mColorDrawableCache
             = new LongSparseArray<WeakReference<Drawable.ConstantState> >();
-    private boolean mPreloading;
+    /*package*/ boolean mPreloading;
 
     /*package*/ TypedArray mCachedStyledAttributes = null;
     RuntimeException mLastRetrievedAttrs = null;
@@ -196,7 +197,7 @@
      * on orientation, etc). 
      */
     public static Resources getSystem() {
-        synchronized (mSync) {
+        synchronized (sSync) {
             Resources ret = mSystem;
             if (ret == null) {
                 ret = new Resources();
@@ -266,7 +267,7 @@
     }
 
     private NativePluralRules getPluralRule() {
-        synchronized (mSync) {
+        synchronized (sSync) {
             if (mPluralRule == null) {
                 mPluralRule = NativePluralRules.forLocale(mConfiguration.locale);
             }
@@ -517,8 +518,11 @@
      * @see #getDimensionPixelSize
      */
     public float getDimension(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedValue value = mTmpValue;
+            if (value == null) {
+                mTmpValue = value = new TypedValue();
+            }
             getValue(id, value, true);
             if (value.type == TypedValue.TYPE_DIMENSION) {
                 return TypedValue.complexToDimension(value.data, mMetrics);
@@ -549,8 +553,11 @@
      * @see #getDimensionPixelSize
      */
     public int getDimensionPixelOffset(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedValue value = mTmpValue;
+            if (value == null) {
+                mTmpValue = value = new TypedValue();
+            }
             getValue(id, value, true);
             if (value.type == TypedValue.TYPE_DIMENSION) {
                 return TypedValue.complexToDimensionPixelOffset(
@@ -583,8 +590,11 @@
      * @see #getDimensionPixelOffset
      */
     public int getDimensionPixelSize(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedValue value = mTmpValue;
+            if (value == null) {
+                mTmpValue = value = new TypedValue();
+            }
             getValue(id, value, true);
             if (value.type == TypedValue.TYPE_DIMENSION) {
                 return TypedValue.complexToDimensionPixelSize(
@@ -614,8 +624,11 @@
      * @throws NotFoundException Throws NotFoundException if the given ID does not exist.
      */
     public float getFraction(int id, int base, int pbase) {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedValue value = mTmpValue;
+            if (value == null) {
+                mTmpValue = value = new TypedValue();
+            }
             getValue(id, value, true);
             if (value.type == TypedValue.TYPE_FRACTION) {
                 return TypedValue.complexToFraction(value.data, base, pbase);
@@ -654,11 +667,23 @@
      * @return Drawable An object that can be used to draw this resource.
      */
     public Drawable getDrawable(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
-            TypedValue value = mTmpValue;
+        TypedValue value;
+        synchronized (mAccessLock) {
+            value = mTmpValue;
+            if (value == null) {
+                value = new TypedValue();
+            } else {
+                mTmpValue = null;
+            }
             getValue(id, value, true);
-            return loadDrawable(value, id);
         }
+        Drawable res = loadDrawable(value, id);
+        synchronized (mAccessLock) {
+            if (mTmpValue == null) {
+                mTmpValue = value;
+            }
+        }
+        return res;
     }
 
     /**
@@ -681,8 +706,14 @@
      * @return Drawable An object that can be used to draw this resource.
      */
     public Drawable getDrawableForDensity(int id, int density) throws NotFoundException {
-        synchronized (mTmpValue) {
-            TypedValue value = mTmpValue;
+        TypedValue value;
+        synchronized (mAccessLock) {
+            value = mTmpValue;
+            if (value == null) {
+                value = new TypedValue();
+            } else {
+                mTmpValue = null;
+            }
             getValueForDensity(id, density, value, true);
 
             /*
@@ -699,9 +730,15 @@
                     value.density = (value.density * mMetrics.densityDpi) / density;
                 }
             }
-
-            return loadDrawable(value, id);
         }
+
+        Drawable res = loadDrawable(value, id);
+        synchronized (mAccessLock) {
+            if (mTmpValue == null) {
+                mTmpValue = value;
+            }
+        }
+        return res;
     }
 
     /**
@@ -739,20 +776,30 @@
      * @return Returns a single color value in the form 0xAARRGGBB.
      */
     public int getColor(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
-            TypedValue value = mTmpValue;
+        TypedValue value;
+        synchronized (mAccessLock) {
+            value = mTmpValue;
+            if (value == null) {
+                value = new TypedValue();
+            }
             getValue(id, value, true);
             if (value.type >= TypedValue.TYPE_FIRST_INT
                 && value.type <= TypedValue.TYPE_LAST_INT) {
+                mTmpValue = value;
                 return value.data;
-            } else if (value.type == TypedValue.TYPE_STRING) {
-                ColorStateList csl = loadColorStateList(mTmpValue, id);
-                return csl.getDefaultColor();
+            } else if (value.type != TypedValue.TYPE_STRING) {
+                throw new NotFoundException(
+                    "Resource ID #0x" + Integer.toHexString(id) + " type #0x"
+                    + Integer.toHexString(value.type) + " is not valid");
             }
-            throw new NotFoundException(
-                "Resource ID #0x" + Integer.toHexString(id) + " type #0x"
-                + Integer.toHexString(value.type) + " is not valid");
         }
+        ColorStateList csl = loadColorStateList(value, id);
+        synchronized (mAccessLock) {
+            if (mTmpValue == null) {
+                mTmpValue = value;
+            }
+        }
+        return csl.getDefaultColor();
     }
 
     /**
@@ -770,11 +817,23 @@
      * solid color or multiple colors that can be selected based on a state.
      */
     public ColorStateList getColorStateList(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
-            TypedValue value = mTmpValue;
+        TypedValue value;
+        synchronized (mAccessLock) {
+            value = mTmpValue;
+            if (value == null) {
+                value = new TypedValue();
+            } else {
+                mTmpValue = null;
+            }
             getValue(id, value, true);
-            return loadColorStateList(value, id);
         }
+        ColorStateList res = loadColorStateList(value, id);
+        synchronized (mAccessLock) {
+            if (mTmpValue == null) {
+                mTmpValue = value;
+            }
+        }
+        return res;
     }
 
     /**
@@ -791,8 +850,11 @@
      * @return Returns the boolean value contained in the resource.
      */
     public boolean getBoolean(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedValue value = mTmpValue;
+            if (value == null) {
+                mTmpValue = value = new TypedValue();
+            }
             getValue(id, value, true);
             if (value.type >= TypedValue.TYPE_FIRST_INT
                 && value.type <= TypedValue.TYPE_LAST_INT) {
@@ -816,8 +878,11 @@
      * @return Returns the integer value contained in the resource.
      */
     public int getInteger(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedValue value = mTmpValue;
+            if (value == null) {
+                mTmpValue = value = new TypedValue();
+            }
             getValue(id, value, true);
             if (value.type >= TypedValue.TYPE_FIRST_INT
                 && value.type <= TypedValue.TYPE_LAST_INT) {
@@ -917,9 +982,22 @@
      * 
      */
     public InputStream openRawResource(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
-            return openRawResource(id, mTmpValue);
+        TypedValue value;
+        synchronized (mAccessLock) {
+            value = mTmpValue;
+            if (value == null) {
+                value = new TypedValue();
+            } else {
+                mTmpValue = null;
+            }
         }
+        InputStream res = openRawResource(id, value);
+        synchronized (mAccessLock) {
+            if (mTmpValue == null) {
+                mTmpValue = value;
+            }
+        }
+        return res;
     }
 
     /**
@@ -971,22 +1049,32 @@
      * 
      */
     public AssetFileDescriptor openRawResourceFd(int id) throws NotFoundException {
-        synchronized (mTmpValue) {
-            TypedValue value = mTmpValue;
-            getValue(id, value, true);
-
-            try {
-                return mAssets.openNonAssetFd(
-                    value.assetCookie, value.string.toString());
-            } catch (Exception e) {
-                NotFoundException rnf = new NotFoundException(
-                    "File " + value.string.toString()
-                    + " from drawable resource ID #0x"
-                    + Integer.toHexString(id));
-                rnf.initCause(e);
-                throw rnf;
+        TypedValue value;
+        synchronized (mAccessLock) {
+            value = mTmpValue;
+            if (value == null) {
+                value = new TypedValue();
+            } else {
+                mTmpValue = null;
             }
-
+            getValue(id, value, true);
+        }
+        try {
+            return mAssets.openNonAssetFd(
+                value.assetCookie, value.string.toString());
+        } catch (Exception e) {
+            NotFoundException rnf = new NotFoundException(
+                "File " + value.string.toString()
+                + " from drawable resource ID #0x"
+                + Integer.toHexString(id));
+            rnf.initCause(e);
+            throw rnf;
+        } finally {
+            synchronized (mAccessLock) {
+                if (mTmpValue == null) {
+                    mTmpValue = value;
+                }
+            }
         }
     }
 
@@ -1407,7 +1495,7 @@
      */
     public void updateConfiguration(Configuration config,
             DisplayMetrics metrics, CompatibilityInfo compat) {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             if (false) {
                 Slog.i(TAG, "**** Updating config of " + this + ": old config is "
                         + mConfiguration + " old compat is " + mCompatibilityInfo);
@@ -1497,21 +1585,21 @@
                         + " final compat is " + mCompatibilityInfo);
             }
 
-            clearDrawableCache(mDrawableCache, configChanges);
-            clearDrawableCache(mColorDrawableCache, configChanges);
+            clearDrawableCacheLocked(mDrawableCache, configChanges);
+            clearDrawableCacheLocked(mColorDrawableCache, configChanges);
 
             mColorStateListCache.clear();
 
             flushLayoutCache();
         }
-        synchronized (mSync) {
+        synchronized (sSync) {
             if (mPluralRule != null) {
                 mPluralRule = NativePluralRules.forLocale(config.locale);
             }
         }
     }
 
-    private void clearDrawableCache(
+    private void clearDrawableCacheLocked(
             LongSparseArray<WeakReference<ConstantState>> cache,
             int configChanges) {
         int N = cache.size();
@@ -1631,6 +1719,9 @@
      *         resource was found.  (0 is not a valid resource ID.)
      */
     public int getIdentifier(String name, String defType, String defPackage) {
+        if (name == null) {
+            throw new NullPointerException("name is null");
+        }
         try {
             return Integer.parseInt(name);
         } catch (Exception e) {
@@ -1846,7 +1937,7 @@
      * {@hide}
      */
     public final void startPreloading() {
-        synchronized (mSync) {
+        synchronized (sSync) {
             if (sPreloaded) {
                 throw new IllegalStateException("Resources already preloaded");
             }
@@ -1990,7 +2081,7 @@
                         }
                     }
                 } else {
-                    synchronized (mTmpValue) {
+                    synchronized (mAccessLock) {
                         //Log.i(TAG, "Saving cached drawable @ #" +
                         //        Integer.toHexString(key.intValue())
                         //        + " in " + this + ": " + cs);
@@ -2010,7 +2101,7 @@
     private Drawable getCachedDrawable(
             LongSparseArray<WeakReference<ConstantState>> drawableCache,
             long key) {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             WeakReference<Drawable.ConstantState> wr = drawableCache.get(key);
             if (wr != null) {   // we have the key
                 Drawable.ConstantState entry = wr.get();
@@ -2102,7 +2193,7 @@
                     sPreloadedColorStateLists.put(key, csl);
                 }
             } else {
-                synchronized (mTmpValue) {
+                synchronized (mAccessLock) {
                     //Log.i(TAG, "Saving cached color state list @ #" +
                     //        Integer.toHexString(key.intValue())
                     //        + " in " + this + ": " + csl);
@@ -2115,7 +2206,7 @@
     }
 
     private ColorStateList getCachedColorStateList(long key) {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             WeakReference<ColorStateList> wr = mColorStateListCache.get(key);
             if (wr != null) {   // we have the key
                 ColorStateList entry = wr.get();
@@ -2134,7 +2225,7 @@
 
     /*package*/ XmlResourceParser loadXmlResourceParser(int id, String type)
             throws NotFoundException {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedValue value = mTmpValue;
             getValue(id, value, true);
             if (value.type == TypedValue.TYPE_STRING) {
@@ -2197,7 +2288,7 @@
     }
 
     private TypedArray getCachedStyledAttributes(int len) {
-        synchronized (mTmpValue) {
+        synchronized (mAccessLock) {
             TypedArray attrs = mCachedStyledAttributes;
             if (attrs != null) {
                 mCachedStyledAttributes = null;
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java
index 2968fbb..27dddd4 100644
--- a/core/java/android/content/res/TypedArray.java
+++ b/core/java/android/content/res/TypedArray.java
@@ -687,7 +687,7 @@
      * Give back a previously retrieved array, for later re-use.
      */
     public void recycle() {
-        synchronized (mResources.mTmpValue) {
+        synchronized (mResources.mAccessLock) {
             TypedArray cached = mResources.mCachedStyledAttributes;
             if (cached == null || cached.mData.length < mData.length) {
                 mXml = null;
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index e2d44f2..60ccc61 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -1481,6 +1481,9 @@
      * @param table the table to delete from
      * @param whereClause the optional WHERE clause to apply when deleting.
      *            Passing null will delete all rows.
+     * @param whereArgs You may include ?s in the where clause, which
+     *            will be replaced by the values from whereArgs. The values
+     *            will be bound as Strings.
      * @return the number of rows affected if a whereClause is passed in, 0
      *         otherwise. To remove all rows and get a count pass "1" as the
      *         whereClause.
@@ -1508,6 +1511,9 @@
      *            valid value that will be translated to NULL.
      * @param whereClause the optional WHERE clause to apply when updating.
      *            Passing null will update all rows.
+     * @param whereArgs You may include ?s in the where clause, which
+     *            will be replaced by the values from whereArgs. The values
+     *            will be bound as Strings.
      * @return the number of rows affected
      */
     public int update(String table, ContentValues values, String whereClause, String[] whereArgs) {
@@ -1522,6 +1528,9 @@
      *            valid value that will be translated to NULL.
      * @param whereClause the optional WHERE clause to apply when updating.
      *            Passing null will update all rows.
+     * @param whereArgs You may include ?s in the where clause, which
+     *            will be replaced by the values from whereArgs. The values
+     *            will be bound as Strings.
      * @param conflictAlgorithm for update conflict resolver
      * @return the number of rows affected
      */
diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java
index a014cec..a282910 100644
--- a/core/java/android/net/TrafficStats.java
+++ b/core/java/android/net/TrafficStats.java
@@ -424,161 +424,156 @@
     }
 
     /**
-     * Get the number of bytes sent through the network for this UID.
-     * The statistics are across all interfaces.
+     * Return number of bytes transmitted by the given UID since device boot.
+     * Counts packets across all network interfaces, and always increases
+     * monotonically since device boot. Statistics are measured at the network
+     * layer, so they include both TCP and UDP usage.
+     * <p>
+     * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+     * {@link #UNSUPPORTED} on devices where statistics aren't available.
      *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of bytes.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @see android.os.Process#myUid()
+     * @see android.content.pm.ApplicationInfo#uid
      */
-    public static native long getUidTxBytes(int uid);
+    public static long getUidTxBytes(int uid) {
+        return nativeGetUidStat(uid, TYPE_TX_BYTES);
+    }
 
     /**
-     * Get the number of bytes received through the network for this UID.
-     * The statistics are across all interfaces.
+     * Return number of bytes received by the given UID since device boot.
+     * Counts packets across all network interfaces, and always increases
+     * monotonically since device boot. Statistics are measured at the network
+     * layer, so they include both TCP and UDP usage.
+     * <p>
+     * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+     * {@link #UNSUPPORTED} on devices where statistics aren't available.
      *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of bytes
+     * @see android.os.Process#myUid()
+     * @see android.content.pm.ApplicationInfo#uid
      */
-    public static native long getUidRxBytes(int uid);
+    public static long getUidRxBytes(int uid) {
+        return nativeGetUidStat(uid, TYPE_RX_BYTES);
+    }
 
     /**
-     * Get the number of packets (TCP segments + UDP) sent through
-     * the network for this UID.
-     * The statistics are across all interfaces.
+     * Return number of packets transmitted by the given UID since device boot.
+     * Counts packets across all network interfaces, and always increases
+     * monotonically since device boot. Statistics are measured at the network
+     * layer, so they include both TCP and UDP usage.
+     * <p>
+     * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+     * {@link #UNSUPPORTED} on devices where statistics aren't available.
      *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of packets.
-     * If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @see android.os.Process#myUid()
+     * @see android.content.pm.ApplicationInfo#uid
      */
-    public static native long getUidTxPackets(int uid);
+    public static long getUidTxPackets(int uid) {
+        return nativeGetUidStat(uid, TYPE_TX_PACKETS);
+    }
 
     /**
-     * Get the number of packets (TCP segments + UDP) received through
-     * the network for this UID.
-     * The statistics are across all interfaces.
+     * Return number of packets received by the given UID since device boot.
+     * Counts packets across all network interfaces, and always increases
+     * monotonically since device boot. Statistics are measured at the network
+     * layer, so they include both TCP and UDP usage.
+     * <p>
+     * Before {@link android.os.Build.VERSION_CODES#K}, this may return
+     * {@link #UNSUPPORTED} on devices where statistics aren't available.
      *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of packets
+     * @see android.os.Process#myUid()
+     * @see android.content.pm.ApplicationInfo#uid
      */
-    public static native long getUidRxPackets(int uid);
+    public static long getUidRxPackets(int uid) {
+        return nativeGetUidStat(uid, TYPE_RX_PACKETS);
+    }
 
     /**
-     * Get the number of TCP payload bytes sent for this UID.
-     * This total does not include protocol and control overheads at
-     * the transport and the lower layers of the networking stack.
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of bytes.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidTxBytes(int)
      */
-    public static native long getUidTcpTxBytes(int uid);
+    @Deprecated
+    public static long getUidTcpTxBytes(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
-     * Get the number of TCP payload bytes received for this UID.
-     * This total does not include protocol and control overheads at
-     * the transport and the lower layers of the networking stack.
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of bytes.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidRxBytes(int)
      */
-    public static native long getUidTcpRxBytes(int uid);
+    @Deprecated
+    public static long getUidTcpRxBytes(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
-     * Get the number of UDP payload bytes sent for this UID.
-     * This total does not include protocol and control overheads at
-     * the transport and the lower layers of the networking stack.
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of bytes.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidTxBytes(int)
      */
-    public static native long getUidUdpTxBytes(int uid);
+    @Deprecated
+    public static long getUidUdpTxBytes(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
-     * Get the number of UDP payload bytes received for this UID.
-     * This total does not include protocol and control overheads at
-     * the transport and the lower layers of the networking stack.
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of bytes.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidRxBytes(int)
      */
-    public static native long getUidUdpRxBytes(int uid);
+    @Deprecated
+    public static long getUidUdpRxBytes(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
-     * Get the number of TCP segments sent for this UID.
-     * Does not include TCP control packets (SYN/ACKs/FIN/..).
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of TCP segments.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidTxPackets(int)
      */
-    public static native long getUidTcpTxSegments(int uid);
+    @Deprecated
+    public static long getUidTcpTxSegments(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
-     * Get the number of TCP segments received for this UID.
-     * Does not include TCP control packets (SYN/ACKs/FIN/..).
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of TCP segments.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidRxPackets(int)
      */
-    public static native long getUidTcpRxSegments(int uid);
+    @Deprecated
+    public static long getUidTcpRxSegments(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
-     * Get the number of UDP packets sent for this UID.
-     * Includes DNS requests.
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of packets.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidTxPackets(int)
      */
-    public static native long getUidUdpTxPackets(int uid);
+    @Deprecated
+    public static long getUidUdpTxPackets(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
-     * Get the number of UDP packets received for this UID.
-     * Includes DNS responses.
-     * The statistics are across all interfaces.
-     *
-     * {@see android.os.Process#myUid()}.
-     *
-     * @param uid The UID of the process to examine.
-     * @return number of packets.  If the statistics are not supported by this device,
-     * {@link #UNSUPPORTED} will be returned.
+     * @deprecated Starting in {@link android.os.Build.VERSION_CODES#K},
+     *             transport layer statistics are no longer available, and will
+     *             always return {@link #UNSUPPORTED}.
+     * @see #getUidRxPackets(int)
      */
-    public static native long getUidUdpRxPackets(int uid);
+    @Deprecated
+    public static long getUidUdpRxPackets(int uid) {
+        return UNSUPPORTED;
+    }
 
     /**
      * Return detailed {@link NetworkStats} for the current UID. Requires no
@@ -616,4 +611,5 @@
 
     private static native long nativeGetTotalStat(int type);
     private static native long nativeGetIfaceStat(String iface, int type);
+    private static native long nativeGetUidStat(int uid, int type);
 }
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index d0e5019..c765457 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -352,4 +352,14 @@
     void setFirewallEgressSourceRule(String addr, boolean allow);
     void setFirewallEgressDestRule(String addr, int port, boolean allow);
     void setFirewallUidRule(int uid, boolean allow);
+
+    /**
+     * Set a process (pid) to use the name servers associated with the specified interface.
+     */
+    void setDnsInterfaceForPid(String iface, int pid);
+
+    /**
+     * Clear a process (pid) from being associated with an interface.
+     */
+    void clearDnsInterfaceForPid(int pid);
 }
diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java
index d20c3dc..2dd27f8 100644
--- a/core/java/android/provider/CalendarContract.java
+++ b/core/java/android/provider/CalendarContract.java
@@ -550,6 +550,8 @@
                         Calendars.CALENDAR_DISPLAY_NAME);
                 DatabaseUtils.cursorIntToContentValuesIfPresent(cursor, cv,
                         Calendars.CALENDAR_COLOR);
+                DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv,
+                        Calendars.CALENDAR_COLOR_KEY);
                 DatabaseUtils.cursorIntToContentValuesIfPresent(cursor, cv, CALENDAR_ACCESS_LEVEL);
                 DatabaseUtils.cursorIntToContentValuesIfPresent(cursor, cv, VISIBLE);
                 DatabaseUtils.cursorIntToContentValuesIfPresent(cursor, cv, SYNC_EVENTS);
diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java
index 0e7ab52..cb6300f 100644
--- a/core/java/android/provider/MediaStore.java
+++ b/core/java/android/provider/MediaStore.java
@@ -1324,6 +1324,18 @@
         }
 
         public static final class Media implements AudioColumns {
+
+            private static final String[] EXTERNAL_PATHS;
+
+            static {
+                String secondary_storage = System.getenv("SECONDARY_STORAGE");
+                if (secondary_storage != null) {
+                    EXTERNAL_PATHS = secondary_storage.split(":");
+                } else {
+                    EXTERNAL_PATHS = new String[0];
+                }
+            }
+
             /**
              * Get the content:// style URI for the audio media table on the
              * given volume.
@@ -1337,6 +1349,12 @@
             }
 
             public static Uri getContentUriForPath(String path) {
+                for (String ep : EXTERNAL_PATHS) {
+                    if (path.startsWith(ep)) {
+                        return EXTERNAL_CONTENT_URI;
+                    }
+                }
+
                 return (path.startsWith(Environment.getExternalStorageDirectory().getPath()) ?
                         EXTERNAL_CONTENT_URI : INTERNAL_CONTENT_URI);
             }
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 3d850cf..25954b9 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -50,7 +50,6 @@
 import android.text.TextUtils;
 import android.util.AndroidException;
 import android.util.Log;
-import android.view.WindowOrientationListener;
 
 import com.android.internal.widget.ILockSettings;
 
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a1305e4..8b1863b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1868,6 +1868,12 @@
     private static final int LAYOUT_DIRECTION_DEFAULT = LAYOUT_DIRECTION_INHERIT;
 
     /**
+     * Default horizontal layout direction.
+     * @hide
+     */
+    static final int LAYOUT_DIRECTION_RESOLVED_DEFAULT = LAYOUT_DIRECTION_LTR;
+
+    /**
      * Indicates that the view is tracking some sort of transient state
      * that the app should not need to be aware of, but that the framework
      * should take special care to preserve.
@@ -1916,6 +1922,12 @@
     private static final int TEXT_DIRECTION_DEFAULT = TEXT_DIRECTION_INHERIT;
 
     /**
+     * Default resolved text direction
+     * @hide
+     */
+    static final int TEXT_DIRECTION_RESOLVED_DEFAULT = TEXT_DIRECTION_FIRST_STRONG;
+
+    /**
      * Bit shift to get the horizontal layout direction. (bits after LAYOUT_DIRECTION_RESOLVED)
      * @hide
      */
@@ -1967,7 +1979,7 @@
      * @hide
      */
     static final int PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT =
-            TEXT_DIRECTION_FIRST_STRONG << PFLAG2_TEXT_DIRECTION_RESOLVED_MASK_SHIFT;
+            TEXT_DIRECTION_RESOLVED_DEFAULT << PFLAG2_TEXT_DIRECTION_RESOLVED_MASK_SHIFT;
 
     /*
      * Default text alignment. The text alignment of this View is inherited from its parent.
@@ -2026,6 +2038,12 @@
     private static final int TEXT_ALIGNMENT_DEFAULT = TEXT_ALIGNMENT_GRAVITY;
 
     /**
+     * Default resolved text alignment
+     * @hide
+     */
+    static final int TEXT_ALIGNMENT_RESOLVED_DEFAULT = TEXT_ALIGNMENT_GRAVITY;
+
+    /**
       * Bit shift to get the horizontal layout direction. (bits after DRAG_HOVERED)
       * @hide
       */
@@ -2075,7 +2093,7 @@
      * Indicates whether if the view text alignment has been resolved to gravity
      */
     private static final int PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT =
-            TEXT_ALIGNMENT_GRAVITY << PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK_SHIFT;
+            TEXT_ALIGNMENT_RESOLVED_DEFAULT << PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK_SHIFT;
 
     // Accessiblity constants for mPrivateFlags2
 
@@ -5979,7 +5997,7 @@
         final int targetSdkVersion = getContext().getApplicationInfo().targetSdkVersion;
         if (targetSdkVersion < JELLY_BEAN_MR1) {
             mPrivateFlags2 |= PFLAG2_LAYOUT_DIRECTION_RESOLVED;
-            return LAYOUT_DIRECTION_LTR;
+            return LAYOUT_DIRECTION_RESOLVED_DEFAULT;
         }
         return ((mPrivateFlags2 & PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL) ==
                 PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL) ? LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR;
@@ -11805,11 +11823,10 @@
                     // later to get the correct resolved value
                     if (!canResolveLayoutDirection()) return false;
 
-                    View parent = ((View) mParent);
                     // Parent has not yet resolved, LTR is still the default
-                    if (!parent.isLayoutDirectionResolved()) return false;
+                    if (!mParent.isLayoutDirectionResolved()) return false;
 
-                    if (parent.getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
+                    if (mParent.getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
                         mPrivateFlags2 |= PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL;
                     }
                     break;
@@ -11842,8 +11859,7 @@
     public boolean canResolveLayoutDirection() {
         switch (getRawLayoutDirection()) {
             case LAYOUT_DIRECTION_INHERIT:
-                return (mParent != null) && (mParent instanceof ViewGroup) &&
-                       ((ViewGroup) mParent).canResolveLayoutDirection();
+                return (mParent != null) && mParent.canResolveLayoutDirection();
             default:
                 return true;
         }
@@ -11871,8 +11887,9 @@
 
     /**
      * @return true if layout direction has been resolved.
+     * @hide
      */
-    private boolean isLayoutDirectionResolved() {
+    public boolean isLayoutDirectionResolved() {
         return (mPrivateFlags2 & PFLAG2_LAYOUT_DIRECTION_RESOLVED) == PFLAG2_LAYOUT_DIRECTION_RESOLVED;
     }
 
@@ -12722,12 +12739,12 @@
             final HardwareCanvas canvas = displayList.start();
             int width = mRight - mLeft;
             int height = mBottom - mTop;
+            int layerType = getLayerType();
 
             try {
                 canvas.setViewport(width, height);
                 // The dirty rect should always be null for a display list
                 canvas.onPreDraw(null);
-                int layerType = getLayerType();
                 if (!isLayer && layerType != LAYER_TYPE_NONE) {
                     if (layerType == LAYER_TYPE_HARDWARE) {
                         final HardwareLayer layer = getHardwareLayer();
@@ -13462,8 +13479,8 @@
             }
             transformToApply = parent.mChildTransformation;
         } else {
-            if ((mPrivateFlags3 & PFLAG3_VIEW_IS_ANIMATING_TRANSFORM) == PFLAG3_VIEW_IS_ANIMATING_TRANSFORM &&
-                    mDisplayList != null) {
+            if ((mPrivateFlags3 & PFLAG3_VIEW_IS_ANIMATING_TRANSFORM) ==
+                    PFLAG3_VIEW_IS_ANIMATING_TRANSFORM && mDisplayList != null) {
                 // No longer animating: clear out old animation matrix
                 mDisplayList.setAnimationMatrix(null);
                 mPrivateFlags3 &= ~PFLAG3_VIEW_IS_ANIMATING_TRANSFORM;
@@ -13660,7 +13677,7 @@
         }
 
         if ((flags & ViewGroup.FLAG_CLIP_CHILDREN) == ViewGroup.FLAG_CLIP_CHILDREN &&
-                !useDisplayListProperties) {
+                !useDisplayListProperties && layerType == LAYER_TYPE_NONE) {
             if (offsetForScroll) {
                 canvas.clipRect(sx, sy, sx + (mRight - mLeft), sy + (mBottom - mTop));
             } else {
@@ -16905,16 +16922,15 @@
                         return false;
                     }
 
-                    View parent = ((View) mParent);
                     // Parent has not yet resolved, so we still return the default
-                    if (!parent.isTextDirectionResolved()) {
+                    if (!mParent.isTextDirectionResolved()) {
                         mPrivateFlags2 |= PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT;
                         // Resolution will need to happen again later
                         return false;
                     }
 
                     // Set current resolved direction to the same value as the parent's one
-                    final int parentResolvedDirection = parent.getTextDirection();
+                    final int parentResolvedDirection = mParent.getTextDirection();
                     switch (parentResolvedDirection) {
                         case TEXT_DIRECTION_FIRST_STRONG:
                         case TEXT_DIRECTION_ANY_RTL:
@@ -16955,12 +16971,13 @@
      * Check if text direction resolution can be done.
      *
      * @return true if text direction resolution can be done otherwise return false.
+     *
+     * @hide
      */
-    private boolean canResolveTextDirection() {
+    public boolean canResolveTextDirection() {
         switch (getRawTextDirection()) {
             case TEXT_DIRECTION_INHERIT:
-                return (mParent != null) && (mParent instanceof View) &&
-                       ((View) mParent).canResolveTextDirection();
+                return (mParent != null) && mParent.canResolveTextDirection();
             default:
                 return true;
         }
@@ -16990,8 +17007,10 @@
 
     /**
      * @return true if text direction is resolved.
+     *
+     * @hide
      */
-    private boolean isTextDirectionResolved() {
+    public boolean isTextDirectionResolved() {
         return (mPrivateFlags2 & PFLAG2_TEXT_DIRECTION_RESOLVED) == PFLAG2_TEXT_DIRECTION_RESOLVED;
     }
 
@@ -17114,16 +17133,15 @@
                         // Resolution will need to happen again later
                         return false;
                     }
-                    View parent = (View) mParent;
 
                     // Parent has not yet resolved, so we still return the default
-                    if (!parent.isTextAlignmentResolved()) {
+                    if (!mParent.isTextAlignmentResolved()) {
                         mPrivateFlags2 |= PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT;
                         // Resolution will need to happen again later
                         return false;
                     }
 
-                    final int parentResolvedTextAlignment = parent.getTextAlignment();
+                    final int parentResolvedTextAlignment = mParent.getTextAlignment();
                     switch (parentResolvedTextAlignment) {
                         case TEXT_ALIGNMENT_GRAVITY:
                         case TEXT_ALIGNMENT_TEXT_START:
@@ -17168,12 +17186,13 @@
      * Check if text alignment resolution can be done.
      *
      * @return true if text alignment resolution can be done otherwise return false.
+     *
+     * @hide
      */
-    private boolean canResolveTextAlignment() {
+    public boolean canResolveTextAlignment() {
         switch (getRawTextAlignment()) {
             case TEXT_DIRECTION_INHERIT:
-                return (mParent != null) && (mParent instanceof View) &&
-                       ((View) mParent).canResolveTextAlignment();
+                return (mParent != null) && mParent.canResolveTextAlignment();
             default:
                 return true;
         }
@@ -17203,8 +17222,10 @@
 
     /**
      * @return true if text alignment is resolved.
+     *
+     * @hide
      */
-    private boolean isTextAlignmentResolved() {
+    public boolean isTextAlignmentResolved() {
         return (mPrivateFlags2 & PFLAG2_TEXT_ALIGNMENT_RESOLVED) == PFLAG2_TEXT_ALIGNMENT_RESOLVED;
     }
 
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java
index ddff91d..4b70bc0 100644
--- a/core/java/android/view/ViewParent.java
+++ b/core/java/android/view/ViewParent.java
@@ -295,4 +295,105 @@
      * @hide
      */
     public void childAccessibilityStateChanged(View child);
+
+    /**
+     * Tells if this view parent can resolve the layout direction.
+     * See {@link View#setLayoutDirection(int)}
+     *
+     * @return True if this view parent can resolve the layout direction.
+     *
+     * @hide
+     */
+    public boolean canResolveLayoutDirection();
+
+    /**
+     * Tells if this view parent layout direction is resolved.
+     * See {@link View#setLayoutDirection(int)}
+     *
+     * @return True if this view parent layout direction is resolved.
+     *
+     * @hide
+     */
+    public boolean isLayoutDirectionResolved();
+
+    /**
+     * Return this view parent layout direction. See {@link View#getLayoutDirection()}
+     *
+     * @return {@link View#LAYOUT_DIRECTION_RTL} if the layout direction is RTL or returns
+     * {@link View#LAYOUT_DIRECTION_LTR} if the layout direction is not RTL.
+     *
+     * @hide
+     */
+    public int getLayoutDirection();
+
+    /**
+     * Tells if this view parent can resolve the text direction.
+     * See {@link View#setTextDirection(int)}
+     *
+     * @return True if this view parent can resolve the text direction.
+     *
+     * @hide
+     */
+    public boolean canResolveTextDirection();
+
+    /**
+     * Tells if this view parent text direction is resolved.
+     * See {@link View#setTextDirection(int)}
+     *
+     * @return True if this view parent text direction is resolved.
+     *
+     * @hide
+     */
+    public boolean isTextDirectionResolved();
+
+    /**
+     * Return this view parent text direction. See {@link View#getTextDirection()}
+     *
+     * @return the resolved text direction. Returns one of:
+     *
+     * {@link View#TEXT_DIRECTION_FIRST_STRONG}
+     * {@link View#TEXT_DIRECTION_ANY_RTL},
+     * {@link View#TEXT_DIRECTION_LTR},
+     * {@link View#TEXT_DIRECTION_RTL},
+     * {@link View#TEXT_DIRECTION_LOCALE}
+     *
+     * @hide
+     */
+    public int getTextDirection();
+
+    /**
+     * Tells if this view parent can resolve the text alignment.
+     * See {@link View#setTextAlignment(int)}
+     *
+     * @return True if this view parent can resolve the text alignment.
+     *
+     * @hide
+     */
+    public boolean canResolveTextAlignment();
+
+    /**
+     * Tells if this view parent text alignment is resolved.
+     * See {@link View#setTextAlignment(int)}
+     *
+     * @return True if this view parent text alignment is resolved.
+     *
+     * @hide
+     */
+    public boolean isTextAlignmentResolved();
+
+    /**
+     * Return this view parent text alignment. See {@link android.view.View#getTextAlignment()}
+     *
+     * @return the resolved text alignment. Returns one of:
+     *
+     * {@link View#TEXT_ALIGNMENT_GRAVITY},
+     * {@link View#TEXT_ALIGNMENT_CENTER},
+     * {@link View#TEXT_ALIGNMENT_TEXT_START},
+     * {@link View#TEXT_ALIGNMENT_TEXT_END},
+     * {@link View#TEXT_ALIGNMENT_VIEW_START},
+     * {@link View#TEXT_ALIGNMENT_VIEW_END}
+     *
+     * @hide
+     */
+    public int getTextAlignment();
 }
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index fa2f8c8..1d86361 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -2111,20 +2111,25 @@
     private void profileRendering(boolean enabled) {
         if (mProfileRendering) {
             mRenderProfilingEnabled = enabled;
-            if (mRenderProfiler == null) {
-                mRenderProfiler = new Choreographer.FrameCallback() {
-                    @Override
-                    public void doFrame(long frameTimeNanos) {
-                        mDirty.set(0, 0, mWidth, mHeight);
-                        scheduleTraversals();
-                        if (mRenderProfilingEnabled) {
-                            mChoreographer.postFrameCallback(mRenderProfiler);
+
+            if (mRenderProfiler != null) {
+                mChoreographer.removeFrameCallback(mRenderProfiler);
+            }
+            if (mRenderProfilingEnabled) {
+                if (mRenderProfiler == null) {
+                    mRenderProfiler = new Choreographer.FrameCallback() {
+                        @Override
+                        public void doFrame(long frameTimeNanos) {
+                            mDirty.set(0, 0, mWidth, mHeight);
+                            scheduleTraversals();
+                            if (mRenderProfilingEnabled) {
+                                mChoreographer.postFrameCallback(mRenderProfiler);
+                            }
                         }
-                    }
-                };
+                    };
+                }
                 mChoreographer.postFrameCallback(mRenderProfiler);
             } else {
-                mChoreographer.removeFrameCallback(mRenderProfiler);
                 mRenderProfiler = null;
             }
         }
@@ -3844,6 +3849,12 @@
                     if (mView.dispatchUnhandledMove(focused, direction)) {
                         return EVENT_HANDLED;
                     }
+                } else {
+                    // find the best view to give focus to in this non-touch-mode with no-focus
+                    View v = focusSearch(null, direction);
+                    if (v != null && v.requestFocus(direction)) {
+                        return EVENT_HANDLED;
+                    }
                 }
             }
         }
@@ -4818,6 +4829,51 @@
         postSendWindowContentChangedCallback(child);
     }
 
+    @Override
+    public boolean canResolveLayoutDirection() {
+        return true;
+    }
+
+    @Override
+    public boolean isLayoutDirectionResolved() {
+        return true;
+    }
+
+    @Override
+    public int getLayoutDirection() {
+        return View.LAYOUT_DIRECTION_RESOLVED_DEFAULT;
+    }
+
+    @Override
+    public boolean canResolveTextDirection() {
+        return true;
+    }
+
+    @Override
+    public boolean isTextDirectionResolved() {
+        return true;
+    }
+
+    @Override
+    public int getTextDirection() {
+        return View.TEXT_DIRECTION_RESOLVED_DEFAULT;
+    }
+
+    @Override
+    public boolean canResolveTextAlignment() {
+        return true;
+    }
+
+    @Override
+    public boolean isTextAlignmentResolved() {
+        return true;
+    }
+
+    @Override
+    public int getTextAlignment() {
+        return View.TEXT_ALIGNMENT_RESOLVED_DEFAULT;
+    }
+
     private View getCommonPredecessor(View first, View second) {
         if (mAttachInfo != null) {
             if (mTempHashSet == null) {
diff --git a/core/java/android/widget/Scroller.java b/core/java/android/widget/Scroller.java
index 3a28e75e..3bfd39d 100644
--- a/core/java/android/widget/Scroller.java
+++ b/core/java/android/widget/Scroller.java
@@ -26,11 +26,39 @@
 
 
 /**
- * This class encapsulates scrolling.  The duration of the scroll
- * can be passed in the constructor and specifies the maximum time that
- * the scrolling animation should take.  Past this time, the scrolling is 
- * automatically moved to its final stage and computeScrollOffset()
- * will always return false to indicate that scrolling is over.
+ * <p>This class encapsulates scrolling. You can use scrollers ({@link Scroller}
+ * or {@link OverScroller}) to collect the data you need to produce a scrolling
+ * animation&mdash;for example, in response to a fling gesture. Scrollers track
+ * scroll offsets for you over time, but they don't automatically apply those
+ * positions to your view. It's your responsibility to get and apply new
+ * coordinates at a rate that will make the scrolling animation look smooth.</p>
+ *
+ * <p>Here is a simple example:</p>
+ *
+ * <pre> private Scroller mScroller = new Scroller(context);
+ * ...
+ * public void zoomIn() {
+ *     // Revert any animation currently in progress
+ *     mScroller.forceFinished(true);
+ *     // Start scrolling by providing a starting point and
+ *     // the distance to travel
+ *     mScroller.startScroll(0, 0, 100, 0);
+ *     // Invalidate to request a redraw
+ *     invalidate();
+ * }</pre>
+ *
+ * <p>To track the changing positions of the x/y coordinates, use
+ * {@link #computeScrollOffset}. The method returns a boolean to indicate
+ * whether the scroller is finished. If it isn't, it means that a fling or
+ * programmatic pan operation is still in progress. You can use this method to
+ * find the current offsets of the x and y coordinates, for example:</p>
+ *
+ * <pre>if (mScroller.computeScrollOffset()) {
+ *     // Get current x and y positions
+ *     int currX = mScroller.getCurrX();
+ *     int currY = mScroller.getCurrY();
+ *    ...
+ * }</pre>
  */
 public class Scroller  {
     private int mMode;
@@ -272,8 +300,7 @@
 
     /**
      * Call this when you want to know the new location.  If it returns true,
-     * the animation is not yet finished.  loc will be altered to provide the
-     * new location.
+     * the animation is not yet finished.
      */ 
     public boolean computeScrollOffset() {
         if (mFinished) {
@@ -355,7 +382,8 @@
     }
 
     /**
-     * Start scrolling by providing a starting point and the distance to travel.
+     * Start scrolling by providing a starting point, the distance to travel,
+     * and the duration of the scroll.
      * 
      * @param startX Starting horizontal scroll offset in pixels. Positive
      *        numbers will scroll the content to the left.
diff --git a/core/java/com/android/internal/statusbar/StatusBarNotification.java b/core/java/com/android/internal/statusbar/StatusBarNotification.java
index a91aa3c..23e87fc 100644
--- a/core/java/com/android/internal/statusbar/StatusBarNotification.java
+++ b/core/java/com/android/internal/statusbar/StatusBarNotification.java
@@ -21,23 +21,13 @@
 import android.os.Parcelable;
 import android.os.UserHandle;
 
-/*
-boolean clearable = !n.ongoingEvent && ((notification.flags & Notification.FLAG_NO_CLEAR) == 0);
-
-
-// TODO: make this restriction do something smarter like never fill
-// more than two screens.  "Why would anyone need more than 80 characters." :-/
-final int maxTickerLen = 80;
-if (truncatedTicker != null && truncatedTicker.length() > maxTickerLen) {
-    truncatedTicker = truncatedTicker.subSequence(0, maxTickerLen);
-}
-*/
-
 /**
- * Class encapsulating a Notification. Sent by the NotificationManagerService to the IStatusBar (in System UI).
+ * Class encapsulating a Notification. Sent by the NotificationManagerService to clients including
+ * the IStatusBar (in System UI).
  */
 public class StatusBarNotification implements Parcelable {
     public final String pkg;
+    public final String basePkg;
     public final int id;
     public final String tag;
     public final int uid;
@@ -47,6 +37,7 @@
     public final Notification notification;
     public final int score;
     public final UserHandle user;
+    public final long postTime;
 
     /** This is temporarily needed for the JB MR1 PDK. */
     @Deprecated
@@ -57,10 +48,23 @@
 
     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);
+    }
+
+    public StatusBarNotification(String pkg, String basePkg, int id, String tag, int uid,
+            int initialPid, int score, Notification notification, UserHandle user) {
+        this(pkg, basePkg, id, tag, uid, initialPid, score, notification, user,
+                System.currentTimeMillis());
+    }
+
+    public StatusBarNotification(String pkg, String basePkg, 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.id = id;
         this.tag = tag;
         this.uid = uid;
@@ -69,10 +73,13 @@
         this.notification = notification;
         this.user = user;
         this.notification.setUser(user);
+
+        this.postTime = postTime;
     }
 
     public StatusBarNotification(Parcel in) {
         this.pkg = in.readString();
+        this.basePkg = in.readString();
         this.id = in.readInt();
         if (in.readInt() != 0) {
             this.tag = in.readString();
@@ -84,11 +91,13 @@
         this.score = in.readInt();
         this.notification = new Notification(in);
         this.user = UserHandle.readFromParcel(in);
-        this.notification.setUser(user);
+        this.notification.setUser(this.user);
+        this.postTime = in.readLong();
     }
 
     public void writeToParcel(Parcel out, int flags) {
         out.writeString(this.pkg);
+        out.writeString(this.basePkg);
         out.writeInt(this.id);
         if (this.tag != null) {
             out.writeInt(1);
@@ -101,6 +110,8 @@
         out.writeInt(this.score);
         this.notification.writeToParcel(out, flags);
         user.writeToParcel(out, flags);
+
+        out.writeLong(this.postTime);
     }
 
     public int describeContents() {
@@ -123,14 +134,17 @@
 
     @Override
     public StatusBarNotification clone() {
-        return new StatusBarNotification(this.pkg, this.id, this.tag, this.uid, this.initialPid,
-                this.score, this.notification.clone(), this.user);
+        return new StatusBarNotification(this.pkg, this.basePkg,
+                this.id, this.tag, this.uid, this.initialPid,
+                this.score, this.notification.clone(), this.user, this.postTime);
     }
 
     @Override
     public String toString() {
-        return "StatusBarNotification(pkg=" + pkg + " id=" + id + " tag=" + tag + " score=" + score
-                + " notn=" + notification + " user=" + user + ")";
+        return String.format(
+                "StatusBarNotification(pkg=%s user=%s id=%d tag=%s score=%d: %s)",
+                this.pkg, this.user, this.id, this.tag,
+                this.score, this.notification);
     }
 
     public boolean isOngoing() {
diff --git a/core/java/com/android/internal/widget/ActionBarContainer.java b/core/java/com/android/internal/widget/ActionBarContainer.java
index 0cfe4fd..6120a09 100644
--- a/core/java/com/android/internal/widget/ActionBarContainer.java
+++ b/core/java/com/android/internal/widget/ActionBarContainer.java
@@ -84,6 +84,10 @@
         mBackground = bg;
         if (bg != null) {
             bg.setCallback(this);
+            if (mActionBarView != null) {
+                mBackground.setBounds(mActionBarView.getLeft(), mActionBarView.getTop(),
+                        mActionBarView.getRight(), mActionBarView.getBottom());
+            }
         }
         setWillNotDraw(mIsSplit ? mSplitBackground == null :
                 mBackground == null && mStackedBackground == null);
@@ -98,6 +102,10 @@
         mStackedBackground = bg;
         if (bg != null) {
             bg.setCallback(this);
+            if ((mIsStacked && mStackedBackground != null)) {
+                mStackedBackground.setBounds(mTabContainer.getLeft(), mTabContainer.getTop(),
+                        mTabContainer.getRight(), mTabContainer.getBottom());
+            }
         }
         setWillNotDraw(mIsSplit ? mSplitBackground == null :
                 mBackground == null && mStackedBackground == null);
@@ -112,6 +120,9 @@
         mSplitBackground = bg;
         if (bg != null) {
             bg.setCallback(this);
+            if (mIsSplit && mSplitBackground != null) {
+                mSplitBackground.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight());
+            }
         }
         setWillNotDraw(mIsSplit ? mSplitBackground == null :
                 mBackground == null && mStackedBackground == null);
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 631cdae..0827f7c 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -76,6 +76,15 @@
 }
 
 static jboolean
+android_media_AudioSystem_isStreamActiveRemotely(JNIEnv *env, jobject thiz, jint stream,
+        jint inPastMs)
+{
+    bool state = false;
+    AudioSystem::isStreamActiveRemotely((audio_stream_type_t) stream, &state, inPastMs);
+    return state;
+}
+
+static jboolean
 android_media_AudioSystem_isSourceActive(JNIEnv *env, jobject thiz, jint source)
 {
     bool state = false;
@@ -270,6 +279,7 @@
     {"muteMicrophone",      "(Z)I",     (void *)android_media_AudioSystem_muteMicrophone},
     {"isMicrophoneMuted",   "()Z",      (void *)android_media_AudioSystem_isMicrophoneMuted},
     {"isStreamActive",      "(II)Z",    (void *)android_media_AudioSystem_isStreamActive},
+    {"isStreamActiveRemotely","(II)Z",  (void *)android_media_AudioSystem_isStreamActiveRemotely},
     {"isSourceActive",      "(I)Z",     (void *)android_media_AudioSystem_isSourceActive},
     {"setDeviceConnectionState", "(IILjava/lang/String;)I", (void *)android_media_AudioSystem_setDeviceConnectionState},
     {"getDeviceConnectionState", "(ILjava/lang/String;)I",  (void *)android_media_AudioSystem_getDeviceConnectionState},
diff --git a/core/jni/android_net_TrafficStats.cpp b/core/jni/android_net_TrafficStats.cpp
index aa8a58b..9e60904 100644
--- a/core/jni/android_net_TrafficStats.cpp
+++ b/core/jni/android_net_TrafficStats.cpp
@@ -32,17 +32,7 @@
 namespace android {
 
 static const char* QTAGUID_IFACE_STATS = "/proc/net/xt_qtaguid/iface_stat_fmt";
-
-enum Tx_Rx {
-    TX,
-    RX
-};
-
-enum Tcp_Udp {
-    TCP,
-    UDP,
-    TCP_AND_UDP
-};
+static const char* QTAGUID_UID_STATS = "/proc/net/xt_qtaguid/stats";
 
 // NOTE: keep these in sync with TrafficStats.java
 static const uint64_t UNKNOWN = -1;
@@ -84,34 +74,13 @@
     }
 }
 
-// Returns an ASCII decimal number read from the specified file, -1 on error.
-static jlong readNumber(char const* filename) {
-    char buf[80];
-    int fd = open(filename, O_RDONLY);
-    if (fd < 0) {
-        if (errno != ENOENT) ALOGE("Can't open %s: %s", filename, strerror(errno));
-        return -1;
-    }
-
-    int len = read(fd, buf, sizeof(buf) - 1);
-    if (len < 0) {
-        ALOGE("Can't read %s: %s", filename, strerror(errno));
-        close(fd);
-        return -1;
-    }
-
-    close(fd);
-    buf[len] = '\0';
-    return atoll(buf);
-}
-
 static int parseIfaceStats(const char* iface, struct Stats* stats) {
     FILE *fp = fopen(QTAGUID_IFACE_STATS, "r");
     if (fp == NULL) {
         return -1;
     }
 
-    char buffer[256];
+    char buffer[384];
     char cur_iface[32];
     bool foundTcp = false;
     uint64_t rxBytes, rxPackets, txBytes, txPackets, tcpRxPackets, tcpTxPackets;
@@ -149,6 +118,36 @@
     return 0;
 }
 
+static int parseUidStats(const uint32_t uid, struct Stats* stats) {
+    FILE *fp = fopen(QTAGUID_UID_STATS, "r");
+    if (fp == NULL) {
+        return -1;
+    }
+
+    char buffer[384];
+    char iface[32];
+    uint32_t idx, cur_uid, set;
+    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 (uid == cur_uid && tag == 0L) {
+                stats->rxBytes += rxBytes;
+                stats->rxPackets += rxPackets;
+                stats->txBytes += txBytes;
+                stats->txPackets += txPackets;
+            }
+        }
+    }
+
+    if (fclose(fp) != 0) {
+        return -1;
+    }
+    return 0;
+}
+
 static jlong getTotalStat(JNIEnv* env, jclass clazz, jint type) {
     struct Stats stats;
     memset(&stats, 0, sizeof(Stats));
@@ -174,160 +173,20 @@
     }
 }
 
-
-// Per-UID stats require reading from a constructed filename.
-
-static jlong getUidBytes(JNIEnv* env, jobject clazz, jint uid,
-                         enum Tx_Rx tx_or_rx, enum Tcp_Udp tcp_or_udp) {
-    char tcp_filename[80], udp_filename[80];
-    jlong tcp_bytes = -1, udp_bytes = -1, total_bytes = -1;
-
-    switch (tx_or_rx) {
-        case TX:
-            sprintf(tcp_filename, "/proc/uid_stat/%d/tcp_snd", uid);
-            sprintf(udp_filename, "/proc/uid_stat/%d/udp_snd", uid);
-            break;
-        case RX:
-            sprintf(tcp_filename, "/proc/uid_stat/%d/tcp_rcv", uid);
-            sprintf(udp_filename, "/proc/uid_stat/%d/udp_rcv", uid);
-            break;
-        default:
-            return -1;
+static jlong getUidStat(JNIEnv* env, jclass clazz, jint uid, jint type) {
+    struct Stats stats;
+    memset(&stats, 0, sizeof(Stats));
+    if (parseUidStats(uid, &stats) == 0) {
+        return getStatsType(&stats, (StatsType) type);
+    } else {
+        return UNKNOWN;
     }
-
-    switch (tcp_or_udp) {
-        case TCP:
-            tcp_bytes = readNumber(tcp_filename);
-            total_bytes = (tcp_bytes >= 0) ? tcp_bytes : -1;
-            break;
-        case UDP:
-            udp_bytes = readNumber(udp_filename);
-            total_bytes = (udp_bytes >= 0) ? udp_bytes : -1;
-            break;
-        case TCP_AND_UDP:
-            tcp_bytes = readNumber(tcp_filename);
-            total_bytes += (tcp_bytes >= 0 ? tcp_bytes : 0);
-
-            udp_bytes = readNumber(udp_filename);
-            total_bytes += (udp_bytes >= 0 ? udp_bytes : 0);
-            break;
-        default:
-            return -1;
-    }
-
-    return total_bytes;
-}
-
-static jlong getUidPkts(JNIEnv* env, jobject clazz, jint uid,
-                         enum Tx_Rx tx_or_rx, enum Tcp_Udp tcp_or_udp) {
-    char tcp_filename[80], udp_filename[80];
-    jlong tcp_pkts = -1, udp_pkts = -1, total_pkts = -1;
-
-    switch (tx_or_rx) {
-        case TX:
-            sprintf(tcp_filename, "/proc/uid_stat/%d/tcp_snd_pkt", uid);
-            sprintf(udp_filename, "/proc/uid_stat/%d/udp_snd_pkt", uid);
-            break;
-        case RX:
-            sprintf(tcp_filename, "/proc/uid_stat/%d/tcp_rcv_pkt", uid);
-            sprintf(udp_filename, "/proc/uid_stat/%d/udp_rcv_pkt", uid);
-            break;
-        default:
-            return -1;
-    }
-
-    switch (tcp_or_udp) {
-        case TCP:
-            tcp_pkts = readNumber(tcp_filename);
-            total_pkts = (tcp_pkts >= 0) ? tcp_pkts : -1;
-            break;
-        case UDP:
-            udp_pkts = readNumber(udp_filename);
-            total_pkts = (udp_pkts >= 0) ? udp_pkts : -1;
-            break;
-        case TCP_AND_UDP:
-            tcp_pkts = readNumber(tcp_filename);
-            total_pkts += (tcp_pkts >= 0 ? tcp_pkts : 0);
-
-            udp_pkts = readNumber(udp_filename);
-            total_pkts += (udp_pkts >= 0 ? udp_pkts : 0);
-            break;
-        default:
-            return -1;
-    }
-
-    return total_pkts;
-}
-
-static jlong getUidRxBytes(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidBytes(env, clazz, uid, RX, TCP_AND_UDP);
-}
-
-static jlong getUidTxBytes(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidBytes(env, clazz, uid, TX, TCP_AND_UDP);
-}
-
-/* TCP Segments + UDP Packets */
-static jlong getUidTxPackets(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidPkts(env, clazz, uid, TX, TCP_AND_UDP);
-}
-
-/* TCP Segments + UDP Packets */
-static jlong getUidRxPackets(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidPkts(env, clazz, uid, RX, TCP_AND_UDP);
-}
-
-static jlong getUidTcpTxBytes(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidBytes(env, clazz, uid, TX, TCP);
-}
-
-static jlong getUidTcpRxBytes(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidBytes(env, clazz, uid, RX, TCP);
-}
-
-static jlong getUidUdpTxBytes(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidBytes(env, clazz, uid, TX, UDP);
-}
-
-static jlong getUidUdpRxBytes(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidBytes(env, clazz, uid, RX, UDP);
-}
-
-static jlong getUidTcpTxSegments(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidPkts(env, clazz, uid, TX, TCP);
-}
-
-static jlong getUidTcpRxSegments(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidPkts(env, clazz, uid, RX, TCP);
-}
-
-static jlong getUidUdpTxPackets(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidPkts(env, clazz, uid, TX, UDP);
-}
-
-static jlong getUidUdpRxPackets(JNIEnv* env, jobject clazz, jint uid) {
-    return getUidPkts(env, clazz, uid, RX, UDP);
 }
 
 static JNINativeMethod gMethods[] = {
     {"nativeGetTotalStat", "(I)J", (void*) getTotalStat},
     {"nativeGetIfaceStat", "(Ljava/lang/String;I)J", (void*) getIfaceStat},
-
-    /* Per-UID Stats */
-    {"getUidTxBytes", "(I)J", (void*) getUidTxBytes},
-    {"getUidRxBytes", "(I)J", (void*) getUidRxBytes},
-    {"getUidTxPackets", "(I)J", (void*) getUidTxPackets},
-    {"getUidRxPackets", "(I)J", (void*) getUidRxPackets},
-
-    {"getUidTcpTxBytes", "(I)J", (void*) getUidTcpTxBytes},
-    {"getUidTcpRxBytes", "(I)J", (void*) getUidTcpRxBytes},
-    {"getUidUdpTxBytes", "(I)J", (void*) getUidUdpTxBytes},
-    {"getUidUdpRxBytes", "(I)J", (void*) getUidUdpRxBytes},
-
-    {"getUidTcpTxSegments", "(I)J", (void*) getUidTcpTxSegments},
-    {"getUidTcpRxSegments", "(I)J", (void*) getUidTcpRxSegments},
-    {"getUidUdpTxPackets", "(I)J", (void*) getUidUdpTxPackets},
-    {"getUidUdpRxPackets", "(I)J", (void*) getUidUdpRxPackets},
+    {"nativeGetUidStat", "(II)J", (void*) getUidStat},
 };
 
 int register_android_net_TrafficStats(JNIEnv* env) {
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 5783bf6..5d0614c 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2175,6 +2175,14 @@
         android:description="@string/permdesc_updateLock"
         android:protectionLevel="signatureOrSystem" />
 
+    <!-- Allows an application to read the current set of notifications, including
+         any metadata and intents attached.
+         @hide -->
+    <permission android:name="android.permission.ACCESS_NOTIFICATIONS"
+        android:label="@string/permlab_accessNotifications"
+        android:description="@string/permdesc_accessNotifications"
+        android:protectionLevel="signature|system" />
+
     <!-- The system process is explicitly the only one allowed to launch the
          confirmation UI for full backup/restore -->
     <uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index d162f69..ac422ea 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Laat die program toe om seluitsending-boodskappe te lees wat deur jou toestel ontvang word. Seluitsending-waarskuwings word in sommige plekke afgelewer om jou van noodsituasies te waarsku. Kwaadwillige programme mag inmeng met die prestasie of die werking van jou toestel wanneer \'n noodgeval se seluitsending ontvang word."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"stuur SMS-boodskappe"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Laat die program toe om SMS-boodskappe te stuur. Dit kan tot onverwagse heffings lei. Kwaadwillige programme kan jou geld kos deur boodskappe sonder jou bevestiging te stuur."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"stuur sms-boodskappe met geen bestiging"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Laat die program toe om SMS-boodskappe te stuur. Dit kan tot onverwagse heffings lei. Kwaadwillige programme kan jou geld kos deur boodskappe sonder jou bevestiging te stuur."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"stuur antwoord-via-boodskap-geleenthede"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Laat die program toe om versoeke te stuur na ander boodskapprogramme om antwoord-via-boodskap-geleenthede vir inkomende oproepe te hanteer."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"lees jou teksboodskappe (SMS of MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Laat die program toe om SMS-boodskappe wat op jou tablet of SIM-kaart gestoor is, te lees. Dit laat die program toe om alle SMS-boodskappe te lees, ongeag van die inhoud of vertroulikheid daarvan."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Laat die program toe om SMS-boodskappe wat op jou foon of SIM-kaart gestoor is, te lees. Dit laat die program toe om alle SMS-boodskappe te lees, ongeag van die inhoud of vertroulikheid daarvan."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"versoek verken-met-aanraking"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Laat die houer toe om \'n interaksiemodus te versoek waarin geraakte items hardop uitgespreek word en die UI via handgebare verken kan word."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"versoek verbeterde webtoeganklikheid"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Laat die houer toe om te versoek dat webtoeganklikheidsverbeterings geaktiveer word. Byvoorbeeld, om skripte te installeer om programinhoud meer toeganklik te maak."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"bind aan \'n teksdiens"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Dit laat die houer toe om aan die topvlak-koppelvlak van \'n teksdiens (bv SpellCheckerService) te bind. Dit moet nooit vir normale programme nodig wees nie."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"bind aan \'n VPN-diens"</string>
@@ -618,6 +617,8 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Laat die program toe om netwerkbeleide te bestuur en program-spesifieke reëls te definieer."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"verander verrekening van netwerkgebruik"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Laat die program toe om te verander hoe netwerkgebruik teenoor programme gemeet word. Nie vir gebruik deur normale programme nie."</string>
+    <string name="permlab_accessNotifications" msgid="7673416487873432268">"kry toegang tot kennisgewings"</string>
+    <string name="permdesc_accessNotifications" msgid="458457742683431387">"Laat die program toe om kennisgewings te herwin, bestudeer en te verwyder, met inbegrip van daardie kennisgewings wat deur ander programme geplaas is."</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Stel wagwoordreëls"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Beheer lengte en watter karakters wat in die skermontsluit-wagwoorde gebruik word."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Monitor pogings om skerm te ontsluit"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 623832b..54b5f6f 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"መሣሪያህ የህዋስ ስርጭት መልዕክቶች ሲቀበል መተግበሪያው እንዲያነበው ይፈቅድለታል። የህዋስ ስርጭት ማንቂያዎች አስቸኳይ ሁኔታዎች ሲያጋጥሙ አንዳንድ አካባቢዎች ላይ የሚላኩ ናቸው። የህዋስ ስርጭት ሲደርስ ተንኮል አዘል መተግበሪያዎች በመሣሪያህ አፈጻጸም ወይም አሰራር ላይ ጣልቃ ሊገቡ ይችላሉ።"</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"የSMS መልዕክቶች ላክ"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"መተግበሪያው የኤስ.ኤም.ኤስ. መልዕክቶችን እንዲልክ ይፈቅድለታል። ይህ ያልተጠበቁ ወጪዎችን ሊያስከትል ይችላል። ተንኮል አዘል መተግበሪያዎች ያላንተ ማረጋገጫ መልዕክቶችን በመላክ ገንዘብ ሊያስወጡህ ይችላሉ።"</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"ያለ ምንም ማረጋገጫ የSMS መልዕክቶች ላክ"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"መተግበሪያው የኤስ.ኤም.ኤስ. መልዕክቶችን እንዲልክ ይፈቅድለታል። ይህ ያልተጠበቁ ወጪዎችን ሊያስከትል ይችላል። ተንኮል አዘል መተግበሪያዎች ያላንተ ማረጋገጫ መልዕክቶችን በመላክ ገንዘብ ሊያስወጡህ ይችላሉ።"</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"የበመልዕክት-በኩል-ምላሽ-ስጥ ክስተቶችን ይላኩ"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"መተግበሪያው ሌሎች የመልዕክት መላኪያ መተግበሪያዎች ለመጪ ጥሪዎች በመልዕክት-በኩል-ምላሽ-መስጠት ስራን እንዲይዙ ጥያቄዎች እንዲልክላቸው ያስችለዋል።"</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"የጽሑፍ መልዕክቶችህን አንብብ (ኤስ.ኤም.ኤስ. ወይም ኤም.ኤም.ኤስ.)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"መገለጫው በጡባዊ ቱኮህ ወይም በSIM ካርድህ የተከማቹ የኤስ.ኤም.ኤስ. መልእክቶችን እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው ይዘት ወይም ሚስጥራዊነትን ከግምት ሳያስገባ ሁሉንም የኤስ.ኤም.ኤስ. መልእክቶች እንዲያነብ ይፈቅድለታል።"</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"መገለጫው በስልክህ ወይም በSIM ካርድህ የተከማቹ የኤስ.ኤም.ኤስ. መልእክቶችን እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው ይዘት ወይም ሚስጥራዊነትን ከግምት ሳያስገባ ሁሉንም የኤስ.ኤም.ኤስ. መልእክቶች እንዲያነብ ይፈቅድለታል።"</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"በንክኪ ማሰስን ይጠይቁ"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"ያዢው የተነኩ ንጥሎች ጮክ ተብለው የሚነገሩበት እና በይነገጹ በምልክቶች በኩል ሊታሰስ በሚችሉበት የበይነግንኙነት ሁኒታ እንዲጠይቅ ያስችለዋል።"</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"የተሻሻለ የድር ተደራሽነት ይጠይቁ"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"ያዢው የድር ተደራሽነት ማሻሻያዎች እንዲነቁለት እንዲጠይቅ ያስችለዋል። ለምሳሌ፣ የመተግበሪያ ይዘት ይበልጥ ተደራሽ እንዲሆን የGoogle ስክሪፕቶችን እንዲጫኑ መጠየቅ።"</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"ለፅሁፍ አገልግሎት አሰረ"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"ያዡ ግቤት ለከፍተኛ-ደረጃ የፅሁፍ አገልግሎት ገፅታ ለመጠረዝ ይፈቅዳል። ለመደበኛ ትግበራዎች በፍፁም አያስፈልግም።"</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"ለVPN አገልግሎት ተገዛ"</string>
@@ -618,6 +617,8 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"የአውታረመረብ ቋሚ መመሪያዎችን እና ትግበራ ተኮር ደንቦችን ለማደራጀት ለመተግበሪያው ይፈቅዳሉ፡፡"</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"የአውታረ መረብ አጠቃቀም"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"ከመተግበሪያዎች በተለየ መልኩ እንዴት የአውታረ መረብ አጠቃቀም እንደተመዘገበ ለመቀየር ለመተግበሪያው ይፈቅዳሉ።ለመደበኛ መተግበሪያዎች አገልግሎት አይውልም።"</string>
+    <string name="permlab_accessNotifications" msgid="7673416487873432268">"ማሳወቂያዎችን ይድረሱ"</string>
+    <string name="permdesc_accessNotifications" msgid="458457742683431387">"መተግበሪያው ማሳወቂያዎችን እንዲያስመጣ፣ እንዲመረምር እና እንዲያጸዳ ያስችለዋል፣ በሌሎች መተግበሪያዎች የተለጠፉትንም ጨምሮ።"</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"የይለፍ ቃል ድንቦች አዘጋጅ"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"በማያ-መክፈት የተፈቀዱ የይለፍ ቃል ርዝመት እና ቁምፊዎች ተቆጣጠር።"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"የማሳያ-ክፈት ሙከራዎችን አሳይ"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index dc97ead..a9ac95d 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"السماح للتطبيق بقراءة رسائل بث الخلية التي يتلقاها هذا الجهاز. يتم تسليم تنبيهات بث الخلية في بعض المواقع لتحذيرك من حالات طارئة. يمكن أن تتداخل التطبيقات الضارة مع أداء أو تشغيل الجهاز عندما يتم تلقي بث خلية طارئ."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"إرسال رسائل قصيرة SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"للسماح للتطبيق بإرسال رسائل قصيرة SMS. وقد يؤدي هذا إلى تحمل رسوم غير متوقعة. وقد تكلفك التطبيقات الضارة أموالاً من خلال إرسال رسائل بدون موافقة منك."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"إرسال رسائل قصيرة SMS بدون تأكيد"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"للسماح للتطبيق بإرسال رسائل قصيرة SMS. وقد يؤدي هذا إلى تحمل رسوم غير متوقعة. وقد تكلفك التطبيقات الضارة أموالاً من خلال إرسال رسائل بدون موافقة منك."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"إرسال أحداث يتم الرد عليها عبر رسالة"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"السماح للتطبيق بإرسال طلبات إلى تطبيقات المراسلة الأخرى للتعامل مع الأحداث التي يتم الرد عليها عبر الرسائل في المكالمات الواردة."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"قراءة الرسائل النصية (الرسائل القصيرة SMS أو رسائل الوسائط المتعددة)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"للسماح للتطبيق بقراءة الرسائل القصيرة SMS المخزنة على الجهاز اللوحي أو على بطاقة SIM. ويتيح هذا للتطبيق قراءة جميع الرسائل القصيرة SMS، بغض النظر عن المحتوى أو مدى السرية."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"للسماح للتطبيق بقراءة الرسائل القصيرة SMS المخزنة على هاتفك أو على بطاقة SIM. ويتيح هذا للتطبيق قراءة جميع الرسائل القصيرة SMS، بغض النظر عن المحتوى أو مدى السرية."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"طلب الاستكشاف باللمس"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"للسماح للمالك بطلب وضع التفاعل الذي يتم فيه النطق بالعناصر الملموسة بصوت عالٍ واستكشاف واجهة المستخدم بالإيماءات."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"طلب إمكانية وصول محسنة"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"للسماح للمالك بطلب تمكين تحسينات إمكانية الوصول إلى الويب، مثل تثبيت البرامج النصية لمزيد من تسهيل الدخول إلى محتوى التطبيق."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"الالتزام بخدمة إدخال النصوص"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"للسماح للمالك بالالتزام بواجهة المستوى العلوي لخدمة إدخال النصوص (على سبيل المثال، SpellCheckerService). لن تكون هناك حاجة إليه مطلقًا مع التطبيقات العادية."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"الالتزام بخدمة VPN"</string>
@@ -618,6 +617,8 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"للسماح لتطبيق بإدارة سياسات الشبكة وتحديد قواعد متعلقة بالتطبيق."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"تعديل حساب استخدام الشبكة"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"للسماح للتطبيق بتعديل كيفية حساب استخدام الشبكة في التطبيقات. ليس للاستخدام بواسطة التطبيقات العادية."</string>
+    <string name="permlab_accessNotifications" msgid="7673416487873432268">"إشعارات الدخول"</string>
+    <string name="permdesc_accessNotifications" msgid="458457742683431387">"يتيح للتطبيق استرجاع الإشعارات وفحصها ومسحها، بما في ذلك تلك التي نشرتها تطبيقات أخرى."</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"تعيين قواعد كلمة المرور"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"يمكنك التحكم في الطول والأحرف المسموح بها في كلمات مرور إلغاء تأمين الشاشة."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"مراقبة محاولات إلغاء قفل الشاشة"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 6e14c0e..960232a 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Дазваляе прыкладанню чытаць паведамленні базавай станцыі, атрыманыя прыладай. Папярэджанні базавай станцыі дасылаюцца ў некаторыя месцы, каб папярэдзіць вас аб надзвычайных сітуацыях. Шкоднасныя прыкладанні могуць уплываць на прадукцыйнасць ці працу прылады пры атрыманні паведамлення базавай станцыі аб надзвычайнай сітуацыі."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"адпраўляць SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Дазваляе прыкладанне для адпраўкі SMS паведамленняў. Гэта можа прывесці да нечаканых абвінавачванняў. Шкоднасныя праграмы могуць каштаваць вам грошай на адпраўку паведамленняў без вашага пацвярджэння."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"адпраўляць SMS-паведамленні без пацверджання"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Дазваляе прыкладанню адпраўляць SMS-паведамленнi. Гэта можа прывесці да нечаканых абвінавачванняў. Шкоднасныя прыкладаннi могуць каштаваць вам грошай на адпраўку паведамленняў без вашага пацвярджэння."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"адправiць мерапрыемства \"адказ праз паведамленне\""</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Прыкладанне зможа адпраўляць запыты ў іншыя прыкладанні для апрацоўкі паведамленняў пра мерапрыемствы туы \"рэагаваць-праз-паведамленне\" для ўваходных выклікаў."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"чытанне сваiх тэкставых паведамленняў (SMS ці MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Дазваляе прыкладанню чытаць SMS-паведамленнi, якія захоўваюцца на планшэце ці SIM-карце. Гэта дазваляе прыкладанням чытаць ўсе SMS-паведамленні, незалежна ад змесцiва або прыватнасці."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Дазваляе прыкладанню чытаць SMS-паведамленні, якія захоўваюцца ў тэлефоне або на SIM-карце. Гэта дазваляе прыкладанням чытаць ўсе SMS-паведамленні, незалежна ад змесцiва або прыватнасці."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"запытаць даследаванне навобмацак"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Дазваляе ўладальнiку запытваць працу ў рэжыме ўзаемадзеяння, у якiм элементы, да якiх дакранулiся, прагаворваюцца ўслых, а карыстальнiцкi iнтэрфейс можна даследаваць рукамi."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"прасіць пашырэння даступнасці вэб-даступнасцi"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Дазваляе ўладальнiку запытваць уключэнне iнтэрнэт-даступнасцi паляпшэнняў. Напрыклад, усталёўка скрыптаў з Google зробiць кантэнт больш прыдатным для доступу."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"звязаць з тэкставай службай"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Дазваляе ўладальніку прывязвацца да інтэрфейсу верхняга ўзроўню тэкставай паслугі (напрыклад, SpellCheckerService). Ніколі не патрабуецца для звычайных прыкладанняў."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"звязвацца з VPN сэрвісам"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Дазваляе прыкладаннм кіраваць сеткавымі палітыкамі і вызначаць правілы пэўных прыкладанняў."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"змяніць улік выкарыстання сеткі"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Дазваляе прыкладанням змяняць метад уліку выкарыстання сеткі прыкладаннямі. Не для выкарыстання звычайнымі прыкладаннямі."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Устанавіць правілы паролю"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Кіраванне даўжынёй і колькасцю знакаў у паролі разблакоўкі экрана."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Сачыць за спробамі разблакоўкі экрана"</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 8af17de..7f351da 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Разрешава на приложението да чете съобщения с клетъчно излъчване, получени от устройството ви. Сигналите с клетъчно излъчване се получават на някои местоположения, за да ви предупредят за спешни ситуации. Злонамерените приложения могат да възпрепятстват изпълнението или работата на устройството ви при получаване на такова спешно излъчване."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"изпращане на SMS съобщения"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Разрешава на приложението да изпраща SMS съобщения. Това може да доведе до неочаквано таксуване. Злонамерените приложения могат да ви въвлекат в разходи, като изпращат съобщения без потвърждение от ваша страна."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"изпращане на SMS съобщения без потвърждаване"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Разрешава на приложението да изпраща SMS съобщения. Това може да доведе до неочаквано таксуване. Злонамерените приложения могат да ви въвлекат в разходи, като изпращат съобщения без потвърждение от ваша страна."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"изпращане на покани за отговор чрез съобщение"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Разрешава на приложението да изпраща заявки до други приложения за съобщения, за да обработва покани за отговор чрез SMS за входящите обаждания."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"четене на текстовите ви съобщения (SMS или MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Разрешава на приложението да чете SMS съобщенията, съхранени на таблета или SIM картата ви. Това разрешение му позволява да чете всички съобщения независимо от съдържанието или поверителността."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Разрешава на приложението да чете SMS съобщенията, съхранени на телефона или SIM картата ви. Това разрешение му позволява да чете всички съобщения независимо от съдържанието или поверителността."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"заявяване на изследване чрез докосване"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Разрешава на собственика да заяви режим на взаимодействие, при който докоснатите елементи се изговарят на глас и потребителският интерфейс може да бъде изследван чрез жестове."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"заявяване на подобрена достъпност в мрежата"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Разрешава на собственика да заяви активирането на подобрения на достъпността в мрежата – например инсталирането на скриптове, за да стане съдържанието от приложенията по-достъпно."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"обвързване с текстова услуга"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Разрешава на притежателя да се обвърже с интерфейса от най-високото ниво на текстова услуга (напр. SpellCheckerService). Нормалните приложения би трябвало никога да не се нуждаят от това."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"обвързване с услуга за VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Разрешава на приложението да управлява правилата на мрежата и да определя такива за конкретно приложение."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"промяна на отчетността на употребата на мрежа"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Разрешава на приложението да променя това как употребата на мрежа се отчита спрямо приложенията. Не е предназначено за нормални приложения."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Задаване на правила за паролата"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Контролирайте дължината и разрешените знаци за паролите за отключване на екрана."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Наблюдаване на опитите за отключване на екрана"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 1a4f58c..de1f9aa 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permet que l\'aplicació llegeixi missatges de difusió mòbil rebuts pel dispositiu. Les alertes de difusió mòbil s\'entreguen en algunes ubicacions per alertar de situacions d\'emergència. És possible que les aplicacions malicioses interfereixin en el rendiment o en el funcionament del dispositiu quan es rep una difusió mòbil d\'emergència."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"enviar missatges SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Permet que l\'aplicació enviï missatges SMS. Aquesta acció pot provocar càrrecs inesperats. Les aplicacions malicioses poden enviar missatges sense la teva confirmació, cosa que et pot fer gastar diners."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"enviament de missatges SMS sense confirmació"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Permet que l\'aplicació enviï missatges SMS. Aquesta acció pot provocar càrrecs inesperats. Les aplicacions malicioses poden enviar missatges sense la teva confirmació, cosa que et pot fer gastar diners."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"envia els esdeveniments amb \"resposta per missatge\""</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Permet que l\'aplicació enviï sol·licituds a altres aplicacions de missatgeria per gestionar els esdeveniments amb \"resposta per missatge\" de les trucades entrants."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"lectura dels missatges de text (SMS o MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Permet que l\'aplicació llegeixi missatges SMS emmagatzemats a la tauleta o a la targeta SIM. Això permet que l\'aplicació llegeixi tots els missatges SMS, independentment del contingut o de la confidencialitat."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Permet que l\'aplicació llegeixi missatges SMS emmagatzemats al telèfon o a la targeta SIM. Això permet que l\'aplicació llegeixi tots els missatges SMS, independentment del contingut o de la confidencialitat."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"sol·licitud d\'exploració tàctil"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Permet que el titular sol·liciti un mode d\'interacció en què els elements que es toquin es llegeixin en veu alta i la interfície d\'usuari es pugui explorar mitjançant gestos."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"sol·licitud d\'accessibilitat web millorada"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Permet que el titular sol·liciti l\'activació de les millores per a l\'accessibilitat web. Per exemple, la instal·lació de scripts de Google per fer més accessible el contingut de l\'aplicació."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"vincula a un servei de text"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Permet al titular vincular amb la interfície de nivell superior d\'un servei de text (per exemple, SpellCheckerService). Les aplicacions normals mai no ho haurien de necessitar."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"vincula a un servei de VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Permet que l\'aplicació gestioni les polítiques de la xarxa i que defineixi les regles específiques d\'aplicació."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modificació del càlcul d\'ús de la xarxa"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Permet que l\'aplicació modifiqui la manera com es calcula l\'ús de la xarxa per part de les aplicacions. No indicat per a les aplicacions normals."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Defineix les normes de contrasenya"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Controla la longitud i els caràcters permesos a les contrasenyes de desbloqueig de pantalla."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Control d\'intents de desbloqueig de pantalla"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index 504b207..0b1715e 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Umožňuje aplikaci číst zprávy informační služby přijaté ve vašem zařízení. Upozornění informační služby jsou v některých oblastech odesílána za účelem varování před mimořádnými událostmi. Škodlivé aplikace mohou narušit výkon či provoz vašeho zařízení během přijímání zpráv informační služby."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"odesílaní zpráv SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Umožňuje aplikaci odesílat zprávy SMS. Může to mít za následek účtování neočekávaných poplatků. Škodlivé aplikace vás mohou připravit o peníze odesíláním zpráv bez vašeho svolení."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"posílat zprávy SMS bez potvrzení"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Umožňuje aplikaci odesílat zprávy SMS. Může to mít za následek účtování neočekávaných poplatků. Škodlivé aplikace vás mohou připravit o peníze odesíláním zpráv bez vašeho svolení."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"odesílání událostí typu „odpovězte zprávou“"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Umožňuje aplikaci odesílat ostatním aplikacím požadavky na zpracování událostí typu „odpovězte zprávou“ pro příchozí volání."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"čtení textových zpráv (SMS nebo MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Umožňuje aplikaci číst zprávy SMS uložené v tabletu nebo na SIM kartě.Toto oprávnění umožňuje aplikaci číst zprávy SMS bez ohledu na jejich obsah nebo důvěrnost."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Umožňuje aplikaci číst zprávy SMS uložené v telefonu nebo na SIM kartě. Toto oprávnění umožňuje aplikaci číst zprávy SMS bez ohledu na jejich obsah nebo důvěrnost."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"požádat o prozkoumání dotykem"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Umožňuje držiteli požádat o interaktivní režim, ve kterém jsou po dotyku vysloveny názvy položek a uživatelské rozhraní lze poznávat pomocí gest."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"požádat o usnadnění přístupu k webu"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Umožňuje držiteli požádat o aktivaci usnadnění přístupu k webu, například o instalaci skriptů, které usnadňují přístup k obsahu aplikace."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"navázat se na textovou službu"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Umožňuje držiteli připojit se k nejvyšší úrovni rozhraní textové služby (např. SpellCheckerService). Běžné aplikace by toto oprávnění neměly nikdy požadovat."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"navázat se na službu VPN"</string>
@@ -457,7 +456,7 @@
     <string name="permdesc_configureWifiDisplay" msgid="7916815158690218065">"Povoluje aplikaci připojit a konfigurovat displeje přes Wi-Fi."</string>
     <string name="permlab_controlWifiDisplay" msgid="393641276723695496">"ovládat displeje přes Wi-Fi"</string>
     <string name="permdesc_controlWifiDisplay" msgid="4543912292681826986">"Povoluje aplikaci ovládat základní funkce displejů přes Wi-Fi."</string>
-    <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"změna vašeho nastavení zvuku"</string>
+    <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"změna nastavení zvuku"</string>
     <string name="permdesc_modifyAudioSettings" msgid="3522565366806248517">"Umožňuje aplikaci změnit globální nastavení zvuku, například hlasitost či reproduktor pro výstup zvuku."</string>
     <string name="permlab_recordAudio" msgid="3876049771427466323">"nahrávání zvuku"</string>
     <string name="permdesc_recordAudio" msgid="4906839301087980680">"Umožňuje aplikaci zaznamenat zvuk pomocí mikrofonu. Toto oprávnění umožňuje aplikaci kdykoliv zaznamenat zvuk bez vašeho svolení."</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Umožňuje aplikaci spravovat zásady sítě a definovat pravidla pro konkrétní aplikace."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"upravit kontrolu používání sítě"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Umožňuje aplikaci upravit způsob výpočtu využití sítě aplikacemi. Toto oprávnění není určeno pro běžné aplikace."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Nastavit pravidla pro heslo"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Řídit délku hesel pro odemčení obrazovky a povolené znaky."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Sledovat pokusy o odemčení obrazovky"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 1dc3d4b..860a9be 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Tillader, at appen læser mobiltransmissionsbeskeder, der modtages af din enhed. I nogle områder sendes mobiltransmissionsbeskeder for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når en mobiltransmission om en nødsituation modtages."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"send sms-beskeder"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Tillader, at appen kan sende sms-beskeder. Dette kan resultere i uventede opkrævninger. Skadelige apps kan koste dig penge ved at sende beskeder uden din bekræftelse."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"sende sms-meddelelser uden bekræftelse"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Tillader, at appen kan sende sms-beskeder. Dette kan resultere i uventede opkrævninger. Skadelige apps kan koste dig penge ved at sende beskeder uden din bekræftelse."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"send hændelser, hvor der skal svares pr. besked"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Tillader, at appen kan sende anmodninger til andre apps til beskeder for at håndtere hændelser, hvor der skal svares pr. besked."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"læse dine tekstbeskeder (SMS eller MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Tillader, at appen kan læse de sms-beskeder, der er gemt på din tablet eller dit SIM-kort. Med denne tilladelse kan appen læse alle sms-beskeder, uanset indhold eller fortrolighed."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Tillader, at appen kan læse de sms-beskeder, der er gemt på din telefon eller dit SIM-kort. Med denne tilladelse kan appen læse alle sms-beskeder, uanset indhold eller fortrolighed."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"anmod om udforsk ved berøring"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Tillader brugeren at anmode om en interaktionstilstand, hvor elementer, der berøres, læses op, og brugergrænsefladen kan udforskes via berøringer."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"anmod om bedre webtilgængelighed"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Tillader, at brugeren kan anmode om aktivering af webtilgængelighedsforbedringer. Disse omfatter bl.a. at installering af scripts, der gør appindhold mere tilgængeligt."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"forpligte sig til en sms-tjeneste"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Tillader, at ejeren kan binde en teksttjenestes grænseflade (f. eks. SpellCheckerService) på øverste niveau. Dette bør aldrig være nødvendigt til normale apps."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"bind til en VPN-tjeneste"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Tillader, at appen kan administrere netværkspolitikker og definere appspecifikke regler."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"skift afregning af netværksbrug"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Tillader, at appen kan ændre den måde, som netværksforbrug udregnes på i forhold til apps. Anvendes ikke af normale apps."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Indstil regler for adgangskode"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontroller længden samt tilladte tegn i adgangskoder til oplåsning af skærmen."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Overvåg forsøg på oplåsning af skærm"</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index e3700d3..3a8c6ab 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Ermöglicht der App, von Ihrem Gerät empfangene Cell Broadcast-Nachrichten zu lesen. Cell Broadcast-Benachrichtigungen werden an einigen Standorten gesendet, um Sie über Notfallsituationen zu informieren. Schädliche Apps können die Leistung oder den Betrieb Ihres Geräts beeinträchtigen, wenn eine Cell Broadcast-Notfallbenachrichtigung eingeht."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"SMS senden"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Ermöglicht der App, SMS zu senden. Dies kann zu unerwarteten Kosten führen. Schädliche Apps können Kosten verursachen, indem sie Nachrichten ohne Ihre Bestätigung senden."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"SMS ohne Bestätigung senden"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Ermöglicht der App, SMS zu senden. Dies kann zu unerwarteten Kosten führen. Schädliche Apps können Kosten verursachen, indem sie Nachrichten ohne Ihre Bestätigung senden."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"Antwort-per-SMS/MMS-Ereignisse senden"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Ermöglicht der App, Anfragen an andere SMS/MMS-Apps zu senden, um Antwort-per-SMS/MMS-Ereignisse für eingehende Anrufe zu verarbeiten"</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"SMS oder MMS lesen"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Ermöglicht der App, auf Ihrem Tablet oder Ihrer SIM-Karte gespeicherte SMS zu lesen. Die App kann alle SMS lesen, unabhängig von Inhalt und Vertraulichkeit."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Ermöglicht der App, auf Ihrem Telefon oder Ihrer SIM-Karte gespeicherte SMS zu lesen. Die App kann alle SMS lesen, unabhängig von Inhalt und Vertraulichkeit."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"Tippen &amp; Entdecken beantragen"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Nutzer darf Interaktionsmodus beantragen, in dem berührte Elemente laut vorgelesen werden und die Benutzeroberfläche über Gesten erkundet werden kann."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"Erweiterte Webbedienungshilfen beantragen"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Nutzer darf Verbesserungen für Webbedienungshilfen beantragen, beispielsweise die Installation von Skripts von Google, um die Nutzerfreundlichkeit des App-Inhalts zu verbessern."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"An einen Textdienst binden"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Ermöglicht dem Halter, sich an die Oberfläche eines Textdienstes auf oberster Ebene zu binden, z. B. eines Rechtschreibprüfungsdienstes. Sollte nie für normale Apps benötigt werden."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"An einen VPN-Dienst binden"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Ermöglicht der App, Netzwerkrichtlinien zu verwalten und anwendungsspezifische Regeln festzulegen"</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"Zuordnung für Netzwerknutzung ändern"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Ermöglicht der App, die Art und Weise zu ändern, wie der Netzwerkverbrauch im Hinblick auf Apps berechnet wird. Nicht für normale Apps vorgesehen."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Passwortregeln festlegen"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Zulässige Länge und Zeichen für Passwörter zum Entsperren des Bildschirms festlegen"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Versuche zum Entsperren des Displays überwachen"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 61e913c..9f7399b 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Επιτρέπει στην εφαρμογή την ανάγνωση μηνυμάτων που έχουν μεταδοθεί μέσω κινητού τηλεφώνου και έχουν ληφθεί από τη συσκευή σας. Ειδοποιήσεις που μεταδίδονται μέσω κινητού παραδίδονται σε ορισμένες τοποθεσίες για να σας προειδοποιήσουν για καταστάσεις έκτακτης ανάγκης. Κακόβουλες εφαρμογές ενδέχεται να παρεμποδίσουν την απόδοση ή τη λειτουργία της συσκευής σας κατά τη λήψη μετάδοσης μέσω κινητού σχετικά με μια επείγουσα κατάσταση."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"αποστολή μηνυμάτων SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Επιτρέπει στην εφαρμογή των αποστολή μηνυμάτων SMS. Αυτό μπορεί να προκαλέσει μη αναμενόμενες χρεώσεις. Οι κακόβουλες εφαρμογές ενδέχεται να σας κοστίσουν χρήματα, αποστέλλοντας μηνύματα χωρίς την έγκρισή σας."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"αποστολή μηνυμάτων SMS χωρίς επιβεβαίωση"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Επιτρέπει στην εφαρμογή των αποστολή μηνυμάτων SMS. Αυτό μπορεί να προκαλέσει μη αναμενόμενες χρεώσεις. Οι κακόβουλες εφαρμογές ενδέχεται να σας κοστίσουν χρήματα, αποστέλλοντας μηνύματα χωρίς την έγκρισή σας."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"αποστολή συμβάντων απόκρισης μέσω μηνύματος"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Επιτρέπει στην εφαρμογή να στέλνει μηνύματα σε άλλες εφαρμογές ανταλλαγής μηνυμάτων για τη διαχείριση συμβάντων απόκρισης μέσω μηνύματος για εισερχόμενες κλήσεις."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"ανάγνωση των μηνυμάτων κειμένου σας (SMS ή MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Επιτρέπει στην εφαρμογή την ανάγνωση μηνυμάτων SMS που είναι αποθηκευμένα στο tablet σας ή στην κάρτα σας SIM. Αυτό δίνει τη δυνατότητα στην εφαρμογή να διαβάζει όλα τα μηνύματα SMS, ανεξάρτητα από το περιεχόμενο ή το επίπεδο εμπιστευτικότητάς τους."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Επιτρέπει στην εφαρμογή την ανάγνωση μηνυμάτων SMS που είναι αποθηκευμένα στο τηλέφωνό σας ή στην κάρτα σας SIM. Αυτό δίνει τη δυνατότητα στην εφαρμογή να διαβάζει όλα τα μηνύματα SMS, ανεξάρτητα από το περιεχόμενο ή το επίπεδο εμπιστευτικότητάς τους."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"αίτημα εξερεύνησης με αφή"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Επιτρέπει στον κάτοχο να ζητήσει μια λειτουργία αλληλεπίδρασης κατά την οποία τα στοιχεία που αγγίζει ο χρήστης εκφωνούνται και είναι δυνατή η εξερεύνηση της διεπαφής χρήστη μέσω αφής."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"αίτημα βελτιωμένης προσβασιμότητας στον ιστό"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Επιτρέπει στον κάτοχο να ζητήσει την ενεργοποίηση βελτιώσεων προσβασιμότητας ιστού. Για παράδειγμα, εγκατάσταση σεναρίων από την Google προκειμένου το περιεχόμενο των εφαρμογών να είναι πιο προσβάσιμο."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"δέσμευση σε υπηρεσία ανταλλαγής μηνυμάτων"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Επιτρέπει στον κάτοχο τη σύνδεση με τη διεπαφή ανωτέρου επιπέδου μιας υπηρεσίας ανταλλαγής μηνυμάτων (π.χ. SpellCheckerService). Δεν είναι απαραίτητο για κανονικές εφαρμογές."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"δέσμευση σε υπηρεσία VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Επιτρέπει στην εφαρμογή τη διαχείριση των πολιτικών δικτύου και τον ορισμό κανόνων για ορισμένες εφαρμογές."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"τροποποίηση υπολογισμού χρήσης δικτύου"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Επιτρέπει στην εφαρμογή την τροποποίηση του τρόπου υπολογισμού της χρήσης δικτύου έναντι των εφαρμογών. Δεν προορίζεται για χρήση από συνήθεις εφαρμογές."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Ορισμός κανόνων κωδικού πρόσβασης"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Έλεγχος του μεγέθους και των χαρακτήρων που επιτρέπονται στους κωδικούς πρόσβασης ξεκλειδώματος οθόνης."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Παρακολούθηση προσπαθειών ξεκλειδώματος οθόνης"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 6bf151a..ec2a60e 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Allows the app to read mobile broadcast messages received by your device. Cell broadcast alerts are delivered in some locations to warn you of emergency situations. Malicious apps may interfere with the performance or operation of your device when an emergency mobile broadcast is received."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"send SMS messages"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Allows the app to send SMS messages. This may result in unexpected charges. Malicious apps may cost you money by sending messages without your confirmation."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"send SMS messages with no confirmation"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Allows the app to send SMS messages. This may result in unexpected charges. Malicious apps may cost you money by sending messages without your confirmation."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"send respond-via-message events"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Allows the app to send requests to other messaging apps to handle respond-via-message events for incoming calls."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"read your text messages (SMS or MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Allows the app to read SMS messages stored on your tablet or SIM card. This allows the app to read all SMS messages, regardless of content or confidentiality."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Allows the app to read SMS messages stored on your phone or SIM card. This allows the app to read all SMS messages, regardless of content or confidentiality."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"request explore by touch"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Allows the hoder to request an interaction mode in which touched items are spoken aloud and the UI can be explored via gestures."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"request enhanced web accessibility"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Allows the hoder to request enabling of web accessibility enhancements. For example, installing scripts to make app content more accessible."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"bind to a text service"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Allows the holder to bind to the top-level interface of a text service (e.g. SpellCheckerService). Should never be needed for normal applications."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"bind to a VPN service"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Allows the app to manage network policies and define app-specific rules."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modify network usage accounting"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Allows the app to modify how network usage is accounted against apps. Not for use by normal apps."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Set password rules"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Control the length and the characters allowed in screen-unlock passwords."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Monitor screen-unlock attempts"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 87b1c24..c6be92d 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permite a la aplicación leer los mensajes de difusión móvil que recibe tu dispositivo. En algunas ubicaciones, las alertas de difusión móvil se envían para informar situaciones de emergencia. Las aplicaciones maliciosas pueden afectar el rendimiento o funcionamiento de tu dispositivo cuando se recibe un un mensaje de difusión móvil de emergencia."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"enviar mensajes SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Permite que la aplicación envíe mensajes SMS, lo que puede generar cargos inesperados. Las aplicaciones malintencionadas pueden causarte gastos imprevistos al enviar mensajes sin tu confirmación."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"Enviar mensajes SMS sin confirmación"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Permite que la aplicación envíe mensajes SMS, lo que puede generar cargos inesperados. Las aplicaciones malintencionadas pueden causarte gastos imprevistos al enviar mensajes sin tu confirmación."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"enviar eventos de respuesta por mensaje"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Permite que la aplicación envíe solicitudes a otras aplicaciones de mensajería para administrar eventos de respuesta por mensaje para las llamadas entrantes."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"leer tus mensajes de texto (SMS o MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Permite que la aplicación consulte los mensajes SMS almacenados en la tableta o en la tarjeta SIM. La aplicación puede utilizar este permiso para leer todos los mensajes SMS, independientemente de cuál sea su contenido o su nivel de confidencialidad."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Permite que la aplicación consulte los mensajes SMS almacenados en el dispositivo o en la tarjeta SIM. La aplicación puede utilizar este permiso para leer todos los mensajes SMS, independientemente de cuál sea su contenido o su nivel de confidencialidad."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"solicitar exploración táctil"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Le permite al titular solicitar un modo de interacción en el cual los elementos tocados se pronuncian en voz alta y la IU se puede explorar a través de gestos."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"solicitar accesibilidad mejorada de la Web"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Le permite al titular solicitar la habilitación de las mejoras en la accesibilidad de la Web. Por ejemplo, instalar las secuencias de comandos de Google para hacer el contenido de la aplicación más accesible."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"vincular a un servicio de texto"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Permite al titular vincularse a la interfaz de nivel superior de un servicio de texto (p. ej., SpellCheckerService). Las aplicaciones normales no deberían necesitar este permiso."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"vincular con un servicio de VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Permite que la aplicación administre las políticas de red y defina reglas específicas de la aplicación."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"Modificar la administración del uso de redes"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Permite que la aplicación modifique cómo se registra el uso de red en relación con las aplicaciones. Las aplicaciones normales no deben usar este permiso."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Establecer reglas de contraseña"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Controlar la longitud y los caracteres permitidos en las contraseñas para desbloquear la pantalla"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Supervisa los intentos para desbloquear la pantalla"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 09ccddd3..6c0761c 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permite que la aplicación lea mensajes de difusión móvil que haya recibido el dispositivo. Las alertas de difusión móvil se envían en algunas ubicaciones para avisar de situaciones de emergencia. Es posible que las aplicaciones malintencionadas interfieran en el rendimiento o en el funcionamiento del dispositivo si se recibe una alerta de difusión móvil de emergencia."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"enviar mensajes SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Permite que la aplicación envíe mensajes SMS, lo que puede generar cargos inesperados. Las aplicaciones malintencionadas pueden causarte gastos imprevistos al enviar mensajes sin tu confirmación."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"enviar mensajes SMS sin confirmación"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Permite que la aplicación envíe mensajes SMS, lo que puede generar cargos inesperados. Las aplicaciones malintencionadas pueden causarte gastos imprevistos al enviar mensajes sin tu confirmación."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"enviar eventos de respuesta mediante mensaje"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Permite que la aplicación envíe solicitudes a otras aplicaciones de mensajería para procesar eventos de respuesta mediante mensaje para llamadas entrantes."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"leer tus mensajes de texto (SMS o MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Permite que la aplicación lea mensajes SMS almacenados en el tablet o en la tarjeta SIM. La aplicación puede utilizar este permiso para leer todos los mensajes SMS, independientemente de cuál sea su contenido o su nivel de confidencialidad."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Permite que la aplicación lea mensajes SMS almacenados en el teléfono o en la tarjeta SIM. La aplicación puede utilizar este permiso para leer todos los mensajes SMS, independientemente de cuál sea su contenido o su nivel de confidencialidad."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"Solicitar exploración por tacto"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Permite al titular solicitar un modo de interacción en el que los elementos que se toquen se reproduzcan en voz alta y la interfaz de usuario se pueda explorar mediante gestos."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"Solicitar accesibilidad web mejorada"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Permite que el titular solicite que se habiliten mejoras de accesibilidad web. Por ejemplo, instalar secuencias de comandos de Google para que el contenido de la aplicación sea más accesible."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"enlazar con un servicio de texto"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Permite enlazar con la interfaz de nivel superior de un servicio de texto (por ejemplo, SpellCheckerService). Las aplicaciones normales no deberían necesitar este permiso."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"enlazar con un servicio VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Permite que la aplicación administre políticas de red y defina reglas específicas de la aplicación."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modificar cálculo de uso de red"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Permite que la aplicación modifique cómo se registra el uso de red en relación con las aplicaciones. Las aplicaciones normales no deben usar este permiso."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Establecimiento de reglas de contraseña"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Controlar la longitud y los caracteres permitidos en las contraseñas de bloqueo de pantalla"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Control de intentos de bloqueo de pantalla"</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 128f261..26482bd 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Võimaldab rakendusel lugeda seadme vastu võetud mobiilsidesõnumeid. Mobiilsidemärguandeid edastatakse mõnes asukohas eriolukorrast teavitamiseks. Pahatahtlikud rakendused võivad segada seadme toimivust või tööd eriolukorra sõnumi vastuvõtmisel."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"saada SMS-sõnumeid"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Võimaldab rakendusel saata SMS-sõnumeid. See võib kaasa tuua ootamatuid tasusid. Pahatahtlikud rakendused võivad teile tekitada kulusid, saates sõnumeid teie kinnituseta."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"lühisõnumite saatmine ilma kinnituseta"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Võimaldab rakendusel saata SMS-sõnumeid. See võib kaasa tuua ootamatuid tasusid. Pahatahtlikud rakendused võivad teile tekitada kulusid, saates sõnumeid teie kinnituseta."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"sõnumiga vastamise sündmuste saatmine"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Lubab rakendusel saata taotlusi teistele sõnumiside rakendustele, et käsitleda sissetulevate kõnedele sõnumiga vastamise sündmusi."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"lugege oma tekstisõnumeid (SMS või MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Võimaldab rakendusel lugeda tahvelarvutisse või SIM-kaardile salvestatud SMS-sõnumeid. See võimaldab rakendusel lugeda kõiki SMS-sõnumeid sisust või konfidentsiaalsusest hoolimata."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Võimaldab rakendusel lugeda telefoni või SIM-kaardile salvestatud SMS-sõnumeid. See võimaldab rakendusel lugeda kõiki SMS-sõnumeid sisust või konfidentsiaalsusest hoolimata."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"puudutusega uurimise taotlus"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Võimaldab taotleda suhtlusrežiimi, milles puudutatud üksused valjusti välja öeldakse ja kus kasutajaliidest saab kasutada liigutuste abil."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"täiustatud veebijuurdepääsu taotlus"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Võimaldab taotleda veebijuurdepääsu täiustuste lubamist. Näiteks installida skripte, mis hõlbustavad juurdepääsu rakenduse sisule."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"tekstiteenusega sidumine"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Võimaldab omanikul siduda tekstiteenuse (nt SpellCheckerService) ülataseme liidesega. Tavarakenduste puhul ei peaks seda kunagi vaja minema."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"seo VPN-teenusega"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Võimaldab rakendusel hallata võrgueeskirju ja määratleda rakendusespetsiifilisi reegleid."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"võrgukasutuse arvestamise muutmine"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Võimaldab rakendusel muuta võrgukasutuse loendamist rakenduste suhtes. Mitte kasutada tavarakenduste puhul."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Parooli reeglite määramine"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontrollige ekraaniluku avamise paroolide pikkust ja tähemärke."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Ekraani avamiskatsed"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 70150c1..5e8ac2b 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"به برنامه اجازه می‎دهد پیام‌های پخش سلولی دستگاه شما را بخواند. هشدارهای پخش سلولی در برخی از موقعیت‌های مکانی تحویل داده می‎شوند تا موقعیت‌های اضطراری را به شما اعلام کنند. وقتی پخش سلولی دریافت می‎شود، ممکن است برنامه‎های مخرب در عملکرد یا کارکرد دستگاه شما اختلال ایجاد کنند."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"ارسال پیامک ها"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"به برنامه اجازه می‌دهد پیامک‌ها را ارسال کند. این باعث ایجاد هزینه‌های پیش‌بینی نشده می‌شود. برنامه‌های مخرب ممکن است با ارسال پیام بدون تأیید شما هزینه‌هایی را برای شما ایجاد کنند."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"ارسال پیامک بدون تأیید"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"به برنامه اجازه می‌دهد پیامک‌ها را ارسال کند. این باعث ایجاد هزینه‌های پیش‌بینی نشده می‌شود. برنامه‌های مخرب ممکن است با ارسال پیام بدون تأیید شما هزینه‌هایی را برای شما ایجاد کنند."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"ارسال رویدادهای «پاسخ‌ از طریق پیام»"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"به برنامه اجازه می‌دهد درخواست‌ها را برای دیگر برنامه‌های پیام‌رسانی بفرستد تا به رویدادهای «پاسخ‌ از طریق پیام» برای تماس‌های دریافتی رسیدگی کند."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"خواندن پیام‌های نوشتاری شما (پیامک یا MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"به برنامه اجازه می‌دهد پیامک‌های ذخیره شده در رایانهٔ لوحی یا سیم کارت شما را بخواند. این ویژگی به برنامه امکان می‌دهد همه پیامک‌ها را صرفنظر از محتوا یا محرمانه بودن آن‌ها بخواند."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"به برنامه اجازه می‌دهد پیامک‌های ذخیره شده در تلفن یا سیم کارت شما را بخواند. این ویژگی به برنامه امکان می‌دهد همه پیامک‌ها را صرفنظر از محتوا یا محرمانه بودن آن‌ها بخواند."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"درخواست کاوش با لمس"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"به دارنده اجازه می‌دهد یک حالت تعاملی را درخواست کند که در این حالت موارد لمس شده به صدای بلند بیان می‌شوند و رابط کاربری از طریق حرکات اشاره قابل کاوش است."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"درخواست افزایش دسترسی به وب"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"به دارنده اجازه می‌دهد فعال کردن افزایش دسترسی به وب را درخواست کند، برای مثال، نصب اسکریپت‌ها، تا محتوای برنامه بیشتر در دسترس باشد."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"اتصال به یک سرویس متنی"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"به دارنده اجازه می‌دهد خود را به یک رابط سطح بالای خدمات متنی مرتبط کند (برای مثال SpellCheckerService). هرگز برای برنامه‌های عادی لازم نیست."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"اتصال به یک سرویس VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"به برنامه اجازه می‎دهد تا خط مشی‎های شبکه را مدیریت کند و قوانین خاص برنامه را تعیین کند."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"اصلاح محاسبه استفاده از شبکه"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"به برنامه اجازه می‎دهد تا نحوه محاسبه کاربرد شبکه در برنامه را تغییر دهد. برای استفاده برنامه‎های عادی نیست."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"تنظیم قوانین رمز ورود"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"طول و نویسه‎های مجاز در گذرواژه‌های بازکردن قفل صفحه را کنترل کنید."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"نمایش تلاش‌های قفل گشایی صفحه"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 6c37941..43cd8ab 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Antaa sovelluksen lukea laitteesi vastaanottamia tiedotteita. Tiedotteiden avulla ilmoitetaan hätätilanteista joissakin paikoissa. Haitalliset sovellukset voivat häiritä laitteen toimintaa laitteen vastaanottaessa hätätiedotteen."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"lähetä tekstiviestejä"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Antaa sovelluksen lähettää tekstiviestejä. Tästä voi aiheutua odottamattomia kuluja. Haitalliset sovellukset voivat aiheuttaa kuluja lähettämällä viestejä ilman lupaasi."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"lähettää tekstiviestejä ilman vahvistusta"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Antaa sovelluksen lähettää tekstiviestejä. Tästä voi aiheutua odottamattomia kuluja. Haitalliset sovellukset voivat aiheuttaa kuluja lähettämällä viestejä ilman lupaasi."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"lähetä vastaa viestillä -tapahtumia"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Antaa sovelluksen lähettää muille viestisovelluksille pyyntöjä käsitellä saapuvien puheluiden vastaa viestillä -tapahtumia."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"lue tekstiviestejä (teksti tai multimedia)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Antaa sovelluksen lukea tablet-laitteeseen tai SIM-kortille tallennettuja tekstiviestejä. Sovellus voi lukea kaikki tekstiviestit huolimatta niiden arkaluonteisuudesta."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Antaa sovelluksen lukea puhelimeen tai SIM-kortille tallennettuja tekstiviestejä. Sovellus voi lukea kaikki tekstiviestit huolimatta niiden arkaluonteisuudesta."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"pyydä kosketuksella tutkimisen käyttöönottoa"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Antaa luvan haltijan pyytää käyttöön vuorovaikutustilaa, jossa kosketettujen kohteiden nimet sanotaan ääneen ja käyttöliittymää voi tutkia eleiden avulla."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"pyydä parannettua verkon esteettömyyttä"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Antaa luvan haltijan pyytää verkon esteettömyysparannuksien käyttöönottoa. Sovellus voi esimerkiksi pyytää Googlen koodikatkelmien asentamista sovelluksen sisällön esteettömyyden parantamiseksi."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"tekstipalveluun sitoutuminen"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Antaa sovelluksen sitoutua tekstipalvelun (kuten SpellCheckerServicen) ylätason liittymään. Ei tavallisten sovellusten käyttöön."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"sitoudu VPN-palveluun"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Sallii sovelluksen hallinnoida verkkokäytäntöjä ja määritellä sovelluskohtaisia sääntöjä."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"verkon käytön seurannan muokkaaminen"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Antaa sovelluksen muokata, miten sovellusten verkonkäyttöä lasketaan. Ei tavallisten sovellusten käyttöön."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Aseta salasanasäännöt"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Hallinnoi ruudun lukituksenpoistosalasanoissa sallittuja merkkejä ja salasanan pituutta."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Tarkkaile ruudun lukituksen poistoyrityksiä"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 6346632..b5d2d2b 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permet à l\'application de lire les messages que votre appareil reçoit via un canal de diffusion cellulaire. Dans certaines zones géographiques, des alertes vous sont envoyées afin de vous prévenir en cas de situation d\'urgence. Les applications malveillantes peuvent venir perturber les performances ou le fonctionnement de votre appareil lorsqu\'un message est reçu via un canal de diffusion cellulaire."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"Envoi de messages SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Permet à l\'application d\'envoyer des messages SMS. Cette autorisation peut entraîner des frais inattendus. Les applications malveillantes peuvent générer des frais en envoyant des messages sans votre consentement."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"envoyer des SMS sans confirmation"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Permet à l\'application d\'envoyer des messages SMS. Cette autorisation peut entraîner des frais inattendus. Les applications malveillantes peuvent générer des frais en envoyant des messages sans votre consentement."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"envoyer des réponses par message"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Permet à l\'application d\'envoyer à d\'autres applications de SMS/MMS des demandes pour gérer les réponses par message pour les appels entrants."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"voir les messages texte (SMS ou MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Permet à l\'application de lire les SMS stockés sur votre tablette ou sur la carte SIM. Cette autorisation lui permet de lire tous les SMS, indépendamment de leur contenu ou de leur caractère confidentiel."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Permet à l\'application de lire les SMS stockés sur votre téléphone ou sur la carte SIM. Cette autorisation lui permet de lire tous les SMS, indépendamment de leur contenu ou de leur caractère confidentiel."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"demander l\'activation de la fonctionnalité \"Explorer au toucher\""</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Permet à l\'application de demander l\'activation d\'un mode d\'interaction dans lequel les éléments sur lesquels l\'utilisateur appuie sont énoncés à voix haute et dans lequel l\'utilisateur peut explorer l\'interface à l\'aide de gestes."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"demander des améliorations de la fonctionnalité d\'accessibilité Web"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Permet à l\'application de demander l\'activation d\'améliorations de la fonctionnalité d\'accessibilité Web, telles que l\'installation de scripts pour rendre le contenu des applications plus accessible."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"associer à un service de texte"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Permet à l\'application de s\'associer à l\'interface de haut niveau d\'un service de texte (par exemple, SpellCheckerService). Les applications standards ne doivent jamais avoir recours à cette fonctionnalité."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"associer à un service VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Permet à l\'application de gérer les stratégies du réseau et de définir celles qui sont spécifiques à l\'application."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modifier le système de comptabilisation de l\'utilisation du réseau"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Permet à l\'application de modifier l\'utilisation du réseau par les autres applications. Les applications standards ne doivent pas utiliser cette fonctionnalité."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Définir les règles du mot de passe"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Choisir le nombre et le type de caractères autorisés dans les mots de passe de déverrouillage de l\'écran"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Gérer les tentatives de déverrouillage de l\'écran"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 61ec7a1..8175fa4 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"एप्‍लिकेशन को आपके उपकरण द्वारा प्राप्त सेल प्रसारण संदेशों को पढ़ने देता है. कुछ स्‍थानों पर आपको आपातकालीन स्‍थितियों की चेतावनी देने के लिए सेल प्रसारण अलर्ट वितरित किए जाते हैं. आपातकालीन सेल प्रसारण प्राप्त होने पर दुर्भावनापूर्ण एप्‍लिकेशन आपके उपकरण के निष्‍पादन या संचालन में हस्‍तक्षेप कर सकते हैं."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"SMS संदेश भेजें"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"एप्लिकेशन को SMS संदेशों को भेजने देता है. इसके परिणामस्वरूप अप्रत्‍याशित शुल्‍क लागू हो सकते हैं. दुर्भावनापूर्ण एप्लिकेशन आपकी पुष्टि के बिना संदेश भेजकर आपका धन व्‍यय कर सकते हैं."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"बिना कि‍सी पुष्टि के SMS संदेश भेजें"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"एप्लिकेशन को SMS संदेशों को भेजने देता है. इसके परिणामस्वरूप अप्रत्‍याशित शुल्‍क लागू हो सकते हैं. दुर्भावनापूर्ण एप्लिकेशन आपकी पुष्टि के बिना संदेश भेजकर आपका धन व्‍यय कर सकते हैं."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"संदेश-द्वारा-जवाब भेजें ईवेंट"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"इनकमिंग कॉल के संदेश-द्वारा-जवाब देने के ईवेंट प्रबंधित करने के लिए, एप्लिकेशन को अन्य संदेश सेवा एप्लिकेशन को अनुरोध भेजने देती है."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"अपने पाठ संदेश (SMS या MMS) पढ़ें"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"एप्लिकेशन को आपके टेबलेट या SIM कार्ड में संग्रहीत SMS संदेश पढ़ने देता है. इससे सामग्री या गोपनीयता पर ध्यान दिए बिना, एप्लिकेशन सभी SMS संदेश पढ़ सकता है."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"एप्लिकेशन को आपके फ़ोन या SIM कार्ड में संग्रहीत SMS संदेश पढ़ने देता है. इससे सामग्री या गोपनीयता पर ध्यान दिए बिना, एप्लिकेशन सभी SMS संदेश पढ़ सकता है."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"स्पर्श द्वारा एक्सप्लोर करें का अनुरोध करें"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"धारक को ऐसे सहभागी मोड का अनुरोध करने देती है जिसमें स्पर्श किए गए आइटम ज़ोर से बोले जाते हैं और UI को जेस्चर के द्वारा एक्सप्लोर किया जा सकता है."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"उन्नत वेब पहुंच-योग्यता का अनुरोध करें"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"धारक को वेब पहुंच-योग्यता एन्हांसमेंट सक्षम करने का अनुरोध करने देती है. उदाहरण के लिए, एप्लिकेशन सामग्री को अधिक पहुंच-योग्य बनाने के लिए स्क्रिप्ट इंस्टॉल करना."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"किसी पाठ सेवा पर बने रहें"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"धारक को किसी पाठ सेवा (उदा. SpellCheckerService) के शीर्ष-स्‍तर इंटरफ़ेस पर आबद्ध होने देता है. सामान्‍य एप्‍लिकेशन के लिए कभी भी आवश्‍यक नहीं होना चाहिए."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"किसी VPN सेवा से आबद्ध करें"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"एप्‍लिकेशन को नेटवर्क नीतियां प्रबंधित करने और एप्‍लिकेशन-विशिष्‍ट नियमों को परिभाषित करने देता है."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"नेटवर्क उपयोग हिसाब बदलें"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"एप्लिकेशन को यह संशोधित करने देता है कि एप्‍लिकेशन की तुलना में नेटवर्क उपयोग का मूल्यांकन कैसे किया जाता है. सामान्‍य एप्‍लिकेशन द्वारा उपयोग करने के लिए नहीं."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"पासवर्ड नियम सेट करें"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"स्‍क्रीन-अनलॉक पासवर्ड में अनुमति प्राप्त लंबाई और वर्णों को नियंत्रित करें."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"स्‍क्रीन-अनलॉक के प्रयासों पर निगरानी रखें"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 58980a7..4773c941 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Omogućuje aplikaciji čitanje poruka emitiranih unutar mobilne mreže koje prima vaš uređaj. Upozorenja koja se emitiraju na području mobilne mreže dostavljaju se na nekim lokacijama kako bi upozorila korisnike na hitne situacije. Zlonamjerne aplikacije mogu ometati izvršavanje ili rad vašeg uređaja kada stigne hitno upozorenje koje se emitira unutar mobilne mreže."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"slanje SMS poruka"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Aplikaciji omogućuje slanje SMS poruka. To može dovesti do neočekivanih troškova. Zlonamjerne aplikacije mogu vam uzrokovati dodatne troškove slanjem poruka bez vašeg odobrenja."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"slanje SMS poruka bez potvrde"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Aplikaciji omogućuje slanje SMS poruka. To može dovesti do neočekivanih troškova. Zlonamjerne aplikacije mogu vam uzrokovati dodatne troškove slanjem poruka bez vašeg odobrenja."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"slanje događaja \"odgovaranja porukom\""</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Omogućuje aplikaciji slanje zahtijeva drugim aplikacijama za primanje i slanje poruka radi obrade događaja \"odgovaranja porukom\" za dolazne pozive."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"čitanje tekstnih poruka (SMS ili MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Aplikaciji omogućuje čitanje SMS poruka pohranjenih na tabletnom računalu ili SIM kartici. To aplikaciji omogućuje čitanje svih SMS poruka, neovisno o sadržaju ili povjerljivosti."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Aplikaciji omogućuje čitanje SMS poruka pohranjenih na telefonu ili SIM kartici. To aplikaciji omogućuje čitanje svih SMS poruka, neovisno o sadržaju ili povjerljivosti."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"zahtijevaj istraživanje dodirom"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Omogućuje korisniku zahtijevanje načina interakcije u kojem se dodirnute stavke izgovaraju naglas, a korisničko sučelje može se istraživati pokretima."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"zahtijevaj poboljšanu web-dostupnost"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Omogućuje korisniku zahtijevanje omogućivanja poboljšanja za dostupnost na webu. Na primjer, instaliranje skripti kako bi sadržaj aplikacije bio pristupačniji."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"vezanje na tekstualnu uslugu"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Omogućuje korisniku povezivanje s najvišom razinom sučelja tekstualne usluge (npr. SpellCheckerService). Ne bi smjelo biti potrebno za normalne aplikacije."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"vezanje na VPN uslugu"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Aplikaciji omogućuje upravljanje mrežnim pravilima i određivanje pravila za aplikacije."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"izmjena evidencije mrežne upotrebe"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Omogućuje aplikaciji izmjenu načina upotrebe mreže u odnosu na aplikacije. Nije namijenjeno uobičajenim aplikacijama."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Postavi pravila zaporke"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Upravljajte duljinom zaporki za otključavanje zaslona i dopuštenim znakovima u tim zaporkama."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Nadgledaj pokušaje otključavanja zaslona"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 08db6d4..a6ea0f6 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Lehetővé teszi az alkalmazás számára az eszközre érkező cellán belüli üzenetek olvasását. Bizonyos helyeken figyelmeztető üzeneteket kaphat a cellán belül a vészhelyzetekről. A rosszindulatú alkalmazások befolyásolhatják az eszköz  teljesítményét vagy működését vészhelyzeti cellaüzenet érkezésekor."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"SMS-ek küldése"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Lehetővé teszi az alkalmazás számára, hogy SMS-eket küldjön. Ennek eredményeként váratlan terhelésekkel találkozhat. A rosszindulatú alkalmazások az Ön jóváhagyása nélkül küldhetnek üzeneteket, így költségek merülhetnek fel."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"SMS üzenetek küldése megerősítés nélkül"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Lehetővé teszi az alkalmazás számára, hogy SMS-eket küldjön. Ennek eredményeként váratlan terhelésekkel találkozhat. A rosszindulatú alkalmazások az Ön jóváhagyása nélkül küldhetnek üzeneteket, így költségek merülhetnek fel."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"válaszküldés üzenetben"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Lehetővé teszi az alkalmazás számára, hogy kérelmeket küldjön más üzenetküldő alkalmazásoknak, azért hogy kezelje az üzenetben történő válaszküldést a bejövő hívások esetében."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"szöveges üzenetek (SMS vagy MMS) olvasása"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Lehetővé teszi az alkalmazás számára, hogy hozzáférjen a táblagépen vagy SIM kártyán tárolt SMS-ekhez. Így az alkalmazás hozzáférhet az összes SMS-hez, azok tartalmától és titkos jellegétől függetlenül."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Lehetővé teszi az alkalmazás számára, hogy hozzáférjen a telefonon vagy SIM kártyán tárolt SMS-ekhez. Így az alkalmazás hozzáférhet az összes SMS-hez, azok tartalmától és titkos jellegétől függetlenül."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"felfedezés érintéssel kérése"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Lehetővé teszi a felhasználó számára egy olyan használati mód engedélyezését, amelyben az eszköz kimondja, hogy milyen elemek lettek megérintve, a felhasználói felület pedig felfedezhető kézmozdulatok révén."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"bővített internetes kisegítő lehetőségek kérése"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Lehetővé teszi a felhasználó számára az internetes kisegítő lehetőségek bővítését. Telepíthet például szkripteket, hogy még inkább elérhetővé tegye az alkalmazás tartalmát."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"csatlakozás szövegszolgáltatáshoz"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Lehetővé teszi, hogy a tulajdonos egy szöveges szolgáltatás felső szintjéhez kapcsolódjon (pl. SpellCheckerService). A normál alkalmazásoknak erre soha nincs szüksége."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"csatlakozás egy VPN-szolgáltatáshoz"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Lehetővé teszi az alkalmazás számára, hogy kezelje a hálózati irányelveket és meghatározza az alkalmazásspecifikus szabályokat."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"hálózathasználat elszámolásának módosítása"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Lehetővé teszi az alkalmazás számára annak módosítását, hogy a hálózathasználatot hogyan számolják el az alkalmazások esetében. Normál alkalmazások nem használhatják."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Jelszavakkal kapcsolatos szabályok beállítása"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"A képernyőzár-feloldási jelszavakban engedélyezett karakterek és hosszúság vezérlése."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Képernyőzár-feloldási kísérletek figyelése"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 8386aa0..72199a1 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Mengizinkan aplikasi membaca pesan siaran seluler yang diterima perangkat Anda. Lansiran siaran seluler dikirimkan di beberapa lokasi untuk memperingatkan Anda tentang situasi darurat. Aplikasi berbahaya dapat mengganggu kinerja atau operasi perangkat Anda saat siaran seluler darurat diterima."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"kirim pesan SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Memungkinkan aplikasi mengirim pesan SMS. Izin ini dapat mengakibatkan biaya tak terduga. Aplikasi berbahaya dapat membebankan biaya kepada Anda dengan mengirim pesan tanpa konfirmasi dari Anda."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"mengirim SMS tanpa konfirmasi"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Memungkinkan aplikasi mengirim pesan SMS. Izin ini dapat mengakibatkan biaya tak terduga. Aplikasi berbahaya dapat membebankan biaya kepada Anda dengan mengirim pesan tanpa konfirmasi dari Anda."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"kirim acara tanggapi-lewat-pesan"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Mengizinkan aplikasi mengirimkan permintaan ke aplikasi perpesanan lainnya guna menangani acara tanggapi-lewat-pesan untuk panggilan masuk."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"membaca pesan teks (SMS atau MMS) Anda"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Memungkinkan aplikasi membaca pesan SMS yang tersimpan di tablet atau kartu SIM Anda. Izin ini memungkinkan aplikasi membaca semua pesan SMS, terlepas dari konten atau kerahasiaan."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Memungkinkan aplikasi membaca pesan SMS yang tersimpan di ponsel atau kartu SIM Anda. Izin ini memungkinkan aplikasi membaca semua pesan SMS, terlepas dari konten atau kerahasiaan."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"meminta penjelajahan dengan sentuhan"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Memungkinkan pemegang meminta mode interaksi yang mana item yang disentuh diucapkan dengan keras dan UI dapat dijelajahi dengan isyarat."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"meminta aksesibilitas web yang disempurnakan"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Memungkinkan pemegang meminta pengaktifan penyempurnaan aksesibilitas web. Contohnya, memasang skrip agar konten aplikasi lebih mudah diakses."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"mengikat ke layanan SMS"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Mengizinkan pemegang mengikat antarmuka tingkat tinggi dari suatu layanan teks (mis. SpellCheckerService). Tidak pernah diperlukan oleh apl normal."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"mengikat ke layanan VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Mengizinkan apl mengelola kebijakan jaringan dan menentukan peraturan khusus apl."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"mengubah penghitungan penggunaan jaringan"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Mengizinkan apl memodifikasi cara penggunaan jaringan diperhitungkan terhadap apl. Tidak untuk digunakan oleh apl normal."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Setel aturan sandi"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontrol panjang dan karakter yang diizinkan dalam sandi pembuka layar."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Upaya pembukaan kunci layar monitor"</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 9621b97..1c95e73 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Consente all\'applicazione di leggere i messaggi cell broadcast ricevuti dal dispositivo. Gli avvisi cell broadcast vengono trasmessi in alcune località per avvertire di eventuali situazioni di emergenza. Le applicazioni dannose potrebbero interferire con il rendimento o con il funzionamento del dispositivo quando si riceve un messaggio cell broadcast di emergenza."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"invio SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Consente all\'applicazione di inviare messaggi SMS. Ciò potrebbe comportare costi imprevisti. Applicazioni dannose potrebbero generare dei costi inviando messaggi senza la tua conferma."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"invio di messaggi SMS senza conferma"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Consente all\'applicazione di inviare messaggi SMS. Ciò potrebbe comportare costi imprevisti. Applicazioni dannose potrebbero generare dei costi inviando messaggi senza la tua conferma."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"invio di eventi di risposta tramite messaggio"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Consente all\'app di inviare richieste ad altre app di messaggi per gestire eventi di risposta tramite messaggio per le chiamate in arrivo."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"lettura messaggi di testo personali (SMS o MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Consente all\'applicazione di leggere i messaggi SMS memorizzati sul tablet o sulla scheda SIM. Ciò consente all\'applicazione di leggere tutti i messaggi SMS, indipendentemente dai contenuti o dal livello di riservatezza."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Consente all\'applicazione di leggere i messaggi SMS memorizzati sul telefono o sulla scheda SIM. Ciò consente all\'applicazione di leggere tutti i messaggi SMS, indipendentemente dai contenuti o dal livello di riservatezza."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"richiesta di esplorazione al tocco"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Consente al titolare di richiedere una modalità di interazione con cui gli elementi toccati vengono descritti tramite output vocale e l\'interfaccia utente può essere esplorata tramite gesti."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"richiesta di accessibilità web migliorata"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Consente al titolare di richiedere l\'attivazione dei miglioramenti dell\'accessibilità web, ad esempio l\'installazione di script per rendere più accessibili i contenuti dell\'app."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"associazione a un servizio di testo"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Consente al titolare di collegarsi all\'interfaccia di primo livello di un servizio di testo (ad esempio SpellCheckerService). Non dovrebbe essere mai necessaria per le normali applicazioni."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"associazione a un servizio VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Consente all\'applicazione di gestire le norme di rete e definire le regole specifiche delle applicazioni."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modifica calcolo dell\'utilizzo della rete"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Consente all\'applicazione di modificare il calcolo dell\'utilizzo della rete tra le applicazioni. Da non usare per normali applicazioni."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Imposta regole password"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Controlla la lunghezza e i caratteri ammessi nelle password di sblocco dello schermo."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Monitora tentativi di sblocco dello schermo"</string>
@@ -1279,7 +1282,7 @@
     <string name="tethered_notification_message" msgid="6857031760103062982">"Tocca per configurare."</string>
     <string name="back_button_label" msgid="2300470004503343439">"Indietro"</string>
     <string name="next_button_label" msgid="1080555104677992408">"Avanti"</string>
-    <string name="skip_button_label" msgid="1275362299471631819">"Salta"</string>
+    <string name="skip_button_label" msgid="1275362299471631819">"Ignora"</string>
     <string name="throttle_warning_notification_title" msgid="4890894267454867276">"Utilizzo dati cell. elevato"</string>
     <string name="throttle_warning_notification_message" msgid="3340822228599337743">"Tocca per ulteriori informazioni sull\'utilizzo dei dati del cellulare."</string>
     <string name="throttled_notification_title" msgid="6269541897729781332">"Limite dati cell. superato"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 86f3ba0..d698a77 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"מאפשר ליישום לקרוא הודעות שידור סלולרי שהתקבלו במכשיר שלך. התראות שידור סלולרי נשלחות במקומות מסוימים על מנת להזהיר אותך מפני מצבי חירום. יישומים זדוניים עשויים להפריע לביצועים או לפעולה של המכשיר שלך כאשר מתקבל שידור חירום סלולרי."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"שלוח הודעות SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"מאפשר ליישום לשלוח הודעות SMS. הדבר עשוי לגרום לחיובים בלתי צפויים. יישומים זדוניים עלולים לגרום לעלויות על ידי שליחת הודעות ללא אישורך."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"שלח הודעות SMS ללא אישור"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"מאפשר ליישום לשלוח הודעות SMS. הדבר עשוי לגרום לחיובים בלתי צפויים. יישומים זדוניים עלולים לגרום לעלויות על ידי שליחת הודעות ללא אישורך."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"שליחת אירועי \'תגובה באמצעות הודעה\'"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"מאפשר ליישום לשלוח בקשות ליישומים אחרים של העברת הודעות כדי לטפל באירועי \'תגובה באמצעות הודעה\' עבור שיחות נכנסות."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"קריאת הודעות הטקסט שלך (SMS או MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"מאפשר ליישום לקרוא הודעות SMS המאוחסנות בטאבלט או בכרטיס ה-SIM. דבר זה מתיר ליישום לקרוא את כל הודעות ה-SMS, ללא התחשבות בתוכן או בסודיות."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"מאפשר ליישום לקרוא הודעות SMS המאוחסנות בטלפון או בכרטיס ה-SIM. דבר זה מתיר ליישום לקרוא את כל הודעות ה-SMS, ללא התחשבות בתוכן או בסודיות."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"בקשת גילוי באמצעות מגע"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"מאפשר לבעלים לבקש מצב אינטראקציה שבו נגיעה בפריטים מלווה בהשמעת התיאור שלהם ושניתן לחקור בו את ה-UI באמצעות מחוות."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"בקשת נגישות משופרת לאינטרנט"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"מאפשר לבעלים לבקש הפעלה של שיפורי נגישות לאינטרנט. לדוגמה, התקנת סקריפטים כדי להגביר את הנגישות של תוכן יישומים."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"הכפפה לשירות טקסט"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"מאפשר למשתמש ליצור איגוד לממשק הרמה העליונה של שירות טקסט (למשל, SpellCheckerService). הרשאה זו לעולם אינה נחוצה ליישומים רגילים."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"אגד לשירות VPN"</string>
@@ -618,6 +617,8 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"מאפשר ליישום לנהל מדיניות הרשת להגדיר כללים ספציפיים-ליישום."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"שנה ניהול חשבונות של שימוש ברשת"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"הרשאה זו מאפשרת ליישום לשנות את אופן החישוב של נתוני שימוש ברשת מול כל יישום. לא מיועד לשימוש ביישומים רגילים."</string>
+    <string name="permlab_accessNotifications" msgid="7673416487873432268">"גישה להתראות"</string>
+    <string name="permdesc_accessNotifications" msgid="458457742683431387">"מאפשר ליישום לאחזר, לבדוק ולמחוק התראות, כולל כאלה שפורסמו על ידי יישומים אחרים."</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"הגדר כללי סיסמה"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"שלוט באורך ובתווים המותרים בסיסמאות לביטול נעילת מסך."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"עקוב אחר ניסיונות לביטול נעילת מסך"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 63d3149..fb7ceb9 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -241,12 +241,12 @@
     <string name="permdesc_receiveMms" msgid="533019437263212260">"MMSメッセージの受信と処理をアプリに許可します。これにより、アプリが端末に届いたメッセージを表示することなく監視または削除できるようになります。"</string>
     <string name="permlab_receiveEmergencyBroadcast" msgid="1803477660846288089">"緊急放送の受信"</string>
     <string name="permdesc_receiveEmergencyBroadcast" msgid="848524070262431974">"緊急ブロードキャストメッセージの受信と処理をアプリに許可します。これはシステムアプリのみが利用できる権限です。"</string>
-    <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"エリアメールSMSの読み取り"</string>
-    <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"端末で受信したエリアメールSMSの読み取りをアプリに許可します。エリアメール警報は、緊急事態を警告する目的で一部の地域に配信されます。緊急エリアメールの受信時に、悪意のあるアプリによって端末の動作や処理が妨害される恐れがあります。"</string>
+    <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"緊急警報SMSの読み取り"</string>
+    <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"端末で受信した緊急警報SMSの読み取りをアプリに許可します。緊急警報は、緊急事態を警告する目的で一部の地域に配信されます。緊急警報の受信時に、悪意のあるアプリによって端末の動作や処理が妨害される恐れがあります。"</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"SMSメッセージの送信"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"SMSメッセージの送信をアプリに許可します。これにより、予期せぬ料金が発生する可能性があります。悪意のあるアプリが確認なしでメッセージを送信し、料金が発生する恐れがあります。"</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"確認せずにSMSメッセージを送信する"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"SMSメッセージの送信をアプリに許可します。これにより、予期せぬ料金が発生する可能性があります。悪意のあるアプリが確認なしでメッセージを送信し、料金が発生する恐れがあります。"</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"メッセージ応答イベントの送信"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"着信時にメッセージ応答イベントを処理するよう他のSMSアプリにリクエストを送信することをアプリに許可します。"</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"テキストメッセージ(SMSまたはMMS)の読み取り"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"タブレットまたはSIMカードに保存されているSMSメッセージの読み取りをアプリに許可します。これにより、すべてのSMSメッセージをコンテンツや機密性に関係なくアプリから読み取ることができるようになります。"</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"携帯端末またはSIMカードに保存されているSMSメッセージの読み取りをアプリに許可します。これにより、すべてのSMSメッセージをコンテンツや機密性に関係なくアプリから読み取ることができるようになります。"</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"タッチガイドのリクエスト"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"触れたアイテムが読み上げられ、ジェスチャーでユーザーインターフェースのガイドを利用できる操作モードをリクエストすることを所有者に許可します。"</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"ウェブアクセシビリティ拡張のリクエスト"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"ウェブアクセシビリティの拡張の有効化をリクエストすることを所有者に許可します。たとえば、アプリコンテンツのアクセシビリティをもっと向上させるためにスクリプトをインストールできます。"</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"テキストサービスにバインド"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"テキストサービス(SpellCheckerServiceなど)のトップレベルインターフェースにバインドすることを所有者に許可します。通常のアプリでは不要です。"</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"VPNサービスにバインド"</string>
@@ -618,6 +617,8 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"ネットワークポリシーを管理しアプリ固有のルールを定義することをアプリに許可します。"</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"ネットワークの課金の変更"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"アプリに対するネットワーク利用の計算方法を変更することをアプリに許可します。通常のアプリでは使用しません。"</string>
+    <string name="permlab_accessNotifications" msgid="7673416487873432268">"通知にアクセス"</string>
+    <string name="permdesc_accessNotifications" msgid="458457742683431387">"通知(他のアプリから投稿されたものも含む)を取得、調査、クリアすることをアプリに許可します。"</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"パスワードルールの設定"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"画面ロック解除パスワードの長さと使用できる文字を制御します。"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"画面ロック解除試行の監視"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 47bc354..333aaa9 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"앱이 기기가 수신한 셀 브로드캐스트 메시지를 읽을 수 있도록 합니다. 비상 상황임을 알리기 위해 일부 지역에서 셀 브로드캐스트 경고가 전달됩니다. 비상 셀 브로드캐스트를 수신할 때 악성 앱이 기기의 성능이나 작동을 방해할 수 있습니다."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"SMS 메시지 보내기"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"앱이 SMS 메시지를 보낼 수 있도록 허용합니다. 이 경우 예상치 못한 통화 요금이 부과될 수 있습니다. 이 경우 악성 앱이 사용자의 확인 없이 메시지를 전송해 요금이 부과될 수 있습니다."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"확인 없이 SMS 메시지 보내기"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"앱이 SMS 메시지를 보낼 수 있도록 허용합니다. 이 경우 예상치 못한 통화 요금이 부과될 수 있습니다. 이 경우 악성 앱이 사용자의 확인 없이 메시지를 전송해 요금이 부과될 수 있습니다."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"메시지를 통한 응답 이벤트 보내기"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"앱에서 다른 메시징 앱에 요청을 보내어 수신 전화에 대해 메시지를 통한 응답 이벤트를 처리하도록 허용합니다."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"내 문자 메시지 읽기(SMS 또는 MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"앱이 태블릿 또는 SIM 카드에 저장된 SMS 메시지를 읽을 수 있도록 허용합니다. 이렇게 하면 앱이 콘텐츠 또는 비밀유지와 관계 없이 모든 SMS 메시지를 읽을 수 있습니다."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"앱이 휴대전화 또는 SIM 카드에 저장된 SMS 메시지를 읽을 수 있도록 허용합니다. 이렇게 하면 앱이 콘텐츠 또는 비밀유지와 관계 없이 모든 SMS 메시지를 읽을 수 있습니다."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"\'터치하여 탐색\' 요청"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"권한을 가진 프로그램이 터치한 항목을 소리내어 말하고 제스처로 UI를 탐색할 수 있는 상호작용 모드를 요청할 수 있도록 허용합니다."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"웹 접근성 개선 요청"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"권한을 가진 프로그램이 웹 접근성 개선을 요청할 수 있도록 허용합니다. 예를 들어 스크립트를 설치하여 앱 콘텐츠에 더 간편하게 액세스할 수 있습니다."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"텍스트 서비스 연결"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"권한을 가진 프로그램이 텍스트 서비스(예: SpellCheckerService)에 대한 최상위 인터페이스를 사용하도록 허용합니다. 일반 앱에는 필요하지 않습니다."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"VPN 서비스와 연결"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"앱이 네트워크 정책을 관리하고 앱별 규칙을 정의할 수 있도록 허용합니다."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"네트워크 사용량 계산 수정"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"애플리케이션이 애플리케이션의 네트워크 사용량을 계산하는 방식을 수정할 수 있도록 허용합니다. 일반 애플리케이션에서는 사용하지 않습니다."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"비밀번호 규칙 설정"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"화면 잠금해제 비밀번호에 허용되는 길이 및 문자 수를 제어합니다."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"화면 잠금해제 시도 모니터링"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index c14ae05..a3460d16 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Programai leidžiama skaityti mobiliuoju transliuojamus pranešimus, gaunamus jūsų įrenginyje. Mobiliuoju transliuojami įspėjimai pristatomi kai kuriose vietose, kad įspėtų apie kritines situacijas. Kai gaunamas  mobiliuoju transliuojamas pranešimas apie kritinę situaciją, kenkėjiškos programos gali trukdyti įrenginiui veikti ar jį naudoti."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"siųsti SMS pranešimus"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Leidžiama programai siųsti SMS pranešimus. Dėl to gali atsirasti nenumatytų apmokestinimų. Kenkėjiškos programos gali siųsti mokamus pranešimus be jūsų patvirtinimo."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"siųsti SMS pranešimus be patvirtinimo"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Leidžiama programai siųsti SMS pranešimus. Dėl to gali atsirasti nenumatytų apmokestinimų. Kenkėjiškos programos gali siųsti mokamus pranešimus be jūsų patvirtinimo."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"siųsti atsakymų pranešimu įvykius"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Programai leidžiama siųsti užklausas į kitas susirašinėjimo pranešimais programas, kad būtų galima apdoroti atsakymų pranešimu įvykius, susijusius su gaunamaisiais skambučiais."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"skaityti teksto pranešimus (SMS arba MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Leidžiama programai skaityti planšetiniame kompiuteryje ar SIM kortelėje saugomus SMS pranešimus. Taip programai leidžiama skaityti visus SMS pranešimus, neatsižvelgiant į turinį ar konfidencialumą."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Leidžiama programai skaityti telefone ar SIM kortelėje saugomus SMS pranešimus. Taip programai leidžiama skaityti visus SMS pranešimus, neatsižvelgiant į turinį ar konfidencialumą."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"pateikti užklausą dėl naršymo palietus"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Leidžiama pateikti užklausą dėl sąveikos režimo, kuriam veikiant garsiai pasakomi paliesti elementai ir palietimu galima tyrinėti naudotojo sąsają."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"pateikti užklausą dėl patobulintos prieigos prie žiniatinklio"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Leidžiama pateikti užklausą dėl žiniatinklio pritaikymo neįgaliesiems patobulinimų įgalinimo. Pavyzdžiui, pateikti užklausą dėl scenarijų diegimo, kad programos turinys būtų geriau pritaikytas neįgaliesiems."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"priskirti teksto paslaugą"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Leidžiama savininkui priskirti aukščiausio lygio teksto paslaugos (pvz., „SpellCheckerService“) sąsają. Įprastoms programoms to neturėtų prireikti."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"susaistyti su VPN paslauga"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Leidžiama programai valdyti tinklo politiką ir apibrėžti konkrečios programos taisykles."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"keisti tinklo naudojimo apskaitą"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Leidžiama programai keisti, kaip tinklas naudojamas, palyginti su programomis. Neskirta naudoti įprastoms programoms."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Nustatyti slaptažodžio taisykles"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Valdyti leidžiamą ekrano atrakinimo slaptažodžių ilgį ir leidžiamus naudoti simbolius."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Stebėti bandymus atrakinti ekraną"</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 6a10595..e92fa7d 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Ļauj lietotnei lasīt ierīcē saņemtos šūnu apraides ziņojumus. Šūnu apraides brīdinājumi tiek piegādāti dažās atrašanās vietās, lai brīdinātu jūs par ārkārtas situācijām. Ļaunprātīgas lietotnes var traucēt ierīces veiktspēju vai darbības, kad ir saņemts ārkārtas šūnas apraides ziņojums."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"sūtīt īsziņas"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Ļauj lietotnei sūtīt īsziņas. Tas var radīt neparedzētas izmaksas. Ļaunprātīgas lietotnes var radīt jums izmaksas, sūtot ziņojumus bez jūsu apstiprinājuma."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"īsziņu sūtīšana bez apstiprinājuma"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Ļauj lietotnei sūtīt īsziņas. Tas var radīt neparedzētas izmaksas. Ļaunprātīgas lietotnes var radīt jums izmaksas, sūtot ziņojumus bez jūsu apstiprinājuma."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"nosūtīt “atbildēt ziņojumā” notikumus"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Ļauj lietotnei nosūtīt pieprasījumus citām ziņojumapmaiņas lietotnēm par “atbildēt ziņojumā” notikumu apstrādi ienākošajiem zvaniem."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"lasīt ziņojumus (SMS vai MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Ļauj lietotnei lasīt planšetdatorā vai SIM kartē saglabātās īsziņas. Tas ļauj lietotnei lasīt visas īsziņas, neraugoties uz to saturu vai konfidencialitāti."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Ļauj lietotnei lasīt tālrunī vai SIM kartē saglabātās īsziņas. Tas ļauj lietotnei lasīt visas īsziņas, neraugoties uz to saturu vai konfidencialitāti."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"pieprasīt funkciju “Pārlūkot pieskaroties”"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Ļauj pieprasīt mijiedarbības režīmu. Izmantojot šo režīmu, vienumi, kuriem pieskaraties, tiek izrunāti skaļi, un lietotāja saskarni var pārlūkot ar žestiem."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"pieprasīt uzlabotu tīmekļa pieejamību"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Ļauj pieprasīt tīmekļa pieejamības uzlabojumu iespējošanu, piemēram, ļauj instalēt skriptus, lai padarītu lietotnes saturu pieejamāku."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"saistīt ar īsziņu pakalpojumu"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Ļauj īpašniekam veikt saistīšanu ar īsziņu pakalpojuma augstākā līmeņa saskarni (piem., SpellCheckerService). Parastajām lietotnēm tas nekad nav nepieciešams."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"saistīt ar VPN pakalpojumu"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Ļauj lietotnei pārvaldīt tīkla politikas un noteikt lietotnes kārtulas."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"Tīkla lietojuma uzskaites mainīšana"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Ļauj lietotnei mainīt to, kā tīkla lietojums tiek uzskaitīts saistībā ar lietotnēm. Atļauja neattiecas uz parastām lietotnēm."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Paroles kārtulu iestatīšana"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontrolē ekrāna atbloķēšanas parolē atļautās rakstzīmes un garumu."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Ekrāna atbloķēšanas mēģinājumu pārraudzīšana"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 42cdbcc..0f30f40 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -226,7 +226,7 @@
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Akses storan USB."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Akses kad SD."</string>
     <string name="permgrouplab_accessibilityFeatures" msgid="7919025602283593907">"Ciri kebolehaksesan"</string>
-    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Ciri yang boleh diminta oleh teknologi eksekutif."</string>
+    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Ciri yang boleh diminta oleh teknologi bantuan."</string>
     <string name="permlab_statusBar" msgid="7417192629601890791">"lumpuhkan atau ubah suai bar status"</string>
     <string name="permdesc_statusBar" msgid="8434669549504290975">"Membenarkan apl melumpuhkan bar status atau menambah dan mengalih keluar ikon sistem."</string>
     <string name="permlab_statusBarService" msgid="7247281911387931485">"bar status"</string>
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Membolehkan apl membaca mesej siaran sel yang diterima oleh peranti anda. Isyarat siaran sel dihantar di beberapa lokasi untuk memberi amaran kepada anda tentang situasi kecemasan. Apl hasad boleh mengganggu prestasi atau operasi peranti anda apabila siaran sel kecemasan diterima."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"hantar mesej SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Membenarkan apl menghantar mesej SMS. Ini boleh menyebabkan caj di luar jangkaan. Apl hasad boleh membuat anda kerugian wang dengan menghantar mesej tanpa pengesahan anda."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"hantar mesej SMS tanpa pengesahan"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Membenarkan apl menghantar mesej SMS. Ini boleh menyebabkan caj di luar jangkaan. Apl hasad boleh membuat anda kerugian wang dengan menghantar mesej tanpa pengesahan anda."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"acara hantar respons-melalui-mesej"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Membenarkan apl menghantar permintaan kepada apl permesejan lain untuk mengendalikan acara respons-melalui-mesej untuk panggilan masuk."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"baca mesej teks anda (SMS atau MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Membenarkan apl membaca mesej SMS yang tersimpan pada tablet atau kad SIM anda. Ini membenarkan apl membaca semua mesej SMS, tanpa mengira kandungan atau kerahsiaan."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Membenarkan apl membaca mesej SMS yang tersimpan pada telefon atau kad SIM anda. Ini membenarkan apl membaca semua mesej SMS, tanpa mengira kandungan atau kerahsiaan."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"minta jelajah melalui sentuhan"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Membenarkan pengguna untuk meminta mod interaksi agar item yang disentuh disebut dengan kuat dan UI boleh dijelajahi melalui gerak isyarat."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"minta kebolehaksesan web dipertingkatkan"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Membenarkan pengguna untuk meminta mendayakan penambahbaikan kebolehaksesan web. Sebagai contoh, memasang skrip untuk menjadikan kandungan apl lebih mudah diakses."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"terikat kepada perkhidmatan teks"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Membenarkan pemegang mengikat kepada antara muka peringkat atasan perkhidmatan teks(mis. PerkhidmatanPenyemakEjaan). Tidak seharusnya diperlukan untuk apl biasa."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"terikat kepada perkhidmatan VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Membenarkan apl mengurus dasar rangkaian dan menentukan peraturan khusus apl."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"ubah suai perakaunan penggunaan rangkaian"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Membenarkan apl untuk mengubah suai bagaimana penggunaan rangkaian diambil kira terhadap apl. Bukan untuk digunakan oleh apl biasa."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Tetapkan peraturan kata laluan"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Mengawal panjang dan aksara yang dibenarkan dalam kata laluan buka kunci skrin."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Memantau percubaan buka kunci skrin"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 8d83af2..1cb41c4 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -226,7 +226,7 @@
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Tilgang til USB-lagring."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Tilgang til minnekortet."</string>
     <string name="permgrouplab_accessibilityFeatures" msgid="7919025602283593907">"Tilgjengelighetsfunksjoner"</string>
-    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Funksjoner hjelpeteknologi kan be om."</string>
+    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Funksjoner støttende teknologi kan be om."</string>
     <string name="permlab_statusBar" msgid="7417192629601890791">"deaktivere eller endre statusfeltet"</string>
     <string name="permdesc_statusBar" msgid="8434669549504290975">"Lar appen deaktivere statusfeltet eller legge til og fjerne systemikoner."</string>
     <string name="permlab_statusBarService" msgid="7247281911387931485">"statusrad"</string>
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Tillater at appen kan lese kringkastede meldinger enheten din mottar. Kringkastede varsler leveres noen steder for å advare deg om nødsituasjoner. Skadelige apper kan forstyrre ytelsen eller funksjonen til enheten din når en kringkastet nødmelding mottas."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"sende SMS-meldinger"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Lar appen sende tekstmeldinger. Dette kan resultere i uventede kostnader. Merk at skadelige apper kan påføre deg kostnader ved å sende meldinger uten bekreftelse fra deg."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"send tekstmeldinger uten godkjenning"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Lar appen sende tekstmeldinger. Dette kan resultere i uventede kostnader. Merk at skadelige apper kan påføre deg kostnader ved å sende meldinger uten bekreftelse fra deg."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"send svar via melding-hendelser"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Lar appen sende forespørsler om håndtering av svar via melding-hendelser for innkommende anrop til andre meldingsapper."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"leser tekstmeldinger (SMS eller MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Lar appen lese tekstmeldinger lagret på nettbrettet eller SIM-kortet ditt. Dette lar appen lese alle tekstmeldingene dine, uavhengig av innhold og konfidensialitet."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Lar appen lese tekstmeldinger lagret på telefonen eller SIM-kortet ditt. Dette lar appen lese alle tekstmeldingene dine, uavhengig av innhold og konfidensialitet."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"be om utforsking ved berøring"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Tillater brukeren å be om en interaksjonsmodus der berørte elementer sies høyt, og brukergrensesnittet kan utforskes med bevegelser."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"be om forbedret nettilgjengelighet"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Tillater brukeren å be om aktivering av forbedret nettilgjengelighet. Dette kan for eksempel være installasjon av skript for å gjøre appinnhold mer tilgjengelig."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"binde til en teksttjeneste"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Lar innehaveren binde seg til øverste grensesnittnivå for en teksttjeneste (f.eks. SpellCheckerService). Skal aldri være nødvendig for vanlige apper."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"binde deg til en VPN-tjeneste"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Lar appen administrere retningslinjene for nettverket og definere appspesifikke regler."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"Modifisering av regnskapsføring av nettverksbruk"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Lar appen endre hvordan nettverksbruk regnes ut for apper. Ikke beregnet på vanlige apper."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Angi passordregler"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontroller tillatt lengde og tillatte tegn i passord for opplåsing av skjerm."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Overvåk forsøk på opplåsing av skjerm"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index a515fa5..757a813 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Toestaan dat de app infodienstberichten leest die worden ontvangen op uw apparaat. Infodienstberichten worden verzonden naar bepaalde locaties om u te waarschuwen voor noodsituaties. Schadelijke apps kunnen de prestaties of verwerking van uw apparaat verstoren wanneer een infodienstbericht wordt ontvangen."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"SMS-berichten verzenden"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Hiermee kan de app sms-berichten verzenden. Dit kan tot onverwachte kosten leiden. Schadelijke apps kunnen u geld kosten doordat ze zonder uw bevestiging berichten kunnen verzenden."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"zonder toestemming sms\'jes verzenden"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Hiermee kan de app sms-berichten verzenden. Dit kan tot onverwachte kosten leiden. Schadelijke apps kunnen u geld kosten doordat ze zonder uw bevestiging berichten kunnen verzenden."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"gebeurtenissen voor reageren-via-berichten verzenden"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Hiermee kan de app verzoeken verzenden aan andere bericht-apps om gebeurtenissen voor reageren-via-berichten voor inkomende oproepen te verwerken."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"uw tekstberichten (SMS of MMS) lezen"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Hiermee kan de app sms-berichten lezen die zijn opgeslagen op uw tablet of simkaart. De app kan alle sms-berichten lezen, ongeacht inhoud of vertrouwelijkheid."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Hiermee kan de app sms-berichten lezen die zijn opgeslagen op uw telefoon of simkaart. De app kan alle sms-berichten lezen, ongeacht inhoud of vertrouwelijkheid."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"verkennen via aanraking aanvragen"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Hiermee kan de houder een interactiemodus aanvragen waarin aangeraakte items worden uitgesproken en de gebruikersinterface kan worden bediend met gebaren."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"verbeterde internettoegankelijkheid aanvragen"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Hiermee kan de houder het inschakelen van verbeteringen voor internettoegankelijkheid aanvragen. Bijvoorbeeld scripts installeren om app-inhoud toegankelijker te maken."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"koppelen aan een sms-service"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Hiermee kan de gebruiker koppelen met de hoofdinterface van een tekstservice (zoals SpellCheckerService). Dit is niet nodig voor normale apps."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"koppelen aan een VPN-service"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Hiermee kan de app het netwerkbeleid beheren en app-specifieke regels definiëren."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"verrekening van netwerkgebruik aanpassen"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Hiermee kan een app aanpassen hoe het netwerkgebruik wordt toegekend aan apps. Dit wordt niet gebruikt door normale apps."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Wachtwoordregels instellen"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"De lengte en tekens beheren die zijn toegestaan in wachtwoorden voor schermontgrendeling."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Pogingen voor schermontgrendeling bijhouden"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index a3ee3a5..a5405de 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Zezwala aplikacji na odczyt wiadomości z sieci komórkowej odebranych na urządzeniu. Alerty sieci komórkowej są dostarczane w niektórych lokalizacjach w celu ostrzeżenia Cię o sytuacjach alarmowych. Złośliwe aplikacje mogą wpływać na wydajność lub zakłócać działanie urządzenia po odebraniu wiadomości alarmowej z sieci komórkowej."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"wysyłanie wiadomości SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Pozwala aplikacji na wysyłanie SMS-ów. Może to skutkować nieoczekiwanymi opłatami. Złośliwe aplikacje mogą generować koszty, wysyłając wiadomości bez Twojego potwierdzenia."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"wysyłanie wiadomości SMS bez potwierdzenia"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Pozwala aplikacji na wysyłanie SMS-ów. Może to skutkować nieoczekiwanymi opłatami. Złośliwe aplikacje mogą generować koszty, wysyłając wiadomości bez Twojego potwierdzenia."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"wysyłanie zdarzeń odpowiedzi przez SMS"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Zezwala aplikacjom na wysyłanie żądań do innych aplikacji komunikacyjnych w celu obsługi zdarzeń odpowiedzi przez SMS dla połączeń przychodzących."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"odczytywanie wiadomości tekstowych (SMS i MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Pozwala aplikacji na odczyt SMS-ów zapisanych na tablecie lub na karcie SIM. Aplikacja z tym uprawnieniem może czytać wszystkie SMS-y niezależnie od ich treści lub poufności."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Pozwala aplikacji na odczyt SMS-ów zapisanych na telefonie lub na karcie SIM. Aplikacja z tym uprawnieniem może czytać wszystkie SMS-y niezależnie od ich treści lub poufności."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"żądanie dotyczące czytania dotykiem"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Pozwala właścicielowi zażądać włączenia trybu interaktywnego, w którym nazwy klikniętych elementów są wypowiadane na głos, a po interfejsie można poruszać się gestami."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"żądanie dotyczące dodatkowych ułatwień dostępu w internecie"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Pozwala właścicielowi zażądać włączenia internetowych funkcji ułatwień dostępu. Może to być np. zainstalowanie skryptów, które sprawią, że treść aplikacji będzie łatwiej dostępna."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"tworzenie powiązania z usługą tekstową"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Pozwala na tworzenie powiązania z interfejsem najwyższego poziomu usługi tekstowej (np. SpellCheckerService). Nie powinno być nigdy potrzebne w przypadku zwykłych aplikacji."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"tworzenie powiązania z usługą VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Pozwala aplikacji na zarządzanie zasadami dotyczącymi sieci i definiowanie reguł aplikacji."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modyfikowanie sposobu naliczania użycia sieci"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Pozwala aplikacji na zmienianie sposobu rozliczania wykorzystania sieci przez aplikacje. Nieprzeznaczone dla zwykłych aplikacji."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Określ reguły hasła"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontrolowanie długości haseł odblokowania ekranu i dozwolonych w nich znaków"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Monitoruj próby odblokowania ekranu"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index cdc5a49..28b6f9d 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permite que a aplicação leia mensagens de transmissão celular recebidas pelo seu dispositivo. Os alertas de transmissão celular são fornecidos em algumas localizações para avisá-lo sobre situações de emergência. As aplicações maliciosas podem interferir com o desempenho ou funcionamento do seu dispositivo quando for recebida uma transmissão celular de emergência."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"enviar mensagens SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Permite que a aplicação envie mensagens SMS. Isto pode resultar em custos inesperados. As aplicações maliciosas podem fazer com que incorra em custos, enviando mensagens sem a sua confirmação."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"enviar mensagens SMS sem confirmação"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Permite que a aplicação envie mensagens SMS. Isto pode resultar em custos inesperados. As aplicações maliciosas podem fazer com que incorra em custos, enviando mensagens sem a sua confirmação."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"enviar eventos de resposta-via-mensagem"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Permite à aplicação enviar pedidos a outras aplicações de mensagens para processar eventos de resposta-via-mensagem para as chamadas recebidas."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"ler as mensagens de texto (SMS ou MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Permite que a aplicação leia mensagens SMS guardadas no tablet ou no cartão SIM. Permite que a aplicação leia todas as mensagens SMS, independentemente do conteúdo ou da confidencialidade das mesmas."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Permite que a aplicação leia mensagens SMS guardadas no telemóvel ou no cartão SIM. Permite que a aplicação leia todas as mensagens SMS, independentemente do conteúdo ou da confidencialidade das mesmas."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"solicitar exploração por toque"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Permite ao Hoder solicitar um modo de interação em que os itens tocados são falados em voz alta e a IU pode ser explorada através de gestos."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"solicitar acessibilidade Web melhorada"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Permite ao Hoder solicitar a ativação de melhoramentos de acessibilidade Web. Por exemplo, a instalação de scripts do Google para tornar o conteúdo das aplicações mais acessível."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"vincular a um serviço de texto"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Permite ao titular ligar-se à interface de nível superior de um serviço de texto (por exemplo SpellCheckerService). Nunca deverá ser necessário para aplicações normais."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"vincular a um serviço VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Permite que a aplicação faça a gestão de políticas de rede e defina regras específicas de aplicações."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modificar contabilização da utilização da rede"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Permite que a aplicação modifique o modo como a utilização da rede é contabilizada em relação a aplicações. Nunca é necessário para aplicações normais."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Definir regras de palavra-passe"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Controlar o comprimento e os caracteres permitidos nas palavras-passe de desbloqueio do ecrã."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Monitorizar tentativas de desbloqueio do ecrã"</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index cacb2d5..bcec57e 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permite que o aplicativo leia mensagens de difusão celular recebidas por seu dispositivo. Alertas de difusão celular são recebidos em alguns locais para avisar você de situações de emergência. Aplicativos maliciosos podem interferir no desempenho ou funcionamento de seu dispositivo quando uma difusão celular de emergência é recebida."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"enviar mensagens SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Permite que o aplicativo envie mensagens SMS. Isso pode resultar em cobranças inesperadas. Aplicativos maliciosos podem gerar custos através do envio de mensagens sem sua confirmação."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"enviar mensagens SMS sem confirmação"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Permite que o aplicativo envie mensagens SMS. Isso pode resultar em cobranças inesperadas. Aplicativos maliciosos podem gerar custos através do envio de mensagens sem sua confirmação."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"enviar eventos de resposta por mensagem"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Permite que o aplicativo envie solicitações a outros aplicativos de mensagens para processar eventos de resposta por mensagem para chamadas recebidas."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"ler suas mensagens de texto (SMS ou MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Permite que o aplicativo leia mensagens SMS armazenadas no tablet ou cartão SIM. Isso permite que o aplicativo leia todas as mensagens SMS, independentemente de seu conteúdo ou confidencialidade."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Permite que o aplicativo leia mensagens SMS armazenadas no telefone ou cartão SIM. Isso permite que o aplicativo leia todas as mensagens SMS, independentemente de seu conteúdo ou confidencialidade."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"solicitar explorar por toque"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Permite ao proprietário solicitar um modo de interação em que os itens tocados são falados em voz alta e a interface do usuário pode ser explorada com gestos."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"solicitar acessibilidade melhorada da Web"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Permite ao proprietário solicitar melhorias na acessibilidade da Web. Por exemplo, a instalação de scripts para tornar o conteúdo de aplicativos mais acessível."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"sujeitar-se a um serviço de texto"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Permite que o proprietário utilize interface de nível superior de um serviço de texto (por exemplo, SpellCheckerService). Nunca deve ser necessário para aplicativos normais."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"se ligam a um serviço de VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Permite que o aplicativo gerencie políticas de rede e definia regras específicas para o aplicativo."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modificar contagem de uso da rede"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Permite que o aplicativo modifique como o uso da rede é contabilizado em relação aos aplicativos. Não deve ser usado em aplicativos normais."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Definir regras para senha"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Controle o tamanho e os caracteres permitidos nas senhas de desbloqueio de tela."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Monitorar tentativas de desbloqueio da tela"</string>
diff --git a/core/res/res/values-rm/strings.xml b/core/res/res/values-rm/strings.xml
index 67e5576..53729f7 100644
--- a/core/res/res/values-rm/strings.xml
+++ b/core/res/res/values-rm/strings.xml
@@ -346,9 +346,9 @@
     <string name="permlab_sendSms" msgid="5600830612147671529">"trametter messadis SMS"</string>
     <!-- no translation found for permdesc_sendSms (7094729298204937667) -->
     <skip />
-    <!-- no translation found for permlab_sendSmsNoConfirmation (4781483105951730228) -->
+    <!-- no translation found for permlab_sendRespondViaMessageRequest (8713889105305943200) -->
     <skip />
-    <!-- no translation found for permdesc_sendSmsNoConfirmation (402569800862935907) -->
+    <!-- no translation found for permdesc_sendRespondViaMessageRequest (7107648548468778734) -->
     <skip />
     <!-- no translation found for permlab_readSms (8745086572213270480) -->
     <skip />
@@ -1032,6 +1032,10 @@
     <skip />
     <!-- no translation found for permdesc_modifyNetworkAccounting (5443412866746198123) -->
     <skip />
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <!-- no translation found for policylab_limitPassword (4497420728857585791) -->
     <skip />
     <!-- no translation found for policydesc_limitPassword (3252114203919510394) -->
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index 4849dff..52fee9b 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permite aplicaţiei să citească mesajele primite prin transmisie celulară de dispozitivul dvs. Alertele cu transmisie celulară sunt difuzate în unele locaţii pentru a vă avertiza cu privire la situaţiile de urgenţă. Aplicaţiile rău intenţionate pot afecta performanţa sau funcţionarea dispozitivului dvs. când este primită o transmisie celulară de urgenţă."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"trimitere mesaje SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Permite aplicaţiei să trimită mesaje SMS, ceea ce ar putea determina apariţia unor taxe neaşteptate. Aplicaţiile rău intenţionate pot acumula costuri prin trimiterea mesajelor fără confirmarea dvs."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"trimitere mesaje SMS fără confirmare"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Permite aplicaţiei să trimită mesaje SMS, ceea ce ar putea determina apariţia unor taxe neaşteptate. Aplicaţiile rău intenţionate pot acumula costuri prin trimiterea mesajelor fără confirmarea dvs."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"trimitere de evenimente de tipul „răspuns prin mesaj”"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Permite aplicației să trimită solicitări altor aplicații de mesagerie pentru a gestiona evenimentele de tipul „răspuns prin mesaj” pentru apelurile primite."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"citeşte mesajele text (SMS sau MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Permite aplicaţiei să citească mesajele SMS stocate pe tabletă sau pe cardul SIM. În acest fel, aplicaţia poate citi toate mesajele SMS, indiferent de conţinutul sau de gradul de confidenţialitate al acestora."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Permite aplicaţiei să citească mesajele SMS stocate pe telefon sau pe cardul SIM. În acest fel, aplicaţia poate citi toate mesajele SMS, indiferent de conţinutul sau de gradul de confidenţialitate al acestora."</string>
@@ -346,11 +346,10 @@
     <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"Permite proprietarului să se conecteze la interfaţa de nivel superior a unei metode de introducere. Nu ar trebui să fie niciodată necesară pentru aplicaţiile obişnuite."</string>
     <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"conectare la un serviciu de accesibilitate"</string>
     <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"Permite proprietarului să se conecteze la interfaţa de nivel superior a unui serviciu de accesibilitate. Nu ar trebui să fie niciodată necesară pentru aplicaţiile obişnuite."</string>
-    <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"solicitare explorare prin atingere"</string>
+    <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"solicitare de explorare prin atingere"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Permite proprietarului să solicite un mod de interacțiune în care elementele atinse sunt rostite cu voce tare, iar interfața de utilizare poate fi explorată prin gesturi."</string>
-    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"solicitare accesibilitate web îmbunătățită"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"solicitare de accesibilitate mai bună la internet"</string>
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Permite proprietarului să solicite activarea îmbunătățirilor accesibilității web. De exemplu, instalarea unor scripturi pentru a mări accesibilitatea conținutului aplicațiilor."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"conectare la un serviciu text"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Permite proprietarului să se conecteze la o interfaţă de nivel superior a unui serviciu text (de ex., SpellCheckerService). Nu ar trebui să fie niciodată necesară pentru aplicaţiile obişnuite."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"conectare la un serviciu VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Permite aplicaţiei să gestioneze politicile de reţea şi să definească regulile specifice aplicaţiilor."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"modificaţi modul de calcul al utilizării reţelei"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Permite aplicaţiei să modifice modul în care este calculată utilizarea reţelei pentru aplicaţii. Nu se utilizează de aplicaţiile obişnuite."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Setaţi reguli pentru parolă"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Stabiliţi lungimea şi tipul de caractere permise în parolele pentru deblocarea ecranului."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Monitorizaţi încercările de deblocare a ecranului"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index b02b6f8..741d78f 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Приложение получит доступ к сообщениям широковещательных SMS-служб, которые в некоторых странах используются для информирования населения об экстренных ситуациях. Вредоносные программы могут помешать работе устройства, на которое поступают такие сообщения."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"Отправка SMS-сообщений"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Приложение сможет отправлять SMS. Учтите, что вредоносные программы смогут отправлять сообщения без уведомления, что может привести к непредвиденным расходам."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"отправка SMS без подтверждения"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Приложение сможет отправлять SMS. Учтите, что вредоносные программы смогут отправлять сообщения без уведомления, что может привести к непредвиденным расходам."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"отвечать на звонки текстовыми сообщениями"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Приложение сможет отправлять запросы другим программам обмена сообщениями, чтобы на звонки можно было отвечать текстовыми сообщениями."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"Просмотр SMS и MMS"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Приложение сможет просматривать SMS-сообщения, сохраненные на устройстве или SIM-карте, независимо от содержания или настроек конфиденциальности."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Приложение сможет просматривать SMS-сообщения, сохраненные на устройстве или SIM-карте, независимо от содержания или настроек конфиденциальности."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"запрашивать функцию \"Изучение касанием\""</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Владелец устройства сможет запрашивать включение режима \"Изучение касанием\", чтобы названия элементов управления озвучивались."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"запрашивать установку веб-скриптов"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Владелец устройства сможет запрашивать установку скриптов для повышения доступности веб-контента."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"привязка к службе текстовых сообщений"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Позволяет подключаться к базовому интерфейсу службы текстовых сообщений (например, SpellCheckerService). Это разрешение не используется обычными приложениями."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"подключаться к VPN-службе"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Приложение сможет управлять сетевыми политиками и определять правила для отдельных приложений."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"изменение учета использования сети"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Приложение сможет изменять порядок расчета использования сетевых ресурсов различными программами. Это разрешение не используется обычными приложениями."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Правила выбора паролей"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Контролировать длину и символы при вводе паролей для снятия блокировки экрана."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Отслеживать попытки снятия блокировки экрана"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 9070f3d..e0126da 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Umožňuje aplikácii čítať správy Cell Broadcast prijaté vaším zariadením. Upozornenia Cell Broadcast sú doručované na určitých miestach a upozorňujú na núdzové situácie. Škodlivé aplikácie môžu pri prijatí núdzovej správy Cell Broadcast narušiť výkonnosť alebo prevádzku vášho zariadenia."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"odosielať správy SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Umožňuje aplikácii odosielať správy SMS. Môže to mať za následok účtovanie neočakávaných poplatkov. Škodlivé aplikácie vám môžu spôsobiť výdavky odosielaním správ bez vášho potvrdenia."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"posielať správy SMS bez potvrdenia"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Umožňuje aplikácii odosielať správy SMS. Môže to mať za následok účtovanie neočakávaných poplatkov. Škodlivé aplikácie vám môžu spôsobiť výdavky odosielaním správ bez vášho potvrdenia."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"odosielanie udalostí typu „odpovedzte správou“"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Umožňuje aplikácii odosielať žiadosti ostatným aplikáciám na posielanie správ s cieľom spracovania udalostí typu „odpovedzte správou“ pre prichádzajúce hovory."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"čítať textové správy (SMS alebo MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Umožňuje aplikácii čítať správy SMS uložené v tablete alebo na karte SIM. Toto povolenie umožňuje aplikácii čítať správy SMS bez ohľadu na ich obsah alebo dôvernosť."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Umožňuje aplikácii čítať správy SMS uložené v telefóne alebo na karte SIM. Toto povolenie umožňuje aplikácii čítať správy SMS bez ohľadu na ich obsah alebo dôvernosť."</string>
@@ -347,10 +347,9 @@
     <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"viazať na službu zjednodušeného ovládania"</string>
     <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"Umožňuje držiteľovi viazať sa na najvyššiu úroveň rozhrania služby zjednodušeného ovládania. Bežné aplikácie by toto nastavenie nemali nikdy potrebovať."</string>
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"vyžiadať preskúmanie dotykom"</string>
-    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Držiteľovi umožňuje, aby požiadal o interaktívny režim, v ktorom aplikácia reaguje na dotyky položiek vyslovením ich názvu a v ktorom môže používateľ preskúmať používateľské rozhranie pomocou gest."</string>
+    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Držiteľovi umožňuje požiadať o interaktívny režim, v ktorom aplikácia reaguje na dotyky položiek vyslovením ich názvu a v ktorom môže používateľ preskúmať používateľské rozhranie pomocou gest."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"vyžiadať zlepšenie dostupnosti webu"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Držiteľovi umožňuje, aby vyžiadal povolenie vylepšení prístupu k webu, napríklad inštaláciu skriptov, ktoré uľahčujú prístup k obsahu aplikácie."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"väzba na textovú službu"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Umožňuje držiteľovi viazať sa na najvyššiu úroveň rozhrania textovej služby (napr. SpellCheckerService). Bežné aplikácie by toto nastavenie nemali nikdy potrebovať."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"Zaviazať k službe VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Umožňuje aplikácii spravovať pravidlá siete a definovať pravidlá pre konkrétnu aplikáciu."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"zmeniť kontrolu používania siete"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Umožňuje aplikácii upraviť používanie siete jednotlivými aplikáciami. Bežné aplikácie toto nastavenie nepoužívajú."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Nastaviť pravidlá pre heslo"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Ovládanie dĺžky hesiel na odomknutie obrazovky a v nich používané znaky."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Sledovať pokusy o odomknutie obrazovky"</string>
@@ -1106,11 +1109,11 @@
     <string name="volume_icon_description_incall" msgid="8890073218154543397">"Hlasitosť hovoru"</string>
     <string name="volume_icon_description_media" msgid="4217311719665194215">"Hlasitosť médií"</string>
     <string name="volume_icon_description_notification" msgid="7044986546477282274">"Hlasitosť upozornení"</string>
-    <string name="ringtone_default" msgid="3789758980357696936">"Predvolený vyzváňací tón"</string>
-    <string name="ringtone_default_with_actual" msgid="8129563480895990372">"Predvolený vyzváňací tón (<xliff:g id="ACTUAL_RINGTONE">%1$s</xliff:g>)"</string>
+    <string name="ringtone_default" msgid="3789758980357696936">"Predvolený tón zvonenia"</string>
+    <string name="ringtone_default_with_actual" msgid="8129563480895990372">"Predvolený tón zvonenia (<xliff:g id="ACTUAL_RINGTONE">%1$s</xliff:g>)"</string>
     <string name="ringtone_silent" msgid="7937634392408977062">"Žiadny"</string>
     <string name="ringtone_picker_title" msgid="3515143939175119094">"Vyzváňacie tóny"</string>
-    <string name="ringtone_unknown" msgid="5477919988701784788">"Neznámy vyzváňací tón"</string>
+    <string name="ringtone_unknown" msgid="5477919988701784788">"Neznámy tón zvonenia"</string>
   <plurals name="wifi_available">
     <item quantity="one" msgid="6654123987418168693">"K dispozícii je sieť Wi-Fi"</item>
     <item quantity="other" msgid="4192424489168397386">"K dispozícii sú siete Wi-Fi."</item>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 768e9a9..73d308c 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Omogoča aplikaciji branje sporočil oddaje v celici, ki jih prejme naprava. Opozorila oddaje v celici so dostavljena na nekaterih lokacijah, da vas opozorijo na izredne razmere. Zlonamerne aplikacije lahko vplivajo na delovanje naprave, ko dobi sporočilo oddaje v celici."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"pošiljanje sporočil SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Aplikaciji omogoča pošiljanje SMS-ov. Zaradi tega lahko pride do nepričakovanih stroškov. Zlonamerne aplikacije lahko pošiljajo sporočila brez vaše potrditve, kar vas lahko drago stane."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"pošiljanje SMS-ov brez potrditve"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Aplikaciji omogoča pošiljanje SMS-ov. Zaradi tega lahko pride do nepričakovanih stroškov. Zlonamerne aplikacije lahko pošiljajo sporočila brez vaše potrditve, kar vas lahko drago stane."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"pošiljanje dogodkov z odgovori prek sporočil"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Aplikaciji dovoli, da pošilja zahteve drugim aplikacijam za sporočila za obravnavanje dogodkov z odgovori prek sporočil za dohodne klice."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"branje sporočil (SMS ali MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Aplikaciji omogoča branje SMS-ov, shranjenih v tabličnem računalniku ali na kartici SIM. S tem lahko aplikacija bere vse SMS-e, ne glede na njihovo vsebino ali zaupnost."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Aplikaciji omogoča branje SMS-ov, shranjenih v telefonu ali na kartici SIM. S tem lahko aplikacija bere vse SMS-e, ne glede na njihovo vsebino ali zaupnost."</string>
@@ -347,10 +347,9 @@
     <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"povezovanje s storitvijo za ljudi s posebnimi potrebami"</string>
     <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"Lastniku omogoča povezovanje z vmesnikom najvišje ravni storitve za ljudi s posebnimi potrebami. Tega nikoli ni treba uporabiti za navadne aplikacije."</string>
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"zahteva za raziskovanje z dotikom"</string>
-    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Imetniku dovoli zahtevanje načina interaktivnosti, v katerem se dotaknjene možnosti izgovorijo na glas in je mogoče uporabniški vmesnik raziskati s potezami."</string>
+    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Imetniku dovoli, da zahteva interaktivni način delovanja, v katerem se dotaknjene možnosti izgovorijo na glas in je mogoče uporabniški vmesnik raziskati s potezami."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"zahteva za izboljšano spletno dostopnost"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Imetniku dovoli, da zahteva omogočanje izboljšav spletne dostopnosti, na primer namestitev skriptov, ki naredijo vsebino aplikacije dostopnejšo."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"poveži z besedilno storitvijo"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Dovoljuje, da se lastnik poveže z vmesnikom besedilne storitve najvišje ravni (npr. SpellCheckerService). Tega nikoli ni treba uporabiti za navadne programe."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"povezava s storitvijo navideznega zasebnega omrežja"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Programu omogoča upravljanje pravilnikov o omrežju in določanje pravil za program."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"spremeni obračunavanje uporabe omrežja"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Programu omogoča, da spremeni uporabo omrežja na podlagi programov. Ni za uporabo z navadnimi programi."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Nastavitev pravil za geslo"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Nadzor nad dolžino in znaki, ki so dovoljeni v geslih za odklepanje zaslona."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"nadzor nad poskusi odklepanja zaslona"</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 0812ed1..127d5eb 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Омогућава апликацији да чита поруке инфо сервиса које уређај прима. Упозорења инфо сервиса се на неким локацијама примају као упозорења на хитне случајеве. Злонамерне апликације могу да утичу на учинак или ометају функционисање уређаја када се прими порука инфо сервиса о хитном случају."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"слање SMS порука"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Дозвољава апликацији да шаље SMS поруке. Ово може да доведе до неочекиваних трошкова. Злонамерне апликације могу да шаљу поруке без ваше потврде, што може да изазове трошкове."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"слање SMS порука без потврде"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Дозвољава апликацији да шаље SMS поруке. Ово може да доведе до неочекиваних трошкова. Злонамерне апликације могу да шаљу поруке без ваше потврде, што може да изазове трошкове."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"слање догађаја одговора преко поруке"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Омогућава апликацији да другим апликацијама за размену порука шаље захтеве за обраду догађаја одговора преко порука за долазне позиве."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"читање текстуалних порука (SMS или MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Дозвољава апликацији да чита SMS поруке ускладиштене на таблету или SIM картици. Ово омогућава апликацији да чита све SMS поруке, без обзира на садржај или поверљивост."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Дозвољава апликацији да чита SMS поруке ускладиштене на телефону или SIM картици. Ово омогућава апликацији да чита све SMS поруке, без обзира на садржај или поверљивост."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"захтевање истраживања додиром"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Омогућава носиоцу да захтева режим интеракције у коме се називи додирнутих ставки изговарају наглас, а кориснички интерфејс може да се истражује покретима."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"захтевање побољшане приступачности вебу"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Омогућава носиоцу да захтева омогућавање побољшања приступачности веба. На пример, инсталирање скрипти да би садржај апликације постао приступачнији."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"обавезивање на текстуалну услугу"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Омогућава власнику да се обавеже на интерфејс текстуалне услуге највишег нивоа (нпр. SpellCheckerService). Обичне апликације никада не би требало да је користе."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"везивање за VPN услугу"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Дозвољава апликацији да управља смерницама за мрежу и одређује посебна правила за апликацију."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"измените обрачунавање коришћења мреже"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Дозвољава апликацији да измени начин на који апликације користе мрежу. Не користе је уобичајене апликације."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Подешавање правила за лозинку"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Контролишите дужину и знакове дозвољене у лозинкама за откључавање екрана."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Надгледање покушаја откључавања екрана"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 7047508..aab6047 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Appen tillåts läsa SMS som skickas till din enhet. På vissa platser skickas SMS för att varna för nödsituationer. Skadliga appar kan påverka enhetens prestanda eller funktionalitet när du får ett meddelande om en nödsituation via SMS."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"skicka SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Tillåter att appen skickar SMS. Detta kan leda till oväntade avgifter. Skadliga appar kan skicka meddelanden utan ditt godkännande vilket kan kosta pengar."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"skicka SMS utan bekräftelse"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Tillåter att appen skickar SMS. Detta kan leda till oväntade avgifter. Skadliga appar kan skicka meddelanden utan ditt godkännande vilket kan kosta pengar."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"skicka svar via meddelanden"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Tillåter att appen skickar förfrågningar till andra meddelandeappar för att kunna skicka meddelanden som svar på inkommande samtal."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"läsa dina textmeddelanden (SMS eller MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Tillåter att appen läser SMS som sparats på surfplattan eller på SIM-kortet. Med den här behörigheten tillåts appen att läsa alla SMS oavsett innehåll eller sekretess."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Tillåter att appen läser SMS som sparats på mobilen eller på SIM-kortet. Med den här behörigheten tillåts appen att läsa alla SMS oavsett innehåll eller sekretess."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"begära beröringsstyrda gränssnittsfunktioner"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Innehavaren tillåts begära ett interaktionsläge där objekt som användaren trycker på läses upp och där gränssnittet kan användas med gester."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"begära tillgänglighetsfunktioner"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Innehavaren tillåts begära aktivering av tillgänglighetsfunktioner. Det kan t.ex. vara att installera skript från Google som gör appens innehåll mer tillgängligt."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"bind till en texttjänst"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Tillåter innehavaren att binda mot den högsta gränssnittsnivån i en texttjänst (t.ex. SpellCheckerService). Bör aldrig behövas för normala appar."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"bind till en VPN-tjänst"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Tillåter att appen hanterar nätverkspolicyer och definierar appspecifika regler."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"ändra nätverksredovisningen"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Tillåter att appen ändrar hur nätverksanvändning redovisas för appar. Används inte av vanliga appar."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Ange lösenordsregler"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Bestäm hur många och vilka tecken som är tillåtna i skärmlåsets lösenord."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Övervaka försök att låsa upp skärmen"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index d590d37..109566f 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -169,7 +169,7 @@
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Huduma ambazo zinakugharimu pesa"</string>
     <string name="permgroupdesc_costMoney" msgid="3293301903409869495">"Fanya mambo ambayo yanaweza kukugharimu pesa."</string>
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Ujumbe wako"</string>
-    <string name="permgroupdesc_messages" msgid="7821999071003699236">"Soma na kuandika SMS, barua pepe, na jumbe zako zingine."</string>
+    <string name="permgroupdesc_messages" msgid="7821999071003699236">"Soma na uandike SMS, barua pepe, na mawasiliano mengine."</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Maelezo yako ya kibinafsi"</string>
     <string name="permgroupdesc_personalInfo" msgid="8426453129788861338">"Kufikia moja kwa moja taarifa kukuhusu, iliyoakibishwa kwenye kadi yako ya anwani."</string>
     <string name="permgrouplab_socialInfo" msgid="5799096623412043791">"Taarifa yako ya kijamii"</string>
@@ -226,7 +226,7 @@
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Fikia hifadhi ya USB."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Fikia kadi ya SD."</string>
     <string name="permgrouplab_accessibilityFeatures" msgid="7919025602283593907">"Vipengele vya ufikiaji"</string>
-    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Vipengele ambavyo teknolojia saidizi inaweza kuomba."</string>
+    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Vipengee ambavyo teknolojia saidizi inaweza kuomba."</string>
     <string name="permlab_statusBar" msgid="7417192629601890791">"zima au rekebisha mwambaa hali"</string>
     <string name="permdesc_statusBar" msgid="8434669549504290975">"Inaruhusu programu kulemaza upau wa hali au kuongeza na kutoa ikoni za mfumo."</string>
     <string name="permlab_statusBarService" msgid="7247281911387931485">"mwamba hali"</string>
@@ -235,25 +235,25 @@
     <string name="permdesc_expandStatusBar" msgid="6917549437129401132">"Inaruhusu programu kupanua au kukunja upau wa hali."</string>
     <string name="permlab_processOutgoingCalls" msgid="3906007831192990946">"panga upya simu zinazotoka"</string>
     <string name="permdesc_processOutgoingCalls" msgid="5331318931937402040">"Inaruhusu programu kuchakata simu zinazotoka nje na kubadilisha nambari ya kupigwa. Idhini hii inaruhusu programu kuchunguza, kuelekeza upya, au kuzuia simu zinazotoka nje."</string>
-    <string name="permlab_receiveSms" msgid="8673471768947895082">"pokea jumbe za maandishi (SMS)"</string>
+    <string name="permlab_receiveSms" msgid="8673471768947895082">"pokea ujumbe wa maandishi wa SMS"</string>
     <string name="permdesc_receiveSms" msgid="6424387754228766939">"Inaruhusu programu kupokea na kuchakata ujumbe wa SMS. Hii inamaanisha programu hii inaweza kuchunguza na kufuta ujumbe uliotumwa katika kifaa chako bila ya kukuonyesha."</string>
-    <string name="permlab_receiveMms" msgid="1821317344668257098">"pokea jumbe za maandishi (MMS)"</string>
+    <string name="permlab_receiveMms" msgid="1821317344668257098">"pokea ujumbe wa maandishi wa MMS"</string>
     <string name="permdesc_receiveMms" msgid="533019437263212260">"Inaruhusu programu kupokea na kuchakata ujumbe medianwai (MMS). Hii inamaanisha uwezo wa kuchunguza na kufuta ujumbe uliotumwa kwa kifaa chako bila ya kukuonyesha."</string>
     <string name="permlab_receiveEmergencyBroadcast" msgid="1803477660846288089">"Pokea matangazo ya dharura"</string>
-    <string name="permdesc_receiveEmergencyBroadcast" msgid="848524070262431974">"Inaruhusu programu kupokea na kuchakata jumbe za dharura. Ruhusa hii inapatikana tu kwa programu za mfumo."</string>
-    <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"soma jumbe za matangazo ya simu"</string>
-    <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Huruhusu programu kusoma jumbe za matangazo ya simu zilizopokewa na kifaa chako. Taarifa za matangazo ya simu huwasilishwa katika maeneo mengine ili kukuonya juu ya hali za dharura. Huenda programu hasidi zikatatiza utendajikazi au shughuli ya kifaa chako wakati matangazo ya simu ya dharura yamepokewa."</string>
+    <string name="permdesc_receiveEmergencyBroadcast" msgid="848524070262431974">"Huruhusu programu kupokea na kuchakata mawasiliano ya dharura. Idhini hii inapatikana tu kwa programu za mfumo."</string>
+    <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"soma mawasiliano ya matangazo ya simu"</string>
+    <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Huruhusu programu kusoma mawasiliano ya matangazo ya simu yaliyoingia kwenye kifaa chako. Arifa za matangazo ya simu huwasilishwa katika maeneo mengine ili kukuonya juu ya hali za dharura. Huenda programu hasidi zikatatiza utendajikazi au shughuli ya kifaa chako wakati matangazo ya simu ya dharura yameingia."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"tuma ujumbe wa SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Inaruhusu programu kutuma ujumbe wa SMS. Hii inaweza ikasababisha malipo yasiyotarajiwa. Programu hasidi zinaweza kukugharimu pesa kwa kutuma ujumbe bila uthibitisho wako."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"Tuma ujumbe wa SMS bila ya thibitisho"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Inaruhusu programu kutuma ujumbe wa SMS. Hii inaweza ikasababisha malipo yasiyotarajiwa. Programu hasidi zinaweza kukugharimu pesa kwa kutuma ujumbe bila uthibitisho wako."</string>
-    <string name="permlab_readSms" msgid="8745086572213270480">"soma jumbe zako za maandishi (SMS au MMS)"</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"tuma matukio ya kujibu-kupitia-ujumbe"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Inaruhusu programu kutuma maombi kwa programu nyingine za ujumbe ili kushughulikia matukio ya kujibu-kupitia-ujumbe kwa simu zinazoingia."</string>
+    <string name="permlab_readSms" msgid="8745086572213270480">"soma SMS au MMS zako"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Inaruhusu programu kusoma ujumbe wa SMS uliohifadhiwa kwenye kompyuta kibao yako au SIM kadi. Hii inaruhusu programu kusoma ujumbe wote wa SMS, bila kujali maudhui au usiri."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Inaruhusu programu kusoma ujumbe wa SMS uliohifadhiwa kwenye simu yako au SIM kadi. Hii inaruhusu programu kusoma ujumbe wote wa SMS, bila kujali maudhui au usiri."</string>
-    <string name="permlab_writeSms" msgid="3216950472636214774">"Hariri jumbe zako za maandishi (SMS au MMS)"</string>
-    <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"Inaruhusu programu kuandikia jumbe za SMS zinazohifadhiwa kwenye kompyuta yako kibao au SIM kadi. Programu hasidi zinaweza kufuta jumbe zako."</string>
-    <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Inaruhusu programu kuandika jumbe za SMS zinazohifadhiwa kwenye simu yako au SIM kadi. programu hasidi zinaweza kufuta ujumbe zako."</string>
-    <string name="permlab_receiveWapPush" msgid="5991398711936590410">"pokea jumbe za maandishi (WAP)"</string>
+    <string name="permlab_writeSms" msgid="3216950472636214774">"Hariri SMS au MMS zako"</string>
+    <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"Huruhusu programu kuandikia SMS zinazohifadhiwa kwenye kompyuta yako kibao au SIM kadi. Programu hasidi zinaweza kufuta SMS zako."</string>
+    <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"Huruhusu programu kuandika SMS zinazohifadhiwa kwenye simu yako au SIM kadi. programu hasidi zinaweza kufuta SMS zako."</string>
+    <string name="permlab_receiveWapPush" msgid="5991398711936590410">"pokea ujumbe wa maandishi wa WAP"</string>
     <string name="permdesc_receiveWapPush" msgid="748232190220583385">"Inaruhusu programu kupokea na kuchakata ujumbe wa WAP. Idhini hii inajumuisha uwezo wa kuchunguza na kufuta ujumbe uliotumwa kwako bila ya kukuonyesha."</string>
     <string name="permlab_getTasks" msgid="6466095396623933906">"rudisha programu zinazoendeshwa"</string>
     <string name="permdesc_getTasks" msgid="7454215995847658102">"Inaruhusu programu kurudisha taarifa kuhusu kazi zinazoendeshwa sasa na hivi karibuni. Hii inaweza kuruhusu programu kugundua taarifa kuhusu ni programu zipi zinazotumika kwenye kifaa."</string>
@@ -308,7 +308,7 @@
     <string name="permlab_broadcastPackageRemoved" msgid="2576333434893532475">"furushi lililotumwa limeondoa tangazo"</string>
     <string name="permdesc_broadcastPackageRemoved" msgid="6621901216207931089">"Inaruhusu programu kutangaza taarifa kwamba furushi ya programu imetolewa. Programu hasidi zinaweza kutumia hii kuua programu yoyote inayoendeshwa."</string>
     <string name="permlab_broadcastSmsReceived" msgid="5689095009030336593">"tuma matanazo yaliyopokewa ya SMS"</string>
-    <string name="permdesc_broadcastSmsReceived" msgid="4152037720034365492">"Inaruhusu programu kutangaza taarifa kwamba ujumbe wa SMS umepokewa. Programu hasidi zinaweza tumia hii kubuni jumbe za SMS zinazoingia."</string>
+    <string name="permdesc_broadcastSmsReceived" msgid="4152037720034365492">"Huruhusu programu kutangaza taarifa kwamba ujumbe wa SMS umeingia. Programu hasidi zinaweza kutumia hii kubuni SMS zinazoingia."</string>
     <string name="permlab_broadcastWapPush" msgid="3145347413028582371">"tuma tangazo lililopokewa la MSUKUMO WA WAP"</string>
     <string name="permdesc_broadcastWapPush" msgid="4783402525039442729">"Inaruhusu programu kutangaza taarifa kwamba ujumbe wa WAP PUSH umepokewa. Programu hasidi zinaweza kutumia hii kubuni risiti ya ujumbe wa MMS au polepole kubadilisha maudhui yoyote ya ukurasa wa tovuti na vibadala vibovu."</string>
     <string name="permlab_setProcessLimit" msgid="2451873664363662666">"zuia idadi ya michakato inayoendeshwa"</string>
@@ -347,10 +347,9 @@
     <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"funga kwa huduma ya ufikiaji"</string>
     <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"Inamuruhusu mmiliki kufunga kipengee kinachojitokeza katika nyanja mbalimbali za kiwango cha juu cha huduma ya afikiaji. Hapaswi kuhitajika kwa programu za kawaida."</string>
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"omba uchunguzi kwa kugusa"</string>
-    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Huruhusu programu kuomba hali ya mwingiliano ambapo vipengee vilivyoguswa husemwa kwa sauti na UI inaweza kuchunguzwa kupitia ishara."</string>
+    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Huruhusu programu kuomba hali ya mwingiliano ambapo vipengee vilivyoguswa hutamkwa kwa sauti na Kiolesura kinaweza kuchunguzwa kupitia ishara."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"omba ufikiaji wa wavuti ulioimarishwa"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Huruhusu programu kuomba uwezeshaji wa uimarishaji wa ufikiaji wa wavuti. Kwa mfano, kusakinisha hati ili kufanya maudhui ya programu kufikiwa zaidi."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"Imefungwa kwa huduma ya maandishi"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Inaruhusu kishikiliaji kushurutisha kusano ya kiwango cha juu ya huduma ya matini(k.m.SpellCheckerService). Haipaswi kuhitajika kwa programu za kawaida."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"funga kwa huduma ya VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Inaruhusu programu kudhibiti sera za mtandao na kufafanua sheria maalum za programu."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"badilisha uthibitishaji wa matumizi ya mtandao"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Huruhusu programu kurekebisha jinsi matumizi ya mtandao yana hesabika dhidi ya programu. Sio ya matumizi na programu za kawaida."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Weka kanuni za nenosiri"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Dhibiti urefu na vibambo vinavyoruhusiwa katika manenosiri ya kufungua skrini."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Chunguza majaribio ya kutofun gua skrini"</string>
@@ -888,7 +891,7 @@
     <string name="permlab_setAlarm" msgid="1379294556362091814">"weka kengele"</string>
     <string name="permdesc_setAlarm" msgid="316392039157473848">"Inaruhusu programu kuweka kengele katika programu iliyosakinishwa ya kengele. Programu zingine za kengele zinawezakosa kutekeleza kipengee hiki."</string>
     <string name="permlab_addVoicemail" msgid="5525660026090959044">"ongeza barua ya sauti"</string>
-    <string name="permdesc_addVoicemail" msgid="6604508651428252437">"Inaruhusu programu kuongeza jumbe kwenye kikasha cha ujumbe wa sauti."</string>
+    <string name="permdesc_addVoicemail" msgid="6604508651428252437">"Huruhusu programu kuongeza mawasiliano kwenye kikasha cha ujumbe wa sauti."</string>
     <string name="permlab_writeGeolocationPermissions" msgid="5962224158955273932">"Rekebisha vibali vya Kivinjari cha eneo la jio"</string>
     <string name="permdesc_writeGeolocationPermissions" msgid="1083743234522638747">"Inaruhusu programu kurekebisha ruhusa za eneo la jio za kivinjari. Programu hasidi zinaweza tumia hii kuruhusu kutuma taarifa ya eneo kwa wavuti holela."</string>
     <string name="permlab_packageVerificationAgent" msgid="5568139100645829117">"thibitisha furushi"</string>
@@ -1141,7 +1144,7 @@
     <string name="wifi_p2p_frequency_conflict_message" msgid="7363907213787469151">"Simu itaukata muunganisho kwa muda kutoka kwenye Wi-Fi inapokuwa imeunganishwa kwenye <xliff:g id="DEVICE_NAME">%1$s</xliff:g>"</string>
     <string name="select_character" msgid="3365550120617701745">"Ingiza kibambo"</string>
     <string name="sms_control_title" msgid="7296612781128917719">"Inatuma ujumbe wa SMS"</string>
-    <string name="sms_control_message" msgid="3867899169651496433">"&lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt; inatuma idadi kubwa ya jumbe za SMS. Je, unataka kuruhusu programu hii kuendelea kutuma jumbe?"</string>
+    <string name="sms_control_message" msgid="3867899169651496433">"&lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt; inatuma idadi kubwa ya SMS. Je, unataka kuruhusu programu hii kuendelea kutuma SMS?"</string>
     <string name="sms_control_yes" msgid="3663725993855816807">"Ruhusu"</string>
     <string name="sms_control_no" msgid="625438561395534982">"Kataza"</string>
     <string name="sms_short_code_confirm_message" msgid="1645436466285310855">"&lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt; ingependa kutuma ujumbe kwa &lt;b&gt;<xliff:g id="DEST_ADDRESS">%2$s</xliff:g>&lt;/b&gt;."</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 374a8ef..e7d4b4f 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"อนุญาตให้แอปอ่านข้อความจากสถานีมือถือที่อุปกรณ์ได้รับ การแจ้งเตือนทางมือถือมีให้บริการในบางพื้นที่ โดยจะแจ้งเตือนคุณเกี่ยวกับสถานการณ์ฉุกเฉิน แอปที่เป็นอันตรายอาจเข้าแทรกแซงการทำงานของอุปกรณ์เมื่อได้รับข้อความแจ้งเตือนฉุกเฉิน"</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"ส่งข้อความ SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"อนุญาตให้แอปพลิเคชันส่งข้อความ SMS ซึ่งอาจทำให้มีการเรียกเก็บเงินที่ไม่คาดคิด แอปพลิเคชันที่เป็นอันตรายอาจทำให้คุณเสียค่าใช้จ่ายด้วยการส่งข้อความโดยไม่รอการยืนยันจากคุณ"</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"ส่งข้อความ SMS โดยไม่มีการยืนยัน"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"อนุญาตให้แอปพลิเคชันส่งข้อความ SMS ซึ่งอาจทำให้มีการเรียกเก็บเงินที่ไม่คาดคิด แอปพลิเคชันที่เป็นอันตรายอาจทำให้คุณเสียค่าใช้จ่ายด้วยการส่งข้อความโดยไม่รอการยืนยันจากคุณ"</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"ส่งกิจกรรมการตอบสนองผ่านทางข้อความ"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"อนุญาตให้แอปพลิเคชันส่งคำขอไปยังแอปพลิเคชันการรับส่งข้อความอื่นๆ ในการจัดการกิจกรรมการตอบสนองผ่านทางข้อความสำหรับสายเรียกเข้า"</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"อ่านข้อความของคุณ (SMS หรือ MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"อนุญาตให้แอปพลิเคชันอ่านข้อความ SMS ที่จัดเก็บไว้ในแท็บเล็ตหรือซิมการ์ด ซึ่งจะทำให้แอปพลิเคชันสามารถอ่านข้อความ SMS ทั้งหมดได้ไม่ว่าจะเป็นเนื้อหาใดหรือมีการรักษาข้อมูลที่เป็นความลับแบบใด"</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"อนุญาตให้แอปพลิเคชันอ่านข้อความ SMS ที่จัดเก็บไว้ในโทรศัพท์หรือซิมการ์ด ซึ่งจะทำให้แอปพลิเคชันสามารถอ่านข้อความ SMS ทั้งหมดได้ไม่ว่าจะเป็นเนื้อหาใดหรือมีการรักษาข้อมูลที่เป็นความลับแบบใด"</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"ขอการแตะเพื่อสำรวจ"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"อนุญาตให้ผู้ถือสิทธิ์ขอโหมดโต้ตอบซึ่งจะมีเสียงพูดออกมาเมื่อรายการถูกแตะ และสามารถสำรวจ UI ได้โดยการใช้ท่าทางสัมผัส"</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"ขอการเข้าถึงเว็บที่มีประสิทธิภาพมากขึ้น"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"อนุญาตให้ผู้ถือสิทธิ์ขอเปิดใช้การเพิ่มประสิทธิภาพการเข้าถึงเว็บ ตัวอย่างเช่น การติดตั้งสคริปต์เพื่อให้เข้าถึงเนื้อหาแอปพลิเคชันได้ดีขึ้น"</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"เชื่อมโยงกับบริการข้อความ"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"อนุญาตให้ผู้ใช้เชื่อมโยงกับส่วนติดต่อผู้ใช้ระดับสูงสุดของบริการข้อความ (เช่น บริการเครื่องตรวจตัวสะกด) ไม่ควรต้องใช้สำหรับแอปพลิเคชันทั่วไป"</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"เชื่อมโยงกับบริการ VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"อนุญาตให้แอปพลิเคชันจัดการนโยบายเครือข่ายและกำหนดกฎเฉพาะแอปพลิเคชัน"</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"แก้ไขการบันทึกบัญชีการใช้งานเครือข่าย"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"อนุญาตให้แอปพลิเคชันแก้ไขวิธีการบันทึกบัญชีการใช้งานเครือข่ายของแอปพลิเคชัน ไม่ใช้สำหรับแอปพลิเคชันทั่วไป"</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"ตั้งค่ากฎรหัสผ่าน"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"ควบคุมความยาวและอักขระที่อนุญาตให้ใช้ในรหัสผ่านการปลดล็อกหน้าจอ"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"ตรวจสอบความพยายามในการปลดล็อกหน้าจอ"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 1ad2b97..0021828 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Binibigyang-daan ang app na magbasa ng mga mensahe ng cell broadcast na natanggap ng iyong device. Inihahatid ang mga alerto ng cell broadcast sa ilang lokasyon upang balaan ka tungkol sa mga emergency na sitwasyon. Maaaring makaabala ang nakakahamak na apps sa pagganap o pagpapatakbo ng iyong device kapag nakatanggap ng emergency na cell broadcast."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"magpadala ng mga SMS na mensahe"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Pinapayagan ang app na magpadala ng mga mensaheng SMS. Maaari itong magresulta sa mga hindi inaasahang pagsingil. Maaaring magpagastos sa iyo ng pera ang nakakahamak na apps sa pamamagitan ng pagpapadala ng mga mensahe nang wala ng iyong kumpirmasyon."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"magpadala ng mga SMS na mensahe nang walang pagkumpirma"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Pinapayagan ang app na magpadala ng mga mensaheng SMS. Maaari itong magresulta sa mga hindi inaasahang pagsingil. Maaaring magpagastos sa iyo ng pera ang nakakahamak na apps sa pamamagitan ng pagpapadala ng mga mensahe nang wala ng iyong kumpirmasyon."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"magpadala ng mga kaganapan ng tumugon sa pamamagitan ng mensahe"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Binibigyang-daan ang app na magpadala ng mga kahilingan sa iba pang apps ng pagmemensahe upang pangasiwaan ang mga kaganapan ng tumugon sa pamamagitan ng mensahe para sa mga papasok na tawag."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"basahin ang iyong mga text message (SMS o MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Pinapayagan ang app na magbasa ng mga mensaheng SMS na naka-imbak sa iyong tablet o SIM card. Pinapayagan nito ang app na basahin ang lahat ng mensaheng SMS, ano pa man ang nilalaman at katayuan sa pagiging kumpedensyal ng mga ito."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Pinapayagan ang app na magbasa ng mga mensaheng SMS na naka-imbak sa iyong telepono o SIM card. Pinapayagan nito ang app na basahin ang lahat ng mensaheng SMS, ano pa man ang nilalaman at katayuan sa pagiging kumpedensyal ng mga ito."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"humiling ng explore by touch"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Binibigyang-daan ang may-ari na humiling ng mode ng pakikipag-ugnayan kung saan sinasabi nang malakas ang mga napindot na item at nagagalugad ang UI sa pamamagitan ng mga galaw."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"humiling ng pinahusay na accessibility sa web"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Binibigyang-daan ang may-ari na hilingin ang pagpapagana ng mga pagpapahusay sa accessibility sa web. Halimbawa, ang pag-install ng mga script mula sa Google upang gawing mas naa-access ang nilalaman ng app."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"sumailalim sa serbisyo ng teksto"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Pinapayagan ang may-hawak na sumailalim sa nangungunang antas na interface (hal. SpellCheckerService). Hindi kailanman dapat na kailanganin para sa normal na apps."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"sumailalim sa isang serbisyo ng VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Pinapayagan ang app na pamahalaan ang mga patakaran ng network at ilarawan ang mga patakarang tukoy sa app."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"baguhin ang pagkukuwenta sa paggamit ng network"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Pinapayagan ang app na baguhin kung paano isinasaalang-alang ang paggamit ng network laban sa apps. Hindi para sa paggamit ng normal na apps."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Magtakda ng mga panuntunan sa password"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontrolin ang haba at mga character na pinapayagan sa mga password sa pag-unlock ng screen."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Subaybayan ang mga pagsubok sa pag-unlock ng screen"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index fd969da..e2c505b 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -226,7 +226,7 @@
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"USB belleğe erişin."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"SD karta erişin."</string>
     <string name="permgrouplab_accessibilityFeatures" msgid="7919025602283593907">"Erişilebilirlik özellikleri"</string>
-    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Engelli kullanıcılara yardımcı olan teknolojinin istekte bulunabileceği özellikler"</string>
+    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Engelli kullanıcılara yardımcı olan teknolojinin istekte bulunabileceği özellikler."</string>
     <string name="permlab_statusBar" msgid="7417192629601890791">"durum çubuğunu devre dışı bırak veya değiştir"</string>
     <string name="permdesc_statusBar" msgid="8434669549504290975">"Uygulamaya, durum çubuğunu devre dışı bırakma ve sistem simgelerini ekleyip kaldırma izni verir."</string>
     <string name="permlab_statusBarService" msgid="7247281911387931485">"durum çubuğu"</string>
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Uygulamaya, cihazınız tarafından alınan hücre yayını mesajlarını okuma izni verir. Hücre yayını uyarıları bazı yerlerde acil durumlar konusunda sizi uyarmak için gönderilir. Kötü amaçlı uygulamalar acil hücre yayını alındığında cihazınızın performansına ya da çalışmasına engel olabilir."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"SMS mesajları gönder"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Uygulamaya SMS mesajları gönderme izni verir. Bu durum beklenmeyen ödemelere neden olabilir. Kötü amaçlı uygulamalar onayınız olmadan mesajlar göndererek sizi zarara uğratabilir."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"SMS mesajlarını onaysız gönder"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Uygulamaya SMS mesajları gönderme izni verir. Bu durum beklenmeyen ödemelere neden olabilir. Kötü amaçlı uygulamalar onayınız olmadan mesajlar göndererek sizi zarara uğratabilir."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"mesajla yanıtla etkinlikleri gönder"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Uygulamaya, gelen çağrıları mesajla yanıtlama etkinliklerini işlemek üzere diğer mesajlaşma uygulamalarına istek gönderme izni verir."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"kısa mesajlarımı (SMS veya MMS) oku"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Uygulamaya tabletinizde veya SIM kartta saklanan SMS mesajlarını okuma izni verir. Bu izin, uygulamanın tüm SMS mesajlarını içeriğinden veya gizliliğinden bağımsız olarak okumasına olanak sağlar."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Uygulamaya telefonunuzda veya SIM kartta saklanan SMS mesajlarını okuma izni verir. Bu izin, uygulamanın tüm SMS mesajlarını içeriğinden veya gizliliğinden bağımsız olarak okumasına olanak sağlar."</string>
@@ -346,11 +346,10 @@
     <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"Cihazın sahibine, bir giriş yönteminin en üst düzey arayüzüne bağlanma izni verir. Normal uygulamalarda hiçbir zaman gerek duyulmaz."</string>
     <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"erişilebilirlik hizmetine bağlan"</string>
     <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"İzin sahibine bir erişilebilirlik hizmetinin en üst düzey arayüzüne bağlanma izni verir. Normal uygulamalarda hiçbir zaman gerek duyulmaz."</string>
-    <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"dokunarak keşfetme isteğinde bulun"</string>
-    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"İzin sahibine, dokunulan öğelerin sesli okunduğu ve kullanıcı arayüzünün hareketlerle keşfedilebildiği etkileşimli mod bir isteğinde bulunma olanağı sağlar."</string>
-    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"genişletilmiş Web erişilebilirliği isteğinde bulun"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"dokunarak keşfetme isteğinde bulunur"</string>
+    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"İzin sahibine, dokunulan öğelerin sesli okunduğu ve kullanıcı arayüzünün hareketlerle keşfedilebildiği etkileşimli bir mod isteğinde bulunma olanağı sağlar."</string>
+    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"genişletilmiş Web erişilebilirliği isteğinde bulunur"</string>
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"İzin sahibine Web erişim geliştirmelerini etkinleştirme isteğinde bulunma olanağı sağlar. Örneğin, uygulama içeriğinin daha fazla erişilebilir olması için Google\'dan komut dosyası yüklemek gibi."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"kısa mesaj hizmetine bağla"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Cihazın sahibine, bir metin hizmetinin (ör. SpellCheckerService) en üst düzey arayüzüne bağlanma izni verir. Normal uygulamalarda hiçbir zaman gerekmez."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"VPN hizmetine bağlan"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Uygulamaya, ağ politikalarını yönetme ve uygulamaya özgü kuralları tanımlama izni verir."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"ağ kullanım hesaplamasını değiştir"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Uygulamaya, ağın uygulamalara göre nasıl kullanılacağını değiştirme izni verir. Normal uygulamalar tarafından kullanılmak için değildir."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Şifre kuralları ayarla"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Ekran kilidini açma şifrelerinde izin verilen uzunluğu ve karakterleri denetleme."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Ekran kilidini açma denemelerini izle"</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 1f87c46..0563f8c 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Дозволяє програмі читати широкомовні повідомлення мережі, отримані пристроєм. Широкомовні сповіщення мережі надсилаються в деяких країнах для попередження про надзвичайні ситуації. Шкідливі програми можуть втручатися у швидкодію чи роботу пристрою під час отримання широкомовного повідомлення мережі про надзвичайну ситуацію."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"надсил. SMS повідом."</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Дозволяє програмі надсилати SMS-повідомлення. Це може спричинити неочікуване стягнення плати. Шкідливі програми можуть надсилати повідомлення без вашого підтвердження, за що з вас стягуватимуться кошти."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"надсилати SMS-повідомлення без підтвердження"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Дозволяє програмі надсилати SMS-повідомлення. Це може спричинити неочікуване стягнення плати. Шкідливі програми можуть надсилати повідомлення без вашого підтвердження, за що з вас стягуватимуться кошти."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"надсилати події типу \"відповідь повідомленням\""</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Дозволяє програмі надсилати запити іншим програмам обміну повідомленнями, щоб обробляти події типу \"відповідь повідомленням\" для вхідних викликів."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"читати текстові повідомлення (SMS або MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Дозволяє програмі читати SMS повідомлення, збережені в планшетному ПК чи на SIM-карті. Це дозволяє програмі читати всі SMS повідомлення, незалежно від вмісту чи конфіденційності."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Дозволяє програмі читати SMS повідомлення, збережені в телефоні чи на SIM-карті. Це дозволяє програмі читати всі SMS повідомлення, незалежно від вмісту чи конфіденційності."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"подавати запит на дослідження дотиком"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Дозволяє подавати запит на інтерактивний режим, у якому надаються голосові підказки для елементів, яких торкається користувач, а інтерфейсом можна користуватися за допомогою жестів."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"подавати запит на покращення веб-доступності"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Дозволяє подавати запит на ввімкнення покращень веб-доступності. Наприклад, установлювати сценарії, які робитимуть вміст програм доступнішим."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"прив’язати до текстової служби"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Дозволяє власникові прив’язуватися до інтерфейсу верхнього рівня текстової служби (напр. SpellCheckerService). Ніколи не застосовується для звичайних програм."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"прив’язуватися до служби VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Дозволяє програмі керувати політикою мережі та визначити спеціальні правила для програм."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"змінювати облік використання мережі"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Дозволяє програмі змінювати метод підрахунку того, як програми використовують мережу. Не для використання звичайними програмами."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Устан. правила пароля"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Контролювати довжину паролів для розблокування екрана та дозволені в них символи."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Відстежув. спроби розблок. екрана"</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index ecd6bf9..70797cb 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Cho phép ứng dụng đọc tin nhắn quảng bá mà thiết bị của bạn nhận được. Tin nhắn quảng bá cảnh báo được gửi ở một số địa điểm nhằm cảnh báo cho bạn về các tình huống khẩn cấp. Các ứng dụng độc hại có thể gây ảnh hưởng đến hiệu suất hoặc hoạt động của thiết bị của bạn khi nhận được tin nhắn quảng bá khẩn cấp."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"gửi tin nhắn SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Cho phép ứng dụng gửi tin nhắn SMS. Việc này có thể dẫn đến các khoản phí không mong muốn. Các ứng dụng độc hai có thể khiến bạn tốn tiền bằng cách gửi tin nhắn mà không cần sự xác nhận của bạn."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"gửi tin nhắn SMS mà không cần xác nhận"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Cho phép ứng dụng gửi tin nhắn SMS. Việc này có thể dẫn đến các khoản phí không mong muốn. Các ứng dụng độc hai có thể khiến bạn tốn tiền bằng cách gửi tin nhắn mà không cần sự xác nhận của bạn."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"gửi sự kiện trả lời qua tin nhắn"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Cho phép ứng dụng gửi yêu cầu đến ứng dụng nhắn tin khác để xử lý các sự kiện trả lời qua tin nhắn cho các cuộc gọi đến."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"đọc tin nhắn văn bản của bạn (SMS hoặc MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Cho phép ứng dụng đọc tin nhắn SMS được lưu trữ trên máy tính bảng hoặc thẻ SIM của bạn. Việc này cho phép ứng dụng đọc tất cả tin nhắn SMS, bất kể nội dung hay tính bí mật là gì."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Cho phép ứng dụng đọc tin nhắn SMS được lưu trữ trên điện thoại hoặc thẻ SIM của bạn. Việc này cho phép ứng dụng đọc tất cả tin nhắn SMS, bất kể nội dung hay tính bí mật là gì."</string>
@@ -347,10 +347,9 @@
     <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"liên kết với dịch vụ truy cập"</string>
     <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"Cho phép chủ sở hữu liên kết với giao diện cấp cao nhất của dịch vụ truy cập. Không cần thiết cho các ứng dụng thông thường."</string>
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"yêu cầu khám phá bằng cách chạm"</string>
-    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Cho phép chủ sở hữu yêu cầu chế độ tương tác mà các mục đã chạm được đọc to và có thể khám phá giao diện  người dùng qua các thao tác."</string>
-    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"yêu cầu cải thiện hỗ trợ truy cập web"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Cho phép chủ sở hữu yêu cầu chế độ tương tác mà các mục đã chạm được đọc to và có thể khám phá giao diện người dùng qua các thao tác."</string>
+    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"yêu cầu khả năng hỗ trợ truy cập web nâng cao"</string>
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Cho phép chủ sở hữu yêu cầu bật tính năng cải thiện hỗ trợ truy cập web. Ví dụ: cài đặt tập lệnh để nội dung ứng dụng dễ truy cập hơn."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"liên kết với dịch vụ văn bản"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Cho phép chủ sở hữu liên kết với giao diện cấp cao nhất của dịch vụ văn bản (ví dụ: SpellCheckerService). Không cần thiết cho các ứng dụng thông thường."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"liên kết với dịch vụ VPN"</string>
@@ -618,6 +617,8 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Cho phép ứng dụng quản lý chính sách mạng và xác định quy tắc dành riêng cho ứng dụng."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"sửa đổi hạch toán sử dụng mạng"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Cho phép ứng dụng sửa đổi cách tính mức sử dụng mạng so với ứng dụng. Không dành cho các ứng dụng thông thường."</string>
+    <string name="permlab_accessNotifications" msgid="7673416487873432268">"truy cập thông báo"</string>
+    <string name="permdesc_accessNotifications" msgid="458457742683431387">"Cho phép ứng dụng truy xuất, kiểm tra và xóa thông báo, bao gồm những thông báo được đăng bởi các ứng dụng khác."</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Đặt quy tắc mật khẩu"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kiểm soát độ dài và ký tự được phép trong mật khẩu mở khóa màn hình."</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Giám sát những lần thử mở khóa màn hình"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index a253a4c..e4da91a 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -226,7 +226,7 @@
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"访问 USB 存储设备。"</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"访问 SD 卡。"</string>
     <string name="permgrouplab_accessibilityFeatures" msgid="7919025602283593907">"辅助功能"</string>
-    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"辅助技术可请求的功能。"</string>
+    <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"辅助技术可请求启用的功能。"</string>
     <string name="permlab_statusBar" msgid="7417192629601890791">"停用或修改状态栏"</string>
     <string name="permdesc_statusBar" msgid="8434669549504290975">"允许应用停用状态栏或者增删系统图标。"</string>
     <string name="permlab_statusBarService" msgid="7247281911387931485">"状态栏"</string>
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"允许应用读取您的设备收到的小区广播消息。小区广播消息是在某些地区发送的、用于发布紧急情况警告的提醒信息。恶意应用可能会在您收到小区紧急广播时干扰您设备的性能或操作。"</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"发送短信"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"允许该应用发送短信。此权限可能会导致意外收费。恶意应用可能会未经您的确认而发送短信,由此产生相关费用。"</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"不经确认直接发送短信"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"允许该应用发送短信。此权限可能会导致意外收费。恶意应用可能会未经您的确认而发送短信,由此产生相关费用。"</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"发送“通过信息回复”事件"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"允许应用向其他信息应用发送请求,以便处理来电的“通过信息回复”事件。"</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"读取您的文字讯息(短信或彩信)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"允许该应用读取您平板电脑或 SIM 卡上存储的短信。此权限可让该应用读取所有短信,而不考虑短信内容或机密性。"</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"允许该应用读取您手机或 SIM 卡上存储的短信。此权限可让该应用读取所有短信,而不考虑短信内容或机密性。"</string>
@@ -346,11 +346,10 @@
     <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"允许用户绑定至输入法的顶级接口。普通应用绝不需要此权限。"</string>
     <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"绑定至辅助服务"</string>
     <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"允许应用绑定至辅助服务的顶级接口。普通应用绝不需要此权限。"</string>
-    <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"请求触摸浏览"</string>
-    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"允许应用请求启用互动模式,在该模式下,设备可大声读出用户触摸的内容项,而且用户可以通过手势浏览用户界面。"</string>
-    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"请求增强网页辅助功能"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"请求启用触摸浏览"</string>
+    <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"允许应用请求启用互动模式,在该模式下,设备可大声读出用户触摸的内容,而且用户可以通过手势浏览用户界面。"</string>
+    <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"请求启用网页辅助增强功能"</string>
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"允许应用请求打开网页辅助增强功能。例如,安装脚本,以方便用户更轻松地访问应用内容。"</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"绑定至文字服务"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"允许用户绑定至文字服务(如 SpellCheckerService)的顶级接口。普通应用绝不需要此权限。"</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"绑定到 VPN 服务"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"允许应用管理网络政策和定义专门针对应用的规则。"</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"修改网络使用情况记录方式"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"允许该应用修改对于各应用的网络使用情况的统计方式。普通应用不应使用此权限。"</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"设置密码规则"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"控制屏幕解锁密码所允许的长度和字符。"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"监视屏幕解锁尝试次数"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index daaa5bd..b313268 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"允許應用程式讀取您裝置收到的區域廣播訊息。某些地點會發出區域廣播警示,警告您有緊急狀況發生。請注意,惡意應用程式可能會在裝置收到緊急區域廣播時,干擾裝置的效能或運作。"</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"傳送 SMS 簡訊"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"允許應用程式傳送簡訊,但可能產生非預期的費用。惡意應用程式可能利用此功能擅自傳送簡訊,增加您不必要的額外支出。"</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"不需經過確認即傳送 SMS 簡訊"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"允許應用程式傳送簡訊,但可能產生非預期的費用。惡意應用程式可能利用此功能擅自傳送簡訊,增加您不必要的額外支出。"</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"傳送「透過訊息回應」事件"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"允許應用程式傳送要求給其他簡訊應用程式,以處理來電的「透過訊息回應」事件。"</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"讀取您的簡訊 (SMS 或 MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"允許應用程式讀取平板電腦或 SIM 卡上儲存的簡訊。這項權限可讓應用程式讀取所有簡訊,包括各種內容及機密簡訊。"</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"允許應用程式讀取手機或 SIM 卡上儲存的簡訊。這項權限可讓應用程式讀取所有簡訊,包括各種內容及機密簡訊。"</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"要求輕觸探索"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"允許應用程式要求啟用互動模式,讓裝置讀出使用者輕觸的項目,並且讓使用者透過手勢探索使用者介面。"</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"要求增強式網頁協助工具"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"允許應用程式要求啟用網頁協助工具增強功能。例如安裝指令碼,讓使用者更容易存取應用程式的內容。"</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"繫結至文字服務"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"允許應用程式繫結至文字服務 (例如 SpellCheckerService) 的頂層介面 (一般應用程式不需使用)。"</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"繫結至 VPN 服務"</string>
@@ -618,6 +617,8 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"允許應用程式管理網路政策並定義應用程式專用規則。"</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"修改網路使用量計算方式"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"允許應用程式修改應用程式網路使用量的計算方式 (不建議一般應用程式使用)。"</string>
+    <string name="permlab_accessNotifications" msgid="7673416487873432268">"存取通知"</string>
+    <string name="permdesc_accessNotifications" msgid="458457742683431387">"允許應用程式擷取、檢查及清除通知 (包括由其他應用程式發佈的通知)。"</string>
     <string name="policylab_limitPassword" msgid="4497420728857585791">"設定密碼規則"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"控制螢幕解鎖密碼所允許的長度和字元。"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"監視螢幕解鎖嘗試次數"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 9872ecf..757ed6c 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -245,8 +245,8 @@
     <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Ivumela uhlelo lokusebenza ukufunda imilayezo yokusakaza yeselula etholwe idivayisi yakho. Izaziso zokusakaza zeselula zilethwa kwezinye izindawo ukukuxwayisa ngezimo ezisheshayo. Izinhlelo zokusebenza ezingalungile zingaphazamisana nokusebenza noma umsebenzi wedivayisi yakho uma ukusakaza kweselula kwesimo esisheshayo kutholwa."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"thumela imiyalezo ye-SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Ivumela uhlelo lokusebenza ukuthumela imilayezo ye-SMS. Lokhu kungaholela emashajini angallindelekile. Izinhlelo zokusebenza ezingalungile zingakubiza imali ngokuthumela imilayezo ngaphandle kokuqinisekisa kwakho."</string>
-    <string name="permlab_sendSmsNoConfirmation" msgid="4781483105951730228">"thumela i-SMS engenakuqinisekiswa"</string>
-    <string name="permdesc_sendSmsNoConfirmation" msgid="402569800862935907">"Ivumela uhlelo lokusebenza ukuthumela imilayezo ye-SMS. Lokhu kungaholela emashajini angallindelekile. Izinhlelo zokusebenza ezingalungile zingakubiza imali ngokuthumela imilayezo ngaphandle kokuqinisekisa kwakho."</string>
+    <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"thumela imicimbi yokuphendula ngemilayezo"</string>
+    <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"Ivumela uhlelo lokusebenza ukuthumela izicelo kwezinye izinhlelo zokusebenza zemilayezo ukuphatha imicimbi yokuphendula ngemilayezo amakholi angenayo."</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"funda imilayezo yakho ebhaliwe (i-SMS noma i-MMS)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"Ivumela uhlelo lokusebenza ukufunda imilayezo ye-SMS elondolozwe kuthebulethi noma ekhadini lakho le-SIM. Lokhu kuvumela uhlelo lokusebenza ukufunda yonke imilayezo ye-SMS, ngaphandle kokuqukethwe noma ukugcinwa kuyimfihlo."</string>
     <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"Ivumela uhlelo lokusebenza ukufunda imilayezo ye-SMS elondolozwe efonini noma ekhadini lakho le-SIM. Lokhu kuvumela uhlelo lokusebenza ukufunda yonke imilayezo ye-SMS, ngaphandle kokuqukethwe noma ukugcinwa kuyimfihlo."</string>
@@ -349,8 +349,7 @@
     <string name="permlab_canRequestTouchExplorationMode" msgid="6094034289937541846">"cela ukuhlola ngokuthinta"</string>
     <string name="permdesc_canRequestTouchExplorationMode" msgid="940314268922270663">"Ivumela i-hoder ukuthi icele imodi yokusebenzisana lapho izinto ezithintiwe zikhulunywa ngokumemezwa ne-UI ingahlolwa ngezimpawu."</string>
     <string name="permlab_canRequestEnahncedWebAccessibility" msgid="1905232971331801453">"cela ukufinyelela kuwebhu okuthuthukisiwe"</string>
-    <!-- no translation found for permdesc_canRequestEnahncedWebAccessibility (4500520989321729676) -->
-    <skip />
+    <string name="permdesc_canRequestEnahncedWebAccessibility" msgid="4500520989321729676">"Ivumela i-hoder ukucela ukunika amandla ukuthuthukiswa kokufinyelela iwebhu. isibonelo, ukufaka izikripthi kusuka ku-Google ukwenza okuqukethwe kohlelo lokusebenza ukuthi kufinyeleleke."</string>
     <string name="permlab_bindTextService" msgid="7358378401915287938">"bophezela kunsizakalo yombhalo"</string>
     <string name="permdesc_bindTextService" msgid="8151968910973998670">"Ivumela umbambi ukuhlanganisa uxhumano nomsebenzisi kwezinga eliphezulu lwesixhumi esibonakalayo sensizakalo yombhalo(isb. InsizakaloYokuhlolaUkubhala). Akusoze kwadingeka kwezinhlelo zokusebenza ezivamile."</string>
     <string name="permlab_bindVpnService" msgid="4708596021161473255">"hlanganisa kwinsizakalo ye-VPN"</string>
@@ -618,6 +617,10 @@
     <string name="permdesc_manageNetworkPolicy" msgid="7537586771559370668">"Ivumela insiza ukuthi yengamele iigomo iphinde ichaze imithetho ehambisana ngqo nensiza."</string>
     <string name="permlab_modifyNetworkAccounting" msgid="5088217309088729650">"lungisa ukubala kokusebenza kohleloxhumano"</string>
     <string name="permdesc_modifyNetworkAccounting" msgid="5443412866746198123">"Ivumela insiza ukuthi iguqule ukuthii ukusetshenziswa kwenethiwekhi kumiswa kanjani ezinsizeni. Ayisetshenziswa izinsiza ezijwayelekile."</string>
+    <!-- no translation found for permlab_accessNotifications (7673416487873432268) -->
+    <skip />
+    <!-- no translation found for permdesc_accessNotifications (458457742683431387) -->
+    <skip />
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Misa imithetho yephasiwedi"</string>
     <string name="policydesc_limitPassword" msgid="3252114203919510394">"Lawula ubude nezinhlamvu ezivunyelwe kumaphasiwedi okuvula isikrini"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Gaka imizamo yokuvula isikrini"</string>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 22f4e2e..00c6f6d 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1806,6 +1806,11 @@
     <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
     <string name="permdesc_modifyNetworkAccounting">Allows the app to modify how network usage is accounted against apps. Not for use by 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_accessNotifications">access notifications</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_accessNotifications">Allows the app to retrieve, examine, and clear notifications, including those posted by other apps.</string>
+
     <!-- Policy administration -->
 
     <!-- Title of policy access to limiting the user's password choices -->
diff --git a/core/tests/benchmarks/src/android/net/TrafficStatsBenchmark.java b/core/tests/benchmarks/src/android/net/TrafficStatsBenchmark.java
new file mode 100644
index 0000000..5a29adc
--- /dev/null
+++ b/core/tests/benchmarks/src/android/net/TrafficStatsBenchmark.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2013 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 com.google.caliper.SimpleBenchmark;
+
+public class TrafficStatsBenchmark extends SimpleBenchmark {
+    public void timeGetUidRxBytes(int reps) {
+        for (int i = 0; i < reps; i++) {
+            TrafficStats.getUidRxBytes(android.os.Process.myUid());
+        }
+    }
+
+    public void timeGetMobileRxBytes(int reps) {
+        for (int i = 0; i < reps; i++) {
+            TrafficStats.getMobileRxBytes();
+        }
+    }
+
+    public void timeGetTotalRxBytes(int reps) {
+        for (int i = 0; i < reps; i++) {
+            TrafficStats.getTotalRxBytes();
+        }
+    }
+}
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 4100b8d..1a7a84e 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -81,7 +81,7 @@
 Google Play within a 14-day period ending on the date indicated on the x-axis.</p>
 
 <img alt="" height="250" width="660"
-src="http://chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chf=bg,s,00000000&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C08/01%7C08/15%7C09/01%7C09/15%7C10/01%7C10/15%7C11/01%7C11/15%7C12/01%7C12/15%7C01/01%7C01/15%7C02/01%7C1%3A%7C2012%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C2013%7C%7C2013%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:99.2,99.2,99.3,99.4,99.5,99.5,99.5,99.6,100.0,100.0,100.0,100.0,100.0|95.0,95.2,95.6,95.8,96.1,96.3,96.4,96.7,96.9,97.2,97.4,97.4,97.6|79.5,80.4,81.4,82.3,83.2,83.8,84.7,85.6,86.4,87.0,88.2,88.8,89.4|18.9,21.2,23.7,25.5,27.4,28.7,31.1,33.0,35.4,36.8,40.3,42.0,43.6|16.6,19.0,21.5,23.5,25.5,26.8,29.4,31.4,33.8,35.2,38.8,40.7,42.3|0.8,0.9,1.1,1.4,1.8,2.1,3.2,4.8,6.5,7.5,9.9,11.7,13.3&chm=b,c3df9b,0,1,0|tFroyo,689326,1,0,15,,t::-5|b,b4db77,1,2,0|tGingerbread,547a19,2,0,15,,t::-5|b,a5db51,2,3,0|b,96dd28,3,4,0|tIce%20Cream%20Sandwich,293f07,4,0,15,,t::-5|b,83c916,4,5,0|tJelly%20Bean,131d02,5,11,15,,t::-5|B,6fad0c,5,6,0&chg=7,25&chdl=Eclair|Froyo|Gingerbread|Honeycomb|Ice%20Cream%20Sandwich|Jelly%20Bean&chco=add274,9dd14f,8ece2a,7ab61c,659b11,507d08"
+src="//chart.apis.google.com/chart?&cht=lc&chs=660x250&chxt=x,x,y,r&chf=bg,s,00000000&chxr=0,0,12|1,0,12|2,0,100|3,0,100&chxl=0%3A%7C08/01%7C08/15%7C09/01%7C09/15%7C10/01%7C10/15%7C11/01%7C11/15%7C12/01%7C12/15%7C01/01%7C01/15%7C02/01%7C1%3A%7C2012%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C2013%7C%7C2013%7C2%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25%7C3%3A%7C0%25%7C25%25%7C50%25%7C75%25%7C100%25&chxp=0,0,1,2,3,4,5,6,7,8,9,10,11,12&chxtc=0,5&chd=t:99.2,99.2,99.3,99.4,99.5,99.5,99.5,99.6,100.0,100.0,100.0,100.0,100.0|95.0,95.2,95.6,95.8,96.1,96.3,96.4,96.7,96.9,97.2,97.4,97.4,97.6|79.5,80.4,81.4,82.3,83.2,83.8,84.7,85.6,86.4,87.0,88.2,88.8,89.4|18.9,21.2,23.7,25.5,27.4,28.7,31.1,33.0,35.4,36.8,40.3,42.0,43.6|16.6,19.0,21.5,23.5,25.5,26.8,29.4,31.4,33.8,35.2,38.8,40.7,42.3|0.8,0.9,1.1,1.4,1.8,2.1,3.2,4.8,6.5,7.5,9.9,11.7,13.3&chm=b,c3df9b,0,1,0|tFroyo,689326,1,0,15,,t::-5|b,b4db77,1,2,0|tGingerbread,547a19,2,0,15,,t::-5|b,a5db51,2,3,0|b,96dd28,3,4,0|tIce%20Cream%20Sandwich,293f07,4,0,15,,t::-5|b,83c916,4,5,0|tJelly%20Bean,131d02,5,11,15,,t::-5|B,6fad0c,5,6,0&chg=7,25&chdl=Eclair|Froyo|Gingerbread|Honeycomb|Ice%20Cream%20Sandwich|Jelly%20Bean&chco=add274,9dd14f,8ece2a,7ab61c,659b11,507d08"
 />
 <p><em>Last historical dataset collected during a 14-day period ending on February 1, 2013</em></p>
 
diff --git a/docs/html/training/gestures/scroll.jd b/docs/html/training/gestures/scroll.jd
index 955495a..8576948 100644
--- a/docs/html/training/gestures/scroll.jd
+++ b/docs/html/training/gestures/scroll.jd
@@ -45,13 +45,7 @@
 
 <p>You can use scrollers ({@link android.widget.Scroller} or {@link
 android.widget.OverScroller}) to collect the data you need to produce a
-scrolling animation in response to a touch event. {@link
-android.widget.Scroller} and {@link android.widget.OverScroller} are largely
-interchangeable&mdash;the difference is that {@link android.widget.OverScroller}
-allows temporarily scrolling beyond the minimum/maximum boundaries and springing
-back to the bounds. This is normally rendered using a "glow" effect, provided by
-the {@link android.widget.EdgeEffect} or {@link
-android.support.v4.widget.EdgeEffectCompat} classes. </p>
+scrolling animation in response to a touch event.</p>
 
 <p>A scroller is used  to animate scrolling over time, using platform-standard
 scrolling physics (friction, velocity, etc.). The scroller itself doesn't
@@ -157,5 +151,4 @@
 }</pre>
 
 <p>For another example of scroller usage, see the <a href="http://github.com/android/platform_frameworks_support/blob/master/v4/java/android/support/v4/view/ViewPager.java">source code</a> for the 
-{@link android.support.v4.view.ViewPager} class. It scrolls in response to flings, 
-and uses scrolling to implement the "snapping to page" animation.</p>
+{@link android.support.v4.view.ViewPager} class.</p>
diff --git a/graphics/java/android/graphics/drawable/BitmapDrawable.java b/graphics/java/android/graphics/drawable/BitmapDrawable.java
index 6e41d34..675c4b6 100644
--- a/graphics/java/android/graphics/drawable/BitmapDrawable.java
+++ b/graphics/java/android/graphics/drawable/BitmapDrawable.java
@@ -74,8 +74,8 @@
     
     /**
      * Create an empty drawable, not dealing with density.
-     * @deprecated Use {@link #BitmapDrawable(Resources)} to ensure
-     * that the drawable has correctly set its target density.
+     * @deprecated Use {@link #BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap)}
+     * instead to specify a bitmap to draw with and ensure the correct density is set.
      */
     @Deprecated
     public BitmapDrawable() {
@@ -85,7 +85,10 @@
     /**
      * Create an empty drawable, setting initial target density based on
      * the display metrics of the resources.
+     * @deprecated Use {@link #BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap)}
+     * instead to specify a bitmap to draw with.
      */
+    @Deprecated
     @SuppressWarnings({"UnusedParameters"})
     public BitmapDrawable(Resources res) {
         mBitmapState = new BitmapState((Bitmap) null);
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java
index 54d1bf5..37f2250 100644
--- a/graphics/java/android/graphics/drawable/Drawable.java
+++ b/graphics/java/android/graphics/drawable/Drawable.java
@@ -868,6 +868,7 @@
         } else if (name.equals("inset")) {
             drawable = new InsetDrawable();
         } else if (name.equals("bitmap")) {
+            //noinspection deprecation
             drawable = new BitmapDrawable(r);
             if (r != null) {
                ((BitmapDrawable) drawable).setTargetDensity(r.getDisplayMetrics());
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 00e8769..50d888f 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -517,6 +517,8 @@
     }
     native void rsnScriptForEach(int con, int id, int slot, int ain, int aout, byte[] params);
     native void rsnScriptForEach(int con, int id, int slot, int ain, int aout);
+    native void rsnScriptForEachClipped(int con, int id, int slot, int ain, int aout, byte[] params,
+                                        int xstart, int xend, int ystart, int yend, int zstart, int zend);
     synchronized void nScriptForEach(int id, int slot, int ain, int aout, byte[] params) {
         validate();
         if (params == null) {
@@ -525,6 +527,13 @@
             rsnScriptForEach(mContext, id, slot, ain, aout, params);
         }
     }
+
+    synchronized void nScriptForEachClipped(int id, int slot, int ain, int aout, byte[] params,
+                                            int xstart, int xend, int ystart, int yend, int zstart, int zend) {
+        validate();
+        rsnScriptForEachClipped(mContext, id, slot, ain, aout, params, xstart, xend, ystart, yend, zstart, zend);
+    }
+
     native void rsnScriptInvokeV(int con, int id, int slot, byte[] params);
     synchronized void nScriptInvokeV(int id, int slot, byte[] params) {
         validate();
diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java
index fe80967..b53ba0d 100644
--- a/graphics/java/android/renderscript/Script.java
+++ b/graphics/java/android/renderscript/Script.java
@@ -166,6 +166,25 @@
         mRS.nScriptForEach(getID(mRS), slot, in_id, out_id, params);
     }
 
+    protected void forEach(int slot, Allocation ain, Allocation aout, FieldPacker v, LaunchOptions sc) {
+        if (ain == null && aout == null) {
+            throw new RSIllegalArgumentException(
+                "At least one of ain or aout is required to be non-null.");
+        }
+        int in_id = 0;
+        if (ain != null) {
+            in_id = ain.getID(mRS);
+        }
+        int out_id = 0;
+        if (aout != null) {
+            out_id = aout.getID(mRS);
+        }
+        byte[] params = null;
+        if (v != null) {
+            params = v.getData();
+        }
+        mRS.nScriptForEachClipped(getID(mRS), slot, in_id, out_id, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend);
+    }
 
     Script(int id, RenderScript rs) {
         super(id, rs);
@@ -320,29 +339,43 @@
     }
 
     public static final class LaunchOptions {
-        protected int xstart = -1;
-        protected int ystart = -1;
-        protected int xend = -1 ;
-        protected int yend = -1;
+        protected int xstart = 0;
+        protected int ystart = 0;
+        protected int xend = 0;
+        protected int yend = 0;
+        protected int zstart = 0;
+        protected int zend = 0;
 
         protected int strategy;
 
-        public void setX(int xstartArg, int xendArg) {
+        public LaunchOptions setX(int xstartArg, int xendArg) {
             if (xstartArg < 0 || xendArg <= xstartArg) {
                 throw new RSIllegalArgumentException("Invalid dimensions");
             }
             xstart = xstartArg;
             xend = xendArg;
+            return this;
         }
 
-        public void setY(int ystartArg, int yendArg) {
+        public LaunchOptions setY(int ystartArg, int yendArg) {
             if (ystartArg < 0 || yendArg <= ystartArg) {
                 throw new RSIllegalArgumentException("Invalid dimensions");
             }
             ystart = ystartArg;
             yend = yendArg;
+            return this;
         }
 
+        public LaunchOptions setZ(int zstartArg, int zendArg) {
+            if (zstartArg < 0 || zendArg <= zstartArg) {
+                throw new RSIllegalArgumentException("Invalid dimensions");
+            }
+            zstart = zstartArg;
+            zend = zendArg;
+            return this;
+        }
+
+
         public int getXStart() {
             return xstart;
         }
@@ -355,6 +388,12 @@
         public int getYEnd() {
             return yend;
         }
+        public int getZStart() {
+            return zstart;
+        }
+        public int getZEnd() {
+            return zend;
+        }
 
     }
 }
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 80001a6..9a8a6e8 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -1039,7 +1039,7 @@
                jint script, jint slot, jint ain, jint aout)
 {
     LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0);
+    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, NULL, 0);
 }
 static void
 nScriptForEachV(JNIEnv *_env, jobject _this, RsContext con,
@@ -1048,10 +1048,32 @@
     LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(params);
     jbyte *ptr = _env->GetByteArrayElements(params, NULL);
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len);
+    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, NULL, 0);
     _env->ReleaseByteArrayElements(params, ptr, JNI_ABORT);
 }
 
+static void
+nScriptForEachClipped(JNIEnv *_env, jobject _this, RsContext con,
+                      jint script, jint slot, jint ain, jint aout,
+                      jbyteArray params, jint xstart, jint xend,
+                      jint ystart, jint yend, jint zstart, jint zend)
+{
+    LOG_API("nScriptForEachClipped, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
+    jint len = _env->GetArrayLength(params);
+    jbyte *ptr = _env->GetByteArrayElements(params, NULL);
+    RsScriptCall sc;
+    sc.xStart = xstart;
+    sc.xEnd = xend;
+    sc.yStart = ystart;
+    sc.yEnd = yend;
+    sc.zStart = zstart;
+    sc.zEnd = zend;
+    sc.strategy = RS_FOR_EACH_STRATEGY_DONT_CARE;
+    sc.arrayStart = 0;
+    sc.arrayEnd = 0;
+    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, &sc, sizeof(sc));
+    _env->ReleaseByteArrayElements(params, ptr, JNI_ABORT);
+}
 
 // -----------------------------------
 
@@ -1514,6 +1536,7 @@
 {"rsnScriptInvokeV",                 "(III[B)V",                              (void*)nScriptInvokeV },
 {"rsnScriptForEach",                 "(IIIII)V",                              (void*)nScriptForEach },
 {"rsnScriptForEach",                 "(IIIII[B)V",                            (void*)nScriptForEachV },
+{"rsnScriptForEachClipped",          "(IIIII[BIIIIII)V",                      (void*)nScriptForEachClipped },
 {"rsnScriptSetVarI",                 "(IIII)V",                               (void*)nScriptSetVarI },
 {"rsnScriptSetVarJ",                 "(IIIJ)V",                               (void*)nScriptSetVarJ },
 {"rsnScriptSetVarF",                 "(IIIF)V",                               (void*)nScriptSetVarF },
diff --git a/icu4j/java/android/icu/text/ArabicShaping.java b/icu4j/java/android/icu/text/ArabicShaping.java
deleted file mode 100644
index 13e2175..0000000
--- a/icu4j/java/android/icu/text/ArabicShaping.java
+++ /dev/null
@@ -1,1947 +0,0 @@
-/*
-*******************************************************************************
-*   Copyright (C) 2001-2009, International Business Machines
-*   Corporation and others.  All Rights Reserved.
-*******************************************************************************
-*/
-
-/*
- * Ported with minor modifications from ICU4J 4.2's
- * com.ibm.icu.text.ArabicShaping class.
- */
-
-package android.icu.text;
-
-
-/**
- * Shape Arabic text on a character basis.
- *
- * <p>ArabicShaping performs basic operations for "shaping" Arabic text. It is most
- * useful for use with legacy data formats and legacy display technology
- * (simple terminals). All operations are performed on Unicode characters.</p>
- *
- * <p>Text-based shaping means that some character code points in the text are
- * replaced by others depending on the context. It transforms one kind of text
- * into another. In comparison, modern displays for Arabic text select
- * appropriate, context-dependent font glyphs for each text element, which means
- * that they transform text into a glyph vector.</p>
- *
- * <p>Text transformations are necessary when modern display technology is not
- * available or when text needs to be transformed to or from legacy formats that
- * use "shaped" characters. Since the Arabic script is cursive, connecting
- * adjacent letters to each other, computers select images for each letter based
- * on the surrounding letters. This usually results in four images per Arabic
- * letter: initial, middle, final, and isolated forms. In Unicode, on the other
- * hand, letters are normally stored abstract, and a display system is expected
- * to select the necessary glyphs. (This makes searching and other text
- * processing easier because the same letter has only one code.) It is possible
- * to mimic this with text transformations because there are characters in
- * Unicode that are rendered as letters with a specific shape
- * (or cursive connectivity). They were included for interoperability with
- * legacy systems and codepages, and for unsophisticated display systems.</p>
- *
- * <p>A second kind of text transformations is supported for Arabic digits:
- * For compatibility with legacy codepages that only include European digits,
- * it is possible to replace one set of digits by another, changing the
- * character code points. These operations can be performed for either
- * Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic
- * digits (U+06f0...U+06f9).</p>
- *
- * <p>Some replacements may result in more or fewer characters (code points).
- * By default, this means that the destination buffer may receive text with a
- * length different from the source length. Some legacy systems rely on the
- * length of the text to be constant. They expect extra spaces to be added
- * or consumed either next to the affected character or at the end of the
- * text.</p>
- * @stable ICU 2.0
- *
- * @hide
- */
-public class ArabicShaping {
-    private final int options;
-    private boolean isLogical; // convenience
-    private boolean spacesRelativeToTextBeginEnd;
-    private char tailChar;
-
-    public static final ArabicShaping SHAPER = new ArabicShaping(
-            ArabicShaping.TEXT_DIRECTION_LOGICAL |
-            ArabicShaping.LENGTH_FIXED_SPACES_NEAR |
-            ArabicShaping.LETTERS_SHAPE |
-            ArabicShaping.DIGITS_NOOP);
-
-    /**
-     * Convert a range of text in the source array, putting the result
-     * into a range of text in the destination array, and return the number
-     * of characters written.
-     *
-     * @param source An array containing the input text
-     * @param sourceStart The start of the range of text to convert
-     * @param sourceLength The length of the range of text to convert
-     * @param dest The destination array that will receive the result.
-     *   It may be <code>NULL</code> only if  <code>destSize</code> is 0.
-     * @param destStart The start of the range of the destination buffer to use.
-     * @param destSize The size (capacity) of the destination buffer.
-     *   If <code>destSize</code> is 0, then no output is produced,
-     *   but the necessary buffer size is returned ("preflighting").  This
-     *   does not validate the text against the options, for example,
-     *   if letters are being unshaped, and spaces are being consumed
-     *   following lamalef, this will not detect a lamalef without a
-     *   corresponding space.  An error will be thrown when the actual
-     *   conversion is attempted.
-     * @return The number of chars written to the destination buffer.
-     *   If an error occurs, then no output was written, or it may be
-     *   incomplete.
-     * @throws ArabicShapingException if the text cannot be converted according to the options.
-     * @stable ICU 2.0
-     */
-    public int shape(char[] source, int sourceStart, int sourceLength,
-                     char[] dest, int destStart, int destSize) throws ArabicShapingException {
-        if (source == null) {
-            throw new IllegalArgumentException("source can not be null");
-        }
-        if (sourceStart < 0 || sourceLength < 0 || sourceStart + sourceLength > source.length) {
-            throw new IllegalArgumentException("bad source start (" + sourceStart +
-                                               ") or length (" + sourceLength +
-                                               ") for buffer of length " + source.length);
-        }
-        if (dest == null && destSize != 0) {
-            throw new IllegalArgumentException("null dest requires destSize == 0");
-        }
-        if ((destSize != 0) &&
-            (destStart < 0 || destSize < 0 || destStart + destSize > dest.length)) {
-            throw new IllegalArgumentException("bad dest start (" + destStart +
-                                               ") or size (" + destSize +
-                                               ") for buffer of length " + dest.length);
-        }
-        /* Validate input options */
-        if ( ((options&TASHKEEL_MASK) > 0) &&
-             !(((options & TASHKEEL_MASK)==TASHKEEL_BEGIN)  ||
-               ((options & TASHKEEL_MASK)==TASHKEEL_END )   ||
-               ((options & TASHKEEL_MASK)==TASHKEEL_RESIZE )||
-               ((options & TASHKEEL_MASK)==TASHKEEL_REPLACE_BY_TATWEEL)) ){
-            throw new IllegalArgumentException("Wrong Tashkeel argument");
-        }
-
-       ///CLOVER:OFF
-       //According to Steven Loomis, the code is unreachable when you OR all the constants within the if statements
-       if(((options&LAMALEF_MASK) > 0)&&
-              !(((options & LAMALEF_MASK)==LAMALEF_BEGIN)  ||
-                ((options & LAMALEF_MASK)==LAMALEF_END )   ||
-                ((options & LAMALEF_MASK)==LAMALEF_RESIZE )||
-                 ((options & LAMALEF_MASK)==LAMALEF_AUTO)  ||
-                 ((options & LAMALEF_MASK)==LAMALEF_NEAR))){
-           throw new IllegalArgumentException("Wrong Lam Alef argument");
-       }
-       ///CLOVER:ON
-
-       /* Validate Tashkeel (Tashkeel replacement options should be enabled in shaping mode only)*/
-       if(((options&TASHKEEL_MASK) > 0) && (options&LETTERS_MASK) == LETTERS_UNSHAPE) {
-            throw new IllegalArgumentException("Tashkeel replacement should not be enabled in deshaping mode ");
-       }
-       return internalShape(source, sourceStart, sourceLength, dest, destStart, destSize);
-    }
-
-    /**
-     * Convert a range of text in place.  This may only be used if the Length option
-     * does not grow or shrink the text.
-     *
-     * @param source An array containing the input text
-     * @param start The start of the range of text to convert
-     * @param length The length of the range of text to convert
-     * @throws ArabicShapingException if the text cannot be converted according to the options.
-     * @stable ICU 2.0
-     */
-    public void shape(char[] source, int start, int length) throws ArabicShapingException {
-        if ((options & LAMALEF_MASK) == LAMALEF_RESIZE) {
-            throw new ArabicShapingException("Cannot shape in place with length option resize.");
-        }
-        shape(source, start, length, source, start, length);
-    }
-
-    /**
-     * Convert a string, returning the new string.
-     *
-     * @param text the string to convert
-     * @return the converted string
-     * @throws ArabicShapingException if the string cannot be converted according to the options.
-     * @stable ICU 2.0
-     */
-    public String shape(String text) throws ArabicShapingException {
-        char[] src = text.toCharArray();
-        char[] dest = src;
-        if (((options & LAMALEF_MASK) == LAMALEF_RESIZE) &&
-            ((options & LETTERS_MASK) == LETTERS_UNSHAPE)) {
-
-            dest = new char[src.length * 2]; // max
-        }
-        int len = shape(src, 0, src.length, dest, 0, dest.length);
-
-        return new String(dest, 0, len);
-    }
-
-    /**
-     * Construct ArabicShaping using the options flags.
-     * The flags are as follows:<br>
-     * 'LENGTH' flags control whether the text can change size, and if not,
-     * how to maintain the size of the text when LamAlef ligatures are
-     * formed or broken.<br>
-     * 'TEXT_DIRECTION' flags control whether the text is read and written
-     * in visual order or in logical order.<br>
-     * 'LETTERS_SHAPE' flags control whether conversion is to or from
-     * presentation forms.<br>
-     * 'DIGITS' flags control whether digits are shaped, and whether from
-     * European to Arabic-Indic or vice-versa.<br>
-     * 'DIGIT_TYPE' flags control whether standard or extended Arabic-Indic
-     * digits are used when performing digit conversion.
-     * @stable ICU 2.0
-     */
-    public ArabicShaping(int options) {
-        this.options = options;
-        if ((options & DIGITS_MASK) > 0x80) {
-            throw new IllegalArgumentException("bad DIGITS options");
-        }
-
-        isLogical = ( (options & TEXT_DIRECTION_MASK) == TEXT_DIRECTION_LOGICAL );
-        /* Validate options */
-        spacesRelativeToTextBeginEnd = ( (options & SPACES_RELATIVE_TO_TEXT_MASK) == SPACES_RELATIVE_TO_TEXT_BEGIN_END );
-        if ( (options&SHAPE_TAIL_TYPE_MASK) == SHAPE_TAIL_NEW_UNICODE){
-            tailChar = NEW_TAIL_CHAR;
-        } else {
-            tailChar = OLD_TAIL_CHAR;
-        }
-    }
-
-    /* Seen Tail options */
-    /**
-     * Memory option: the result must have the same length as the source.
-     * Shaping mode: The SEEN family character will expand into two characters using space near
-     *               the SEEN family character(i.e. the space after the character).
-     *               if there are no spaces found, ArabicShapingException will be thrown
-     *
-     * De-shaping mode: Any Seen character followed by Tail character will be
-     *                  replaced by one cell Seen and a space will replace the Tail.
-     * Affects: Seen options
-     */
-    public static final int SEEN_TWOCELL_NEAR = 0x200000;
-
-    /** Bit mask for Seen memory options. */
-    public static final int SEEN_MASK = 0x700000;
-
-    /* YehHamza options */
-    /**
-     * Memory option: the result must have the same length as the source.
-     * Shaping mode: The YEHHAMZA character will expand into two characters using space near it
-     *              (i.e. the space after the character)
-     *               if there are no spaces found, ArabicShapingException will be thrown
-     *
-     * De-shaping mode: Any Yeh (final or isolated) character followed by Hamza character will be
-     *                  replaced by one cell YehHamza and space will replace the Hamza.
-     * Affects: YehHamza options
-     */
-    public static final int YEHHAMZA_TWOCELL_NEAR  = 0x1000000;
-
-
-    /** Bit mask for YehHamza memory options. */
-    public static final int YEHHAMZA_MASK = 0x3800000;
-
-    /* New Tashkeel options */
-    /**
-     * Memory option: the result must have the same length as the source.
-     * Shaping mode: Tashkeel characters will be replaced by spaces.
-     *               Spaces will be placed at beginning of the buffer
-     *
-     * De-shaping mode: N/A
-     * Affects: Tashkeel options
-     */
-    public static final int TASHKEEL_BEGIN = 0x40000;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * Shaping mode: Tashkeel characters will be replaced by spaces.
-     *               Spaces will be placed at end of the buffer
-     *
-     * De-shaping mode: N/A
-     * Affects: Tashkeel options
-     */
-    public static final int TASHKEEL_END = 0x60000;
-
-    /**
-     * Memory option: allow the result to have a different length than the source.
-     * Shaping mode: Tashkeel characters will be removed, buffer length will shrink.
-     * De-shaping mode: N/A
-     *
-     * Affects: Tashkeel options
-     */
-    public static final int TASHKEEL_RESIZE = 0x80000;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * Shaping mode: Tashkeel characters will be replaced by Tatweel if it is connected to adjacent
-     *               characters (i.e. shaped on Tatweel) or replaced by space if it is not connected.
-     *
-     * De-shaping mode: N/A
-     * Affects: YehHamza options
-     */
-    public static final int TASHKEEL_REPLACE_BY_TATWEEL = 0xC0000;
-
-    /** Bit mask for Tashkeel replacement with Space or Tatweel memory options. */
-    public static final int TASHKEEL_MASK  = 0xE0000;
-
-    /* Space location Control options */
-    /**
-     * This option effects the meaning of BEGIN and END options. if this option is not used the default
-     * for BEGIN and END will be as following:
-     * The Default (for both Visual LTR, Visual RTL and Logical Text)
-     *           1. BEGIN always refers to the start address of physical memory.
-     *           2. END always refers to the end address of physical memory.
-     *
-     * If this option is used it will swap the meaning of BEGIN and END only for Visual LTR text.
-     *
-     * The affect on BEGIN and END Memory Options will be as following:
-     *    A. BEGIN For Visual LTR text: This will be the beginning (right side) of the visual text
-     *       (corresponding to the physical memory address end, same as END in default behavior)
-     *    B. BEGIN For Logical text: Same as BEGIN in default behavior.
-     *    C. END For Visual LTR text: This will be the end (left side) of the visual text. (corresponding to
-     *      the physical memory address beginning, same as BEGIN in default behavior)
-     *    D. END For Logical text: Same as END in default behavior.
-     * Affects: All LamAlef BEGIN, END and AUTO options.
-     */
-    public static final int SPACES_RELATIVE_TO_TEXT_BEGIN_END = 0x4000000;
-
-    /** Bit mask for swapping BEGIN and END for Visual LTR text */
-    public static final int SPACES_RELATIVE_TO_TEXT_MASK = 0x4000000;
-
-    /**
-     * If this option is used, shaping will use the new Unicode code point for TAIL (i.e. 0xFE73).
-     * If this option is not specified (Default), old unofficial Unicode TAIL code point is used (i.e. 0x200B)
-     * De-shaping will not use this option as it will always search for both the new Unicode code point for the
-     * TAIL (i.e. 0xFE73) or the old unofficial Unicode TAIL code point (i.e. 0x200B) and de-shape the
-     * Seen-Family letter accordingly.
-     *
-     * Shaping Mode: Only shaping.
-     * De-shaping Mode: N/A.
-     * Affects: All Seen options
-     */
-    public static final int SHAPE_TAIL_NEW_UNICODE = 0x8000000;
-
-    /** Bit mask for new Unicode Tail option */
-    public static final int SHAPE_TAIL_TYPE_MASK = 0x8000000;
-
-    /**
-     * Memory option: allow the result to have a different length than the source.
-     * @stable ICU 2.0
-     */
-    public static final int LENGTH_GROW_SHRINK = 0;
-
-    /**
-     * Memory option: allow the result to have a different length than the source.
-     * Affects: LamAlef options
-     * This option is an alias to LENGTH_GROW_SHRINK
-     */
-    public static final int LAMALEF_RESIZE   = 0;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * If more room is necessary, then try to consume spaces next to modified characters.
-     * @stable ICU 2.0
-     */
-    public static final int LENGTH_FIXED_SPACES_NEAR = 1;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * If more room is necessary, then try to consume spaces next to modified characters.
-     * Affects: LamAlef options
-     * This option is an alias to LENGTH_FIXED_SPACES_NEAR
-     */
-    public static final int LAMALEF_NEAR = 1 ;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * If more room is necessary, then try to consume spaces at the end of the text.
-     * @stable ICU 2.0
-     */
-    public static final int LENGTH_FIXED_SPACES_AT_END = 2;
-
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * If more room is necessary, then try to consume spaces at the end of the text.
-     * Affects: LamAlef options
-     * This option is an alias to LENGTH_FIXED_SPACES_AT_END
-     */
-    public static final int LAMALEF_END = 2;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * If more room is necessary, then try to consume spaces at the beginning of the text.
-     * @stable ICU 2.0
-     */
-    public static final int LENGTH_FIXED_SPACES_AT_BEGINNING = 3;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * If more room is necessary, then try to consume spaces at the beginning of the text.
-     * Affects: LamAlef options
-     * This option is an alias to LENGTH_FIXED_SPACES_AT_BEGINNING
-     */
-    public static final int LAMALEF_BEGIN = 3;
-
-    /**
-     * Memory option: the result must have the same length as the source.
-     * Shaping Mode: For each LAMALEF character found, expand LAMALEF using space at end.
-     *               If there is no space at end, use spaces at beginning of the buffer. If there
-     *               is no space at beginning of the buffer, use spaces at the near (i.e. the space
-     *               after the LAMALEF character).
-     *
-     * Deshaping Mode: Perform the same function as the flag equals LAMALEF_END.
-     * Affects: LamAlef options
-     */
-    public static final int LAMALEF_AUTO  = 0x10000;
-
-    /**
-     * Bit mask for memory options.
-     * @stable ICU 2.0
-     */
-    public static final int LENGTH_MASK = 0x10003;
-
-    /** Bit mask for LamAlef memory options. */
-
-    public static final int LAMALEF_MASK  = 0x10003;
-
-    /**
-     * Direction indicator: the source is in logical (keyboard) order.
-     * @stable ICU 2.0
-     */
-    public static final int TEXT_DIRECTION_LOGICAL = 0;
-
-    /**
-     * Direction indicator:the source is in visual RTL order,
-     * the rightmost displayed character stored first.
-     * This option is an alias to U_SHAPE_TEXT_DIRECTION_LOGICAL
-     */
-    public static final int TEXT_DIRECTION_VISUAL_RTL = 0;
-
-    /**
-     * Direction indicator: the source is in visual (display) order, that is,
-     * the leftmost displayed character is stored first.
-     * @stable ICU 2.0
-     */
-    public static final int TEXT_DIRECTION_VISUAL_LTR = 4;
-
-    /**
-     * Bit mask for direction indicators.
-     * @stable ICU 2.0
-     */
-    public static final int TEXT_DIRECTION_MASK = 4;
-
-
-    /**
-     * Letter shaping option: do not perform letter shaping.
-     * @stable ICU 2.0
-     */
-    public static final int LETTERS_NOOP = 0;
-
-    /**
-     * Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block,
-     * by shaped ones in the U+FE70 (Presentation Forms B) block. Performs Lam-Alef ligature
-     * substitution.
-     * @stable ICU 2.0
-     */
-    public static final int LETTERS_SHAPE = 8;
-
-    /**
-     * Letter shaping option: replace shaped letter characters in the U+FE70 (Presentation Forms B) block
-     * by normative ones in the U+0600 (Arabic) block.  Converts Lam-Alef ligatures to pairs of Lam and
-     * Alef characters, consuming spaces if required.
-     * @stable ICU 2.0
-     */
-    public static final int LETTERS_UNSHAPE = 0x10;
-
-    /**
-     * Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block,
-     * except for the TASHKEEL characters at U+064B...U+0652, by shaped ones in the U+Fe70
-     * (Presentation Forms B) block.  The TASHKEEL characters will always be converted to
-     * the isolated forms rather than to their correct shape.
-     * @stable ICU 2.0
-     */
-    public static final int LETTERS_SHAPE_TASHKEEL_ISOLATED = 0x18;
-
-    /**
-     * Bit mask for letter shaping options.
-     * @stable ICU 2.0
-     */
-    public static final int LETTERS_MASK = 0x18;
-
-
-    /**
-     * Digit shaping option: do not perform digit shaping.
-     * @stable ICU 2.0
-     */
-    public static final int DIGITS_NOOP = 0;
-
-    /**
-     * Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
-     * @stable ICU 2.0
-     */
-    public static final int DIGITS_EN2AN = 0x20;
-
-    /**
-     * Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
-     * @stable ICU 2.0
-     */
-    public static final int DIGITS_AN2EN = 0x40;
-
-    /**
-     * Digit shaping option:
-     * Replace European digits (U+0030...U+0039) by Arabic-Indic digits
-     * if the most recent strongly directional character
-     * is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
-     * The initial state at the start of the text is assumed to be not an Arabic,
-     * letter, so European digits at the start of the text will not change.
-     * Compare to DIGITS_ALEN2AN_INIT_AL.
-     * @stable ICU 2.0
-     */
-    public static final int DIGITS_EN2AN_INIT_LR = 0x60;
-
-    /**
-     * Digit shaping option:
-     * Replace European digits (U+0030...U+0039) by Arabic-Indic digits
-     * if the most recent strongly directional character
-     * is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
-     * The initial state at the start of the text is assumed to be an Arabic,
-     * letter, so European digits at the start of the text will change.
-     * Compare to DIGITS_ALEN2AN_INT_LR.
-     * @stable ICU 2.0
-     */
-    public static final int DIGITS_EN2AN_INIT_AL = 0x80;
-
-    /** Not a valid option value. */
-    //private static final int DIGITS_RESERVED = 0xa0;
-
-    /**
-     * Bit mask for digit shaping options.
-     * @stable ICU 2.0
-     */
-    public static final int DIGITS_MASK = 0xe0;
-
-    /**
-     * Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
-     * @stable ICU 2.0
-     */
-    public static final int DIGIT_TYPE_AN = 0;
-
-    /**
-     * Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
-     * @stable ICU 2.0
-     */
-    public static final int DIGIT_TYPE_AN_EXTENDED = 0x100;
-
-    /**
-     * Bit mask for digit type options.
-     * @stable ICU 2.0
-     */
-    public static final int DIGIT_TYPE_MASK = 0x0100; // 0x3f00?
-
-    /**
-     * some constants
-     */
-    private static final char HAMZAFE_CHAR       = '\ufe80';
-    private static final char HAMZA06_CHAR       = '\u0621';
-    private static final char YEH_HAMZA_CHAR     = '\u0626';
-    private static final char YEH_HAMZAFE_CHAR   = '\uFE89';
-    private static final char LAMALEF_SPACE_SUB  = '\uffff';
-    private static final char TASHKEEL_SPACE_SUB = '\ufffe';
-    private static final char LAM_CHAR      = '\u0644';
-    private static final char SPACE_CHAR    = '\u0020';
-    private static final char SPACE_CHAR_FOR_LAMALEF = '\ufeff'; // XXX: tweak for TextLine use
-    private static final char SHADDA_CHAR   = '\uFE7C';
-    private static final char TATWEEL_CHAR  = '\u0640';
-    private static final char SHADDA_TATWEEL_CHAR = '\uFE7D';
-    private static final char NEW_TAIL_CHAR = '\uFE73';
-    private static final char OLD_TAIL_CHAR = '\u200B';
-    private static final int SHAPE_MODE      = 0;
-    private static final int DESHAPE_MODE    = 1;
-
-    /**
-     * @stable ICU 2.0
-     */
-    public boolean equals(Object rhs) {
-        return rhs != null &&
-            rhs.getClass() == ArabicShaping.class &&
-            options == ((ArabicShaping)rhs).options;
-    }
-
-    /**
-     * @stable ICU 2.0
-     */
-     ///CLOVER:OFF
-    public int hashCode() {
-        return options;
-    }
-
-    /**
-     * @stable ICU 2.0
-     */
-    public String toString() {
-        StringBuffer buf = new StringBuffer(super.toString());
-        buf.append('[');
-
-        switch (options & LAMALEF_MASK) {
-        case LAMALEF_RESIZE: buf.append("LamAlef resize"); break;
-        case LAMALEF_NEAR: buf.append("LamAlef spaces at near"); break;
-        case LAMALEF_BEGIN: buf.append("LamAlef spaces at begin"); break;
-        case LAMALEF_END: buf.append("LamAlef spaces at end"); break;
-        case LAMALEF_AUTO: buf.append("lamAlef auto"); break;
-        }
-        switch (options & TEXT_DIRECTION_MASK) {
-        case TEXT_DIRECTION_LOGICAL: buf.append(", logical"); break;
-        case TEXT_DIRECTION_VISUAL_LTR: buf.append(", visual"); break;
-        }
-        switch (options & LETTERS_MASK) {
-        case LETTERS_NOOP: buf.append(", no letter shaping"); break;
-        case LETTERS_SHAPE: buf.append(", shape letters"); break;
-        case LETTERS_SHAPE_TASHKEEL_ISOLATED: buf.append(", shape letters tashkeel isolated"); break;
-        case LETTERS_UNSHAPE: buf.append(", unshape letters"); break;
-        }
-        switch (options & SEEN_MASK) {
-        case SEEN_TWOCELL_NEAR: buf.append(", Seen at near"); break;
-        }
-        switch (options & YEHHAMZA_MASK) {
-        case YEHHAMZA_TWOCELL_NEAR: buf.append(", Yeh Hamza at near"); break;
-        }
-        switch (options & TASHKEEL_MASK) {
-        case TASHKEEL_BEGIN: buf.append(", Tashkeel at begin"); break;
-        case TASHKEEL_END: buf.append(", Tashkeel at end"); break;
-        case TASHKEEL_REPLACE_BY_TATWEEL: buf.append(", Tashkeel replace with tatweel"); break;
-        case TASHKEEL_RESIZE: buf.append(", Tashkeel resize"); break;
-        }
-
-        switch (options & DIGITS_MASK) {
-        case DIGITS_NOOP: buf.append(", no digit shaping"); break;
-        case DIGITS_EN2AN: buf.append(", shape digits to AN"); break;
-        case DIGITS_AN2EN: buf.append(", shape digits to EN"); break;
-        case DIGITS_EN2AN_INIT_LR: buf.append(", shape digits to AN contextually: default EN"); break;
-        case DIGITS_EN2AN_INIT_AL: buf.append(", shape digits to AN contextually: default AL"); break;
-        }
-        switch (options & DIGIT_TYPE_MASK) {
-        case DIGIT_TYPE_AN: buf.append(", standard Arabic-Indic digits"); break;
-        case DIGIT_TYPE_AN_EXTENDED: buf.append(", extended Arabic-Indic digits"); break;
-        }
-        buf.append("]");
-
-        return buf.toString();
-    }
-    ///CLOVER:ON
-
-    //
-    // ported api
-    //
-
-    private static final int IRRELEVANT = 4;
-    private static final int LAMTYPE = 16;
-    private static final int ALEFTYPE = 32;
-
-    private static final int LINKR = 1;
-    private static final int LINKL = 2;
-    private static final int LINK_MASK = 3;
-
-    private static final int irrelevantPos[] = {
-        0x0, 0x2, 0x4, 0x6, 0x8, 0xA, 0xC, 0xE
-    };
-
-/*
-    private static final char convertLamAlef[] =  {
-        '\u0622', // FEF5
-        '\u0622', // FEF6
-        '\u0623', // FEF7
-        '\u0623', // FEF8
-        '\u0625', // FEF9
-        '\u0625', // FEFA
-        '\u0627', // FEFB
-        '\u0627'  // FEFC
-    };
-*/
-
-    private static final int tailFamilyIsolatedFinal[] = {
-        /* FEB1 */ 1,
-        /* FEB2 */ 1,
-        /* FEB3 */ 0,
-        /* FEB4 */ 0,
-        /* FEB5 */ 1,
-        /* FEB6 */ 1,
-        /* FEB7 */ 0,
-        /* FEB8 */ 0,
-        /* FEB9 */ 1,
-        /* FEBA */ 1,
-        /* FEBB */ 0,
-        /* FEBC */ 0,
-        /* FEBD */ 1,
-        /* FEBE */ 1
-    };
-
-    private static final int tashkeelMedial[] = {
-        /* FE70 */ 0,
-        /* FE71 */ 1,
-        /* FE72 */ 0,
-        /* FE73 */ 0,
-        /* FE74 */ 0,
-        /* FE75 */ 0,
-        /* FE76 */ 0,
-        /* FE77 */ 1,
-        /* FE78 */ 0,
-        /* FE79 */ 1,
-        /* FE7A */ 0,
-        /* FE7B */ 1,
-        /* FE7C */ 0,
-        /* FE7D */ 1,
-        /* FE7E */ 0,
-        /* FE7F */ 1
-    };
-
-    private static final char yehHamzaToYeh[] =
-    {
-    /* isolated*/ 0xFEEF,
-    /* final   */ 0xFEF0
-    };
-
-    private static final char convertNormalizedLamAlef[] = {
-        '\u0622', // 065C
-        '\u0623', // 065D
-        '\u0625', // 065E
-        '\u0627', // 065F
-    };
-
-    private static final int[] araLink = {
-        1           + 32 + 256 * 0x11,  /*0x0622*/
-        1           + 32 + 256 * 0x13,  /*0x0623*/
-        1                + 256 * 0x15,  /*0x0624*/
-        1           + 32 + 256 * 0x17,  /*0x0625*/
-        1 + 2            + 256 * 0x19,  /*0x0626*/
-        1           + 32 + 256 * 0x1D,  /*0x0627*/
-        1 + 2            + 256 * 0x1F,  /*0x0628*/
-        1                + 256 * 0x23,  /*0x0629*/
-        1 + 2            + 256 * 0x25,  /*0x062A*/
-        1 + 2            + 256 * 0x29,  /*0x062B*/
-        1 + 2            + 256 * 0x2D,  /*0x062C*/
-        1 + 2            + 256 * 0x31,  /*0x062D*/
-        1 + 2            + 256 * 0x35,  /*0x062E*/
-        1                + 256 * 0x39,  /*0x062F*/
-        1                + 256 * 0x3B,  /*0x0630*/
-        1                + 256 * 0x3D,  /*0x0631*/
-        1                + 256 * 0x3F,  /*0x0632*/
-        1 + 2            + 256 * 0x41,  /*0x0633*/
-        1 + 2            + 256 * 0x45,  /*0x0634*/
-        1 + 2            + 256 * 0x49,  /*0x0635*/
-        1 + 2            + 256 * 0x4D,  /*0x0636*/
-        1 + 2            + 256 * 0x51,  /*0x0637*/
-        1 + 2            + 256 * 0x55,  /*0x0638*/
-        1 + 2            + 256 * 0x59,  /*0x0639*/
-        1 + 2            + 256 * 0x5D,  /*0x063A*/
-        0, 0, 0, 0, 0,                  /*0x063B-0x063F*/
-        1 + 2,                          /*0x0640*/
-        1 + 2            + 256 * 0x61,  /*0x0641*/
-        1 + 2            + 256 * 0x65,  /*0x0642*/
-        1 + 2            + 256 * 0x69,  /*0x0643*/
-        1 + 2       + 16 + 256 * 0x6D,  /*0x0644*/
-        1 + 2            + 256 * 0x71,  /*0x0645*/
-        1 + 2            + 256 * 0x75,  /*0x0646*/
-        1 + 2            + 256 * 0x79,  /*0x0647*/
-        1                + 256 * 0x7D,  /*0x0648*/
-        1                + 256 * 0x7F,  /*0x0649*/
-        1 + 2            + 256 * 0x81,  /*0x064A*/
-        4, 4, 4, 4,                     /*0x064B-0x064E*/
-        4, 4, 4, 4,                     /*0x064F-0x0652*/
-        4, 4, 4, 0, 0,                  /*0x0653-0x0657*/
-        0, 0, 0, 0,                     /*0x0658-0x065B*/
-        1                + 256 * 0x85,  /*0x065C*/
-        1                + 256 * 0x87,  /*0x065D*/
-        1                + 256 * 0x89,  /*0x065E*/
-        1                + 256 * 0x8B,  /*0x065F*/
-        0, 0, 0, 0, 0,                  /*0x0660-0x0664*/
-        0, 0, 0, 0, 0,                  /*0x0665-0x0669*/
-        0, 0, 0, 0, 0, 0,               /*0x066A-0x066F*/
-        4,                              /*0x0670*/
-        0,                              /*0x0671*/
-        1           + 32,               /*0x0672*/
-        1           + 32,               /*0x0673*/
-        0,                              /*0x0674*/
-        1           + 32,               /*0x0675*/
-        1, 1,                           /*0x0676-0x0677*/
-        1+2, 1+2, 1+2, 1+2, 1+2, 1+2,   /*0x0678-0x067D*/
-        1+2, 1+2, 1+2, 1+2, 1+2, 1+2,   /*0x067E-0x0683*/
-        1+2, 1+2, 1+2, 1+2,             /*0x0684-0x0687*/
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1,   /*0x0688-0x0691*/
-        1, 1, 1, 1, 1, 1, 1, 1,         /*0x0692-0x0699*/
-        1+2, 1+2, 1+2, 1+2, 1+2, 1+2,   /*0x069A-0x06A3*/
-        1+2, 1+2, 1+2, 1+2,             /*0x069A-0x06A3*/
-        1+2, 1+2, 1+2, 1+2, 1+2, 1+2,   /*0x06A4-0x06AD*/
-        1+2, 1+2, 1+2, 1+2,             /*0x06A4-0x06AD*/
-        1+2, 1+2, 1+2, 1+2, 1+2, 1+2,   /*0x06AE-0x06B7*/
-        1+2, 1+2, 1+2, 1+2,             /*0x06AE-0x06B7*/
-        1+2, 1+2, 1+2, 1+2, 1+2, 1+2,   /*0x06B8-0x06BF*/
-        1+2, 1+2,                       /*0x06B8-0x06BF*/
-        1,                              /*0x06C0*/
-        1+2,                            /*0x06C1*/
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1,   /*0x06C2-0x06CB*/
-        1+2,                            /*0x06CC*/
-        1,                              /*0x06CD*/
-        1+2, 1+2, 1+2, 1+2,             /*0x06CE-0x06D1*/
-        1, 1                            /*0x06D2-0x06D3*/
-    };
-
-    private static final int[] presLink = {
-        1 + 2,                        /*0xFE70*/
-        1 + 2,                        /*0xFE71*/
-        1 + 2, 0, 1+ 2, 0, 1+ 2,      /*0xFE72-0xFE76*/
-        1 + 2,                        /*0xFE77*/
-        1+ 2, 1 + 2, 1+2, 1 + 2,      /*0xFE78-0xFE81*/
-        1+ 2, 1 + 2, 1+2, 1 + 2,      /*0xFE82-0xFE85*/
-        0, 0 + 32, 1 + 32, 0 + 32,    /*0xFE86-0xFE89*/
-        1 + 32, 0, 1,  0 + 32,        /*0xFE8A-0xFE8D*/
-        1 + 32, 0, 2,  1 + 2,         /*0xFE8E-0xFE91*/
-        1, 0 + 32, 1 + 32, 0,         /*0xFE92-0xFE95*/
-        2, 1 + 2, 1, 0,               /*0xFE96-0xFE99*/
-        1, 0, 2, 1 + 2,               /*0xFE9A-0xFE9D*/
-        1, 0, 2, 1 + 2,               /*0xFE9E-0xFEA1*/
-        1, 0, 2, 1 + 2,               /*0xFEA2-0xFEA5*/
-        1, 0, 2, 1 + 2,               /*0xFEA6-0xFEA9*/
-        1, 0, 2, 1 + 2,               /*0xFEAA-0xFEAD*/
-        1, 0, 1, 0,                   /*0xFEAE-0xFEB1*/
-        1, 0, 1, 0,                   /*0xFEB2-0xFEB5*/
-        1, 0, 2, 1+2,                 /*0xFEB6-0xFEB9*/
-        1, 0, 2, 1+2,                 /*0xFEBA-0xFEBD*/
-        1, 0, 2, 1+2,                 /*0xFEBE-0xFEC1*/
-        1, 0, 2, 1+2,                 /*0xFEC2-0xFEC5*/
-        1, 0, 2, 1+2,                 /*0xFEC6-0xFEC9*/
-        1, 0, 2, 1+2,                 /*0xFECA-0xFECD*/
-        1, 0, 2, 1+2,                 /*0xFECE-0xFED1*/
-        1, 0, 2, 1+2,                 /*0xFED2-0xFED5*/
-        1, 0, 2, 1+2,                 /*0xFED6-0xFED9*/
-        1, 0, 2, 1+2,                 /*0xFEDA-0xFEDD*/
-        1, 0, 2, 1+2,                 /*0xFEDE-0xFEE1*/
-        1, 0 + 16, 2 + 16, 1 + 2 +16, /*0xFEE2-0xFEE5*/
-        1 + 16, 0, 2, 1+2,            /*0xFEE6-0xFEE9*/
-        1, 0, 2, 1+2,                 /*0xFEEA-0xFEED*/
-        1, 0, 2, 1+2,                 /*0xFEEE-0xFEF1*/
-        1, 0, 1, 0,                   /*0xFEF2-0xFEF5*/
-        1, 0, 2, 1+2,                 /*0xFEF6-0xFEF9*/
-        1, 0, 1, 0,                   /*0xFEFA-0xFEFD*/
-        1, 0, 1, 0,
-        1
-    };
-
-    private static int[] convertFEto06 = {
-        /***********0******1******2******3******4******5******6******7******8******9******A******B******C******D******E******F***/
-        /*FE7*/   0x64B, 0x64B, 0x64C, 0x64C, 0x64D, 0x64D, 0x64E, 0x64E, 0x64F, 0x64F, 0x650, 0x650, 0x651, 0x651, 0x652, 0x652,
-        /*FE8*/   0x621, 0x622, 0x622, 0x623, 0x623, 0x624, 0x624, 0x625, 0x625, 0x626, 0x626, 0x626, 0x626, 0x627, 0x627, 0x628,
-        /*FE9*/   0x628, 0x628, 0x628, 0x629, 0x629, 0x62A, 0x62A, 0x62A, 0x62A, 0x62B, 0x62B, 0x62B, 0x62B, 0x62C, 0x62C, 0x62C,
-        /*FEA*/   0x62C, 0x62D, 0x62D, 0x62D, 0x62D, 0x62E, 0x62E, 0x62E, 0x62E, 0x62F, 0x62F, 0x630, 0x630, 0x631, 0x631, 0x632,
-        /*FEB*/   0x632, 0x633, 0x633, 0x633, 0x633, 0x634, 0x634, 0x634, 0x634, 0x635, 0x635, 0x635, 0x635, 0x636, 0x636, 0x636,
-        /*FEC*/   0x636, 0x637, 0x637, 0x637, 0x637, 0x638, 0x638, 0x638, 0x638, 0x639, 0x639, 0x639, 0x639, 0x63A, 0x63A, 0x63A,
-        /*FED*/   0x63A, 0x641, 0x641, 0x641, 0x641, 0x642, 0x642, 0x642, 0x642, 0x643, 0x643, 0x643, 0x643, 0x644, 0x644, 0x644,
-        /*FEE*/   0x644, 0x645, 0x645, 0x645, 0x645, 0x646, 0x646, 0x646, 0x646, 0x647, 0x647, 0x647, 0x647, 0x648, 0x648, 0x649,
-        /*FEF*/   0x649, 0x64A, 0x64A, 0x64A, 0x64A, 0x65C, 0x65C, 0x65D, 0x65D, 0x65E, 0x65E, 0x65F, 0x65F
-    };
-
-    private static final int shapeTable[][][] = {
-        { {0,0,0,0}, {0,0,0,0}, {0,1,0,3}, {0,1,0,1} },
-        { {0,0,2,2}, {0,0,1,2}, {0,1,1,2}, {0,1,1,3} },
-        { {0,0,0,0}, {0,0,0,0}, {0,1,0,3}, {0,1,0,3} },
-        { {0,0,1,2}, {0,0,1,2}, {0,1,1,2}, {0,1,1,3} }
-    };
-
-    /*
-     * This function shapes European digits to Arabic-Indic digits
-     * in-place, writing over the input characters.  Data is in visual
-     * order.
-     */
-    private void shapeToArabicDigitsWithContext(char[] dest,
-                                                int start,
-                                                int length,
-                                                char digitBase,
-                                                boolean lastStrongWasAL) {
-        digitBase -= '0'; // move common adjustment out of loop
-
-        for(int i = start + length; --i >= start;) {
-            char ch = dest[i];
-            switch (Character.getDirectionality(ch)) {
-            case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
-            case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
-                lastStrongWasAL = false;
-                break;
-            case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
-                lastStrongWasAL = true;
-                break;
-            case Character.DIRECTIONALITY_EUROPEAN_NUMBER:
-                if (lastStrongWasAL && ch <= '\u0039') {
-                    dest[i] = (char)(ch + digitBase);
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-    /*
-     * Name    : invertBuffer
-     * Function: This function inverts the buffer, it's used
-     *           in case the user specifies the buffer to be
-     *           TEXT_DIRECTION_LOGICAL
-     */
-    private static void invertBuffer(char[] buffer,
-                                     int start,
-                                     int length) {
-
-        for(int i = start, j = start + length - 1; i < j; i++, --j) {
-            char temp = buffer[i];
-            buffer[i] = buffer[j];
-            buffer[j] = temp;
-        }
-    }
-
-    /*
-     * Name    : changeLamAlef
-     * Function: Converts the Alef characters into an equivalent
-     *           LamAlef location in the 0x06xx Range, this is an
-     *           intermediate stage in the operation of the program
-     *           later it'll be converted into the 0xFExx LamAlefs
-     *           in the shaping function.
-     */
-    private static char changeLamAlef(char ch) {
-        switch(ch) {
-        case '\u0622': return '\u065C';
-        case '\u0623': return '\u065D';
-        case '\u0625': return '\u065E';
-        case '\u0627': return '\u065F';
-        default:  return '\u0000'; // not a lamalef
-        }
-    }
-
-    /*
-     * Name    : specialChar
-     * Function: Special Arabic characters need special handling in the shapeUnicode
-     *           function, this function returns 1 or 2 for these special characters
-     */
-    private static int specialChar(char ch) {
-        if ((ch > '\u0621' && ch < '\u0626') ||
-            (ch == '\u0627') ||
-            (ch > '\u062E' && ch < '\u0633') ||
-            (ch > '\u0647' && ch < '\u064A') ||
-            (ch == '\u0629')) {
-            return 1;
-        } else if (ch >= '\u064B' && ch<= '\u0652') {
-            return 2;
-        } else if (ch >= 0x0653 && ch <= 0x0655 ||
-                   ch == 0x0670 ||
-                   ch >= 0xFE70 && ch <= 0xFE7F) {
-            return 3;
-        } else {
-            return 0;
-        }
-    }
-
-    /*
-     * Name    : getLink
-     * Function: Resolves the link between the characters as
-     *           Arabic characters have four forms :
-     *           Isolated, Initial, Middle and Final Form
-     */
-    private static int getLink(char ch) {
-        if (ch >= '\u0622' && ch <= '\u06D3') {
-            return araLink[ch - '\u0622'];
-        } else if (ch == '\u200D') {
-            return 3;
-        } else if (ch >= '\u206D' && ch <= '\u206F') {
-            return 4;
-        } else if (ch >= '\uFE70' && ch <= '\uFEFC') {
-            return presLink[ch - '\uFE70'];
-        } else {
-            return 0;
-        }
-    }
-
-    /*
-     * Name    : countSpaces
-     * Function: Counts the number of spaces
-     *           at each end of the logical buffer
-     */
-    private static int countSpacesLeft(char[] dest,
-                                       int start,
-                                       int count) {
-        for (int i = start, e = start + count; i < e; ++i) {
-            if (dest[i] != SPACE_CHAR) {
-                return i - start;
-            }
-        }
-        return count;
-    }
-
-    private static int countSpacesRight(char[] dest,
-                                        int start,
-                                        int count) {
-
-        for (int i = start + count; --i >= start;) {
-            if (dest[i] != SPACE_CHAR) {
-                return start + count - 1 - i;
-            }
-        }
-        return count;
-    }
-
-    /*
-     * Name    : isTashkeelChar
-     * Function: Returns true for Tashkeel characters else return false
-     */
-    private static boolean isTashkeelChar(char ch) {
-        return ( ch >='\u064B' && ch <= '\u0652' );
-    }
-
-    /*
-     *Name     : isSeenTailFamilyChar
-     *Function : returns 1 if the character is a seen family isolated character
-     *           in the FE range otherwise returns 0
-     */
-
-    private static int isSeenTailFamilyChar(char ch) {
-        if (ch >= 0xfeb1 && ch < 0xfebf){
-             return tailFamilyIsolatedFinal [ch - 0xFEB1];
-        } else {
-             return 0;
-        }
-    }
-
-     /* Name     : isSeenFamilyChar
-      * Function : returns 1 if the character is a seen family character in the Unicode
-      *            06 range otherwise returns 0
-     */
-
-    private static int isSeenFamilyChar(char  ch){
-        if (ch >= 0x633 && ch <= 0x636){
-            return 1;
-        }else {
-            return 0;
-        }
-    }
-
-    /*
-     *Name     : isTailChar
-     *Function : returns true if the character matches one of the tail characters
-     *           (0xfe73 or 0x200b) otherwise returns false
-     */
-
-    private static boolean isTailChar(char ch) {
-        if(ch == OLD_TAIL_CHAR || ch == NEW_TAIL_CHAR){
-                return true;
-        }else{
-                return false;
-        }
-    }
-
-    /*
-     *Name     : isAlefMaksouraChar
-     *Function : returns true if the character is a Alef Maksoura Final or isolated
-     *           otherwise returns false
-     */
-    private static boolean isAlefMaksouraChar(char ch) {
-        return ( (ch == 0xFEEF) || ( ch == 0xFEF0) || (ch == 0x0649));
-    }
-
-    /*
-     * Name     : isYehHamzaChar
-     * Function : returns true if the character is a yehHamza isolated or yehhamza
-     *            final is found otherwise returns false
-     */
-    private static boolean isYehHamzaChar(char ch) {
-        if((ch==0xFE89)||(ch==0xFE8A)){
-            return true;
-        }else{
-            return false;
-        }
-    }
-
-    /*
-     *Name     : isTashkeelCharFE
-     *Function : Returns true for Tashkeel characters in FE range else return false
-     */
-
-    private static boolean isTashkeelCharFE(char ch) {
-        return ( ch!=0xFE75 &&(ch>=0xFE70 && ch<= 0xFE7F) );
-    }
-
-    /*
-     * Name: isTashkeelOnTatweelChar
-     * Function: Checks if the Tashkeel Character is on Tatweel or not,if the
-     *           Tashkeel on tatweel (FE range), it returns 1 else if the
-     *           Tashkeel with shadda on tatweel (FC range)return 2 otherwise
-     *           returns 0
-     */
-    private static int isTashkeelOnTatweelChar(char ch){
-        if (ch >= 0xfe70 && ch <= 0xfe7f && ch != NEW_TAIL_CHAR && ch != 0xFE75 && ch != SHADDA_TATWEEL_CHAR)
-        {
-            return tashkeelMedial [ch - 0xFE70];
-        } else if( (ch >= 0xfcf2 && ch <= 0xfcf4) || (ch == SHADDA_TATWEEL_CHAR)) {
-            return 2;
-        } else {
-            return 0;
-        }
-    }
-
-    /*
-     * Name: isIsolatedTashkeelChar
-     * Function: Checks if the Tashkeel Character is in the isolated form
-     *           (i.e. Unicode FE range) returns 1 else if the Tashkeel
-     *           with shadda is in the isolated form (i.e. Unicode FC range)
-     *           returns 1 otherwise returns 0
-     */
-    private static int isIsolatedTashkeelChar(char ch){
-        if (ch >= 0xfe70 && ch <= 0xfe7f && ch != NEW_TAIL_CHAR && ch != 0xFE75){
-            return (1 - tashkeelMedial [ch - 0xFE70]);
-        } else if(ch >= 0xfc5e && ch <= 0xfc63){
-            return 1;
-        } else{
-            return 0;
-        }
-    }
-
-    /*
-     * Name    : isAlefChar
-     * Function: Returns 1 for Alef characters else return 0
-     */
-    private static boolean isAlefChar(char ch) {
-        return ch == '\u0622' || ch == '\u0623' || ch == '\u0625' || ch == '\u0627';
-    }
-
-    /*
-     * Name    : isLamAlefChar
-     * Function: Returns true for LamAlef characters else return false
-     */
-    private static boolean isLamAlefChar(char ch) {
-        return ch >= '\uFEF5' && ch <= '\uFEFC';
-    }
-
-    private static boolean isNormalizedLamAlefChar(char ch) {
-        return ch >= '\u065C' && ch <= '\u065F';
-    }
-
-    /*
-     * Name    : calculateSize
-     * Function: This function calculates the destSize to be used in preflighting
-     *           when the destSize is equal to 0
-     */
-    private int calculateSize(char[] source,
-                              int sourceStart,
-                              int sourceLength) {
-
-        int destSize = sourceLength;
-
-        switch (options & LETTERS_MASK) {
-        case LETTERS_SHAPE:
-        case LETTERS_SHAPE_TASHKEEL_ISOLATED:
-            if (isLogical) {
-                for (int i = sourceStart, e = sourceStart + sourceLength - 1; i < e; ++i) {
-                    if ((source[i] == LAM_CHAR && isAlefChar(source[i+1])) || isTashkeelCharFE(source[i])){
-                        --destSize;
-                    }
-                }
-            } else { // visual
-                for(int i = sourceStart + 1, e = sourceStart + sourceLength; i < e; ++i) {
-                    if ((source[i] == LAM_CHAR && isAlefChar(source[i-1])) || isTashkeelCharFE(source[i])) {
-                        --destSize;
-                    }
-                }
-            }
-            break;
-
-        case LETTERS_UNSHAPE:
-            for(int i = sourceStart, e = sourceStart + sourceLength; i < e; ++i) {
-                if (isLamAlefChar(source[i])) {
-                    destSize++;
-                }
-            }
-            break;
-
-        default:
-            break;
-        }
-
-        return destSize;
-    }
-
-
-    /*
-     * Name    : countSpaceSub
-     * Function: Counts number of times the subChar appears in the array
-     */
-    public static int countSpaceSub(char [] dest,int length, char subChar){
-        int i = 0;
-        int count = 0;
-        while (i < length) {
-          if (dest[i] == subChar) {
-              count++;
-              }
-          i++;
-        }
-        return count;
-    }
-
-    /*
-     * Name    : shiftArray
-     * Function: Shifts characters to replace space sub characters
-     */
-    public static void shiftArray(char [] dest,int start, int e, char subChar){
-        int w = e;
-        int r = e;
-        while (--r >= start) {
-          char ch = dest[r];
-          if (ch != subChar) {
-            --w;
-            if (w != r) {
-              dest[w] = ch;
-            }
-          }
-        }
-   }
-
-    /*
-     * Name    : flipArray
-     * Function: inverts array, so that start becomes end and vice versa
-     */
-      public static int flipArray(char [] dest, int start, int e, int w){
-        int r;
-        if (w > start) {
-        // shift, assume small buffer size so don't use arraycopy
-          r = w;
-          w = start;
-          while (r < e) {
-            dest[w++] = dest[r++];
-           }
-         } else {
-             w = e;
-         }
-        return w;
-      }
-
-    /*
-     * Name     : handleTashkeelWithTatweel
-     * Function : Replaces Tashkeel as following:
-     *            Case 1 :if the Tashkeel on tatweel, replace it with Tatweel.
-     *            Case 2 :if the Tashkeel aggregated with Shadda on Tatweel, replace
-     *                   it with Shadda on Tatweel.
-     *            Case 3: if the Tashkeel is isolated replace it with Space.
-     *
-     */
-    private static int handleTashkeelWithTatweel(char[] dest, int sourceLength) {
-                     int i;
-                     for(i = 0; i < sourceLength; i++){
-                         if((isTashkeelOnTatweelChar(dest[i]) == 1)){
-                             dest[i] = TATWEEL_CHAR;
-                        }else if((isTashkeelOnTatweelChar(dest[i]) == 2)){
-                             dest[i] = SHADDA_TATWEEL_CHAR;
-                        }else if((isIsolatedTashkeelChar(dest[i])==1) && dest[i] != SHADDA_CHAR){
-                             dest[i] = SPACE_CHAR;
-                        }
-                     }
-                     return sourceLength;
-    }
-
-    /*
-     *Name     : handleGeneratedSpaces
-     *Function : The shapeUnicode function converts Lam + Alef into LamAlef + space,
-     *           and Tashkeel to space.
-     *           handleGeneratedSpaces function puts these generated spaces
-     *           according to the options the user specifies. LamAlef and Tashkeel
-     *           spaces can be replaced at begin, at end, at near or decrease the
-     *           buffer size.
-     *
-     *           There is also Auto option for LamAlef and tashkeel, which will put
-     *           the spaces at end of the buffer (or end of text if the user used
-     *           the option SPACES_RELATIVE_TO_TEXT_BEGIN_END).
-     *
-     *           If the text type was visual_LTR and the option
-     *           SPACES_RELATIVE_TO_TEXT_BEGIN_END was selected the END
-     *           option will place the space at the beginning of the buffer and
-     *           BEGIN will place the space at the end of the buffer.
-     */
-  private int handleGeneratedSpaces(char[] dest,
-            int start,
-            int length) {
-
-      int lenOptionsLamAlef = options & LAMALEF_MASK;
-      int lenOptionsTashkeel = options & TASHKEEL_MASK;
-      boolean lamAlefOn = false;
-      boolean tashkeelOn = false;
-
-      if (!isLogical & !spacesRelativeToTextBeginEnd) {
-          switch (lenOptionsLamAlef) {
-          case LAMALEF_BEGIN: lenOptionsLamAlef = LAMALEF_END; break;
-          case LAMALEF_END: lenOptionsLamAlef = LAMALEF_BEGIN; break;
-          default: break;
-         }
-          switch (lenOptionsTashkeel){
-          case TASHKEEL_BEGIN: lenOptionsTashkeel = TASHKEEL_END; break;
-          case TASHKEEL_END: lenOptionsTashkeel = TASHKEEL_BEGIN; break;
-          default: break;
-          }
-        }
-
-
-      if (lenOptionsLamAlef == LAMALEF_NEAR) {
-          for (int i = start, e = i + length; i < e; ++i) {
-              if (dest[i] == LAMALEF_SPACE_SUB) {
-                  dest[i] = SPACE_CHAR_FOR_LAMALEF;
-              }
-          }
-
-      } else {
-
-          final int e = start + length;
-          int wL = countSpaceSub(dest, length, LAMALEF_SPACE_SUB);
-          int wT = countSpaceSub(dest, length, TASHKEEL_SPACE_SUB);
-
-          if (lenOptionsLamAlef == LAMALEF_END){
-            lamAlefOn = true;
-          }
-          if (lenOptionsTashkeel == TASHKEEL_END){
-            tashkeelOn = true;
-          }
-
-
-          if (lamAlefOn && (lenOptionsLamAlef == LAMALEF_END)) {
-            shiftArray(dest, start, e, LAMALEF_SPACE_SUB);
-            while (wL > start) {
-                dest[--wL] = SPACE_CHAR;
-            }
-          }
-
-          if (tashkeelOn && (lenOptionsTashkeel == TASHKEEL_END)){
-            shiftArray(dest, start, e, TASHKEEL_SPACE_SUB);
-            while (wT > start) {
-                 dest[--wT] = SPACE_CHAR;
-            }
-          }
-
-          lamAlefOn = false;
-          tashkeelOn = false;
-
-          if (lenOptionsLamAlef == LAMALEF_RESIZE){
-            lamAlefOn = true;
-          }
-          if (lenOptionsTashkeel == TASHKEEL_RESIZE){
-            tashkeelOn = true;
-          }
-
-          if (lamAlefOn && (lenOptionsLamAlef == LAMALEF_RESIZE)){
-              shiftArray(dest, start, e, LAMALEF_SPACE_SUB);
-              wL = flipArray(dest,start,e, wL);
-              length = wL - start;
-          }
-          if (tashkeelOn && (lenOptionsTashkeel == TASHKEEL_RESIZE)) {
-              shiftArray(dest, start, e, TASHKEEL_SPACE_SUB);
-              wT = flipArray(dest,start,e, wT);
-              length = wT - start;
-          }
-
-          lamAlefOn = false;
-          tashkeelOn = false;
-
-          if ((lenOptionsLamAlef == LAMALEF_BEGIN) ||
-              (lenOptionsLamAlef == LAMALEF_AUTO)){
-                lamAlefOn = true;
-          }
-          if (lenOptionsTashkeel == TASHKEEL_BEGIN){
-                tashkeelOn = true;
-          }
-
-          if (lamAlefOn && ((lenOptionsLamAlef == LAMALEF_BEGIN)||
-                            (lenOptionsLamAlef == LAMALEF_AUTO))) { // spaces at beginning
-              shiftArray(dest, start, e, LAMALEF_SPACE_SUB);
-               wL = flipArray(dest,start,e, wL);
-                  while (wL < e) {
-                      dest[wL++] = SPACE_CHAR;
-                  }
-              }
-              if(tashkeelOn && (lenOptionsTashkeel == TASHKEEL_BEGIN)){
-               shiftArray(dest, start, e, TASHKEEL_SPACE_SUB);
-               wT = flipArray(dest,start,e, wT);
-                  while (wT < e) {
-                      dest[wT++] = SPACE_CHAR;
-                  }
-              }
-           }
-
-      return length;
-  }
-
-
-  /*
-   *Name     :expandCompositCharAtBegin
-   *Function :Expands the LamAlef character to Lam and Alef consuming the required
-   *         space from beginning of the buffer. If the text type was visual_LTR
-   *         and the option SPACES_RELATIVE_TO_TEXT_BEGIN_END was selected
-   *         the spaces will be located at end of buffer.
-   *         If there are no spaces to expand the LamAlef, an exception is thrown.
-*/
- private boolean expandCompositCharAtBegin(char[] dest,int start, int length,
-                            int lacount) {
-     boolean spaceNotFound = false;
-
-     if (lacount > countSpacesRight(dest, start, length)) {
-         spaceNotFound = true;
-         return spaceNotFound;
-     }
-     for (int r = start + length - lacount, w = start + length; --r >= start;) {
-         char ch = dest[r];
-         if (isNormalizedLamAlefChar(ch)) {
-             dest[--w] = LAM_CHAR;
-             dest[--w] = convertNormalizedLamAlef[ch - '\u065C'];
-         } else {
-             dest[--w] = ch;
-         }
-     }
-     return spaceNotFound;
-
-  }
-
-  /*
-   *Name     : expandCompositCharAtEnd
-   *Function : Expands the LamAlef character to Lam and Alef consuming the
-   *           required space from end of the buffer. If the text type was
-   *           Visual LTR and the option SPACES_RELATIVE_TO_TEXT_BEGIN_END
-   *           was used, the spaces will be consumed from begin of buffer. If
-   *           there are no spaces to expand the LamAlef, an exception is thrown.
-   */
-
-  private boolean  expandCompositCharAtEnd(char[] dest,int start, int length,
-                          int lacount){
-      boolean spaceNotFound = false;
-
-      if (lacount > countSpacesLeft(dest, start, length)) {
-          spaceNotFound = true;
-          return spaceNotFound;
-      }
-      for (int r = start + lacount, w = start, e = start + length; r < e; ++r) {
-          char ch = dest[r];
-          if (isNormalizedLamAlefChar(ch)) {
-              dest[w++] = convertNormalizedLamAlef[ch - '\u065C'];
-              dest[w++] = LAM_CHAR;
-          } else {
-              dest[w++] = ch;
-          }
-      }
-      return spaceNotFound;
-  }
-
-  /*
-   *Name     : expandCompositCharAtNear
-   *Function : Expands the LamAlef character into Lam + Alef, YehHamza character
-   *           into Yeh + Hamza, SeenFamily character into SeenFamily character
-   *           + Tail, while consuming the space next to the character.
-   */
-
-  private boolean expandCompositCharAtNear(char[] dest,int start, int length,
-                                       int yehHamzaOption, int seenTailOption, int lamAlefOption){
-
-      boolean spaceNotFound = false;
-
-
-
-      if (isNormalizedLamAlefChar(dest[start])) {
-          spaceNotFound = true;
-          return spaceNotFound;
-      }
-      for (int i = start + length; --i >=start;) {
-          char ch = dest[i];
-          if (lamAlefOption == 1 && isNormalizedLamAlefChar(ch)) {
-              if (i>start &&dest[i-1] == SPACE_CHAR) {
-                  dest[i] = LAM_CHAR;
-                  dest[--i] = convertNormalizedLamAlef[ch - '\u065C'];
-              } else {
-                  spaceNotFound = true;
-                  return spaceNotFound;
-              }
-          }else if(seenTailOption == 1 && isSeenTailFamilyChar(ch) == 1){
-              if(i>start &&dest[i-1] == SPACE_CHAR){
-                  dest[i-1] = tailChar;
-              } else{
-                  spaceNotFound = true;
-                  return spaceNotFound;
-              }
-          }else if(yehHamzaOption == 1 && isYehHamzaChar(ch)){
-
-               if(i>start &&dest[i-1] == SPACE_CHAR){
-                  dest[i] = yehHamzaToYeh[ch - YEH_HAMZAFE_CHAR];
-                  dest[i-1] = HAMZAFE_CHAR;
-              }else{
-                  spaceNotFound = true;
-                  return spaceNotFound;
-                }
-
-
-          }
-      }
-      return false;
-
-  }
-
-    /*
-     * Name    : expandCompositChar
-     * Function: LamAlef needs special handling as the LamAlef is
-     *           one character while expanding it will give two
-     *           characters Lam + Alef, so we need to expand the LamAlef
-     *           in near or far spaces according to the options the user
-     *           specifies or increase the buffer size.
-     *           Dest has enough room for the expansion if we are growing.
-     *           lamalef are normalized to the 'special characters'
-     */
-    private int expandCompositChar(char[] dest,
-                              int start,
-                              int length,
-                              int lacount,
-                              int shapingMode) throws ArabicShapingException {
-
-        int lenOptionsLamAlef = options & LAMALEF_MASK;
-        int lenOptionsSeen = options & SEEN_MASK;
-        int lenOptionsYehHamza = options & YEHHAMZA_MASK;
-        boolean spaceNotFound = false;
-
-        if (!isLogical && !spacesRelativeToTextBeginEnd) {
-            switch (lenOptionsLamAlef) {
-            case LAMALEF_BEGIN: lenOptionsLamAlef = LAMALEF_END; break;
-            case LAMALEF_END: lenOptionsLamAlef = LAMALEF_BEGIN; break;
-            default: break;
-            }
-        }
-
-        if(shapingMode == 1){
-            if(lenOptionsLamAlef == LAMALEF_AUTO){
-                if(isLogical){
-                    spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);
-                    if(spaceNotFound){
-                        spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);
-                    }
-                    if(spaceNotFound){
-                        spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);
-                    }
-                    if(spaceNotFound){
-                        throw new ArabicShapingException("No spacefor lamalef");
-                    }
-                }else{
-                    spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);
-                    if(spaceNotFound){
-                        spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);
-                    }
-                    if(spaceNotFound){
-                        spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);
-                    }
-                    if(spaceNotFound){
-                        throw new ArabicShapingException("No spacefor lamalef");
-                    }
-                }
-            }else if(lenOptionsLamAlef == LAMALEF_END){
-                spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);
-                if(spaceNotFound){
-                    throw new ArabicShapingException("No spacefor lamalef");
-                }
-            }else if(lenOptionsLamAlef == LAMALEF_BEGIN){
-                spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);
-                if(spaceNotFound){
-                    throw new ArabicShapingException("No spacefor lamalef");
-                }
-            }else if(lenOptionsLamAlef == LAMALEF_NEAR){
-                spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);
-                if(spaceNotFound){
-                    throw new ArabicShapingException("No spacefor lamalef");
-            }
-            }else if(lenOptionsLamAlef == LAMALEF_RESIZE){
-                for (int r = start + length, w = r + lacount; --r >= start;) {
-                    char ch = dest[r];
-                    if (isNormalizedLamAlefChar(ch)) {
-                        dest[--w] = '\u0644';
-                        dest[--w] = convertNormalizedLamAlef[ch - '\u065C'];
-                    } else {
-                        dest[--w] = ch;
-                    }
-                }
-                length += lacount;
-            }
-            }else{
-                if(lenOptionsSeen == SEEN_TWOCELL_NEAR){
-                spaceNotFound = expandCompositCharAtNear(dest, start, length,0,1,0);
-                if(spaceNotFound){
-                    throw new ArabicShapingException("No space for Seen tail expansion");
-                }
-            }
-            if(lenOptionsYehHamza == YEHHAMZA_TWOCELL_NEAR){
-                spaceNotFound = expandCompositCharAtNear(dest, start, length,1,0,0);
-                if(spaceNotFound){
-                    throw new ArabicShapingException("No space for YehHamza expansion");
-                }
-            }
-            }
-        return length;
-    }
-
-
-    /* Convert the input buffer from FExx Range into 06xx Range
-     * to put all characters into the 06xx range
-     * even the lamalef is converted to the special region in
-     * the 06xx range.  Return the number of lamalef chars found.
-     */
-    private int normalize(char[] dest, int start, int length) {
-        int lacount = 0;
-        for (int i = start, e = i + length; i < e; ++i) {
-            char ch = dest[i];
-            if (ch >= '\uFE70' && ch <= '\uFEFC') {
-                if (isLamAlefChar(ch)) {
-                    ++lacount;
-                }
-                dest[i] = (char)convertFEto06[ch - '\uFE70'];
-            }
-        }
-        return lacount;
-    }
-
-    /*
-     * Name    : deshapeNormalize
-     * Function: Convert the input buffer from FExx Range into 06xx Range
-     *           even the lamalef is converted to the special region in the 06xx range.
-     *           According to the options the user enters, all seen family characters
-     *           followed by a tail character are merged to seen tail family character and
-     *           any yeh followed by a hamza character are merged to yehhamza character.
-     *           Method returns the number of lamalef chars found.
-     */
-    private int deshapeNormalize(char[] dest, int start, int length) {
-        int lacount = 0;
-        int yehHamzaComposeEnabled = 0;
-        int seenComposeEnabled = 0;
-
-        yehHamzaComposeEnabled = ((options&YEHHAMZA_MASK) == YEHHAMZA_TWOCELL_NEAR) ? 1 : 0;
-        seenComposeEnabled = ((options&SEEN_MASK) == SEEN_TWOCELL_NEAR)? 1 : 0;
-
-        for (int i = start, e = i + length; i < e; ++i) {
-            char ch = dest[i];
-
-        if( (yehHamzaComposeEnabled == 1) && ((ch == HAMZA06_CHAR) || (ch == HAMZAFE_CHAR))
-               && (i < (length - 1)) && isAlefMaksouraChar(dest[i+1] )) {
-                dest[i] = SPACE_CHAR;
-                dest[i+1] = YEH_HAMZA_CHAR;
-       } else if ( (seenComposeEnabled == 1) && (isTailChar(ch)) && (i< (length - 1))
-                       && (isSeenTailFamilyChar(dest[i+1])==1) ) {
-               dest[i] = SPACE_CHAR;
-       }
-       else if (ch >= '\uFE70' && ch <= '\uFEFC') {
-                if (isLamAlefChar(ch)) {
-                    ++lacount;
-                }
-                dest[i] = (char)convertFEto06[ch - '\uFE70'];
-            }
-        }
-        return lacount;
-    }
-
-    /*
-     * Name    : shapeUnicode
-     * Function: Converts an Arabic Unicode buffer in 06xx Range into a shaped
-     *           arabic Unicode buffer in FExx Range
-     */
-    private int shapeUnicode(char[] dest,
-                             int start,
-                             int length,
-                             int destSize,
-                             int tashkeelFlag)throws ArabicShapingException {
-
-        int lamalef_count = normalize(dest, start, length);
-
-        // resolve the link between the characters.
-        // Arabic characters have four forms: Isolated, Initial, Medial and Final.
-        // Tashkeel characters have two, isolated or medial, and sometimes only isolated.
-        // tashkeelFlag == 0: shape normally, 1: shape isolated, 2: don't shape
-
-        boolean lamalef_found = false, seenfam_found = false;
-        boolean yehhamza_found = false, tashkeel_found = false;
-        int i = start + length - 1;
-        int currLink = getLink(dest[i]);
-        int nextLink = 0;
-        int prevLink = 0;
-        int lastLink = 0;
-        //int prevPos = i;
-        int lastPos = i;
-        int nx = -2;
-        int nw = 0;
-
-        while (i >= 0) {
-            // If high byte of currLink > 0 then there might be more than one shape
-            if ((currLink & '\uFF00') > 0 || isTashkeelChar(dest[i])) {
-                nw = i - 1;
-                nx = -2;
-                while (nx < 0) { // we need to know about next char
-                    if (nw == -1) {
-                        nextLink = 0;
-                        nx = Integer.MAX_VALUE;
-                    } else {
-                        nextLink = getLink(dest[nw]);
-                        if ((nextLink & IRRELEVANT) == 0) {
-                            nx = nw;
-                        } else {
-                            --nw;
-                        }
-                    }
-                }
-
-                if (((currLink & ALEFTYPE) > 0) && ((lastLink & LAMTYPE) > 0)) {
-                    lamalef_found = true;
-                    char wLamalef = changeLamAlef(dest[i]); // get from 0x065C-0x065f
-                    if (wLamalef != '\u0000') {
-                        // replace alef by marker, it will be removed later
-                        dest[i] = '\uffff';
-                        dest[lastPos] = wLamalef;
-                        i = lastPos;
-                    }
-
-                    lastLink = prevLink;
-                    currLink = getLink(wLamalef); // requires '\u0000', unfortunately
-                }
-                if ((i > 0) && (dest[i-1] == SPACE_CHAR))
-                {
-                    if ( isSeenFamilyChar(dest[i]) == 1){
-                        seenfam_found = true;
-                    } else if (dest[i] == YEH_HAMZA_CHAR) {
-                        yehhamza_found = true;
-                    }
-                }
-                else if(i==0){
-                    if ( isSeenFamilyChar(dest[i]) == 1){
-                        seenfam_found = true;
-                    } else if (dest[i] == YEH_HAMZA_CHAR) {
-                        yehhamza_found = true;
-                    }
-                }
-
-
-                // get the proper shape according to link ability of neighbors
-                // and of character; depends on the order of the shapes
-                // (isolated, initial, middle, final) in the compatibility area
-
-                int flag = specialChar(dest[i]);
-
-                int shape = shapeTable[nextLink & LINK_MASK]
-                    [lastLink & LINK_MASK]
-                    [currLink & LINK_MASK];
-
-                if (flag == 1) {
-                    shape &= 0x1;
-                } else if (flag == 2) {
-                    if (tashkeelFlag == 0 &&
-                        ((lastLink & LINKL) != 0) &&
-                        ((nextLink & LINKR) != 0) &&
-                        dest[i] != '\u064C' &&
-                        dest[i] != '\u064D' &&
-                        !((nextLink & ALEFTYPE) == ALEFTYPE &&
-                          (lastLink & LAMTYPE) == LAMTYPE)) {
-
-                        shape = 1;
-                    } else {
-                        shape = 0;
-                    }
-                }
-                if (flag == 2) {
-                    if (tashkeelFlag == 2) {
-                        dest[i] = TASHKEEL_SPACE_SUB;
-                        tashkeel_found = true;
-                    }
-                    else{
-                        dest[i] = (char)('\uFE70' + irrelevantPos[dest[i] - '\u064B'] + shape);
-                    }
-                    // else leave tashkeel alone
-                } else {
-                    dest[i] = (char)('\uFE70' + (currLink >> 8) + shape);
-                }
-            }
-
-            // move one notch forward
-            if ((currLink & IRRELEVANT) == 0) {
-                prevLink = lastLink;
-                lastLink = currLink;
-                //prevPos = lastPos;
-                lastPos = i;
-            }
-
-            --i;
-            if (i == nx) {
-                currLink = nextLink;
-                nx = -2;
-            } else if (i != -1) {
-                currLink = getLink(dest[i]);
-            }
-        }
-
-        // If we found a lam/alef pair in the buffer
-        // call handleGeneratedSpaces to remove the spaces that were added
-
-        destSize = length;
-        if (lamalef_found || tashkeel_found) {
-            destSize = handleGeneratedSpaces(dest, start, length);
-        }
-        if (seenfam_found || yehhamza_found){
-            destSize = expandCompositChar(dest, start, destSize, lamalef_count, SHAPE_MODE);
-        }
-        return destSize;
-    }
-
-    /*
-     * Name    : deShapeUnicode
-     * Function: Converts an Arabic Unicode buffer in FExx Range into unshaped
-     *           arabic Unicode buffer in 06xx Range
-     */
-    private int deShapeUnicode(char[] dest,
-                               int start,
-                               int length,
-                               int destSize) throws ArabicShapingException {
-
-        int lamalef_count = deshapeNormalize(dest, start, length);
-
-        // If there was a lamalef in the buffer call expandLamAlef
-        if (lamalef_count != 0) {
-            // need to adjust dest to fit expanded buffer... !!!
-            destSize = expandCompositChar(dest, start, length, lamalef_count,DESHAPE_MODE);
-        } else {
-            destSize = length;
-        }
-
-        return destSize;
-    }
-
-    private int internalShape(char[] source,
-                              int sourceStart,
-                              int sourceLength,
-                              char[] dest,
-                              int destStart,
-                              int destSize) throws ArabicShapingException {
-
-        if (sourceLength == 0) {
-            return 0;
-        }
-
-        if (destSize == 0) {
-            if (((options & LETTERS_MASK) != LETTERS_NOOP) &&
-                ((options & LAMALEF_MASK) == LAMALEF_RESIZE)) {
-
-                return calculateSize(source, sourceStart, sourceLength);
-            } else {
-                return sourceLength; // by definition
-            }
-        }
-
-        // always use temp buffer
-        char[] temp = new char[sourceLength * 2]; // all lamalefs requiring expansion
-        System.arraycopy(source, sourceStart, temp, 0, sourceLength);
-
-        if (isLogical) {
-            invertBuffer(temp, 0, sourceLength);
-        }
-
-        int outputSize = sourceLength;
-
-        switch (options & LETTERS_MASK) {
-        case LETTERS_SHAPE_TASHKEEL_ISOLATED:
-            outputSize = shapeUnicode(temp, 0, sourceLength, destSize, 1);
-            break;
-
-        case LETTERS_SHAPE:
-            if( ((options&TASHKEEL_MASK)> 0) &&
-                ((options&TASHKEEL_MASK) !=TASHKEEL_REPLACE_BY_TATWEEL)) {
-                   /* Call the shaping function with tashkeel flag == 2 for removal of tashkeel */
-                outputSize = shapeUnicode(temp, 0, sourceLength, destSize, 2);
-                }else {
-                   //default Call the shaping function with tashkeel flag == 1 */
-                    outputSize = shapeUnicode(temp, 0, sourceLength, destSize, 0);
-
-                   /*After shaping text check if user wants to remove tashkeel and replace it with tatweel*/
-                   if( (options&TASHKEEL_MASK) == TASHKEEL_REPLACE_BY_TATWEEL){
-                       outputSize = handleTashkeelWithTatweel(temp,sourceLength);
-                   }
-               }
-            break;
-
-        case LETTERS_UNSHAPE:
-            outputSize = deShapeUnicode(temp, 0, sourceLength, destSize);
-            break;
-
-        default:
-            break;
-        }
-
-        if (outputSize > destSize) {
-            throw new ArabicShapingException("not enough room for result data");
-        }
-
-        if ((options & DIGITS_MASK) != DIGITS_NOOP) {
-            char digitBase = '\u0030'; // European digits
-            switch (options & DIGIT_TYPE_MASK) {
-            case DIGIT_TYPE_AN:
-                digitBase = '\u0660';  // Arabic-Indic digits
-                break;
-
-            case DIGIT_TYPE_AN_EXTENDED:
-                digitBase = '\u06f0';  // Eastern Arabic-Indic digits (Persian and Urdu)
-                break;
-
-            default:
-                break;
-            }
-
-            switch (options & DIGITS_MASK) {
-            case DIGITS_EN2AN:
-                {
-                    int digitDelta = digitBase - '\u0030';
-                    for (int i = 0; i < outputSize; ++i) {
-                        char ch = temp[i];
-                        if (ch <= '\u0039' && ch >= '\u0030') {
-                            temp[i] += digitDelta;
-                        }
-                    }
-                }
-                break;
-
-            case DIGITS_AN2EN:
-                {
-                    char digitTop = (char)(digitBase + 9);
-                    int digitDelta = '\u0030' - digitBase;
-                    for (int i = 0; i < outputSize; ++i) {
-                        char ch = temp[i];
-                        if (ch <= digitTop && ch >= digitBase) {
-                            temp[i] += digitDelta;
-                        }
-                    }
-                }
-                break;
-
-            case DIGITS_EN2AN_INIT_LR:
-                shapeToArabicDigitsWithContext(temp, 0, outputSize, digitBase, false);
-                break;
-
-            case DIGITS_EN2AN_INIT_AL:
-                shapeToArabicDigitsWithContext(temp, 0, outputSize, digitBase, true);
-                break;
-
-            default:
-                break;
-            }
-        }
-
-        if (isLogical) {
-            invertBuffer(temp, 0, outputSize);
-        }
-
-        System.arraycopy(temp, 0, dest, destStart, outputSize);
-
-        return outputSize;
-    }
-
-    private static class ArabicShapingException extends RuntimeException {
-        ArabicShapingException(String msg) {
-            super(msg);
-        }
-    }
-}
diff --git a/icu4j/license.html b/icu4j/license.html
deleted file mode 100644
index b905ddf..0000000
--- a/icu4j/license.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></meta>
-<title>ICU License - ICU 1.8.1 and later</title>
-</head>
-
-<body BGCOLOR="#ffffff">
-<h2>ICU License - ICU 1.8.1 and later</h2>
-
-<p>COPYRIGHT AND PERMISSION NOTICE</p>
-
-<p>
-Copyright (c) 1995-2006 International Business Machines Corporation and others
-</p>
-<p>
-All rights reserved.
-</p>
-<p>
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, and/or sell
-copies of the Software, and to permit persons
-to whom the Software is furnished to do so, provided that the above
-copyright notice(s) and this permission notice appear in all copies
-of the Software and that both the above copyright notice(s) and this
-permission notice appear in supporting documentation.
-</p>
-<p>
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL
-THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM,
-OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
-USE OR PERFORMANCE OF THIS SOFTWARE.
-</p>
-<p>
-Except as contained in this notice, the name of a copyright holder shall not be
-used in advertising or otherwise to promote the sale, use or other dealings in
-this Software without prior written authorization of the copyright holder.
-</p>
-
-<hr>
-<p><small>
-All trademarks and registered trademarks mentioned herein are the property of their respective owners.
-</small></p>
-</body>
-</html>
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index 881d160..2111a56 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -14,6 +14,7 @@
 		DisplayListLogBuffer.cpp \
 		DisplayListRenderer.cpp \
 		Dither.cpp \
+		Extensions.cpp \
 		FboCache.cpp \
 		GradientCache.cpp \
 		Layer.cpp \
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 1a86b3a..492bb7d 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -47,7 +47,7 @@
 // Constructors/destructor
 ///////////////////////////////////////////////////////////////////////////////
 
-Caches::Caches(): Singleton<Caches>(), mInitialized(false) {
+Caches::Caches(): Singleton<Caches>(), mExtensions(Extensions::getInstance()), mInitialized(false) {
     init();
     initFont();
     initExtensions();
@@ -100,7 +100,7 @@
 }
 
 void Caches::initExtensions() {
-    if (extensions.hasDebugMarker()) {
+    if (mExtensions.hasDebugMarker()) {
         eventMark = glInsertEventMarkerEXT;
         startMark = glPushGroupMarkerEXT;
         endMark = glPopGroupMarkerEXT;
@@ -110,7 +110,7 @@
         endMark = endMarkNull;
     }
 
-    if (extensions.hasDebugLabel()) {
+    if (mExtensions.hasDebugLabel()) {
         setLabel = glLabelObjectEXT;
         getLabel = glGetObjectLabelEXT;
     } else {
@@ -470,13 +470,13 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool discard) {
-    if (extensions.hasTiledRendering() && !debugOverdraw) {
+    if (mExtensions.hasTiledRendering() && !debugOverdraw) {
         glStartTilingQCOM(x, y, width, height, (discard ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM));
     }
 }
 
 void Caches::endTiling() {
-    if (extensions.hasTiledRendering() && !debugOverdraw) {
+    if (mExtensions.hasTiledRendering() && !debugOverdraw) {
         glEndTilingQCOM(GL_COLOR_BUFFER_BIT0_QCOM);
     }
 }
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index d73ac1e..0fa54fb 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -25,7 +25,6 @@
 
 #include <cutils/compiler.h>
 
-#include "Extensions.h"
 #include "FontRenderer.h"
 #include "GammaFontRenderer.h"
 #include "TextureCache.h"
@@ -243,9 +242,6 @@
     // VBO to draw with
     GLuint meshBuffer;
 
-    // GL extensions
-    Extensions extensions;
-
     // Misc
     GLint maxTextureSize;
     bool debugLayersUpdates;
@@ -311,6 +307,8 @@
     GLint mScissorWidth;
     GLint mScissorHeight;
 
+    Extensions& mExtensions;
+
     // Used to render layers
     TextureVertex* mRegionMesh;
     GLuint mRegionMeshIndices;
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index dfc4e25..5f8baac 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -44,6 +44,9 @@
 // Turn on to display info about layers
 #define DEBUG_LAYERS 0
 
+// Turn on to make stencil operations easier to debug
+#define DEBUG_STENCIL 0
+
 // Turn on to display debug info about 9patch objects
 #define DEBUG_PATCHES 0
 // Turn on to "explode" 9patch objects
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index 0e3e4f8..17ed8ac 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -350,7 +350,7 @@
                     mMultipliedAlpha, flags);
         }
     }
-    if (mClipChildren) {
+    if (mClipChildren && !mCaching) {
         ALOGD("%*sClipRect %.2f, %.2f, %.2f, %.2f", level * 2, "", 0.0f, 0.0f,
                 (float) mRight - mLeft, (float) mBottom - mTop);
     }
@@ -391,7 +391,7 @@
                     mMultipliedAlpha, flags);
         }
     }
-    if (mClipChildren) {
+    if (mClipChildren && !mCaching) {
         renderer.clipRect(0, 0, mRight - mLeft, mBottom - mTop,
                 SkRegion::kIntersect_Op);
     }
diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp
new file mode 100644
index 0000000..edc90fb
--- /dev/null
+++ b/libs/hwui/Extensions.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#include "Debug.h"
+#include "Extensions.h"
+
+namespace android {
+
+using namespace uirenderer;
+ANDROID_SINGLETON_STATIC_INSTANCE(Extensions);
+
+namespace uirenderer {
+
+///////////////////////////////////////////////////////////////////////////////
+// Defines
+///////////////////////////////////////////////////////////////////////////////
+
+// Debug
+#if DEBUG_EXTENSIONS
+    #define EXT_LOGD(...) ALOGD(__VA_ARGS__)
+#else
+    #define EXT_LOGD(...)
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Constructors
+///////////////////////////////////////////////////////////////////////////////
+
+Extensions::Extensions(): Singleton<Extensions>() {
+    const char* buffer = (const char*) glGetString(GL_EXTENSIONS);
+    const char* current = buffer;
+    const char* head = current;
+    EXT_LOGD("Available GL extensions:");
+    do {
+        head = strchr(current, ' ');
+        String8 s(current, head ? head - current : strlen(current));
+        if (s.length()) {
+            mExtensionList.add(s);
+            EXT_LOGD("  %s", s.string());
+        }
+        current = head + 1;
+    } while (head);
+
+    mHasNPot = hasExtension("GL_OES_texture_npot");
+    mHasFramebufferFetch = hasExtension("GL_NV_shader_framebuffer_fetch");
+    mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer");
+    mHasDebugMarker = hasExtension("GL_EXT_debug_marker");
+    mHasDebugLabel = hasExtension("GL_EXT_debug_label");
+    mHasTiledRendering = hasExtension("GL_QCOM_tiled_rendering");
+    mHas1BitStencil = hasExtension("GL_OES_stencil1");
+    mHas4BitStencil = hasExtension("GL_OES_stencil4");
+
+    mExtensions = strdup(buffer);
+}
+
+Extensions::~Extensions() {
+   free(mExtensions);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Methods
+///////////////////////////////////////////////////////////////////////////////
+
+bool Extensions::hasExtension(const char* extension) const {
+   const String8 s(extension);
+   return mExtensionList.indexOf(s) >= 0;
+}
+
+void Extensions::dump() const {
+   ALOGD("Supported extensions:\n%s", mExtensions);
+}
+
+}; // namespace uirenderer
+}; // namespace android
diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h
index bdaa3cc..a069a6a 100644
--- a/libs/hwui/Extensions.h
+++ b/libs/hwui/Extensions.h
@@ -17,62 +17,24 @@
 #ifndef ANDROID_HWUI_EXTENSIONS_H
 #define ANDROID_HWUI_EXTENSIONS_H
 
+#include <utils/Singleton.h>
 #include <utils/SortedVector.h>
 #include <utils/String8.h>
 
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 
-#include "Debug.h"
-
 namespace android {
 namespace uirenderer {
 
 ///////////////////////////////////////////////////////////////////////////////
-// Defines
-///////////////////////////////////////////////////////////////////////////////
-
-// Debug
-#if DEBUG_EXTENSIONS
-    #define EXT_LOGD(...) ALOGD(__VA_ARGS__)
-#else
-    #define EXT_LOGD(...)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
 // Classes
 ///////////////////////////////////////////////////////////////////////////////
 
-class Extensions {
+class Extensions: public Singleton<Extensions> {
 public:
-    Extensions() {
-        const char* buffer = (const char*) glGetString(GL_EXTENSIONS);
-        const char* current = buffer;
-        const char* head = current;
-        EXT_LOGD("Available GL extensions:");
-        do {
-            head = strchr(current, ' ');
-            String8 s(current, head ? head - current : strlen(current));
-            if (s.length()) {
-                mExtensionList.add(s);
-                EXT_LOGD("  %s", s.string());
-            }
-            current = head + 1;
-        } while (head);
-
-        mHasNPot = hasExtension("GL_OES_texture_npot");
-        mHasFramebufferFetch = hasExtension("GL_NV_shader_framebuffer_fetch");
-        mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer");
-        mHasDebugMarker = hasExtension("GL_EXT_debug_marker");
-        mHasDebugLabel = hasExtension("GL_EXT_debug_label");
-        mHasTiledRendering = hasExtension("GL_QCOM_tiled_rendering");
-
-        mExtensions = strdup(buffer);
-    }
-
-    ~Extensions() {
-        free(mExtensions);
-    }
+    Extensions();
+    ~Extensions();
 
     inline bool hasNPot() const { return mHasNPot; }
     inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
@@ -80,17 +42,16 @@
     inline bool hasDebugMarker() const { return mHasDebugMarker; }
     inline bool hasDebugLabel() const { return mHasDebugLabel; }
     inline bool hasTiledRendering() const { return mHasTiledRendering; }
+    inline bool has1BitStencil() const { return mHas1BitStencil; }
+    inline bool has4BitStencil() const { return mHas4BitStencil; }
 
-    bool hasExtension(const char* extension) const {
-        const String8 s(extension);
-        return mExtensionList.indexOf(s) >= 0;
-    }
+    bool hasExtension(const char* extension) const;
 
-    void dump() {
-        ALOGD("Supported extensions:\n%s", mExtensions);
-    }
+    void dump() const;
 
 private:
+    friend class Singleton<Extensions>;
+
     SortedVector<String8> mExtensionList;
 
     char* mExtensions;
@@ -101,6 +62,8 @@
     bool mHasDebugMarker;
     bool mHasDebugLabel;
     bool mHasTiledRendering;
+    bool mHas1BitStencil;
+    bool mHas4BitStencil;
 }; // class Extensions
 
 }; // namespace uirenderer
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp
index 154c0ec..78f9cf5 100644
--- a/libs/hwui/GradientCache.cpp
+++ b/libs/hwui/GradientCache.cpp
@@ -152,7 +152,7 @@
         GradientInfo& info) {
     uint32_t width = 256 * (count - 1);
 
-    if (!Caches::getInstance().extensions.hasNPot()) {
+    if (!Extensions::getInstance().hasNPot()) {
         width = 1 << (31 - __builtin_clz(width));
     }
 
diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp
index 79dbfb0..9247b1d 100644
--- a/libs/hwui/Layer.cpp
+++ b/libs/hwui/Layer.cpp
@@ -41,7 +41,7 @@
     renderer = NULL;
     displayList = NULL;
     fbo = 0;
-    stencil = 0;
+    stencil = NULL;
     debugDrawUpdate = false;
     Caches::getInstance().resourceCache.incrementRefcount(this);
 }
@@ -87,8 +87,8 @@
     }
 
     if (stencil) {
-        bindStencilRenderBuffer();
-        allocateStencilRenderBuffer();
+        stencil->bind();
+        stencil->resize(desiredWidth, desiredHeight);
 
         if (glGetError() != GL_NO_ERROR) {
             setSize(oldWidth, oldHeight);
@@ -108,8 +108,8 @@
         glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
         if (fbo != previousFbo) glBindFramebuffer(GL_FRAMEBUFFER, previousFbo);
 
-        glDeleteRenderbuffers(1, &stencil);
-        stencil = 0;
+        delete stencil;
+        stencil = NULL;
     }
 
     if (fbo) {
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index a580d89..ccf1da5 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -27,6 +27,7 @@
 #include <SkXfermode.h>
 
 #include "Rect.h"
+#include "RenderBuffer.h"
 #include "SkiaColorFilter.h"
 #include "Texture.h"
 #include "Vertex.h"
@@ -87,11 +88,11 @@
         deferredUpdateScheduled = true;
     }
 
-    inline uint32_t getWidth() {
+    inline uint32_t getWidth() const {
         return texture.width;
     }
 
-    inline uint32_t getHeight() {
+    inline uint32_t getHeight() const {
         return texture.height;
     }
 
@@ -117,7 +118,7 @@
         texture.blend = blend;
     }
 
-    inline bool isBlend() {
+    inline bool isBlend() const {
         return texture.blend;
     }
 
@@ -130,11 +131,11 @@
         this->mode = mode;
     }
 
-    inline int getAlpha() {
+    inline int getAlpha() const {
         return alpha;
     }
 
-    inline SkXfermode::Mode getMode() {
+    inline SkXfermode::Mode getMode() const {
         return mode;
     }
 
@@ -142,7 +143,7 @@
         this->empty = empty;
     }
 
-    inline bool isEmpty() {
+    inline bool isEmpty() const {
         return empty;
     }
 
@@ -150,23 +151,29 @@
         this->fbo = fbo;
     }
 
-    inline GLuint getFbo() {
+    inline GLuint getFbo() const {
         return fbo;
     }
 
-    inline void setStencilRenderBuffer(GLuint renderBuffer) {
-        this->stencil = renderBuffer;
+    inline void setStencilRenderBuffer(RenderBuffer* renderBuffer) {
+        if (RenderBuffer::isStencilBuffer(renderBuffer->getFormat())) {
+            this->stencil = renderBuffer;
+            glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+                    GL_RENDERBUFFER, stencil->getName());
+        } else {
+            ALOGE("The specified render buffer is not a stencil buffer");
+        }
     }
 
-    inline GLuint getStencilRenderBuffer() {
+    inline RenderBuffer* getStencilRenderBuffer() const {
         return stencil;
     }
 
-    inline GLuint getTexture() {
+    inline GLuint getTexture() const {
         return texture.id;
     }
 
-    inline GLenum getRenderTarget() {
+    inline GLenum getRenderTarget() const {
         return renderTarget;
     }
 
@@ -182,7 +189,7 @@
         texture.setFilter(filter, bindTexture, force, renderTarget);
     }
 
-    inline bool isCacheable() {
+    inline bool isCacheable() const {
         return cacheable;
     }
 
@@ -190,7 +197,7 @@
         this->cacheable = cacheable;
     }
 
-    inline bool isDirty() {
+    inline bool isDirty() const {
         return dirty;
     }
 
@@ -198,7 +205,7 @@
         this->dirty = dirty;
     }
 
-    inline bool isTextureLayer() {
+    inline bool isTextureLayer() const {
         return textureLayer;
     }
 
@@ -206,21 +213,21 @@
         this->textureLayer = textureLayer;
     }
 
-    inline SkiaColorFilter* getColorFilter() {
+    inline SkiaColorFilter* getColorFilter() const {
         return colorFilter;
     }
 
     ANDROID_API void setColorFilter(SkiaColorFilter* filter);
 
-    inline void bindTexture() {
+    inline void bindTexture() const {
         if (texture.id) {
             glBindTexture(renderTarget, texture.id);
         }
     }
 
-    inline void bindStencilRenderBuffer() {
+    inline void bindStencilRenderBuffer() const {
         if (stencil) {
-            glBindRenderbuffer(GL_RENDERBUFFER, stencil);
+            stencil->bind();
         }
     }
 
@@ -256,12 +263,6 @@
         }
     }
 
-    inline void allocateStencilRenderBuffer() {
-        if (stencil) {
-            glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, getWidth(), getHeight());
-        }
-    }
-
     inline mat4& getTexTransform() {
         return texTransform;
     }
@@ -318,10 +319,9 @@
     GLuint fbo;
 
     /**
-     * Name of the render buffer used as the stencil buffer. If the
-     * name is 0, this layer does not have a stencil buffer.
+     * The render buffer used as the stencil buffer.
      */
-    GLuint stencil;
+    RenderBuffer* stencil;
 
     /**
      * Indicates whether this layer has been used already.
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index c8a8ed4..bc660cd 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -351,7 +351,7 @@
     if (layer && fbo) {
         // If possible, discard any enqueud operations on deferred
         // rendering architectures
-        if (Caches::getInstance().extensions.hasDiscardFramebuffer()) {
+        if (Extensions::getInstance().hasDiscardFramebuffer()) {
             GLuint previousFbo;
             glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*) &previousFbo);
             if (fbo != previousFbo) glBindFramebuffer(GL_FRAMEBUFFER, fbo);
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 1a760a8..08e2332 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -109,7 +109,8 @@
 // Constructors/destructor
 ///////////////////////////////////////////////////////////////////////////////
 
-OpenGLRenderer::OpenGLRenderer(): mCaches(Caches::getInstance()) {
+OpenGLRenderer::OpenGLRenderer():
+        mCaches(Caches::getInstance()), mExtensions(Extensions::getInstance()) {
     mShader = NULL;
     mColorFilter = NULL;
     mHasShadow = false;
@@ -216,7 +217,7 @@
     // If we know that we are going to redraw the entire framebuffer,
     // perform a discard to let the driver know we don't need to preserve
     // the back buffer for this frame.
-    if (mCaches.extensions.hasDiscardFramebuffer() &&
+    if (mExtensions.hasDiscardFramebuffer() &&
             left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) {
         const bool isFbo = getTargetFbo() == 0;
         const GLenum attachments[] = {
@@ -1119,7 +1120,7 @@
         it.next();
     }
 
-    drawColorRects(rects.array(), count, color, mode, true, dirty);
+    drawColorRects(rects.array(), count, color, mode, true, dirty, false);
 }
 
 void OpenGLRenderer::dirtyLayer(const float left, const float top,
@@ -1269,15 +1270,12 @@
         // attach the new render buffer then turn tiling back on
         endTiling();
 
-        // TODO: See Layer::removeFbo(). The stencil renderbuffer should be cached
-        GLuint buffer;
-        glGenRenderbuffers(1, &buffer);
+        RenderBuffer* buffer = new RenderBuffer(
+                Stencil::getSmallestStencilFormat(), layer->getWidth(), layer->getHeight());
+        buffer->bind();
+        buffer->allocate();
 
         layer->setStencilRenderBuffer(buffer);
-        layer->bindStencilRenderBuffer();
-        layer->allocateStencilRenderBuffer();
-
-        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, buffer);
 
         startTiling(layer->clipRect, layer->layer.getHeight());
     }
@@ -1521,13 +1519,13 @@
 
 void OpenGLRenderer::setupDrawShader() {
     if (mShader) {
-        mShader->describe(mDescription, mCaches.extensions);
+        mShader->describe(mDescription, mExtensions);
     }
 }
 
 void OpenGLRenderer::setupDrawColorFilter() {
     if (mColorFilter) {
-        mColorFilter->describe(mDescription, mCaches.extensions);
+        mColorFilter->describe(mDescription, mExtensions);
     }
 }
 
@@ -2147,6 +2145,11 @@
     VertexBuffer buffer;
     SkRect bounds;
     PathTessellator::tessellateLines(points, count, paint, mSnapshot->transform, bounds, buffer);
+
+    if (quickReject(bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom)) {
+        return DrawGlInfo::kStatusDone;
+    }
+
     dirtyLayer(bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom, *mSnapshot->transform);
 
     bool useOffset = !paint->isAntiAlias();
@@ -2168,6 +2171,7 @@
         strokeWidth = 1.0f;
     }
     const float halfWidth = strokeWidth / 2;
+
     int alpha;
     SkXfermode::Mode mode;
     getAlphaAndMode(paint, &alpha, &mode);
@@ -2916,7 +2920,7 @@
 }
 
 status_t OpenGLRenderer::drawColorRects(const float* rects, int count, int color,
-        SkXfermode::Mode mode, bool ignoreTransform, bool dirty) {
+        SkXfermode::Mode mode, bool ignoreTransform, bool dirty, bool clip) {
 
     float left = FLT_MAX;
     float top = FLT_MAX;
@@ -2950,7 +2954,7 @@
         }
     }
 
-    if (count == 0 || quickReject(left, top, right, bottom)) {
+    if (count == 0 || (clip && quickReject(left, top, right, bottom))) {
         return DrawGlInfo::kStatusDone;
     }
 
@@ -3095,7 +3099,7 @@
         // If the blend mode cannot be implemented using shaders, fall
         // back to the default SrcOver blend mode instead
         if (CC_UNLIKELY(mode > SkXfermode::kScreen_Mode)) {
-            if (CC_UNLIKELY(mCaches.extensions.hasFramebufferFetch())) {
+            if (CC_UNLIKELY(mExtensions.hasFramebufferFetch())) {
                 description.framebufferMode = mode;
                 description.swapSrcDst = swapSrcDst;
 
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index ee205a4..0ad81c1 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -567,9 +567,11 @@
      * @param mode The Skia xfermode to use
      * @param ignoreTransform True if the current transform should be ignored
      * @param dirty True if calling this method should dirty the current layer
+     * @param clip True if the rects should be clipped, false otherwise
      */
     status_t drawColorRects(const float* rects, int count, int color,
-            SkXfermode::Mode mode, bool ignoreTransform = false, bool dirty = true);
+            SkXfermode::Mode mode, bool ignoreTransform = false,
+            bool dirty = true, bool clip = true);
 
     /**
      * Draws the shape represented by the specified path texture.
@@ -888,6 +890,7 @@
 
     // Various caches
     Caches& mCaches;
+    Extensions& mExtensions;
 
     // List of rectangles to clear after saveLayer() is invoked
     Vector<Rect*> mLayers;
diff --git a/libs/hwui/RenderBuffer.h b/libs/hwui/RenderBuffer.h
new file mode 100644
index 0000000..927f265
--- /dev/null
+++ b/libs/hwui/RenderBuffer.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#ifndef ANDROID_HWUI_RENDER_BUFFER_H
+#define ANDROID_HWUI_RENDER_BUFFER_H
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+namespace android {
+namespace uirenderer {
+
+/**
+ * Represents an OpenGL render buffer. Render buffers are attached
+ * to layers to perform stencil work.
+ */
+struct RenderBuffer {
+    /**
+     * Creates a new render buffer in the specified format and dimensions.
+     * The format must be one of the formats allowed by glRenderbufferStorage().
+     */
+    RenderBuffer(GLenum format, uint32_t width, uint32_t height):
+        mFormat(format), mWidth(width), mHeight(height), mAllocated(false) {
+
+        glGenRenderbuffers(1, &mName);
+    }
+
+    ~RenderBuffer() {
+        if (mName && mAllocated) {
+            glDeleteRenderbuffers(1, &mName);
+        }
+    }
+
+    /**
+     * Returns the GL name of this render buffer.
+     */
+    GLuint getName() const {
+        return mName;
+    }
+
+    /**
+     * Returns the format of this render buffer.
+     */
+    GLenum getFormat() const {
+        return mFormat;
+    }
+
+    /**
+     * Binds this render buffer to the current GL context.
+     */
+    void bind() const {
+        glBindRenderbuffer(GL_RENDERBUFFER, mName);
+    }
+
+    /**
+     * Indicates whether this render buffer has allocated its
+     * storage. See allocate() and resize().
+     */
+    bool isAllocated() const {
+        return mAllocated;
+    }
+
+    /**
+     * Allocates this render buffer's storage if needed.
+     * This method doesn't do anything if isAllocated() returns true.
+     */
+    void allocate() {
+        if (!mAllocated) {
+            glRenderbufferStorage(GL_RENDERBUFFER, mFormat, mWidth, mHeight);
+            mAllocated = true;
+        }
+    }
+
+    /**
+     * Resizes this render buffer. If the buffer was previously allocated,
+     * the storage is re-allocated wit the new specified dimensions. If the
+     * buffer wasn't previously allocated, the buffer remains unallocated.
+     */
+    void resize(uint32_t width, uint32_t height) {
+        if (isAllocated() && (width != mWidth || height != mHeight)) {
+            glRenderbufferStorage(GL_RENDERBUFFER, mFormat, width, height);
+        }
+
+        mWidth = width;
+        mHeight = height;
+    }
+
+    /**
+     * Returns the width of the render buffer in pixels.
+     */
+    uint32_t getWidth() const {
+        return mWidth;
+    }
+
+    /**
+     * Returns the height of the render buffer in pixels.
+     */
+    uint32_t getHeight() const {
+        return mHeight;
+    }
+
+    /**
+     * Returns the size of this render buffer in bytes.
+     */
+    uint32_t getSize() const {
+        // Round to the nearest byte
+        return (uint32_t) ((mWidth * mHeight * formatSize(mFormat)) / 8.0f + 0.5f);
+    }
+
+    /**
+     * Returns the number of bits per component in the specified format.
+     * The format must be one of the formats allowed by glRenderbufferStorage().
+     */
+    static uint32_t formatSize(GLenum format) {
+        switch (format) {
+            case GL_STENCIL_INDEX8:
+                return 8;
+            case GL_STENCIL_INDEX1_OES:
+                return 1;
+            case GL_STENCIL_INDEX4_OES:
+                return 4;
+            case GL_DEPTH_COMPONENT16:
+            case GL_RGBA4:
+            case GL_RGB565:
+            case GL_RGB5_A1:
+                return 16;
+        }
+        return 0;
+    }
+
+    /**
+     * Indicates whether the specified format represents a stencil buffer.
+     */
+    static bool isStencilBuffer(GLenum format) {
+        switch (format) {
+            case GL_STENCIL_INDEX8:
+            case GL_STENCIL_INDEX1_OES:
+            case GL_STENCIL_INDEX4_OES:
+                return true;
+        }
+        return false;
+    }
+
+private:
+    GLenum mFormat;
+
+    uint32_t mWidth;
+    uint32_t mHeight;
+
+    bool mAllocated;
+
+    GLuint mName;
+}; // struct RenderBuffer
+
+}; // namespace uirenderer
+}; // namespace android
+
+#endif // ANDROID_HWUI_RENDER_BUFFER_H
diff --git a/libs/hwui/Snapshot.cpp b/libs/hwui/Snapshot.cpp
index 87ed825..19a5db7 100644
--- a/libs/hwui/Snapshot.cpp
+++ b/libs/hwui/Snapshot.cpp
@@ -183,6 +183,9 @@
 }
 
 void Snapshot::resetClip(float left, float top, float right, float bottom) {
+    // TODO: This is incorrect, when we start rendering into a new layer,
+    // we may have to modify the previous snapshot's clip rect and clip
+    // region if the previous restore() call did not restore the clip
     clipRect = &mClipRectRoot;
     clipRegion = &mClipRegionRoot;
     setClip(left, top, right, bottom);
diff --git a/libs/hwui/Stencil.cpp b/libs/hwui/Stencil.cpp
index 4fcd51d..ba2e6f2 100644
--- a/libs/hwui/Stencil.cpp
+++ b/libs/hwui/Stencil.cpp
@@ -14,14 +14,23 @@
  * limitations under the License.
  */
 
-#include <GLES2/gl2.h>
-
+#include "Extensions.h"
 #include "Properties.h"
 #include "Stencil.h"
 
+#include <GLES2/gl2ext.h>
+
 namespace android {
 namespace uirenderer {
 
+#if DEBUG_STENCIL
+#define STENCIL_WRITE_VALUE 0xff
+#define STENCIL_MASK_VALUE 0xff
+#else
+#define STENCIL_WRITE_VALUE 0x1
+#define STENCIL_MASK_VALUE 0x1
+#endif
+
 Stencil::Stencil(): mState(kDisabled) {
 }
 
@@ -29,6 +38,18 @@
     return STENCIL_BUFFER_SIZE;
 }
 
+GLenum Stencil::getSmallestStencilFormat() {
+#if !DEBUG_STENCIL
+    const Extensions& extensions = Extensions::getInstance();
+    if (extensions.has1BitStencil()) {
+        return GL_STENCIL_INDEX1_OES;
+    } else if (extensions.has4BitStencil()) {
+        return GL_STENCIL_INDEX4_OES;
+    }
+#endif
+    return GL_STENCIL_INDEX8;
+}
+
 void Stencil::clear() {
     glClearStencil(0);
     glClear(GL_STENCIL_BUFFER_BIT);
@@ -37,7 +58,7 @@
 void Stencil::enableTest() {
     if (mState != kTest) {
         enable();
-        glStencilFunc(GL_EQUAL, 0xff, 0xff);
+        glStencilFunc(GL_EQUAL, STENCIL_WRITE_VALUE, STENCIL_MASK_VALUE);
         // We only want to test, let's keep everything
         glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
@@ -48,7 +69,7 @@
 void Stencil::enableWrite() {
     if (mState != kWrite) {
         enable();
-        glStencilFunc(GL_ALWAYS, 0xff, 0xff);
+        glStencilFunc(GL_ALWAYS, STENCIL_WRITE_VALUE, STENCIL_MASK_VALUE);
         // The test always passes so the first two values are meaningless
         glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
         glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
diff --git a/libs/hwui/Stencil.h b/libs/hwui/Stencil.h
index 2f8a66a..047f7ee 100644
--- a/libs/hwui/Stencil.h
+++ b/libs/hwui/Stencil.h
@@ -21,6 +21,8 @@
     #define LOG_TAG "OpenGLRenderer"
 #endif
 
+#include <GLES2/gl2.h>
+
 #include <cutils/compiler.h>
 
 namespace android {
@@ -41,6 +43,11 @@
     ANDROID_API static uint32_t getStencilSize();
 
     /**
+     * Returns the smallest stencil format accepted by render buffers.
+     */
+    static GLenum getSmallestStencilFormat();
+
+    /**
      * Clears the stencil buffer.
      */
     void clear();
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index abf2d98..5cff5a5 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -219,7 +219,7 @@
 
     // We could also enable mipmapping if both bitmap dimensions are powers
     // of 2 but we'd have to deal with size changes. Let's keep this simple
-    const bool canMipMap = Caches::getInstance().extensions.hasNPot();
+    const bool canMipMap = Extensions::getInstance().hasNPot();
 
     // If the texture had mipmap enabled but not anymore,
     // force a glTexImage2D to discard the mipmap levels
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 035b282..2e4fa4b 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1526,6 +1526,16 @@
 
     /**
      * @hide
+     * Checks whether any music or media is actively playing on a remote device (e.g. wireless
+     *   display). Note that BT audio sinks are not considered remote devices.
+     * @return true if {@link AudioManager#STREAM_MUSIC} is active on a remote device
+     */
+    public boolean isMusicActiveRemotely() {
+        return AudioSystem.isStreamActiveRemotely(STREAM_MUSIC, 0);
+    }
+
+    /**
+     * @hide
      * Checks whether speech recognition is active
      * @return true if a recording with source {@link MediaRecorder.AudioSource#VOICE_RECOGNITION}
      *    is underway.
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index dde2979..4a33743 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -111,6 +111,14 @@
     public static native boolean isStreamActive(int stream, int inPastMs);
 
     /*
+     * Checks whether the specified stream type is active on a remotely connected device. The notion
+     * of what constitutes a remote device is enforced by the audio policy manager of the platform.
+     *
+     * return true if any track playing on this stream is active on a remote device.
+     */
+    public static native boolean isStreamActiveRemotely(int stream, int inPastMs);
+
+    /*
      * Checks whether the specified audio source is active.
      *
      * return true if any recorder using this source is currently recording
diff --git a/packages/InputDevices/res/raw/keyboard_layout_english_uk.kcm b/packages/InputDevices/res/raw/keyboard_layout_english_uk.kcm
new file mode 100644
index 0000000..6d9c2e5
--- /dev/null
+++ b/packages/InputDevices/res/raw/keyboard_layout_english_uk.kcm
@@ -0,0 +1,331 @@
+# Copyright (C) 2012 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.
+
+#
+# English (UK) keyboard layout.
+#
+
+type OVERLAY
+
+map key 43 POUND
+
+### ROW 1
+
+key GRAVE {
+    label:                              '`'
+    base:                               '`'
+    shift:                              '\u00AC'
+    ralt:                               '\u00A6'
+}
+
+key 1 {
+    label:                              '1'
+    base:                               '1'
+    shift:                              '!'
+}
+
+key 2 {
+    label:                              '2'
+    base:                               '2'
+    shift:                              '"'
+}
+
+key 3 {
+    label:                              '3'
+    base:                               '3'
+    shift:                              '\u00A3'
+}
+
+key 4 {
+    label:                              '4'
+    base:                               '4'
+    shift:                              '$'
+    ralt:                               '\u20AC'
+}
+
+key 5 {
+    label:                              '5'
+    base:                               '5'
+    shift:                              '%'
+}
+
+key 6 {
+    label:                              '6'
+    base:                               '6'
+    shift:                              '^'
+}
+
+key 7 {
+    label:                              '7'
+    base:                               '7'
+    shift:                              '&'
+}
+
+key 8 {
+    label:                              '8'
+    base:                               '8'
+    shift:                              '*'
+}
+
+key 9 {
+    label:                              '9'
+    base:                               '9'
+    shift:                              '('
+}
+
+key 0 {
+    label:                              '0'
+    base:                               '0'
+    shift:                              ')'
+}
+
+key MINUS {
+    label:                              '-'
+    base:                               '-'
+    shift:                              '_'
+}
+
+key EQUALS {
+    label:                              '='
+    base:                               '='
+    shift:                              '+'
+}
+
+### ROW 2
+
+key Q {
+    label:                              'Q'
+    base:                               'q'
+    shift, capslock:                    'Q'
+}
+
+key W {
+    label:                              'W'
+    base:                               'w'
+    shift, capslock:                    'W'
+}
+
+key E {
+    label:                              'E'
+    base:                               'e'
+    shift, capslock:                    'E'
+    ralt:                               '\u00e9'
+    shift+ralt:                         '\u00c9'
+}
+
+key R {
+    label:                              'R'
+    base:                               'r'
+    shift, capslock:                    'R'
+}
+
+key T {
+    label:                              'T'
+    base:                               't'
+    shift, capslock:                    'T'
+}
+
+key Y {
+    label:                              'Y'
+    base:                               'y'
+    shift, capslock:                    'Y'
+}
+
+key U {
+    label:                              'U'
+    base:                               'u'
+    shift, capslock:                    'U'
+    ralt:                               '\u00fa'
+    shift+ralt:                         '\u00da'
+}
+
+key I {
+    label:                              'I'
+    base:                               'i'
+    shift, capslock:                    'I'
+    ralt:                               '\u00ed'
+    shift+ralt:                         '\u00cd'
+}
+
+key O {
+    label:                              'O'
+    base:                               'o'
+    shift, capslock:                    'O'
+    ralt:                               '\u00f3'
+    shift+ralt:                         '\u00d3'
+}
+
+key P {
+    label:                              'P'
+    base:                               'p'
+    shift, capslock:                    'P'
+}
+
+key LEFT_BRACKET {
+    label:                              '['
+    base:                               '['
+    shift:                              '{'
+}
+
+key RIGHT_BRACKET {
+    label:                              ']'
+    base:                               ']'
+    shift:                              '}'
+}
+
+### ROW 3
+
+key A {
+    label:                              'A'
+    base:                               'a'
+    shift, capslock:                    'A'
+    ralt:                               '\u00e1'
+    shift+ralt:                         '\u00c1'
+}
+
+key S {
+    label:                              'S'
+    base:                               's'
+    shift, capslock:                    'S'
+}
+
+key D {
+    label:                              'D'
+    base:                               'd'
+    shift, capslock:                    'D'
+}
+
+key F {
+    label:                              'F'
+    base:                               'f'
+    shift, capslock:                    'F'
+}
+
+key G {
+    label:                              'G'
+    base:                               'g'
+    shift, capslock:                    'G'
+}
+
+key H {
+    label:                              'H'
+    base:                               'h'
+    shift, capslock:                    'H'
+}
+
+key J {
+    label:                              'J'
+    base:                               'j'
+    shift, capslock:                    'J'
+}
+
+key K {
+    label:                              'K'
+    base:                               'k'
+    shift, capslock:                    'K'
+}
+
+key L {
+    label:                              'L'
+    base:                               'l'
+    shift, capslock:                    'L'
+}
+
+key SEMICOLON {
+    label:                              ';'
+    base:                               ';'
+    shift:                              ':'
+}
+
+key APOSTROPHE {
+    label:                              '\''
+    base:                               '\''
+    shift:                              '@'
+}
+
+key POUND {
+    label:                              '#'
+    base:                               '#'
+    shift:                              '~'
+    ralt:                               '\\'
+    shift+ralt:                         '|'
+}
+
+### ROW 4
+
+key BACKSLASH {
+    label:                              '\\'
+    base:                               '\\'
+    shift:                              '|'
+}
+
+key Z {
+    label:                              'Z'
+    base:                               'z'
+    shift, capslock:                    'Z'
+}
+
+key X {
+    label:                              'X'
+    base:                               'x'
+    shift, capslock:                    'X'
+}
+
+key C {
+    label:                              'C'
+    base:                               'c'
+    shift, capslock:                    'C'
+}
+
+key V {
+    label:                              'V'
+    base:                               'v'
+    shift, capslock:                    'V'
+}
+
+key B {
+    label:                              'B'
+    base:                               'b'
+    shift, capslock:                    'B'
+}
+
+key N {
+    label:                              'N'
+    base:                               'n'
+    shift, capslock:                    'N'
+}
+
+key M {
+    label:                              'M'
+    base:                               'm'
+    shift, capslock:                    'M'
+}
+
+key COMMA {
+    label:                              ','
+    base:                               ','
+    shift:                              '<'
+}
+
+key PERIOD {
+    label:                              '.'
+    base:                               '.'
+    shift:                              '>'
+}
+
+key SLASH {
+    label:                              '/'
+    base:                               '/'
+    shift:                              '?'
+}
diff --git a/packages/InputDevices/res/values/strings.xml b/packages/InputDevices/res/values/strings.xml
index c13e606..65d3304 100644
--- a/packages/InputDevices/res/values/strings.xml
+++ b/packages/InputDevices/res/values/strings.xml
@@ -6,6 +6,9 @@
     <!-- Keyboard layouts label, used to describe the set of all built-in layouts in the UI. [CHAR LIMIT=35] -->
     <string name="keyboard_layouts_label">Android keyboard</string>
 
+    <!-- UK English keyboard layout label. [CHAR LIMIT=35] -->
+    <string name="keyboard_layout_english_uk_label">English (UK)</string>
+
     <!-- US English keyboard layout label. [CHAR LIMIT=35] -->
     <string name="keyboard_layout_english_us_label">English (US)</string>
 
diff --git a/packages/InputDevices/res/xml/keyboard_layouts.xml b/packages/InputDevices/res/xml/keyboard_layouts.xml
index c2a2ecc..3cfa170 100644
--- a/packages/InputDevices/res/xml/keyboard_layouts.xml
+++ b/packages/InputDevices/res/xml/keyboard_layouts.xml
@@ -1,5 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <keyboard-layouts xmlns:android="http://schemas.android.com/apk/res/android">
+    <keyboard-layout android:name="keyboard_layout_english_uk"
+            android:label="@string/keyboard_layout_english_uk_label"
+            android:keyboardLayout="@raw/keyboard_layout_english_uk" />
+
     <keyboard-layout android:name="keyboard_layout_english_us"
             android:label="@string/keyboard_layout_english_us_label"
             android:keyboardLayout="@raw/keyboard_layout_english_us" />
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index c40e26d..48edc73 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -189,7 +189,7 @@
     <string name="quick_settings_location_label" msgid="3292451598267467545">"الموقع المستخدم"</string>
     <string name="quick_settings_media_device_label" msgid="1302906836372603762">"جهاز الوسائط"</string>
     <string name="quick_settings_rssi_label" msgid="7725671335550695589">"RSSI"</string>
-    <string name="quick_settings_rssi_emergency_only" msgid="2713774041672886750">"مكالمات الطوارئ فقط"</string>
+    <string name="quick_settings_rssi_emergency_only" msgid="2713774041672886750">"مكالمات طوارئ فقط"</string>
     <string name="quick_settings_settings_label" msgid="5326556592578065401">"الإعدادات"</string>
     <string name="quick_settings_time_label" msgid="4635969182239736408">"الوقت"</string>
     <string name="quick_settings_user_label" msgid="5238995632130897840">"أنا"</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 8c2dd8e..580bfe7 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -147,7 +147,7 @@
     <string name="accessibility_ringer_silent" msgid="9061243307939135383">"Mode silenci."</string>
     <string name="accessibility_recents_item_dismissed" msgid="6803574935084867070">"S\'ha omès <xliff:g id="APP">%s</xliff:g>."</string>
     <string name="accessibility_notification_dismissed" msgid="854211387186306927">"Notificació omesa."</string>
-    <string name="accessibility_desc_notification_shade" msgid="4690274844447504208">"Capa de notificació."</string>
+    <string name="accessibility_desc_notification_shade" msgid="4690274844447504208">"Àrea de notificacions"</string>
     <string name="accessibility_desc_quick_settings" msgid="6186378411582437046">"Configuració ràpida."</string>
     <string name="accessibility_desc_recent_apps" msgid="9014032916410590027">"Aplicacions recents."</string>
     <string name="accessibility_quick_settings_user" msgid="1104846699869476855">"Usuari <xliff:g id="USER">%s</xliff:g>."</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index d619de1..0789b29 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -133,7 +133,7 @@
     <string name="accessibility_data_connection_wifi" msgid="2324496756590645221">"Wi-Fi"</string>
     <string name="accessibility_no_sim" msgid="8274017118472455155">"No hay tarjeta SIM."</string>
     <string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Conexión mediante Bluetooth"</string>
-    <string name="accessibility_airplane_mode" msgid="834748999790763092">"Modo de avión"</string>
+    <string name="accessibility_airplane_mode" msgid="834748999790763092">"Modo avión"</string>
     <!-- String.format failed for translation -->
     <!-- no translation found for accessibility_battery_level (7451474187113371965) -->
     <skip />
@@ -154,7 +154,7 @@
     <string name="accessibility_quick_settings_wifi" msgid="6099781031669728709">"<xliff:g id="SIGNAL">%1$s</xliff:g>. <xliff:g id="NETWORK">%2$s</xliff:g>"</string>
     <string name="accessibility_quick_settings_mobile" msgid="4876806564086241341">"Móvil <xliff:g id="SIGNAL">%1$s</xliff:g>. <xliff:g id="TYPE">%2$s</xliff:g>. <xliff:g id="NETWORK">%3$s</xliff:g>."</string>
     <string name="accessibility_quick_settings_battery" msgid="1480931583381408972">"Batería <xliff:g id="STATE">%s</xliff:g>"</string>
-    <string name="accessibility_quick_settings_airplane" msgid="4196876722090224753">"Modo de avión <xliff:g id="STATE">%s</xliff:g>"</string>
+    <string name="accessibility_quick_settings_airplane" msgid="4196876722090224753">"Modo avión <xliff:g id="STATE">%s</xliff:g>"</string>
     <string name="accessibility_quick_settings_bluetooth" msgid="5749054971341882340">"Bluetooth <xliff:g id="STATE">%s</xliff:g>"</string>
     <string name="accessibility_quick_settings_alarm" msgid="3959908972897295660">"Alarma: <xliff:g id="TIME">%s</xliff:g>"</string>
     <string name="data_usage_disabled_dialog_3g_title" msgid="5257833881698644687">"Datos de 2G-3G inhabilitados"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index c454bb1..fff1aa0 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -157,14 +157,14 @@
     <string name="accessibility_quick_settings_alarm" msgid="3959908972897295660">"Alarm ustawiony na <xliff:g id="TIME">%s</xliff:g>."</string>
     <string name="data_usage_disabled_dialog_3g_title" msgid="5257833881698644687">"Wyłączono transmisję danych 2G/3G"</string>
     <string name="data_usage_disabled_dialog_4g_title" msgid="4789143363492682629">"Wyłączono transmisję danych 4G"</string>
-    <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Wyłączono komórkową transmisję danych"</string>
+    <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Transmisja danych została wyłączona"</string>
     <string name="data_usage_disabled_dialog_title" msgid="2086815304858964954">"Wyłączono transmisję danych"</string>
-    <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Osiągnięto określony limit wykorzystania transmisji danych."\n\n"Jeśli ponownie włączysz przesyłanie danych, operator może naliczyć opłaty."</string>
+    <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Ustawiony limit transmisji danych został osiągnięty."\n\n"Jeśli ponownie włączysz przesyłanie danych, operator może naliczyć dodatkowe opłaty."</string>
     <string name="data_usage_disabled_dialog_enable" msgid="7729772039208664606">"Włącz transmisję danych"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="1940231521274147771">"Brak internetu"</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="6557486452774597820">"Wi-Fi: połączono"</string>
     <string name="gps_notification_searching_text" msgid="8574247005642736060">"Wyszukiwanie sygnału GPS"</string>
-    <string name="gps_notification_found_text" msgid="4619274244146446464">"Lokalizacja ustawiona według GPS"</string>
+    <string name="gps_notification_found_text" msgid="4619274244146446464">"Lokalizacja z GPSa"</string>
     <string name="accessibility_clear_all" msgid="5235938559247164925">"Usuń wszystkie powiadomienia."</string>
     <string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"O aplikacji"</string>
     <string name="close_universe" msgid="3736513750241754348">"Zamknij"</string>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index ccf4fd48..3d0ddd4 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -77,7 +77,7 @@
     <string name="use_ptp_button_title" msgid="7517127540301625751">"Установить как камеру (PTP)"</string>
     <string name="installer_cd_button_title" msgid="2312667578562201583">"Установить приложение"</string>
     <string name="accessibility_back" msgid="567011538994429120">"Назад"</string>
-    <string name="accessibility_home" msgid="8217216074895377641">"Главная страница"</string>
+    <string name="accessibility_home" msgid="8217216074895377641">"Домой"</string>
     <string name="accessibility_menu" msgid="316839303324695949">"Меню"</string>
     <string name="accessibility_recent" msgid="8571350598987952883">"Недавние приложения"</string>
     <string name="accessibility_ime_switch_button" msgid="5032926134740456424">"Кнопка переключения способа ввода."</string>
@@ -118,8 +118,8 @@
     <string name="accessibility_two_bars" msgid="6437363648385206679">"два деления"</string>
     <string name="accessibility_three_bars" msgid="2648241415119396648">"три деления"</string>
     <string name="accessibility_signal_full" msgid="9122922886519676839">"надежный сигнал"</string>
-    <string name="accessibility_desc_on" msgid="2385254693624345265">"ВКЛ"</string>
-    <string name="accessibility_desc_off" msgid="6475508157786853157">"ВЫКЛ"</string>
+    <string name="accessibility_desc_on" msgid="2385254693624345265">"Вкл."</string>
+    <string name="accessibility_desc_off" msgid="6475508157786853157">"Выкл."</string>
     <string name="accessibility_desc_connected" msgid="8366256693719499665">"Подключено"</string>
     <string name="accessibility_data_connection_gprs" msgid="1606477224486747751">"GPRS"</string>
     <string name="accessibility_data_connection_1x" msgid="994133468120244018">"1 X"</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 91214d1..a58c9a0 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -181,7 +181,7 @@
     <string name="quick_settings_battery_charged_label" msgid="8865413079414246081">"Laddat"</string>
     <string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"Bluetooth"</string>
     <string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"Bluetooth (<xliff:g id="NUMBER">%d</xliff:g> enheter)"</string>
-    <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Bluetooth inaktivt"</string>
+    <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Bluetooth av"</string>
     <string name="quick_settings_brightness_label" msgid="6968372297018755815">"Ljusstyrka"</string>
     <string name="quick_settings_rotation_unlocked_label" msgid="336054930362580584">"Rotera automatiskt"</string>
     <string name="quick_settings_rotation_locked_label" msgid="8058646447242565486">"Rotationen har låsts"</string>
@@ -196,9 +196,9 @@
     <string name="quick_settings_wifi_label" msgid="9135344704899546041">"Wi-Fi"</string>
     <string name="quick_settings_wifi_not_connected" msgid="7171904845345573431">"Ej ansluten"</string>
     <string name="quick_settings_wifi_no_network" msgid="2221993077220856376">"Inget nätverk"</string>
-    <string name="quick_settings_wifi_off_label" msgid="7558778100843885864">"Wi-Fi är inaktiverat"</string>
-    <string name="quick_settings_wifi_display_label" msgid="6893592964463624333">"Wi-Fi visas"</string>
-    <string name="quick_settings_wifi_display_no_connection_label" msgid="2355298740765736918">"Trådlös visning"</string>
+    <string name="quick_settings_wifi_off_label" msgid="7558778100843885864">"Wi-Fi av"</string>
+    <string name="quick_settings_wifi_display_label" msgid="6893592964463624333">"Trådlös skärm"</string>
+    <string name="quick_settings_wifi_display_no_connection_label" msgid="2355298740765736918">"Trådlös skärm"</string>
     <string name="quick_settings_brightness_dialog_title" msgid="8599674057673605368">"Ljusstyrka"</string>
     <string name="quick_settings_brightness_dialog_auto_brightness_label" msgid="5064982743784071218">"AUTO"</string>
     <string name="status_bar_help_title" msgid="1199237744086469217">"Meddelanden visas här"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 7750e77..f43eabe 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -35,10 +35,10 @@
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"Поточні"</string>
     <string name="status_bar_latest_events_title" msgid="6594767438577593172">"Сповіщення"</string>
     <string name="battery_low_title" msgid="2783104807551211639">"Підключіть зарядний пристрій"</string>
-    <string name="battery_low_subtitle" msgid="1752040062087829196">"Батарея виснажується."</string>
+    <string name="battery_low_subtitle" msgid="1752040062087829196">"Акумулятор розряджається."</string>
     <string name="battery_low_percent_format" msgid="1077244949318261761">"Залишилося <xliff:g id="NUMBER">%d%%</xliff:g>"</string>
     <string name="invalid_charger" msgid="4549105996740522523">"Заряджання USB не підтримується."\n"Використовуйте лише наданий у комплекті зарядний пристрій."</string>
-    <string name="battery_low_why" msgid="7279169609518386372">"Викор. батареї"</string>
+    <string name="battery_low_why" msgid="7279169609518386372">"Використання акумулятора"</string>
     <string name="status_bar_settings_settings_button" msgid="3023889916699270224">"Налаштування"</string>
     <string name="status_bar_settings_wifi_button" msgid="1733928151698311923">"Wi-Fi"</string>
     <string name="status_bar_settings_airplane" msgid="4879879698500955300">"Режим польоту"</string>
@@ -85,11 +85,11 @@
     <string name="accessibility_compatibility_zoom_example" msgid="4220687294564945780">"Збільшення екрана."</string>
     <string name="accessibility_bluetooth_connected" msgid="2707027633242983370">"Bluetooth під’єднано."</string>
     <string name="accessibility_bluetooth_disconnected" msgid="7416648669976870175">"Bluetooth від’єднано."</string>
-    <string name="accessibility_no_battery" msgid="358343022352820946">"Немає заряду батареї."</string>
-    <string name="accessibility_battery_one_bar" msgid="7774887721891057523">"Одна смужка заряду батареї."</string>
-    <string name="accessibility_battery_two_bars" msgid="8500650438735009973">"Дві смужки заряду батареї."</string>
-    <string name="accessibility_battery_three_bars" msgid="2302983330865040446">"Три смужки заряду батареї."</string>
-    <string name="accessibility_battery_full" msgid="8909122401720158582">"Повний заряд батареї"</string>
+    <string name="accessibility_no_battery" msgid="358343022352820946">"Акумулятор розряджений."</string>
+    <string name="accessibility_battery_one_bar" msgid="7774887721891057523">"Заряд акумулятора: одна смужка."</string>
+    <string name="accessibility_battery_two_bars" msgid="8500650438735009973">"Заряд акумулятора: дві смужки."</string>
+    <string name="accessibility_battery_three_bars" msgid="2302983330865040446">"Заряд акумулятора: три смужки."</string>
+    <string name="accessibility_battery_full" msgid="8909122401720158582">"Акумулятор заряджений."</string>
     <string name="accessibility_no_phone" msgid="4894708937052611281">"Немає сигналу телефону."</string>
     <string name="accessibility_phone_one_bar" msgid="687699278132664115">"Одна смужка сигналу телефону."</string>
     <string name="accessibility_phone_two_bars" msgid="8384905382804815201">"Дві смужки сигналу телефону."</string>
@@ -134,7 +134,7 @@
     <string name="accessibility_no_sim" msgid="8274017118472455155">"Немає SIM-карти."</string>
     <string name="accessibility_bluetooth_tether" msgid="4102784498140271969">"Прив’язка Bluetooth."</string>
     <string name="accessibility_airplane_mode" msgid="834748999790763092">"Режим польоту."</string>
-    <string name="accessibility_battery_level" msgid="7451474187113371965">"Відсотків батареї: <xliff:g id="NUMBER">%d</xliff:g>."</string>
+    <string name="accessibility_battery_level" msgid="7451474187113371965">"Заряд акумулятора: <xliff:g id="NUMBER">%d</xliff:g>."</string>
     <string name="accessibility_settings_button" msgid="799583911231893380">"Налаштування системи."</string>
     <string name="accessibility_notifications_button" msgid="4498000369779421892">"Сповіщення."</string>
     <string name="accessibility_remove_notification" msgid="3603099514902182350">"Очистити сповіщення."</string>
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 280b368..ddfaad5 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -45,6 +45,7 @@
 import android.os.Process;
 import android.provider.MediaStore;
 import android.util.DisplayMetrics;
+import android.util.Log;
 import android.view.Display;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
@@ -86,6 +87,8 @@
  */
 class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Void,
         SaveImageInBackgroundData> {
+    private static final String TAG = "SaveImageInBackgroundTask";
+
     private static final String SCREENSHOTS_DIR_NAME = "Screenshots";
     private static final String SCREENSHOT_FILE_NAME_TEMPLATE = "Screenshot_%s.png";
     private static final String SCREENSHOT_SHARE_SUBJECT_TEMPLATE = "Screenshot (%s)";
@@ -138,6 +141,7 @@
                             (shortSide - mImageHeight) / 2);
         c.drawBitmap(data.image, matrix, paint);
         c.drawColor(0x40FFFFFF);
+        c.setBitmap(null);
 
         Bitmap croppedIcon = Bitmap.createScaledBitmap(preview, iconSize, iconSize, true);
 
@@ -167,6 +171,8 @@
         mNotificationBuilder.setLargeIcon(croppedIcon);
         // But we still don't set it for the expanded view, allowing the smallIcon to show here.
         mNotificationStyle.bigLargeIcon(null);
+
+        Log.d(TAG, "SaveImageInBackgroundTask constructor");
     }
 
     @Override
@@ -174,6 +180,7 @@
         if (params.length != 1) return null;
         if (isCancelled()) {
             params[0].clearImage();
+            Log.d(TAG, "doInBackground cancelled");
             return null;
         }
 
@@ -238,6 +245,7 @@
             // mounted
             params[0].clearImage();
             params[0].result = 1;
+            Log.d(TAG, "doInBackground failed");
         }
 
         // Recycle the bitmap data
@@ -245,6 +253,7 @@
             image.recycle();
         }
 
+        Log.d(TAG, "doInBackground complete");
         return params[0];
     }
 
@@ -253,6 +262,7 @@
         if (isCancelled()) {
             params.finisher.run();
             params.clearImage();
+            Log.d(TAG, "onPostExecute cancelled");
             return;
         }
 
@@ -280,6 +290,7 @@
             mNotificationManager.notify(mNotificationId, n);
         }
         params.finisher.run();
+        Log.d(TAG, "onPostExecute complete");
     }
 }
 
@@ -290,6 +301,8 @@
  *     type of gallery?
  */
 class GlobalScreenshot {
+    private static final String TAG = "GlobalScreenshot";
+
     private static final int SCREENSHOT_NOTIFICATION_ID = 789;
     private static final int SCREENSHOT_FLASH_TO_PEAK_DURATION = 130;
     private static final int SCREENSHOT_DROP_IN_DURATION = 430;
@@ -381,12 +394,15 @@
         // Setup the Camera shutter sound
         mCameraSound = new MediaActionSound();
         mCameraSound.load(MediaActionSound.SHUTTER_CLICK);
+
+        Log.d(TAG, "GlobalScreenshot constructor");
     }
 
     /**
      * Creates a new worker thread and saves the screenshot to the media store.
      */
     private void saveScreenshotInWorkerThread(Runnable finisher) {
+        Log.d(TAG, "saveScreenshotInWorkerThread");
         SaveImageInBackgroundData data = new SaveImageInBackgroundData();
         data.context = mContext;
         data.image = mScreenBitmap;
@@ -394,6 +410,7 @@
         data.finisher = finisher;
         if (mSaveInBgTask != null) {
             mSaveInBgTask.cancel(false);
+            Log.d(TAG, "saveScreenshotInWorkerThread cancel");
         }
         mSaveInBgTask = new SaveImageInBackgroundTask(mContext, data, mNotificationManager,
                 SCREENSHOT_NOTIFICATION_ID).execute(data);
@@ -418,6 +435,8 @@
      * Takes a screenshot of the current display and shows an animation.
      */
     void takeScreenshot(Runnable finisher, boolean statusBarVisible, boolean navBarVisible) {
+        Log.d(TAG, "takeScreenshot");
+
         // We need to orient the screenshot correctly (and the Surface api seems to take screenshots
         // only in the natural orientation of the device :!)
         mDisplay.getRealMetrics(mDisplayMetrics);
@@ -431,6 +450,8 @@
             mDisplayMatrix.mapPoints(dims);
             dims[0] = Math.abs(dims[0]);
             dims[1] = Math.abs(dims[1]);
+
+            Log.d(TAG, "takeScreenshot requiresRotation");
         }
 
         // Take the screenshot
@@ -438,6 +459,7 @@
         if (mScreenBitmap == null) {
             notifyScreenshotError(mContext, mNotificationManager);
             finisher.run();
+            Log.d(TAG, "takeScreenshot null bitmap");
             return;
         }
 
@@ -451,7 +473,10 @@
             c.translate(-dims[0] / 2, -dims[1] / 2);
             c.drawBitmap(mScreenBitmap, 0, 0, null);
             c.setBitmap(null);
+            // Recycle the previous bitmap
+            mScreenBitmap.recycle();
             mScreenBitmap = ss;
+            Log.d(TAG, "takeScreenshot rotation bitmap created");
         }
 
         // Optimizations
@@ -461,6 +486,7 @@
         // Start the post-screenshot animation
         startAnimation(finisher, mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels,
                 statusBarVisible, navBarVisible);
+        Log.d(TAG, "takeScreenshot startedAnimation");
     }
 
 
@@ -469,6 +495,7 @@
      */
     private void startAnimation(final Runnable finisher, int w, int h, boolean statusBarVisible,
             boolean navBarVisible) {
+        Log.d(TAG, "startAnimation");
         // Add the view for the animation
         mScreenshotView.setImageBitmap(mScreenBitmap);
         mScreenshotLayout.requestFocus();
@@ -477,9 +504,11 @@
         if (mScreenshotAnimation != null) {
             mScreenshotAnimation.end();
             mScreenshotAnimation.removeAllListeners();
+            Log.d(TAG, "startAnimation reset previous animations");
         }
 
         mWindowManager.addView(mScreenshotLayout, mWindowLayoutParams);
+        Log.d(TAG, "startAnimation layout added to WM");
         ValueAnimator screenshotDropInAnim = createScreenshotDropInAnimation();
         ValueAnimator screenshotFadeOutAnim = createScreenshotDropOutAnimation(w, h,
                 statusBarVisible, navBarVisible);
@@ -495,6 +524,7 @@
                 // Clear any references to the bitmap
                 mScreenBitmap = null;
                 mScreenshotView.setImageBitmap(null);
+                Log.d(TAG, "startAnimation onAnimationEnd");
             }
         });
         mScreenshotLayout.post(new Runnable() {
@@ -506,6 +536,7 @@
                 mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
                 mScreenshotView.buildLayer();
                 mScreenshotAnimation.start();
+                Log.d(TAG, "startAnimation post runnable");
             }
         });
     }
@@ -643,6 +674,7 @@
     }
 
     static void notifyScreenshotError(Context context, NotificationManager nManager) {
+        Log.d(TAG, "notifyScreenshotError");
         Resources r = context.getResources();
 
         // Clear all existing notification, compose the new notification and show it
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
index 456b5fa..1954af8 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
@@ -23,6 +23,7 @@
 import android.os.Message;
 import android.os.Messenger;
 import android.os.RemoteException;
+import android.util.Log;
 
 public class TakeScreenshotService extends Service {
     private static final String TAG = "TakeScreenshotService";
@@ -37,12 +38,15 @@
                     final Messenger callback = msg.replyTo;
                     if (mScreenshot == null) {
                         mScreenshot = new GlobalScreenshot(TakeScreenshotService.this);
+                        Log.d(TAG, "Global screenshot initialized");
                     }
+                    Log.d(TAG, "Global screenshot captured");
                     mScreenshot.takeScreenshot(new Runnable() {
                         @Override public void run() {
                             Message reply = Message.obtain(null, 1);
                             try {
                                 callback.send(reply);
+                                Log.d(TAG, "Global screenshot completed");
                             } catch (RemoteException e) {
                             }
                         }
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 9d0903c..9cb54a9 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -84,7 +84,6 @@
 import android.view.WindowManager;
 import android.view.WindowManagerGlobal;
 import android.view.WindowManagerPolicy;
-import android.view.WindowOrientationListener;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
@@ -555,8 +554,8 @@
     }
     
     class MyOrientationListener extends WindowOrientationListener {
-        MyOrientationListener(Context context) {
-            super(context);
+        MyOrientationListener(Context context, Handler handler) {
+            super(context, handler);
         }
         
         @Override
@@ -854,7 +853,7 @@
             mKeyguardMediator = new KeyguardViewMediator(context, null);
         }
         mHandler = new PolicyHandler();
-        mOrientationListener = new MyOrientationListener(mContext);
+        mOrientationListener = new MyOrientationListener(mContext, mHandler);
         try {
             mOrientationListener.setCurrentRotation(windowManager.getRotation());
         } catch (RemoteException ex) { }
@@ -3760,13 +3759,16 @@
     }
 
     BroadcastReceiver mDockReceiver = new BroadcastReceiver() {
+        @Override
         public void onReceive(Context context, Intent intent) {
             if (Intent.ACTION_DOCK_EVENT.equals(intent.getAction())) {
                 mDockMode = intent.getIntExtra(Intent.EXTRA_DOCK_STATE,
                         Intent.EXTRA_DOCK_STATE_UNDOCKED);
             }
             updateRotation(true);
-            updateOrientationListenerLp();
+            synchronized (mLock) {
+                updateOrientationListenerLp();
+            }
         }
     };
 
diff --git a/core/java/android/view/WindowOrientationListener.java b/policy/src/com/android/internal/policy/impl/WindowOrientationListener.java
similarity index 65%
rename from core/java/android/view/WindowOrientationListener.java
rename to policy/src/com/android/internal/policy/impl/WindowOrientationListener.java
index bf77c67..0c77556 100644
--- a/core/java/android/view/WindowOrientationListener.java
+++ b/policy/src/com/android/internal/policy/impl/WindowOrientationListener.java
@@ -14,13 +14,14 @@
  * limitations under the License.
  */
 
-package android.view;
+package com.android.internal.policy.impl;
 
 import android.content.Context;
 import android.hardware.Sensor;
 import android.hardware.SensorEvent;
 import android.hardware.SensorEventListener;
 import android.hardware.SensorManager;
+import android.os.Handler;
 import android.os.SystemProperties;
 import android.util.FloatMath;
 import android.util.Log;
@@ -47,26 +48,31 @@
 
     private static final boolean USE_GRAVITY_SENSOR = false;
 
+    private Handler mHandler;
     private SensorManager mSensorManager;
     private boolean mEnabled;
     private int mRate;
     private Sensor mSensor;
     private SensorEventListenerImpl mSensorEventListener;
-    int mCurrentRotation = -1;
+    private int mCurrentRotation = -1;
+
+    private final Object mLock = new Object();
 
     /**
      * Creates a new WindowOrientationListener.
      * 
      * @param context for the WindowOrientationListener.
+     * @param handler Provides the Looper for receiving sensor updates.
      */
-    public WindowOrientationListener(Context context) {
-        this(context, SensorManager.SENSOR_DELAY_UI);
+    public WindowOrientationListener(Context context, Handler handler) {
+        this(context, handler, SensorManager.SENSOR_DELAY_UI);
     }
     
     /**
      * Creates a new WindowOrientationListener.
      * 
      * @param context for the WindowOrientationListener.
+     * @param handler Provides the Looper for receiving sensor updates.
      * @param rate at which sensor events are processed (see also
      * {@link android.hardware.SensorManager SensorManager}). Use the default
      * value of {@link android.hardware.SensorManager#SENSOR_DELAY_NORMAL 
@@ -74,33 +80,36 @@
      *
      * This constructor is private since no one uses it.
      */
-    private WindowOrientationListener(Context context, int rate) {
+    private WindowOrientationListener(Context context, Handler handler, int rate) {
+        mHandler = handler;
         mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
         mRate = rate;
         mSensor = mSensorManager.getDefaultSensor(USE_GRAVITY_SENSOR
                 ? Sensor.TYPE_GRAVITY : Sensor.TYPE_ACCELEROMETER);
         if (mSensor != null) {
             // Create listener only if sensors do exist
-            mSensorEventListener = new SensorEventListenerImpl(this);
+            mSensorEventListener = new SensorEventListenerImpl();
         }
     }
 
     /**
      * Enables the WindowOrientationListener so it will monitor the sensor and call
-     * {@link #onOrientationChanged} when the device orientation changes.
+     * {@link #onProposedRotationChanged(int)} when the device orientation changes.
      */
     public void enable() {
-        if (mSensor == null) {
-            Log.w(TAG, "Cannot detect sensors. Not enabled");
-            return;
-        }
-        if (mEnabled == false) {
-            if (LOG) {
-                Log.d(TAG, "WindowOrientationListener enabled");
+        synchronized (mLock) {
+            if (mSensor == null) {
+                Log.w(TAG, "Cannot detect sensors. Not enabled");
+                return;
             }
-            mSensorEventListener.reset();
-            mSensorManager.registerListener(mSensorEventListener, mSensor, mRate);
-            mEnabled = true;
+            if (mEnabled == false) {
+                if (LOG) {
+                    Log.d(TAG, "WindowOrientationListener enabled");
+                }
+                mSensorEventListener.resetLocked();
+                mSensorManager.registerListener(mSensorEventListener, mSensor, mRate, mHandler);
+                mEnabled = true;
+            }
         }
     }
 
@@ -108,16 +117,18 @@
      * Disables the WindowOrientationListener.
      */
     public void disable() {
-        if (mSensor == null) {
-            Log.w(TAG, "Cannot detect sensors. Invalid disable");
-            return;
-        }
-        if (mEnabled == true) {
-            if (LOG) {
-                Log.d(TAG, "WindowOrientationListener disabled");
+        synchronized (mLock) {
+            if (mSensor == null) {
+                Log.w(TAG, "Cannot detect sensors. Invalid disable");
+                return;
             }
-            mSensorManager.unregisterListener(mSensorEventListener);
-            mEnabled = false;
+            if (mEnabled == true) {
+                if (LOG) {
+                    Log.d(TAG, "WindowOrientationListener disabled");
+                }
+                mSensorManager.unregisterListener(mSensorEventListener);
+                mEnabled = false;
+            }
         }
     }
 
@@ -127,7 +138,9 @@
      * @param rotation The current rotation.
      */
     public void setCurrentRotation(int rotation) {
-        mCurrentRotation = rotation;
+        synchronized (mLock) {
+            mCurrentRotation = rotation;
+        }
     }
 
     /**
@@ -139,17 +152,21 @@
      * @return The proposed rotation, or -1 if unknown.
      */
     public int getProposedRotation() {
-        if (mEnabled) {
-            return mSensorEventListener.getProposedRotation();
+        synchronized (mLock) {
+            if (mEnabled) {
+                return mSensorEventListener.getProposedRotationLocked();
+            }
+            return -1;
         }
-        return -1;
     }
 
     /**
      * Returns true if sensor is enabled and false otherwise
      */
     public boolean canDetectOrientation() {
-        return mSensor != null;
+        synchronized (mLock) {
+            return mSensor != null;
+        }
     }
 
     /**
@@ -160,7 +177,7 @@
      * uncertain to being certain again, even if it is the same orientation as before.
      *
      * @param rotation The new orientation of the device, one of the Surface.ROTATION_* constants.
-     * @see Surface
+     * @see android.view.Surface
      */
     public abstract void onProposedRotationChanged(int rotation);
 
@@ -202,7 +219,7 @@
      * See http://en.wikipedia.org/wiki/Low-pass_filter#Discrete-time_realization for
      * signal processing background.
      */
-    static final class SensorEventListenerImpl implements SensorEventListener {
+    final class SensorEventListenerImpl implements SensorEventListener {
         // We work with all angles in degrees in this class.
         private static final float RADIANS_TO_DEGREES = (float) (180 / Math.PI);
 
@@ -214,8 +231,6 @@
         private static final int ACCELEROMETER_DATA_Y = 1;
         private static final int ACCELEROMETER_DATA_Z = 2;
 
-        private final WindowOrientationListener mOrientationListener;
-
         // The minimum amount of time that a predicted rotation must be stable before it
         // is accepted as a valid rotation proposal.  This value can be quite small because
         // the low-pass filter already suppresses most of the noise so we're really just
@@ -320,7 +335,7 @@
         // facing up (resting on a table).
         // The ideal tilt angle is 0 (when the device is vertical) so the limits establish
         // how close to vertical the device must be in order to change orientation.
-        private static final int[][] TILT_TOLERANCE = new int[][] {
+        private final int[][] TILT_TOLERANCE = new int[][] {
             /* ROTATION_0   */ { -25, 70 },
             /* ROTATION_90  */ { -25, 65 },
             /* ROTATION_180 */ { -25, 60 },
@@ -362,12 +377,7 @@
         private long[] mTiltHistoryTimestampNanos = new long[TILT_HISTORY_SIZE];
         private int mTiltHistoryIndex;
 
-        public SensorEventListenerImpl(WindowOrientationListener orientationListener) {
-            mOrientationListener = orientationListener;
-            reset();
-        }
-
-        public int getProposedRotation() {
+        public int getProposedRotationLocked() {
             return mProposedRotation;
         }
 
@@ -377,179 +387,187 @@
 
         @Override
         public void onSensorChanged(SensorEvent event) {
-            // The vector given in the SensorEvent points straight up (towards the sky) under ideal
-            // conditions (the phone is not accelerating).  I'll call this up vector elsewhere.
-            float x = event.values[ACCELEROMETER_DATA_X];
-            float y = event.values[ACCELEROMETER_DATA_Y];
-            float z = event.values[ACCELEROMETER_DATA_Z];
+            int proposedRotation;
+            int oldProposedRotation;
 
-            if (LOG) {
-                Slog.v(TAG, "Raw acceleration vector: "
-                        + "x=" + x + ", y=" + y + ", z=" + z
-                        + ", magnitude=" + FloatMath.sqrt(x * x + y * y + z * z));
-            }
+            synchronized (mLock) {
+                // The vector given in the SensorEvent points straight up (towards the sky) under
+                // ideal conditions (the phone is not accelerating).  I'll call this up vector
+                // elsewhere.
+                float x = event.values[ACCELEROMETER_DATA_X];
+                float y = event.values[ACCELEROMETER_DATA_Y];
+                float z = event.values[ACCELEROMETER_DATA_Z];
 
-            // Apply a low-pass filter to the acceleration up vector in cartesian space.
-            // Reset the orientation listener state if the samples are too far apart in time
-            // or when we see values of (0, 0, 0) which indicates that we polled the
-            // accelerometer too soon after turning it on and we don't have any data yet.
-            final long now = event.timestamp;
-            final long then = mLastFilteredTimestampNanos;
-            final float timeDeltaMS = (now - then) * 0.000001f;
-            final boolean skipSample;
-            if (now < then
-                    || now > then + MAX_FILTER_DELTA_TIME_NANOS
-                    || (x == 0 && y == 0 && z == 0)) {
                 if (LOG) {
-                    Slog.v(TAG, "Resetting orientation listener.");
-                }
-                reset();
-                skipSample = true;
-            } else {
-                final float alpha = timeDeltaMS / (FILTER_TIME_CONSTANT_MS + timeDeltaMS);
-                x = alpha * (x - mLastFilteredX) + mLastFilteredX;
-                y = alpha * (y - mLastFilteredY) + mLastFilteredY;
-                z = alpha * (z - mLastFilteredZ) + mLastFilteredZ;
-                if (LOG) {
-                    Slog.v(TAG, "Filtered acceleration vector: "
+                    Slog.v(TAG, "Raw acceleration vector: "
                             + "x=" + x + ", y=" + y + ", z=" + z
                             + ", magnitude=" + FloatMath.sqrt(x * x + y * y + z * z));
                 }
-                skipSample = false;
-            }
-            mLastFilteredTimestampNanos = now;
-            mLastFilteredX = x;
-            mLastFilteredY = y;
-            mLastFilteredZ = z;
 
-            boolean isAccelerating = false;
-            boolean isFlat = false;
-            boolean isSwinging = false;
-            if (!skipSample) {
-                // Calculate the magnitude of the acceleration vector.
-                final float magnitude = FloatMath.sqrt(x * x + y * y + z * z);
-                if (magnitude < NEAR_ZERO_MAGNITUDE) {
+                // Apply a low-pass filter to the acceleration up vector in cartesian space.
+                // Reset the orientation listener state if the samples are too far apart in time
+                // or when we see values of (0, 0, 0) which indicates that we polled the
+                // accelerometer too soon after turning it on and we don't have any data yet.
+                final long now = event.timestamp;
+                final long then = mLastFilteredTimestampNanos;
+                final float timeDeltaMS = (now - then) * 0.000001f;
+                final boolean skipSample;
+                if (now < then
+                        || now > then + MAX_FILTER_DELTA_TIME_NANOS
+                        || (x == 0 && y == 0 && z == 0)) {
                     if (LOG) {
-                        Slog.v(TAG, "Ignoring sensor data, magnitude too close to zero.");
+                        Slog.v(TAG, "Resetting orientation listener.");
                     }
-                    clearPredictedRotation();
+                    resetLocked();
+                    skipSample = true;
                 } else {
-                    // Determine whether the device appears to be undergoing external acceleration.
-                    if (isAccelerating(magnitude)) {
-                        isAccelerating = true;
-                        mAccelerationTimestampNanos = now;
+                    final float alpha = timeDeltaMS / (FILTER_TIME_CONSTANT_MS + timeDeltaMS);
+                    x = alpha * (x - mLastFilteredX) + mLastFilteredX;
+                    y = alpha * (y - mLastFilteredY) + mLastFilteredY;
+                    z = alpha * (z - mLastFilteredZ) + mLastFilteredZ;
+                    if (LOG) {
+                        Slog.v(TAG, "Filtered acceleration vector: "
+                                + "x=" + x + ", y=" + y + ", z=" + z
+                                + ", magnitude=" + FloatMath.sqrt(x * x + y * y + z * z));
                     }
+                    skipSample = false;
+                }
+                mLastFilteredTimestampNanos = now;
+                mLastFilteredX = x;
+                mLastFilteredY = y;
+                mLastFilteredZ = z;
 
-                    // Calculate the tilt angle.
-                    // This is the angle between the up vector and the x-y plane (the plane of
-                    // the screen) in a range of [-90, 90] degrees.
-                    //   -90 degrees: screen horizontal and facing the ground (overhead)
-                    //     0 degrees: screen vertical
-                    //    90 degrees: screen horizontal and facing the sky (on table)
-                    final int tiltAngle = (int) Math.round(
-                            Math.asin(z / magnitude) * RADIANS_TO_DEGREES);
-                    addTiltHistoryEntry(now, tiltAngle);
-
-                    // Determine whether the device appears to be flat or swinging.
-                    if (isFlat(now)) {
-                        isFlat = true;
-                        mFlatTimestampNanos = now;
-                    }
-                    if (isSwinging(now, tiltAngle)) {
-                        isSwinging = true;
-                        mSwingTimestampNanos = now;
-                    }
-
-                    // If the tilt angle is too close to horizontal then we cannot determine
-                    // the orientation angle of the screen.
-                    if (Math.abs(tiltAngle) > MAX_TILT) {
+                boolean isAccelerating = false;
+                boolean isFlat = false;
+                boolean isSwinging = false;
+                if (!skipSample) {
+                    // Calculate the magnitude of the acceleration vector.
+                    final float magnitude = FloatMath.sqrt(x * x + y * y + z * z);
+                    if (magnitude < NEAR_ZERO_MAGNITUDE) {
                         if (LOG) {
-                            Slog.v(TAG, "Ignoring sensor data, tilt angle too high: "
-                                    + "tiltAngle=" + tiltAngle);
+                            Slog.v(TAG, "Ignoring sensor data, magnitude too close to zero.");
                         }
-                        clearPredictedRotation();
+                        clearPredictedRotationLocked();
                     } else {
-                        // Calculate the orientation angle.
-                        // This is the angle between the x-y projection of the up vector onto
-                        // the +y-axis, increasing clockwise in a range of [0, 360] degrees.
-                        int orientationAngle = (int) Math.round(
-                                -Math.atan2(-x, y) * RADIANS_TO_DEGREES);
-                        if (orientationAngle < 0) {
-                            // atan2 returns [-180, 180]; normalize to [0, 360]
-                            orientationAngle += 360;
+                        // Determine whether the device appears to be undergoing external
+                        // acceleration.
+                        if (isAcceleratingLocked(magnitude)) {
+                            isAccelerating = true;
+                            mAccelerationTimestampNanos = now;
                         }
 
-                        // Find the nearest rotation.
-                        int nearestRotation = (orientationAngle + 45) / 90;
-                        if (nearestRotation == 4) {
-                            nearestRotation = 0;
+                        // Calculate the tilt angle.
+                        // This is the angle between the up vector and the x-y plane (the plane of
+                        // the screen) in a range of [-90, 90] degrees.
+                        //   -90 degrees: screen horizontal and facing the ground (overhead)
+                        //     0 degrees: screen vertical
+                        //    90 degrees: screen horizontal and facing the sky (on table)
+                        final int tiltAngle = (int) Math.round(
+                                Math.asin(z / magnitude) * RADIANS_TO_DEGREES);
+                        addTiltHistoryEntryLocked(now, tiltAngle);
+
+                        // Determine whether the device appears to be flat or swinging.
+                        if (isFlatLocked(now)) {
+                            isFlat = true;
+                            mFlatTimestampNanos = now;
+                        }
+                        if (isSwingingLocked(now, tiltAngle)) {
+                            isSwinging = true;
+                            mSwingTimestampNanos = now;
                         }
 
-                        // Determine the predicted orientation.
-                        if (isTiltAngleAcceptable(nearestRotation, tiltAngle)
-                                && isOrientationAngleAcceptable(nearestRotation,
-                                        orientationAngle)) {
-                            updatePredictedRotation(now, nearestRotation);
+                        // If the tilt angle is too close to horizontal then we cannot determine
+                        // the orientation angle of the screen.
+                        if (Math.abs(tiltAngle) > MAX_TILT) {
                             if (LOG) {
-                                Slog.v(TAG, "Predicted: "
-                                        + "tiltAngle=" + tiltAngle
-                                        + ", orientationAngle=" + orientationAngle
-                                        + ", predictedRotation=" + mPredictedRotation
-                                        + ", predictedRotationAgeMS="
-                                                + ((now - mPredictedRotationTimestampNanos)
-                                                        * 0.000001f));
+                                Slog.v(TAG, "Ignoring sensor data, tilt angle too high: "
+                                        + "tiltAngle=" + tiltAngle);
                             }
+                            clearPredictedRotationLocked();
                         } else {
-                            if (LOG) {
-                                Slog.v(TAG, "Ignoring sensor data, no predicted rotation: "
-                                        + "tiltAngle=" + tiltAngle
-                                        + ", orientationAngle=" + orientationAngle);
+                            // Calculate the orientation angle.
+                            // This is the angle between the x-y projection of the up vector onto
+                            // the +y-axis, increasing clockwise in a range of [0, 360] degrees.
+                            int orientationAngle = (int) Math.round(
+                                    -Math.atan2(-x, y) * RADIANS_TO_DEGREES);
+                            if (orientationAngle < 0) {
+                                // atan2 returns [-180, 180]; normalize to [0, 360]
+                                orientationAngle += 360;
                             }
-                            clearPredictedRotation();
+
+                            // Find the nearest rotation.
+                            int nearestRotation = (orientationAngle + 45) / 90;
+                            if (nearestRotation == 4) {
+                                nearestRotation = 0;
+                            }
+
+                            // Determine the predicted orientation.
+                            if (isTiltAngleAcceptableLocked(nearestRotation, tiltAngle)
+                                    && isOrientationAngleAcceptableLocked(nearestRotation,
+                                            orientationAngle)) {
+                                updatePredictedRotationLocked(now, nearestRotation);
+                                if (LOG) {
+                                    Slog.v(TAG, "Predicted: "
+                                            + "tiltAngle=" + tiltAngle
+                                            + ", orientationAngle=" + orientationAngle
+                                            + ", predictedRotation=" + mPredictedRotation
+                                            + ", predictedRotationAgeMS="
+                                                    + ((now - mPredictedRotationTimestampNanos)
+                                                            * 0.000001f));
+                                }
+                            } else {
+                                if (LOG) {
+                                    Slog.v(TAG, "Ignoring sensor data, no predicted rotation: "
+                                            + "tiltAngle=" + tiltAngle
+                                            + ", orientationAngle=" + orientationAngle);
+                                }
+                                clearPredictedRotationLocked();
+                            }
                         }
                     }
                 }
-            }
 
-            // Determine new proposed rotation.
-            final int oldProposedRotation = mProposedRotation;
-            if (mPredictedRotation < 0 || isPredictedRotationAcceptable(now)) {
-                mProposedRotation = mPredictedRotation;
-            }
+                // Determine new proposed rotation.
+                oldProposedRotation = mProposedRotation;
+                if (mPredictedRotation < 0 || isPredictedRotationAcceptableLocked(now)) {
+                    mProposedRotation = mPredictedRotation;
+                }
+                proposedRotation = mProposedRotation;
 
-            // Write final statistics about where we are in the orientation detection process.
-            if (LOG) {
-                Slog.v(TAG, "Result: currentRotation=" + mOrientationListener.mCurrentRotation
-                        + ", proposedRotation=" + mProposedRotation
-                        + ", predictedRotation=" + mPredictedRotation
-                        + ", timeDeltaMS=" + timeDeltaMS
-                        + ", isAccelerating=" + isAccelerating
-                        + ", isFlat=" + isFlat
-                        + ", isSwinging=" + isSwinging
-                        + ", timeUntilSettledMS=" + remainingMS(now,
-                                mPredictedRotationTimestampNanos + PROPOSAL_SETTLE_TIME_NANOS)
-                        + ", timeUntilAccelerationDelayExpiredMS=" + remainingMS(now,
-                                mAccelerationTimestampNanos + PROPOSAL_MIN_TIME_SINCE_ACCELERATION_ENDED_NANOS)
-                        + ", timeUntilFlatDelayExpiredMS=" + remainingMS(now,
-                                mFlatTimestampNanos + PROPOSAL_MIN_TIME_SINCE_FLAT_ENDED_NANOS)
-                        + ", timeUntilSwingDelayExpiredMS=" + remainingMS(now,
-                                mSwingTimestampNanos + PROPOSAL_MIN_TIME_SINCE_SWING_ENDED_NANOS));
+                // Write final statistics about where we are in the orientation detection process.
+                if (LOG) {
+                    Slog.v(TAG, "Result: currentRotation=" + mCurrentRotation
+                            + ", proposedRotation=" + proposedRotation
+                            + ", predictedRotation=" + mPredictedRotation
+                            + ", timeDeltaMS=" + timeDeltaMS
+                            + ", isAccelerating=" + isAccelerating
+                            + ", isFlat=" + isFlat
+                            + ", isSwinging=" + isSwinging
+                            + ", timeUntilSettledMS=" + remainingMS(now,
+                                    mPredictedRotationTimestampNanos + PROPOSAL_SETTLE_TIME_NANOS)
+                            + ", timeUntilAccelerationDelayExpiredMS=" + remainingMS(now,
+                                    mAccelerationTimestampNanos + PROPOSAL_MIN_TIME_SINCE_ACCELERATION_ENDED_NANOS)
+                            + ", timeUntilFlatDelayExpiredMS=" + remainingMS(now,
+                                    mFlatTimestampNanos + PROPOSAL_MIN_TIME_SINCE_FLAT_ENDED_NANOS)
+                            + ", timeUntilSwingDelayExpiredMS=" + remainingMS(now,
+                                    mSwingTimestampNanos + PROPOSAL_MIN_TIME_SINCE_SWING_ENDED_NANOS));
+                }
             }
 
             // Tell the listener.
-            if (mProposedRotation != oldProposedRotation && mProposedRotation >= 0) {
+            if (proposedRotation != oldProposedRotation && proposedRotation >= 0) {
                 if (LOG) {
-                    Slog.v(TAG, "Proposed rotation changed!  proposedRotation=" + mProposedRotation
+                    Slog.v(TAG, "Proposed rotation changed!  proposedRotation=" + proposedRotation
                             + ", oldProposedRotation=" + oldProposedRotation);
                 }
-                mOrientationListener.onProposedRotationChanged(mProposedRotation);
+                onProposedRotationChanged(proposedRotation);
             }
         }
 
         /**
          * Returns true if the tilt angle is acceptable for a given predicted rotation.
          */
-        private boolean isTiltAngleAcceptable(int rotation, int tiltAngle) {
+        private boolean isTiltAngleAcceptableLocked(int rotation, int tiltAngle) {
             return tiltAngle >= TILT_TOLERANCE[rotation][0]
                     && tiltAngle <= TILT_TOLERANCE[rotation][1];
         }
@@ -560,11 +578,11 @@
          * This function takes into account the gap between adjacent orientations
          * for hysteresis.
          */
-        private boolean isOrientationAngleAcceptable(int rotation, int orientationAngle) {
+        private boolean isOrientationAngleAcceptableLocked(int rotation, int orientationAngle) {
             // If there is no current rotation, then there is no gap.
             // The gap is used only to introduce hysteresis among advertised orientation
             // changes to avoid flapping.
-            final int currentRotation = mOrientationListener.mCurrentRotation;
+            final int currentRotation = mCurrentRotation;
             if (currentRotation >= 0) {
                 // If the specified rotation is the same or is counter-clockwise adjacent
                 // to the current rotation, then we set a lower bound on the orientation angle.
@@ -611,7 +629,7 @@
          * Returns true if the predicted rotation is ready to be advertised as a
          * proposed rotation.
          */
-        private boolean isPredictedRotationAcceptable(long now) {
+        private boolean isPredictedRotationAcceptableLocked(long now) {
             // The predicted rotation must have settled long enough.
             if (now < mPredictedRotationTimestampNanos + PROPOSAL_SETTLE_TIME_NANOS) {
                 return false;
@@ -638,47 +656,47 @@
             return true;
         }
 
-        private void reset() {
+        private void resetLocked() {
             mLastFilteredTimestampNanos = Long.MIN_VALUE;
             mProposedRotation = -1;
             mFlatTimestampNanos = Long.MIN_VALUE;
             mSwingTimestampNanos = Long.MIN_VALUE;
             mAccelerationTimestampNanos = Long.MIN_VALUE;
-            clearPredictedRotation();
-            clearTiltHistory();
+            clearPredictedRotationLocked();
+            clearTiltHistoryLocked();
         }
 
-        private void clearPredictedRotation() {
+        private void clearPredictedRotationLocked() {
             mPredictedRotation = -1;
             mPredictedRotationTimestampNanos = Long.MIN_VALUE;
         }
 
-        private void updatePredictedRotation(long now, int rotation) {
+        private void updatePredictedRotationLocked(long now, int rotation) {
             if (mPredictedRotation != rotation) {
                 mPredictedRotation = rotation;
                 mPredictedRotationTimestampNanos = now;
             }
         }
 
-        private boolean isAccelerating(float magnitude) {
+        private boolean isAcceleratingLocked(float magnitude) {
             return magnitude < MIN_ACCELERATION_MAGNITUDE
                     || magnitude > MAX_ACCELERATION_MAGNITUDE;
         }
 
-        private void clearTiltHistory() {
+        private void clearTiltHistoryLocked() {
             mTiltHistoryTimestampNanos[0] = Long.MIN_VALUE;
             mTiltHistoryIndex = 1;
         }
 
-        private void addTiltHistoryEntry(long now, float tilt) {
+        private void addTiltHistoryEntryLocked(long now, float tilt) {
             mTiltHistory[mTiltHistoryIndex] = tilt;
             mTiltHistoryTimestampNanos[mTiltHistoryIndex] = now;
             mTiltHistoryIndex = (mTiltHistoryIndex + 1) % TILT_HISTORY_SIZE;
             mTiltHistoryTimestampNanos[mTiltHistoryIndex] = Long.MIN_VALUE;
         }
 
-        private boolean isFlat(long now) {
-            for (int i = mTiltHistoryIndex; (i = nextTiltHistoryIndex(i)) >= 0; ) {
+        private boolean isFlatLocked(long now) {
+            for (int i = mTiltHistoryIndex; (i = nextTiltHistoryIndexLocked(i)) >= 0; ) {
                 if (mTiltHistory[i] < FLAT_ANGLE) {
                     break;
                 }
@@ -690,8 +708,8 @@
             return false;
         }
 
-        private boolean isSwinging(long now, float tilt) {
-            for (int i = mTiltHistoryIndex; (i = nextTiltHistoryIndex(i)) >= 0; ) {
+        private boolean isSwingingLocked(long now, float tilt) {
+            for (int i = mTiltHistoryIndex; (i = nextTiltHistoryIndexLocked(i)) >= 0; ) {
                 if (mTiltHistoryTimestampNanos[i] + SWING_TIME_NANOS < now) {
                     break;
                 }
@@ -703,12 +721,12 @@
             return false;
         }
 
-        private int nextTiltHistoryIndex(int index) {
+        private int nextTiltHistoryIndexLocked(int index) {
             index = (index == 0 ? TILT_HISTORY_SIZE : index) - 1;
             return mTiltHistoryTimestampNanos[index] != Long.MIN_VALUE ? index : -1;
         }
 
-        private static float remainingMS(long now, long until) {
+        private float remainingMS(long now, long until) {
             return now >= until ? 0 : (until - now) * 0.000001f;
         }
     }
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java
index 210312a..77359ff 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardMessageArea.java
@@ -24,6 +24,7 @@
 import android.os.BatteryManager;
 import android.os.Handler;
 import android.os.Looper;
+import android.os.SystemClock;
 import android.os.UserHandle;
 import android.provider.Settings;
 import android.text.TextUtils;
@@ -33,12 +34,23 @@
 
 import libcore.util.MutableInt;
 
+import java.lang.ref.WeakReference;
+
 import com.android.internal.R;
 
 /***
  * Manages a number of views inside of the given layout. See below for a list of widgets.
  */
 class KeyguardMessageArea extends TextView {
+    /** Handler token posted with accessibility announcement runnables. */
+    private static final Object ANNOUNCE_TOKEN = new Object();
+
+    /**
+     * Delay before speaking an accessibility announcement. Used to prevent
+     * lift-to-type from interrupting itself.
+     */
+    private static final long ANNOUNCEMENT_DELAY = 250;
+
     static final int CHARGING_ICON = 0; //R.drawable.ic_lock_idle_charging;
     static final int BATTERY_LOW_ICON = 0; //R.drawable.ic_lock_idle_low_battery;
 
@@ -174,7 +186,9 @@
         if (mTimeout > 0) {
             mHandler.postDelayed(mClearMessageRunnable, mTimeout);
         }
-        announceForAccessibility(getText());
+        mHandler.removeCallbacksAndMessages(ANNOUNCE_TOKEN);
+        mHandler.postAtTime(new AnnounceRunnable(this, getText()), ANNOUNCE_TOKEN,
+                (SystemClock.uptimeMillis() + ANNOUNCEMENT_DELAY));
     }
 
     /**
@@ -271,4 +285,25 @@
             setAlpha(1f);
         }
     }
+
+    /**
+     * Runnable used to delay accessibility announcements.
+     */
+    private static class AnnounceRunnable implements Runnable {
+        private final WeakReference<View> mHost;
+        private final CharSequence mTextToAnnounce;
+
+        public AnnounceRunnable(View host, CharSequence textToAnnounce) {
+            mHost = new WeakReference<View>(host);
+            mTextToAnnounce = textToAnnounce;
+        }
+
+        @Override
+        public void run() {
+            final View host = mHost.get();
+            if (host != null) {
+                host.announceForAccessibility(mTextToAnnounce);
+            }
+        }
+    }
 }
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 4cfe5d5..fb81391 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -183,7 +183,7 @@
      * A per Net list of the PID's that requested access to the net
      * used both as a refcount and for per-PID DNS selection
      */
-    private List mNetRequestersPids[];
+    private List<Integer> mNetRequestersPids[];
 
     // priority order of the nettrackers
     // (excluding dynamically set mNetworkPreference)
@@ -200,7 +200,6 @@
     private int mDefaultConnectionSequence = 0;
 
     private Object mDnsLock = new Object();
-    private int mNumDnsEntries;
     private boolean mDnsOverridden = false;
 
     private boolean mTestMode;
@@ -508,15 +507,14 @@
             }
         }
 
-        mNetRequestersPids = new ArrayList[ConnectivityManager.MAX_NETWORK_TYPE+1];
+        mNetRequestersPids =
+                (List<Integer> [])new ArrayList[ConnectivityManager.MAX_NETWORK_TYPE+1];
         for (int i : mPriorityList) {
-            mNetRequestersPids[i] = new ArrayList();
+            mNetRequestersPids[i] = new ArrayList<Integer>();
         }
 
         mFeatureUsers = new ArrayList<FeatureUser>();
 
-        mNumDnsEntries = 0;
-
         mTestMode = SystemProperties.get("cm.test.mode").equals("true")
                 && SystemProperties.get("ro.build.type").equals("eng");
 
@@ -1317,6 +1315,7 @@
                 Integer currentPid = new Integer(pid);
                 mNetRequestersPids[usedNetworkType].remove(currentPid);
                 reassessPidDns(pid, true);
+                flushVmDnsCache();
                 if (mNetRequestersPids[usedNetworkType].size() != 0) {
                     if (VDBG) {
                         log("stopUsingNetworkFeature: net " + networkType + ": " + feature +
@@ -1698,9 +1697,8 @@
          * in accordance with network preference policies.
          */
         if (!mNetConfigs[prevNetType].isDefault()) {
-            List pids = mNetRequestersPids[prevNetType];
-            for (int i = 0; i<pids.size(); i++) {
-                Integer pid = (Integer)pids.get(i);
+            List<Integer> pids = mNetRequestersPids[prevNetType];
+            for (Integer pid : pids) {
                 // will remove them because the net's no longer connected
                 // need to do this now as only now do we know the pids and
                 // can properly null things that are no longer referenced.
@@ -2250,6 +2248,7 @@
                         }
                     }
                     if (resetDns) {
+                        flushVmDnsCache();
                         if (VDBG) log("resetting DNS cache for " + iface);
                         try {
                             mNetd.flushInterfaceDnsCache(iface);
@@ -2416,9 +2415,10 @@
      * on the highest priority active net which this process requested.
      * If there aren't any, clear it out
      */
-    private void reassessPidDns(int myPid, boolean doBump)
+    private void reassessPidDns(int pid, boolean doBump)
     {
-        if (VDBG) log("reassessPidDns for pid " + myPid);
+        if (VDBG) log("reassessPidDns for pid " + pid);
+        Integer myPid = new Integer(pid);
         for(int i : mPriorityList) {
             if (mNetConfigs[i].isDefault()) {
                 continue;
@@ -2428,61 +2428,25 @@
                     !nt.isTeardownRequested()) {
                 LinkProperties p = nt.getLinkProperties();
                 if (p == null) continue;
-                List pids = mNetRequestersPids[i];
-                for (int j=0; j<pids.size(); j++) {
-                    Integer pid = (Integer)pids.get(j);
-                    if (pid.intValue() == myPid) {
-                        Collection<InetAddress> dnses = p.getDnses();
-                        writePidDns(dnses, myPid);
-                        if (doBump) {
-                            bumpDns();
-                        }
-                        return;
+                if (mNetRequestersPids[i].contains(myPid)) {
+                    try {
+                        mNetd.setDnsInterfaceForPid(p.getInterfaceName(), pid);
+                    } catch (Exception e) {
+                        Slog.e(TAG, "exception reasseses pid dns: " + e);
                     }
+                    return;
                 }
            }
         }
         // nothing found - delete
-        for (int i = 1; ; i++) {
-            String prop = "net.dns" + i + "." + myPid;
-            if (SystemProperties.get(prop).length() == 0) {
-                if (doBump) {
-                    bumpDns();
-                }
-                return;
-            }
-            SystemProperties.set(prop, "");
+        try {
+            mNetd.clearDnsInterfaceForPid(pid);
+        } catch (Exception e) {
+            Slog.e(TAG, "exception clear interface from pid: " + e);
         }
     }
 
-    // return true if results in a change
-    private boolean writePidDns(Collection <InetAddress> dnses, int pid) {
-        int j = 1;
-        boolean changed = false;
-        for (InetAddress dns : dnses) {
-            String dnsString = dns.getHostAddress();
-            if (changed || !dnsString.equals(SystemProperties.get("net.dns" + j + "." + pid))) {
-                changed = true;
-                SystemProperties.set("net.dns" + j + "." + pid, dns.getHostAddress());
-            }
-            j++;
-        }
-        return changed;
-    }
-
-    private void bumpDns() {
-        /*
-         * Bump the property that tells the name resolver library to reread
-         * the DNS server list from the properties.
-         */
-        String propVal = SystemProperties.get("net.dnschange");
-        int n = 0;
-        if (propVal.length() != 0) {
-            try {
-                n = Integer.parseInt(propVal);
-            } catch (NumberFormatException e) {}
-        }
-        SystemProperties.set("net.dnschange", "" + (n+1));
+    private void flushVmDnsCache() {
         /*
          * Tell the VMs to toss their DNS caches
          */
@@ -2501,56 +2465,23 @@
     }
 
     // Caller must grab mDnsLock.
-    private boolean updateDns(String network, String iface,
+    private void updateDnsLocked(String network, String iface,
             Collection<InetAddress> dnses, String domains) {
-        boolean changed = false;
         int last = 0;
         if (dnses.size() == 0 && mDefaultDns != null) {
-            ++last;
-            String value = mDefaultDns.getHostAddress();
-            if (!value.equals(SystemProperties.get("net.dns1"))) {
-                if (DBG) {
-                    loge("no dns provided for " + network + " - using " + value);
-                }
-                changed = true;
-                SystemProperties.set("net.dns1", value);
+            dnses = new ArrayList();
+            dnses.add(mDefaultDns);
+            if (DBG) {
+                loge("no dns provided for " + network + " - using " + mDefaultDns.getHostAddress());
             }
-        } else {
-            for (InetAddress dns : dnses) {
-                ++last;
-                String key = "net.dns" + last;
-                String value = dns.getHostAddress();
-                if (!changed && value.equals(SystemProperties.get(key))) {
-                    continue;
-                }
-                if (VDBG) {
-                    log("adding dns " + value + " for " + network);
-                }
-                changed = true;
-                SystemProperties.set(key, value);
-            }
-        }
-        for (int i = last + 1; i <= mNumDnsEntries; ++i) {
-            String key = "net.dns" + i;
-            if (VDBG) log("erasing " + key);
-            changed = true;
-            SystemProperties.set(key, "");
-        }
-        mNumDnsEntries = last;
-        if (SystemProperties.get("net.dns.search").equals(domains) == false) {
-            SystemProperties.set("net.dns.search", domains);
-            changed = true;
         }
 
-        if (changed) {
-            try {
-                mNetd.setDnsServersForInterface(iface, NetworkUtils.makeStrings(dnses), domains);
-                mNetd.setDefaultInterfaceForDns(iface);
-            } catch (Exception e) {
-                if (DBG) loge("exception setting default dns interface: " + e);
-            }
+        try {
+            mNetd.setDnsServersForInterface(iface, NetworkUtils.makeStrings(dnses), domains);
+            mNetd.setDefaultInterfaceForDns(iface);
+        } catch (Exception e) {
+            if (DBG) loge("exception setting default dns interface: " + e);
         }
-        return changed;
     }
 
     private void handleDnsConfigurationChange(int netType) {
@@ -2560,12 +2491,11 @@
             LinkProperties p = nt.getLinkProperties();
             if (p == null) return;
             Collection<InetAddress> dnses = p.getDnses();
-            boolean changed = false;
             if (mNetConfigs[netType].isDefault()) {
                 String network = nt.getNetworkInfo().getTypeName();
                 synchronized (mDnsLock) {
                     if (!mDnsOverridden) {
-                        changed = updateDns(network, p.getInterfaceName(), dnses, p.getDomains());
+                        updateDnsLocked(network, p.getInterfaceName(), dnses, p.getDomains());
                     }
                 }
             } else {
@@ -2576,13 +2506,16 @@
                     if (DBG) loge("exception setting dns servers: " + e);
                 }
                 // set per-pid dns for attached secondary nets
-                List pids = mNetRequestersPids[netType];
-                for (int y=0; y< pids.size(); y++) {
-                    Integer pid = (Integer)pids.get(y);
-                    changed = writePidDns(dnses, pid.intValue());
+                List<Integer> pids = mNetRequestersPids[netType];
+                for (Integer pid : pids) {
+                    try {
+                        mNetd.setDnsInterfaceForPid(p.getInterfaceName(), pid);
+                    } catch (Exception e) {
+                        Slog.e(TAG, "exception setting interface for pid: " + e);
+                    }
                 }
             }
-            if (changed) bumpDns();
+            flushVmDnsCache();
         }
     }
 
@@ -2641,7 +2574,7 @@
         pw.increaseIndent();
         for (int net : mPriorityList) {
             String pidString = net + ": ";
-            for (Object pid : mNetRequestersPids[net]) {
+            for (Integer pid : mNetRequestersPids[net]) {
                 pidString = pidString + pid.toString() + ", ";
             }
             pw.println(pidString);
@@ -3351,14 +3284,10 @@
             String domains = buffer.toString().trim();
 
             // Apply DNS changes.
-            boolean changed = false;
             synchronized (mDnsLock) {
-                changed = updateDns("VPN", "VPN", addresses, domains);
+                updateDnsLocked("VPN", "VPN", addresses, domains);
                 mDnsOverridden = true;
             }
-            if (changed) {
-                bumpDns();
-            }
 
             // Temporarily disable the default proxy.
             synchronized (mDefaultProxyLock) {
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 0a54593..2b0d824 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -1468,6 +1468,32 @@
     }
 
     @Override
+    public void setDnsInterfaceForPid(String iface, int pid) throws IllegalStateException {
+        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
+        try {
+            String cmd = "resolver setifaceforpid " + iface + " " + pid;
+
+            mConnector.execute(cmd);
+        } catch (NativeDaemonConnectorException e) {
+            throw new IllegalStateException(
+                    "Error communicating with native deamon to set interface for pid" + iface, e);
+        }
+    }
+
+    @Override
+    public void clearDnsInterfaceForPid(int pid) throws IllegalStateException {
+        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
+        try {
+            String cmd = "resolver clearifaceforpid " + pid;
+
+            mConnector.execute(cmd);
+        } catch (NativeDaemonConnectorException e) {
+            throw new IllegalStateException(
+                    "Error communicating with native deamon to clear interface for pid " + pid, e);
+        }
+    }
+
+    /** {@inheritDoc} */
     public void monitor() {
         if (mConnector != null) {
             mConnector.monitor();
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index d121653..1a2c3de 100644
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -49,6 +49,8 @@
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Message;
+import android.os.Parcel;
+import android.os.Parcelable;
 import android.os.Process;
 import android.os.RemoteException;
 import android.os.ServiceManager;
@@ -77,9 +79,12 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 import libcore.io.IoUtils;
 
@@ -169,6 +174,71 @@
     private static final String TAG_PACKAGE = "package";
     private static final String ATTR_NAME = "name";
 
+    private static class Archive {
+        static final int BUFFER_SIZE = 1000;
+        ArrayDeque<StatusBarNotification> mBuffer = new ArrayDeque<StatusBarNotification>(BUFFER_SIZE);
+
+        public Archive() {
+
+        }
+        public void record(StatusBarNotification nr) {
+            if (mBuffer.size() == BUFFER_SIZE) {
+                mBuffer.removeFirst();
+            }
+            mBuffer.addLast(nr);
+        }
+
+        public void clear() {
+            mBuffer.clear();
+        }
+
+        public Iterator<StatusBarNotification> descendingIterator() {
+            return mBuffer.descendingIterator();
+        }
+        public Iterator<StatusBarNotification> ascendingIterator() {
+            return mBuffer.iterator();
+        }
+        public Iterator<StatusBarNotification> filter(
+                final Iterator<StatusBarNotification> iter, final String pkg, final int userId) {
+            return new Iterator<StatusBarNotification>() {
+                StatusBarNotification mNext = findNext();
+
+                private StatusBarNotification findNext() {
+                    while (iter.hasNext()) {
+                        StatusBarNotification nr = iter.next();
+                        if ((pkg == null || nr.pkg == pkg)
+                                && (userId == UserHandle.USER_ALL || nr.getUserId() == userId)) {
+                            return nr;
+                        }
+                    }
+                    return null;
+                }
+
+                @Override
+                public boolean hasNext() {
+                    return mNext == null;
+                }
+
+                @Override
+                public StatusBarNotification next() {
+                    StatusBarNotification next = mNext;
+                    if (next == null) {
+                        throw new NoSuchElementException();
+                    }
+                    mNext = findNext();
+                    return next;
+                }
+
+                @Override
+                public void remove() {
+                    iter.remove();
+                }
+            };
+        }
+    }
+
+    Archive mArchive = new Archive();
+
     private void loadBlockDb() {
         synchronized(mBlockedPackages) {
             if (mPolicyFile == null) {
@@ -275,44 +345,53 @@
         }
     }
 
-    private static final class NotificationRecord
+    public StatusBarNotification[] getActiveNotifications(String callingPkg) {
+        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.ACCESS_NOTIFICATIONS,
+                "NotificationManagerService");
+
+        StatusBarNotification[] tmp = null;
+        int userId = UserHandle.getCallingUserId();
+        int uid = Binder.getCallingUid();
+
+        if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg)
+                == AppOpsManager.MODE_ALLOWED) {
+            synchronized (mNotificationList) {
+                tmp = new StatusBarNotification[mNotificationList.size()];
+                final int N = mNotificationList.size();
+                for (int i=0; i<N; i++) {
+                    tmp[i] = mNotificationList.get(i).sbn;
+                }
+            }
+        }
+        return tmp;
+    }
+
+    public static final class NotificationRecord
     {
-        final String pkg;
-        final String basePkg;
-        final String tag;
-        final int id;
-        final int uid;
-        final int initialPid;
-        final int userId;
-        final Notification notification;
-        final int score;
+        final StatusBarNotification sbn;
         IBinder statusBarKey;
 
-        NotificationRecord(String pkg, String basePkg, String tag, int id, int uid, int initialPid,
-                int userId, int score, Notification notification)
+        NotificationRecord(StatusBarNotification sbn)
         {
-            this.pkg = pkg;
-            this.basePkg = basePkg;
-            this.tag = tag;
-            this.id = id;
-            this.uid = uid;
-            this.initialPid = initialPid;
-            this.userId = userId;
-            this.score = score;
-            this.notification = notification;
+            this.sbn = sbn;
         }
 
+        public Notification getNotification() { return sbn.notification; }
+        public int getFlags() { return sbn.notification.flags; }
+        public int getUserId() { return sbn.getUserId(); }
+
         void dump(PrintWriter pw, String prefix, Context baseContext) {
+            final Notification notification = sbn.notification;
             pw.println(prefix + this);
             pw.println(prefix + "  icon=0x" + Integer.toHexString(notification.icon)
-                    + " / " + idDebugString(baseContext, this.pkg, notification.icon));
+                    + " / " + idDebugString(baseContext, this.sbn.pkg, notification.icon));
             pw.println(prefix + "  pri=" + notification.priority);
-            pw.println(prefix + "  score=" + this.score);
+            pw.println(prefix + "  score=" + this.sbn.score);
             pw.println(prefix + "  contentIntent=" + notification.contentIntent);
             pw.println(prefix + "  deleteIntent=" + notification.deleteIntent);
             pw.println(prefix + "  tickerText=" + notification.tickerText);
             pw.println(prefix + "  contentView=" + notification.contentView);
-            pw.println(prefix + "  uid=" + uid + " userId=" + userId);
+            pw.println(prefix + "  uid=" + this.sbn.uid + " userId=" + this.sbn.getUserId());
             pw.println(prefix + "  defaults=0x" + Integer.toHexString(notification.defaults));
             pw.println(prefix + "  flags=0x" + Integer.toHexString(notification.flags));
             pw.println(prefix + "  sound=" + notification.sound);
@@ -323,15 +402,12 @@
         }
 
         @Override
-        public final String toString()
-        {
-            return "NotificationRecord{"
-                + Integer.toHexString(System.identityHashCode(this))
-                + " pkg=" + pkg
-                + " id=" + Integer.toHexString(id)
-                + " tag=" + tag 
-                + " score=" + score
-                + "}";
+        public final String toString() {
+            return String.format(
+                    "NotificationRecord(0x%08x: pkg=%s user=%s id=%d tag=%s score=%d: %s)",
+                    System.identityHashCode(this),
+                    this.sbn.pkg, this.sbn.user, this.sbn.id, this.sbn.tag,
+                    this.sbn.score, this.sbn.notification);
         }
     }
 
@@ -916,7 +992,7 @@
                 final int N = mNotificationList.size();
                 for (int i=0; i<N; i++) {
                     final NotificationRecord r = mNotificationList.get(i);
-                    if (r.pkg.equals(pkg) && r.userId == userId) {
+                    if (r.sbn.pkg.equals(pkg) && r.sbn.getUserId() == userId) {
                         count++;
                         if (count >= MAX_PACKAGE_NOTIFICATIONS) {
                             Slog.e(TAG, "Package has already posted " + count
@@ -986,10 +1062,9 @@
         final boolean canInterrupt = (score >= SCORE_INTERRUPTION_THRESHOLD);
 
         synchronized (mNotificationList) {
-            NotificationRecord r = new NotificationRecord(pkg, basePkg, tag, id,
-                    callingUid, callingPid, userId,
-                    score,
-                    notification);
+            final StatusBarNotification n = new StatusBarNotification(
+                    pkg, id, tag, callingUid, callingPid, score, notification, user);
+            NotificationRecord r = new NotificationRecord(n);
             NotificationRecord old = null;
 
             int index = indexOfNotificationLocked(pkg, tag, id, userId);
@@ -1001,7 +1076,7 @@
                 // Make sure we don't lose the foreground service state.
                 if (old != null) {
                     notification.flags |=
-                        old.notification.flags&Notification.FLAG_FOREGROUND_SERVICE;
+                        old.getNotification().flags&Notification.FLAG_FOREGROUND_SERVICE;
                 }
             }
 
@@ -1021,8 +1096,6 @@
             }
 
             if (notification.icon != 0) {
-                final StatusBarNotification n = new StatusBarNotification(
-                        pkg, id, tag, r.uid, r.initialPid, score, notification, user);
                 if (old != null && old.statusBarKey != null) {
                     r.statusBarKey = old.statusBarKey;
                     long identity = Binder.clearCallingIdentity();
@@ -1049,6 +1122,9 @@
                 if (currentUser == userId) {
                     sendAccessibilityEvent(notification, pkg);
                 }
+
+                // finally, keep some of this information around for later use
+                mArchive.record(n);
             } else {
                 Slog.e(TAG, "Ignoring notification with icon==0: " + notification);
                 if (old != null && old.statusBarKey != null) {
@@ -1060,14 +1136,15 @@
                         Binder.restoreCallingIdentity(identity);
                     }
                 }
+                return; // do not play sounds, show lights, etc. for invalid notifications
             }
 
             // If we're not supposed to beep, vibrate, etc. then don't.
             if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
                     && (!(old != null
                         && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
-                    && (r.userId == UserHandle.USER_ALL ||
-                        (r.userId == userId && r.userId == currentUser))
+                    && (r.getUserId() == UserHandle.USER_ALL ||
+                        (r.getUserId() == userId && r.getUserId() == currentUser))
                     && canInterrupt
                     && mSystemReady) {
 
@@ -1143,7 +1220,7 @@
                         // does not have the VIBRATE permission.
                         long identity = Binder.clearCallingIdentity();
                         try {
-                            mVibrator.vibrate(r.uid, r.basePkg,
+                            mVibrator.vibrate(r.sbn.uid, r.sbn.basePkg,
                                 useDefaultVibrate ? mDefaultVibrationPattern
                                     : mFallbackVibrationPattern,
                                 ((notification.flags & Notification.FLAG_INSISTENT) != 0) ? 0: -1);
@@ -1152,14 +1229,12 @@
                         }
                     } else if (notification.vibrate.length > 1) {
                         // If you want your own vibration pattern, you need the VIBRATE permission
-                        mVibrator.vibrate(r.uid, r.basePkg, notification.vibrate,
+                        mVibrator.vibrate(r.sbn.uid, r.sbn.basePkg, notification.vibrate,
                             ((notification.flags & Notification.FLAG_INSISTENT) != 0) ? 0: -1);
                     }
                 }
             }
 
-            // this option doesn't shut off the lights
-
             // light
             // the most recent thing gets the light
             mLights.remove(old);
@@ -1174,7 +1249,7 @@
                 updateLightsLocked();
             } else {
                 if (old != null
-                        && ((old.notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0)) {
+                        && ((old.getFlags() & Notification.FLAG_SHOW_LIGHTS) != 0)) {
                     updateLightsLocked();
                 }
             }
@@ -1205,19 +1280,19 @@
     private void cancelNotificationLocked(NotificationRecord r, boolean sendDelete) {
         // tell the app
         if (sendDelete) {
-            if (r.notification.deleteIntent != null) {
+            if (r.getNotification().deleteIntent != null) {
                 try {
-                    r.notification.deleteIntent.send();
+                    r.getNotification().deleteIntent.send();
                 } catch (PendingIntent.CanceledException ex) {
                     // do nothing - there's no relevant way to recover, and
                     //     no reason to let this propagate
-                    Slog.w(TAG, "canceled PendingIntent for " + r.pkg, ex);
+                    Slog.w(TAG, "canceled PendingIntent for " + r.sbn.pkg, ex);
                 }
             }
         }
 
         // status bar
-        if (r.notification.icon != 0) {
+        if (r.getNotification().icon != 0) {
             long identity = Binder.clearCallingIdentity();
             try {
                 mStatusBar.removeNotification(r.statusBarKey);
@@ -1276,10 +1351,10 @@
             if (index >= 0) {
                 NotificationRecord r = mNotificationList.get(index);
 
-                if ((r.notification.flags & mustHaveFlags) != mustHaveFlags) {
+                if ((r.getNotification().flags & mustHaveFlags) != mustHaveFlags) {
                     return;
                 }
-                if ((r.notification.flags & mustNotHaveFlags) != 0) {
+                if ((r.getNotification().flags & mustNotHaveFlags) != 0) {
                     return;
                 }
 
@@ -1300,9 +1375,9 @@
                 // looking for USER_ALL notifications? match everything
                    userId == UserHandle.USER_ALL
                 // a notification sent to USER_ALL matches any query
-                || r.userId == UserHandle.USER_ALL
+                || r.getUserId() == UserHandle.USER_ALL
                 // an exact user match
-                || r.userId == userId;
+                || r.getUserId() == userId;
     }
 
     /**
@@ -1323,16 +1398,16 @@
                     continue;
                 }
                 // Don't remove notifications to all, if there's no package name specified
-                if (r.userId == UserHandle.USER_ALL && pkg == null) {
+                if (r.getUserId() == UserHandle.USER_ALL && pkg == null) {
                     continue;
                 }
-                if ((r.notification.flags & mustHaveFlags) != mustHaveFlags) {
+                if ((r.getFlags() & mustHaveFlags) != mustHaveFlags) {
                     continue;
                 }
-                if ((r.notification.flags & mustNotHaveFlags) != 0) {
+                if ((r.getFlags() & mustNotHaveFlags) != 0) {
                     continue;
                 }
-                if (pkg != null && !r.pkg.equals(pkg)) {
+                if (pkg != null && !r.sbn.pkg.equals(pkg)) {
                     continue;
                 }
                 canceledSomething = true;
@@ -1405,7 +1480,7 @@
                     continue;
                 }
 
-                if ((r.notification.flags & (Notification.FLAG_ONGOING_EVENT
+                if ((r.getFlags() & (Notification.FLAG_ONGOING_EVENT
                                 | Notification.FLAG_NO_CLEAR)) == 0) {
                     mNotificationList.remove(i);
                     cancelNotificationLocked(r, true);
@@ -1432,10 +1507,11 @@
         if (mLedNotification == null || mInCall || mScreenOn) {
             mNotificationLight.turnOff();
         } else {
-            int ledARGB = mLedNotification.notification.ledARGB;
-            int ledOnMS = mLedNotification.notification.ledOnMS;
-            int ledOffMS = mLedNotification.notification.ledOffMS;
-            if ((mLedNotification.notification.defaults & Notification.DEFAULT_LIGHTS) != 0) {
+            final Notification ledno = mLedNotification.sbn.notification;
+            int ledARGB = ledno.ledARGB;
+            int ledOnMS = ledno.ledOnMS;
+            int ledOffMS = ledno.ledOffMS;
+            if ((ledno.defaults & Notification.DEFAULT_LIGHTS) != 0) {
                 ledARGB = mDefaultNotificationColor;
                 ledOnMS = mDefaultNotificationLedOn;
                 ledOffMS = mDefaultNotificationLedOff;
@@ -1455,19 +1531,19 @@
         final int len = list.size();
         for (int i=0; i<len; i++) {
             NotificationRecord r = list.get(i);
-            if (!notificationMatchesUserId(r, userId) || r.id != id) {
+            if (!notificationMatchesUserId(r, userId) || r.sbn.id != id) {
                 continue;
             }
             if (tag == null) {
-                if (r.tag != null) {
+                if (r.sbn.tag != null) {
                     continue;
                 }
             } else {
-                if (!tag.equals(r.tag)) {
+                if (!tag.equals(r.sbn.tag)) {
                     continue;
                 }
             }
-            if (r.pkg.equals(pkg)) {
+            if (r.sbn.pkg.equals(pkg)) {
                 return i;
             }
         }
diff --git a/services/java/com/android/server/accessibility/AccessibilityInputFilter.java b/services/java/com/android/server/accessibility/AccessibilityInputFilter.java
index c37f51f..179db12 100644
--- a/services/java/com/android/server/accessibility/AccessibilityInputFilter.java
+++ b/services/java/com/android/server/accessibility/AccessibilityInputFilter.java
@@ -174,7 +174,7 @@
                 mMotionEventSequenceStarted = true;
             }
         } else {
-        // Wait for an enter hover event to start processing.
+            // Wait for an enter hover event to start processing.
             if (!mHoverEventSequenceStarted) {
                 if (motionEvent.getActionMasked() != MotionEvent.ACTION_HOVER_ENTER) {
                     return;
@@ -234,10 +234,14 @@
         if (DEBUG) {
             Slog.i(TAG, "Handling batched event: " + event + ", policyFlags: " + policyFlags);
         }
-        mPm.userActivity(event.getEventTime(), false);
-        MotionEvent transformedEvent = MotionEvent.obtain(event);
-        mEventHandler.onMotionEvent(transformedEvent, event, policyFlags);
-        transformedEvent.recycle();
+        // Since we do batch processing it is possible that by the time the
+        // next batch is processed the event handle had been set to null.
+        if (mEventHandler != null) {
+            mPm.userActivity(event.getEventTime(), false);
+            MotionEvent transformedEvent = MotionEvent.obtain(event);
+            mEventHandler.onMotionEvent(transformedEvent, event, policyFlags);
+            transformedEvent.recycle();
+        }
     }
 
     @Override
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index bb040bf..aadb790 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -123,6 +123,9 @@
     private static final String TEMPORARY_ENABLE_ACCESSIBILITY_UNTIL_KEYGUARD_REMOVED =
             "temporaryEnableAccessibilityStateUntilKeyguardRemoved";
 
+    private static final ComponentName sFakeAccessibilityServiceComponentName =
+            new ComponentName("foo.bar", "FakeService");
+
     private static final String FUNCTION_DUMP = "dump";
 
     private static final char COMPONENT_NAME_SEPARATOR = ':';
@@ -157,8 +160,6 @@
 
     private final MainHandler mMainHandler;
 
-    private Service mUiAutomationService;
-
     private Service mQueryBridge;
 
     private AlertDialog mEnableTouchExplorationDialog;
@@ -167,6 +168,11 @@
 
     private boolean mHasInputFilter;
 
+    private final Set<ComponentName> mTempComponentNameSet = new HashSet<ComponentName>();
+
+    private final List<AccessibilityServiceInfo> mTempAccessibilityServiceInfoList =
+            new ArrayList<AccessibilityServiceInfo>();
+
     private final RemoteCallbackList<IAccessibilityManagerClient> mGlobalClients =
             new RemoteCallbackList<IAccessibilityManagerClient>();
 
@@ -177,9 +183,6 @@
 
     private final SparseArray<UserState> mUserStates = new SparseArray<UserState>();
 
-    private final TempUserStateChangeMemento mTempStateChangeForCurrentUserMemento =
-            new TempUserStateChangeMemento();
-
     private int mCurrentUserId = UserHandle.USER_OWNER;
 
     private UserState getCurrentUserStateLocked() {
@@ -224,10 +227,11 @@
                         return;
                     }
                     // We will update when the automation service dies.
-                    if (mUiAutomationService == null) {
-                        UserState userState = getCurrentUserStateLocked();
-                        populateInstalledAccessibilityServiceLocked(userState);
-                        manageServicesLocked(userState);
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readConfigurationForUserStateLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
                     }
                 }
             }
@@ -239,8 +243,8 @@
                     if (userId != mCurrentUserId) {
                         return;
                     }
-                    UserState state = getUserStateLocked(userId);
-                    Iterator<ComponentName> it = state.mEnabledServices.iterator();
+                    UserState userState = getUserStateLocked(userId);
+                    Iterator<ComponentName> it = userState.mEnabledServices.iterator();
                     while (it.hasNext()) {
                         ComponentName comp = it.next();
                         String compPkg = comp.getPackageName();
@@ -249,13 +253,17 @@
                             // Update the enabled services setting.
                             persistComponentNamesToSettingLocked(
                                     Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
-                                    state.mEnabledServices, userId);
+                                    userState.mEnabledServices, userId);
                             // Update the touch exploration granted services setting.
-                            state.mTouchExplorationGrantedServices.remove(comp);
+                            userState.mTouchExplorationGrantedServices.remove(comp);
                             persistComponentNamesToSettingLocked(
                                     Settings.Secure.
                                     TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
-                                    state.mEnabledServices, userId);
+                                    userState.mTouchExplorationGrantedServices, userId);
+                            // We will update when the automation service dies.
+                            if (userState.mUiAutomationService == null) {
+                                onUserStateChangedLocked(userState);
+                            }
                             return;
                         }
                     }
@@ -270,8 +278,8 @@
                     if (userId != mCurrentUserId) {
                         return false;
                     }
-                    UserState state = getUserStateLocked(userId);
-                    Iterator<ComponentName> it = state.mEnabledServices.iterator();
+                    UserState userState = getUserStateLocked(userId);
+                    Iterator<ComponentName> it = userState.mEnabledServices.iterator();
                     while (it.hasNext()) {
                         ComponentName comp = it.next();
                         String compPkg = comp.getPackageName();
@@ -283,7 +291,11 @@
                                 it.remove();
                                 persistComponentNamesToSettingLocked(
                                         Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
-                                        state.mEnabledServices, userId);
+                                        userState.mEnabledServices, userId);
+                                // We will update when the automation service dies.
+                                if (userState.mUiAutomationService == null) {
+                                    onUserStateChangedLocked(userState);
+                                }
                             }
                         }
                     }
@@ -310,7 +322,13 @@
                 } else if (Intent.ACTION_USER_REMOVED.equals(action)) {
                     removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0));
                 } else if (Intent.ACTION_USER_PRESENT.equals(action)) {
-                    restoreStateFromMementoIfNeeded();
+                    // We will update when the automation service dies.
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readConfigurationForUserStateLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
+                    }
                 }
             }
         }, UserHandle.ALL, intentFilter, null, null);
@@ -329,7 +347,7 @@
                 if (DEBUG) {
                     Slog.i(LOG_TAG, "Added global client for pid:" + Binder.getCallingPid());
                 }
-                return getClientState(userState);
+                return userState.getClientState();
             } else {
                 userState.mClients.register(client);
                 // If this client is not for the current user we do not
@@ -339,7 +357,7 @@
                     Slog.i(LOG_TAG, "Added user client for pid:" + Binder.getCallingPid()
                             + " and userId:" + mCurrentUserId);
                 }
-                return (resolvedUserId == mCurrentUserId) ? getClientState(userState) : 0;
+                return (resolvedUserId == mCurrentUserId) ? userState.getClientState() : 0;
             }
         }
     }
@@ -385,7 +403,7 @@
                     .resolveCallingUserIdEnforcingPermissionsLocked(userId);
             result = mEnabledServicesForFeedbackTempList;
             result.clear();
-            List<Service> services = getUserStateLocked(resolvedUserId).mServices;
+            List<Service> services = getUserStateLocked(resolvedUserId).mBoundServices;
             while (feedbackType != 0) {
                 final int feedbackTypeBit = (1 << Integer.numberOfTrailingZeros(feedbackType));
                 feedbackType &= ~feedbackTypeBit;
@@ -410,7 +428,7 @@
             if (resolvedUserId != mCurrentUserId) {
                 return;
             }
-            services = getUserStateLocked(resolvedUserId).mServices;
+            services = getUserStateLocked(resolvedUserId).mBoundServices;
         }
         for (int i = 0, count = services.size(); i < count; i++) {
             Service service = services.get(i);
@@ -514,36 +532,48 @@
             AccessibilityServiceInfo accessibilityServiceInfo) {
         mSecurityPolicy.enforceCallingPermission(Manifest.permission.RETRIEVE_WINDOW_CONTENT,
                 FUNCTION_REGISTER_UI_TEST_AUTOMATION_SERVICE);
-        ComponentName componentName = new ComponentName("foo.bar",
-                "AutomationAccessibilityService");
+
+        accessibilityServiceInfo.setComponentName(sFakeAccessibilityServiceComponentName);
+
         synchronized (mLock) {
-            if (mUiAutomationService != null) {
+            UserState userState = getCurrentUserStateLocked();
+
+            if (userState.mUiAutomationService != null) {
                 throw new IllegalStateException("UiAutomationService " + serviceClient
                         + "already registered!");
             }
-            // If an automation services is connected to the system all services are stopped
-            // so the automation one is the only one running. Settings are not changed so when
-            // the automation service goes away the state is restored from the settings.
-            UserState userState = getCurrentUserStateLocked();
-            unbindAllServicesLocked(userState);
 
-            // If necessary enable accessibility and announce that.
-            if (!userState.mIsAccessibilityEnabled) {
-                userState.mIsAccessibilityEnabled = true;
-            }
-            // No touch exploration.
+            userState.mUiAutomationServiceClient = serviceClient;
+
+            // Set the temporary state.
+            userState.mIsAccessibilityEnabled = true;
             userState.mIsTouchExplorationEnabled = false;
-
-            // No touch enhanced web accessibility.
             userState.mIsEnhancedWebAccessibilityEnabled = false;
+            userState.mIsDisplayMagnificationEnabled = false;
+            userState.mInstalledServices.add(accessibilityServiceInfo);
+            userState.mEnabledServices.clear();
+            userState.mEnabledServices.add(sFakeAccessibilityServiceComponentName);
+            userState.mTouchExplorationGrantedServices.add(sFakeAccessibilityServiceComponentName);
 
-            // Hook the automation service up.
-            mUiAutomationService = new Service(mCurrentUserId, componentName,
-                    accessibilityServiceInfo, true);
-            mUiAutomationService.onServiceConnected(componentName, serviceClient.asBinder());
+            // Use the new state instead of settings.
+            onUserStateChangedLocked(userState);
+        }
+    }
 
-            scheduleUpdateInputFilter(userState);
-            scheduleSendStateToClientsLocked(userState);
+    public void unregisterUiTestAutomationService(IAccessibilityServiceClient serviceClient) {
+        synchronized (mLock) {
+            UserState userState = getCurrentUserStateLocked();
+            // Automation service is not bound, so pretend it died to perform clean up.
+            if (userState.mUiAutomationService != null
+                    && userState.mUiAutomationService.mServiceInterface != null
+                    && serviceClient != null
+                    && userState.mUiAutomationService.mServiceInterface.asBinder()
+                    == serviceClient.asBinder()) {
+                userState.mUiAutomationService.binderDied();
+            } else {
+                throw new IllegalStateException("UiAutomationService " + serviceClient
+                        + " not registered!");
+            }
         }
     }
 
@@ -560,36 +590,26 @@
             return;
         }
         synchronized (mLock) {
-            UserState userState = getCurrentUserStateLocked();
-            // Stash the old state so we can restore it when the keyguard is gone.
-            mTempStateChangeForCurrentUserMemento.initialize(getCurrentUserStateLocked());
             // Set the temporary state.
+            UserState userState = getCurrentUserStateLocked();
+
+            // This is a nop if UI automation is enabled.
+            if (userState.mUiAutomationService != null) {
+                return;
+            }
+
             userState.mIsAccessibilityEnabled = true;
             userState.mIsTouchExplorationEnabled = touchExplorationEnabled;
             userState.mIsEnhancedWebAccessibilityEnabled = false;
             userState.mIsDisplayMagnificationEnabled = false;
             userState.mEnabledServices.clear();
             userState.mEnabledServices.add(service);
+            userState.mBindingServices.clear();
             userState.mTouchExplorationGrantedServices.clear();
             userState.mTouchExplorationGrantedServices.add(service);
-            // Update the internal state.
-            performServiceManagementLocked(userState);
-            scheduleUpdateInputFilter(userState);
-            scheduleSendStateToClientsLocked(userState);
-        }
-    }
 
-    public void unregisterUiTestAutomationService(IAccessibilityServiceClient serviceClient) {
-        synchronized (mLock) {
-            // Automation service is not bound, so pretend it died to perform clean up.
-            if (mUiAutomationService != null && mUiAutomationService.mServiceInterface != null
-                    && serviceClient != null && mUiAutomationService.mServiceInterface
-                            .asBinder() == serviceClient.asBinder()) {
-                mUiAutomationService.binderDied();
-            } else {
-                throw new IllegalStateException("UiAutomationService " + serviceClient
-                        + " not registered!");
-            }
+            // User the current state instead settings.
+            onUserStateChangedLocked(userState);
         }
     }
 
@@ -695,10 +715,6 @@
 
     private void switchUser(int userId) {
         synchronized (mLock) {
-            // The user switched so we do not need to restore the current user
-            // state since we will fully rebuild it when he becomes current again.
-            mTempStateChangeForCurrentUserMemento.clear();
-
             // Disconnect from services for the old user.
             UserState oldUserState = getUserStateLocked(mCurrentUserId);
             unbindAllServicesLocked(oldUserState);
@@ -716,9 +732,14 @@
             // The user changed.
             mCurrentUserId = userId;
 
-            // Recreate the internal state for the new user.
-            mMainHandler.obtainMessage(MainHandler.MSG_SEND_RECREATE_INTERNAL_STATE,
-                    mCurrentUserId, 0).sendToTarget();
+            UserState userState = getCurrentUserStateLocked();
+            if (userState.mUiAutomationService != null) {
+                // Switching users disables the UI automation service.
+                userState.mUiAutomationService.binderDied();
+            } else if (readConfigurationForUserStateLocked(userState)) {
+                // Update the user state if needed.
+               onUserStateChangedLocked(userState);
+            }
 
             if (announceNewUser) {
                 // Schedule announcement of the current user if needed.
@@ -734,25 +755,11 @@
         }
     }
 
-    private void restoreStateFromMementoIfNeeded() {
-        synchronized (mLock) {
-            if (mTempStateChangeForCurrentUserMemento.mUserId != UserHandle.USER_NULL) {
-                UserState userState = getCurrentUserStateLocked();
-                // Restore the state from the memento.
-                mTempStateChangeForCurrentUserMemento.applyTo(userState);
-                mTempStateChangeForCurrentUserMemento.clear();
-                // Update the internal state.
-                performServiceManagementLocked(userState);
-                scheduleUpdateInputFilter(userState);
-                scheduleSendStateToClientsLocked(userState);
-            }
-        }
-    }
-
     private Service getQueryBridge() {
         if (mQueryBridge == null) {
             AccessibilityServiceInfo info = new AccessibilityServiceInfo();
-            mQueryBridge = new Service(UserHandle.USER_NULL, null, info, true);
+            mQueryBridge = new Service(UserHandle.USER_NULL,
+                    sFakeAccessibilityServiceComponentName, info);
         }
         return mQueryBridge;
     }
@@ -768,8 +775,8 @@
         //       behavior is observed from different combinations of
         //       enabled accessibility services.
         UserState state = getCurrentUserStateLocked();
-        for (int i = state.mServices.size() - 1; i >= 0; i--) {
-            Service service = state.mServices.get(i);
+        for (int i = state.mBoundServices.size() - 1; i >= 0; i--) {
+            Service service = state.mBoundServices.get(i);
             if (service.mRequestTouchExplorationMode && service.mIsDefault == isDefault) {
                 service.notifyGesture(gestureId);
                 return true;
@@ -780,8 +787,8 @@
 
     private void notifyClearAccessibilityNodeInfoCacheLocked() {
         UserState state = getCurrentUserStateLocked();
-        for (int i = state.mServices.size() - 1; i >= 0; i--) {
-            Service service = state.mServices.get(i);
+        for (int i = state.mBoundServices.size() - 1; i >= 0; i--) {
+            Service service = state.mBoundServices.get(i);
             service.notifyClearAccessibilityNodeInfoCache();
         }
     }
@@ -807,8 +814,8 @@
         }
     }
 
-    private void populateInstalledAccessibilityServiceLocked(UserState userState) {
-        userState.mInstalledServices.clear();
+    private boolean readInstalledAccessibilityServiceLocked(UserState userState) {
+        mTempAccessibilityServiceInfoList.clear();
 
         List<ResolveInfo> installedServices = mPackageManager.queryIntentServicesAsUser(
                 new Intent(AccessibilityService.SERVICE_INTERFACE),
@@ -829,26 +836,53 @@
             AccessibilityServiceInfo accessibilityServiceInfo;
             try {
                 accessibilityServiceInfo = new AccessibilityServiceInfo(resolveInfo, mContext);
-                userState.mInstalledServices.add(accessibilityServiceInfo);
+                mTempAccessibilityServiceInfoList.add(accessibilityServiceInfo);
             } catch (XmlPullParserException xppe) {
                 Slog.e(LOG_TAG, "Error while initializing AccessibilityServiceInfo", xppe);
             } catch (IOException ioe) {
                 Slog.e(LOG_TAG, "Error while initializing AccessibilityServiceInfo", ioe);
             }
         }
+
+        if (!mTempAccessibilityServiceInfoList.equals(userState.mInstalledServices)) {
+            userState.mInstalledServices.clear();
+            userState.mInstalledServices.addAll(mTempAccessibilityServiceInfoList);
+            mTempAccessibilityServiceInfoList.clear();
+            return true;
+        }
+
+        mTempAccessibilityServiceInfoList.clear();
+        return false;
     }
 
-    private void populateEnabledAccessibilityServicesLocked(UserState userState) {
-        populateComponentNamesFromSettingLocked(
-                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
-                userState.mUserId,
-                userState.mEnabledServices);
+    private boolean readEnabledAccessibilityServicesLocked(UserState userState) {
+        mTempComponentNameSet.clear();
+        readComponentNamesFromSettingLocked(Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
+                userState.mUserId, mTempComponentNameSet);
+        if (!mTempComponentNameSet.equals(userState.mEnabledServices)) {
+            userState.mEnabledServices.clear();
+            userState.mEnabledServices.addAll(mTempComponentNameSet);
+            mTempComponentNameSet.clear();
+            return true;
+        }
+        mTempComponentNameSet.clear();
+        return false;
     }
 
-    private void populateTouchExplorationGrantedAccessibilityServicesLocked(UserState userState) {
-        populateComponentNamesFromSettingLocked(
+    private boolean readTouchExplorationGrantedAccessibilityServicesLocked(
+            UserState userState) {
+        mTempComponentNameSet.clear();
+        readComponentNamesFromSettingLocked(
                 Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
-                userState.mUserId, userState.mTouchExplorationGrantedServices);
+                userState.mUserId, mTempComponentNameSet);
+        if (!mTempComponentNameSet.equals(userState.mTouchExplorationGrantedServices)) {
+            userState.mTouchExplorationGrantedServices.clear();
+            userState.mTouchExplorationGrantedServices.addAll(mTempComponentNameSet);
+            mTempComponentNameSet.clear();
+            return true;
+        }
+        mTempComponentNameSet.clear();
+        return false;
     }
 
     /**
@@ -862,8 +896,8 @@
             boolean isDefault) {
         try {
             UserState state = getCurrentUserStateLocked();
-            for (int i = 0, count = state.mServices.size(); i < count; i++) {
-                Service service = state.mServices.get(i);
+            for (int i = 0, count = state.mBoundServices.size(); i < count; i++) {
+                Service service = state.mBoundServices.get(i);
 
                 if (service.mIsDefault == isDefault) {
                     if (canDispathEventLocked(service, event, state.mHandledFeedbackTypes)) {
@@ -880,25 +914,12 @@
         }
     }
 
-    /**
-     * Adds a service for a user.
-     *
-     * @param service The service to add.
-     * @param userId The user id.
-     */
-    private void tryAddServiceLocked(Service service, int userId) {
+    private void addServiceLocked(Service service, UserState userState) {
         try {
-            UserState userState = getUserStateLocked(userId);
-            if (userState.mServices.contains(service)) {
-                return;
-            }
             service.linkToOwnDeath();
-            userState.mServices.add(service);
+            userState.mBoundServices.add(service);
             userState.mComponentNameToServiceMap.put(service.mComponentName, service);
-            scheduleUpdateInputFilter(userState);
-            tryEnableTouchExplorationLocked(service);
-            tryEnableEnhancedWebAccessibilityLocked(service);
-        } catch (RemoteException e) {
+        } catch (RemoteException re) {
             /* do nothing */
         }
     }
@@ -909,19 +930,12 @@
      * @param service The service.
      * @return True if the service was removed, false otherwise.
      */
-    private boolean tryRemoveServiceLocked(Service service) {
+    private void removeServiceLocked(Service service) {
         UserState userState = getUserStateLocked(service.mUserId);
-        final boolean removed = userState.mServices.remove(service);
-        if (!removed) {
-            return false;
-        }
+        userState.mBoundServices.remove(service);
         userState.mComponentNameToServiceMap.remove(service.mComponentName);
         service.unlinkToOwnDeath();
         service.dispose();
-        scheduleUpdateInputFilter(userState);
-        tryDisableTouchExplorationLocked(service);
-        tryDisableEnhancedWebAccessibilityLocked(service);
-        return removed;
     }
 
     /**
@@ -969,29 +983,11 @@
         return false;
     }
 
-    /**
-     * Manages services by starting enabled ones and stopping disabled ones.
-     */
-    private void manageServicesLocked(UserState userState) {
-        final int enabledInstalledServicesCount = updateServicesStateLocked(userState);
-        // No enabled installed services => disable accessibility to avoid
-        // sending accessibility events with no recipient across processes.
-        if (userState.mIsAccessibilityEnabled && enabledInstalledServicesCount == 0) {
-            Settings.Secure.putIntForUser(mContext.getContentResolver(),
-                    Settings.Secure.ACCESSIBILITY_ENABLED, 0, userState.mUserId);
-        }
-    }
-
-    /**
-     * Unbinds all bound services for a user.
-     *
-     * @param userState The user state.
-     */
     private void unbindAllServicesLocked(UserState userState) {
-        List<Service> services = userState.mServices;
+        List<Service> services = userState.mBoundServices;
         for (int i = 0, count = services.size(); i < count; i++) {
             Service service = services.get(i);
-            if (service.unbind()) {
+            if (service.unbindLocked()) {
                 i--;
                 count--;
             }
@@ -1006,7 +1002,7 @@
      * @param userId The user id.
      * @param outComponentNames The output component names.
      */
-    private void populateComponentNamesFromSettingLocked(String settingName, int userId,
+    private void readComponentNamesFromSettingLocked(String settingName, int userId,
             Set<ComponentName> outComponentNames) {
         String settingValue = Settings.Secure.getStringForUser(mContext.getContentResolver(),
                 settingName, userId);
@@ -1047,19 +1043,11 @@
                 settingName, builder.toString(), userId);
     }
 
-    /**
-     * Updates the state of each service by starting (or keeping running) enabled ones and
-     * stopping the rest.
-     *
-     * @param userState The user state for which to do that.
-     * @return The number of enabled installed services.
-     */
-    private int updateServicesStateLocked(UserState userState) {
+    private void manageServicesLocked(UserState userState) {
         Map<ComponentName, Service> componentNameToServiceMap =
                 userState.mComponentNameToServiceMap;
         boolean isEnabled = userState.mIsAccessibilityEnabled;
 
-        int enabledInstalledServices = 0;
         for (int i = 0, count = userState.mInstalledServices.size(); i < count; i++) {
             AccessibilityServiceInfo installedService = userState.mInstalledServices.get(i);
             ComponentName componentName = ComponentName.unflattenFromString(
@@ -1067,32 +1055,46 @@
             Service service = componentNameToServiceMap.get(componentName);
 
             if (isEnabled) {
+                // Wait for the binding if it is in process.
+                if (userState.mBindingServices.contains(componentName)) {
+                    continue;
+                }
+                // No enabled installed services => disable accessibility to avoid
+                // sending accessibility events with no recipient across processes.
+                if (userState.mEnabledServices.isEmpty()) {
+                    userState.mIsAccessibilityEnabled = false;
+                    Settings.Secure.putIntForUser(mContext.getContentResolver(),
+                            Settings.Secure.ACCESSIBILITY_ENABLED, 0, userState.mUserId);
+                    return;
+                }
                 if (userState.mEnabledServices.contains(componentName)) {
                     if (service == null) {
-                        service = new Service(userState.mUserId, componentName,
-                                installedService, false);
+                        service = new Service(userState.mUserId, componentName, installedService);
+                    } else if (userState.mBoundServices.contains(service)) {
+                        continue;
                     }
-                    service.bind();
-                    enabledInstalledServices++;
+                    service.bindLocked();
                 } else {
                     if (service != null) {
-                        service.unbind();
+                        service.unbindLocked();
                     }
                 }
             } else {
                 if (service != null) {
-                    service.unbind();
+                    service.unbindLocked();
+                } else {
+                    userState.mBindingServices.remove(componentName);
                 }
             }
         }
-
-        return enabledInstalledServices;
     }
 
-    private void scheduleSendStateToClientsLocked(UserState userState) {
-        if (mGlobalClients.getRegisteredCallbackCount() > 0
-                || userState.mClients.getRegisteredCallbackCount() > 0) {
-            final int clientState = getClientState(userState);
+    private void scheduleUpdateClientsIfNeededLocked(UserState userState) {
+        final int clientState = userState.getClientState();
+        if (userState.mLastSentClientState != clientState
+                && (mGlobalClients.getRegisteredCallbackCount() > 0
+                        || userState.mClients.getRegisteredCallbackCount() > 0)) {
+            userState.mLastSentClientState = clientState;
             mMainHandler.obtainMessage(MainHandler.MSG_SEND_STATE_TO_CLIENTS,
                     clientState, userState.mUserId) .sendToTarget();
         }
@@ -1144,10 +1146,10 @@
     }
 
     private void showEnableTouchExplorationDialog(final Service service) {
-        String label = service.mResolveInfo.loadLabel(
-
-        mContext.getPackageManager()).toString();
         synchronized (mLock) {
+            String label = service.mResolveInfo.loadLabel(
+            mContext.getPackageManager()).toString();
+
             final UserState state = getCurrentUserStateLocked();
             if (state.mIsTouchExplorationEnabled) {
                 return;
@@ -1167,9 +1169,12 @@
                                  Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
                                  state.mTouchExplorationGrantedServices, state.mUserId);
                          // Enable touch exploration.
+                         UserState userState = getUserStateLocked(service.mUserId);
+                         userState.mIsTouchExplorationEnabled = true;
                          Settings.Secure.putIntForUser(mContext.getContentResolver(),
                                  Settings.Secure.TOUCH_EXPLORATION_ENABLED, 1,
                                  service.mUserId);
+                         onUserStateChangedLocked(userState);
                      }
                  })
                  .setNegativeButton(android.R.string.cancel, new OnClickListener() {
@@ -1191,92 +1196,104 @@
         }
     }
 
-    private int getClientState(UserState userState) {
-        int clientState = 0;
-        if (userState.mIsAccessibilityEnabled) {
-            clientState |= AccessibilityManager.STATE_FLAG_ACCESSIBILITY_ENABLED;
-        }
-        // Touch exploration relies on enabled accessibility.
-        if (userState.mIsAccessibilityEnabled && userState.mIsTouchExplorationEnabled) {
-            clientState |= AccessibilityManager.STATE_FLAG_TOUCH_EXPLORATION_ENABLED;
-        }
-        return clientState;
-    }
-
-    private void recreateInternalStateLocked(UserState userState) {
-        populateInstalledAccessibilityServiceLocked(userState);
-        populateEnabledAccessibilityServicesLocked(userState);
-        populateTouchExplorationGrantedAccessibilityServicesLocked(userState);
-        populatedEnhancedWebAccessibilityEnabledChangedLocked(userState);
-
-        handleTouchExplorationEnabledSettingChangedLocked(userState);
-        handleDisplayMagnificationEnabledSettingChangedLocked(userState);
-        handleAccessibilityEnabledSettingChangedLocked(userState);
-        handleTouchExplorationGrantedAccessibilityServicesChangedLocked(userState);
-
-        performServiceManagementLocked(userState);
-
+    private void onUserStateChangedLocked(UserState userState) {
+        updateServicesLocked(userState);
+        updateTouchExplorationLocked(userState);
+        updateEnhancedWebAccessibilityLocked(userState);
         scheduleUpdateInputFilter(userState);
-        scheduleSendStateToClientsLocked(userState);
+        scheduleUpdateClientsIfNeededLocked(userState);
     }
 
-    private void handleAccessibilityEnabledSettingChangedLocked(UserState userState) {
-        userState.mIsAccessibilityEnabled = Settings.Secure.getIntForUser(
-               mContext.getContentResolver(),
-               Settings.Secure.ACCESSIBILITY_ENABLED, 0, userState.mUserId) == 1;
-    }
-
-    private void performServiceManagementLocked(UserState userState) {
-        if (userState.mIsAccessibilityEnabled ) {
+    private void updateServicesLocked(UserState userState) {
+        if (userState.mIsAccessibilityEnabled) {
             manageServicesLocked(userState);
         } else {
             unbindAllServicesLocked(userState);
         }
     }
 
-    private void handleTouchExplorationEnabledSettingChangedLocked(UserState userState) {
-        userState.mIsTouchExplorationEnabled = Settings.Secure.getIntForUser(
-                mContext.getContentResolver(),
-                Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0, userState.mUserId) == 1;
+    private boolean readConfigurationForUserStateLocked(UserState userState) {
+        boolean somthingChanged = false;
+        somthingChanged |= readAccessibilityEnabledSettingLocked(userState);
+        somthingChanged |= readInstalledAccessibilityServiceLocked(userState);
+        somthingChanged |= readEnabledAccessibilityServicesLocked(userState);
+        somthingChanged |= readTouchExplorationGrantedAccessibilityServicesLocked(userState);
+        somthingChanged |= readTouchExplorationEnabledSettingLocked(userState);
+        somthingChanged |= readEnhancedWebAccessibilityEnabledChangedLocked(userState);
+        somthingChanged |= readDisplayMagnificationEnabledSettingLocked(userState);
+        return somthingChanged;
     }
 
-    private void handleDisplayMagnificationEnabledSettingChangedLocked(UserState userState) {
-        userState.mIsDisplayMagnificationEnabled = Settings.Secure.getIntForUser(
+    private boolean readAccessibilityEnabledSettingLocked(UserState userState) {
+        final boolean accessibilityEnabled = Settings.Secure.getIntForUser(
+               mContext.getContentResolver(),
+               Settings.Secure.ACCESSIBILITY_ENABLED, 0, userState.mUserId) == 1;
+        if (accessibilityEnabled != userState.mIsAccessibilityEnabled) {
+            userState.mIsAccessibilityEnabled = accessibilityEnabled;
+            return true;
+        }
+        return false;
+    }
+
+    private boolean readTouchExplorationEnabledSettingLocked(UserState userState) {
+        final boolean touchExplorationEnabled = Settings.Secure.getIntForUser(
+                mContext.getContentResolver(),
+                Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0, userState.mUserId) == 1;
+        if (touchExplorationEnabled != userState.mIsTouchExplorationEnabled) {
+            userState.mIsTouchExplorationEnabled = touchExplorationEnabled;
+            return true;
+        }
+        return false;
+    }
+
+    private boolean readDisplayMagnificationEnabledSettingLocked(UserState userState) {
+        final boolean displayMagnificationEnabled = Settings.Secure.getIntForUser(
                 mContext.getContentResolver(),
                 Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
                 0, userState.mUserId) == 1;
+        if (displayMagnificationEnabled != userState.mIsDisplayMagnificationEnabled) {
+            userState.mIsDisplayMagnificationEnabled = displayMagnificationEnabled;
+            return true;
+        }
+        return false;
     }
 
-    private void handleTouchExplorationGrantedAccessibilityServicesChangedLocked(
-            UserState userState) {
-        Settings.Secure.putIntForUser(mContext.getContentResolver(),
-                Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0, userState.mUserId);
-        final int serviceCount = userState.mServices.size();
+    private boolean readEnhancedWebAccessibilityEnabledChangedLocked(UserState userState) {
+         final boolean enhancedWeAccessibilityEnabled = Settings.Secure.getIntForUser(
+                mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION,
+                0, userState.mUserId) == 1;
+         if (enhancedWeAccessibilityEnabled != userState.mIsEnhancedWebAccessibilityEnabled) {
+             userState.mIsEnhancedWebAccessibilityEnabled = enhancedWeAccessibilityEnabled;
+             return true;
+         }
+         return false;
+    }
+
+    private void updateTouchExplorationLocked(UserState userState) {
+        userState.mIsTouchExplorationEnabled = false;
+        final int serviceCount = userState.mBoundServices.size();
         for (int i = 0; i < serviceCount; i++) {
-            Service service = userState.mServices.get(i);
-            tryEnableTouchExplorationLocked(service);
+            Service service = userState.mBoundServices.get(i);
+            if (tryEnableTouchExplorationLocked(service)) {
+                break;
+            }
         }
     }
 
-    private void populatedEnhancedWebAccessibilityEnabledChangedLocked(UserState userState) {
-        userState.mIsEnhancedWebAccessibilityEnabled = Settings.Secure.getIntForUser(
-                mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION,
-                0, userState.mUserId) == 1;
-    }
-
-    private void tryEnableTouchExplorationLocked(Service service) {
+    private boolean tryEnableTouchExplorationLocked(Service service) {
         if (!service.canReceiveEventsLocked() || !service.mRequestTouchExplorationMode) {
-            return;
+            return false;
         }
         UserState userState = getUserStateLocked(service.mUserId);
         if (userState.mIsTouchExplorationEnabled) {
-            return;
+            return false;
         }
         // UI test automation service can always enable it.
         if (service.mIsAutomation) {
+            userState.mIsTouchExplorationEnabled = true;
             Settings.Secure.putIntForUser(mContext.getContentResolver(),
                     Settings.Secure.TOUCH_EXPLORATION_ENABLED, 1, service.mUserId);
-            return;
+            return true;
         }
         if (service.mResolveInfo.serviceInfo.applicationInfo.targetSdkVersion
                 <= Build.VERSION_CODES.JELLY_BEAN_MR1) {
@@ -1287,11 +1304,15 @@
                 if (mEnableTouchExplorationDialog == null
                         || (mEnableTouchExplorationDialog != null
                             && !mEnableTouchExplorationDialog.isShowing())) {
-                    showEnableTouchExplorationDialog(service);
+                    mMainHandler.obtainMessage(
+                            MainHandler.MSG_SHOW_ENABLED_TOUCH_EXPLORATION_DIALOG,
+                            service).sendToTarget();
                 }
             } else {
+                userState.mIsTouchExplorationEnabled = true;
                 Settings.Secure.putIntForUser(mContext.getContentResolver(),
                         Settings.Secure.TOUCH_EXPLORATION_ENABLED, 1, service.mUserId);
+                return true;
             }
         } else {
             // Starting in JB-MR2 we request a permission to allow a service to enable
@@ -1299,94 +1320,43 @@
             if (mContext.getPackageManager().checkPermission(
                     android.Manifest.permission.CAN_REQUEST_TOUCH_EXPLORATION_MODE,
                     service.mComponentName.getPackageName()) == PackageManager.PERMISSION_GRANTED) {
+                userState.mIsTouchExplorationEnabled = true;
                 Settings.Secure.putIntForUser(mContext.getContentResolver(),
                         Settings.Secure.TOUCH_EXPLORATION_ENABLED, 1, service.mUserId);
+                return true;
             }
         }
+        return false;
     }
 
-    private void tryDisableTouchExplorationLocked(Service service) {
-        if (!service.mRequestTouchExplorationMode) {
-            return;
-        }
-        UserState userState = getUserStateLocked(service.mUserId);
-        if (!userState.mIsTouchExplorationEnabled) {
-            return;
-        }
-        final int serviceCount = userState.mServices.size();
+    private void updateEnhancedWebAccessibilityLocked(UserState userState) {
+        userState.mIsEnhancedWebAccessibilityEnabled = false;
+        final int serviceCount = userState.mBoundServices.size();
         for (int i = 0; i < serviceCount; i++) {
-            Service other = userState.mServices.get(i);
-            if (other != service) {
-                if (service.mResolveInfo.serviceInfo.applicationInfo.targetSdkVersion
-                        <= Build.VERSION_CODES.JELLY_BEAN_MR1) {
-                    // Up to JB-MR1 we had a white list with services that can enable touch
-                    // exploration. When a service is first started we show a dialog to the
-                    // use to get a permission to white list the service.
-                    if (other.mRequestTouchExplorationMode &&
-                            userState.mTouchExplorationGrantedServices.contains(
-                                    service.mComponentName)) {
-                        // A white-listed service wants touch exploration, do not disable.
-                        return;
-                    }
-                } else {
-                    // Starting in JB-MR2 we request a permission to allow a service to enable
-                    // touch exploration and do not care if the service is in the white list.
-                    if (other.mRequestTouchExplorationMode && (service.mIsAutomation
-                            || mContext.getPackageManager().checkPermission(
-                                    android.Manifest.permission.CAN_REQUEST_TOUCH_EXPLORATION_MODE,
-                                    service.mComponentName.getPackageName())
-                                    == PackageManager.PERMISSION_GRANTED)) {
-                        // A service with permission wants touch exploration, do not disable.
-                        return;
-                    }
-                }
-            }
-        }
-        Settings.Secure.putIntForUser(mContext.getContentResolver(),
-                Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0, userState.mUserId);
-    }
-
-    private void tryEnableEnhancedWebAccessibilityLocked(Service service) {
-        if (!service.canReceiveEventsLocked() || !service.mRequestEnhancedWebAccessibility ) {
-            return;
-        }
-        UserState userState = getUserStateLocked(service.mUserId);
-        if (userState.mIsEnhancedWebAccessibilityEnabled) {
-            return;
-        }
-        // Requested and can enabled, do it.
-        if (service.mRequestEnhancedWebAccessibility
-                && canEnabledEnhancedWebAccessibility(service)) {
-            Settings.Secure.putIntForUser(mContext.getContentResolver(),
-                    Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION, 1, userState.mUserId);
-        }
-    }
-
-    private void tryDisableEnhancedWebAccessibilityLocked(Service service) {
-        if (!service.mRequestEnhancedWebAccessibility) {
-            return;
-        }
-        UserState userState = getUserStateLocked(service.mUserId);
-        if (!userState.mIsEnhancedWebAccessibilityEnabled) {
-            return;
-        }
-        final int serviceCount = userState.mServices.size();
-        for (int i = 0; i < serviceCount; i++) {
-            Service other = userState.mServices.get(i);
-            if (other != service && other.mRequestEnhancedWebAccessibility
-                    && canEnabledEnhancedWebAccessibility(other)) {
-                // One service requests the feature, do not disable.
+            Service service = userState.mBoundServices.get(i);
+            if (tryEnableEnhancedWebAccessibilityLocked(service)) {
                 return;
             }
         }
-        Settings.Secure.putIntForUser(mContext.getContentResolver(),
-                Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION, 0, service.mUserId);
     }
 
-    private boolean canEnabledEnhancedWebAccessibility(Service service) {
-        return (service.mIsAutomation || mContext.getPackageManager().checkPermission(
+    private boolean tryEnableEnhancedWebAccessibilityLocked(Service service) {
+        if (!service.canReceiveEventsLocked() || !service.mRequestEnhancedWebAccessibility ) {
+            return false;
+        }
+        UserState userState = getUserStateLocked(service.mUserId);
+        if (userState.mIsEnhancedWebAccessibilityEnabled) {
+            return false;
+        }
+        if (service.mIsAutomation || mContext.getPackageManager().checkPermission(
                 android.Manifest.permission.CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY,
-                service.mComponentName.getPackageName()) == PackageManager.PERMISSION_GRANTED);
+                service.mComponentName.getPackageName()) == PackageManager.PERMISSION_GRANTED) {
+            userState.mIsEnhancedWebAccessibilityEnabled = true;
+            Settings.Secure.putIntForUser(mContext.getContentResolver(),
+                    Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION, 1, userState.mUserId);
+            return true;
+        }
+        return false;
     }
 
     @Override
@@ -1395,12 +1365,6 @@
         synchronized (mLock) {
             pw.println("ACCESSIBILITY MANAGER (dumpsys accessibility)");
             pw.println();
-            pw.println("Ui automation service: bound=" + (mUiAutomationService != null));
-            pw.println();
-            if (mUiAutomationService != null) {
-                mUiAutomationService.dump(fd, pw, args);
-                pw.println();
-            }
             final int userCount = mUserStates.size();
             for (int i = 0; i < userCount; i++) {
                 UserState userState = mUserStates.valueAt(i);
@@ -1410,17 +1374,22 @@
                 pw.append(", touchExplorationEnabled=" + userState.mIsTouchExplorationEnabled);
                 pw.append(", displayMagnificationEnabled="
                         + userState.mIsDisplayMagnificationEnabled);
+                if (userState.mUiAutomationService != null) {
+                    pw.append(", ");
+                    userState.mUiAutomationService.dump(fd, pw, args);
+                    pw.println();
+                }
                 pw.append("}");
                 pw.println();
                 pw.append("           services:{");
-                final int serviceCount = userState.mServices.size();
+                final int serviceCount = userState.mBoundServices.size();
                 for (int j = 0; j < serviceCount; j++) {
                     if (j > 0) {
                         pw.append(", ");
                         pw.println();
                         pw.append("                     ");
                     }
-                    Service service = userState.mServices.get(j);
+                    Service service = userState.mBoundServices.get(j);
                     service.dump(fd, pw, args);
                 }
                 pw.println("}]");
@@ -1462,10 +1431,10 @@
         public static final int MSG_SEND_ACCESSIBILITY_EVENT_TO_INPUT_FILTER = 1;
         public static final int MSG_SEND_STATE_TO_CLIENTS = 2;
         public static final int MSG_SEND_CLEARED_STATE_TO_CLIENTS_FOR_USER = 3;
-        public static final int MSG_SEND_RECREATE_INTERNAL_STATE = 4;
-        public static final int MSG_UPDATE_ACTIVE_WINDOW = 5;
-        public static final int MSG_ANNOUNCE_NEW_USER_IF_NEEDED = 6;
-        public static final int MSG_UPDATE_INPUT_FILTER = 7;
+        public static final int MSG_UPDATE_ACTIVE_WINDOW = 4;
+        public static final int MSG_ANNOUNCE_NEW_USER_IF_NEEDED = 5;
+        public static final int MSG_UPDATE_INPUT_FILTER = 6;
+        public static final int MSG_SHOW_ENABLED_TOUCH_EXPLORATION_DIALOG = 7;
 
         public MainHandler(Looper looper) {
             super(looper);
@@ -1494,13 +1463,6 @@
                     final int userId = msg.arg1;
                     sendStateToClientsForUser(0, userId);
                 } break;
-                case MSG_SEND_RECREATE_INTERNAL_STATE: {
-                    final int userId = msg.arg1;
-                    synchronized (mLock) {
-                        UserState userState = getUserStateLocked(userId);
-                        recreateInternalStateLocked(userState);
-                    }
-                } break;
                 case MSG_UPDATE_ACTIVE_WINDOW: {
                     final int windowId = msg.arg1;
                     final int eventType = msg.arg2;
@@ -1513,6 +1475,10 @@
                     UserState userState = (UserState) msg.obj;
                     updateInputFilter(userState);
                 } break;
+                case MSG_SHOW_ENABLED_TOUCH_EXPLORATION_DIALOG: {
+                    Service service = (Service) msg.obj;
+                    showEnableTouchExplorationDialog(service);
+                } break;
             }
         }
 
@@ -1641,14 +1607,14 @@
         };
 
         public Service(int userId, ComponentName componentName,
-                AccessibilityServiceInfo accessibilityServiceInfo, boolean isAutomation) {
+                AccessibilityServiceInfo accessibilityServiceInfo) {
             mUserId = userId;
             mResolveInfo = accessibilityServiceInfo.getResolveInfo();
             mId = sIdCounter++;
             mComponentName = componentName;
             mAccessibilityServiceInfo = accessibilityServiceInfo;
-            mIsAutomation = isAutomation;
-            if (!isAutomation) {
+            mIsAutomation = (sFakeAccessibilityServiceComponentName.equals(componentName));
+            if (!mIsAutomation) {
                 mCanRetrieveScreenContent = accessibilityServiceInfo.getCanRetrieveWindowContent();
                 mIntent = new Intent().setComponent(mComponentName);
                 mIntent.putExtra(Intent.EXTRA_CLIENT_LABEL,
@@ -1688,24 +1654,6 @@
                 mRequestEnhancedWebAccessibility = (info.flags
                            & AccessibilityServiceInfo.FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY) != 0;
             }
-
-            // If this service is up and running we may have to enable touch
-            // exploration or enhanced web accessibility, otherwise this will
-            // happen when the service connects.
-            synchronized (mLock) {
-                if (canReceiveEventsLocked()) {
-                    if (mRequestTouchExplorationMode) {
-                        tryEnableTouchExplorationLocked(this);
-                    } else {
-                        tryDisableTouchExplorationLocked(this);
-                    }
-                    if (mRequestEnhancedWebAccessibility) {
-                        tryEnableEnhancedWebAccessibilityLocked(this);
-                    } else {
-                        tryDisableEnhancedWebAccessibilityLocked(this);
-                    }
-                }
-            }
         }
 
         /**
@@ -1713,10 +1661,20 @@
          *
          * @return True if binding is successful.
          */
-        public boolean bind() {
-            if (!mIsAutomation && mService == null) {
-                return mContext.bindServiceAsUser(mIntent, this, Context.BIND_AUTO_CREATE,
-                        new UserHandle(mUserId));
+        public boolean bindLocked() {
+            UserState userState = getUserStateLocked(mUserId);
+            if (!mIsAutomation) {
+                if (mService == null) {
+                    if (mContext.bindServiceAsUser(mIntent, this, Context.BIND_AUTO_CREATE,
+                            new UserHandle(mUserId))) {
+                        userState.mBindingServices.add(mComponentName);
+                    }
+                }
+            } else {
+                userState.mBindingServices.add(mComponentName);
+                mService = userState.mUiAutomationServiceClient.asBinder();
+                onServiceConnected(mComponentName, mService);
+                userState.mUiAutomationService = this;
             }
             return false;
         }
@@ -1727,17 +1685,19 @@
          *
          * @return True if unbinding is successful.
          */
-        public boolean unbind() {
-            if (mService != null) {
-                synchronized (mLock) {
-                    tryRemoveServiceLocked(this);
-                }
-                if (!mIsAutomation) {
-                    mContext.unbindService(this);
-                }
-                return true;
+        public boolean unbindLocked() {
+            if (mService == null) {
+                return false;
             }
-            return false;
+            if (!mIsAutomation) {
+                mContext.unbindService(this);
+            } else {
+                UserState userState = getUserStateLocked(mUserId);
+                userState.mUiAutomationService = null;
+                userState.mUiAutomationServiceClient = null;
+            }
+            removeServiceLocked(this);
+            return true;
         }
 
         public boolean canReceiveEventsLocked() {
@@ -1766,6 +1726,8 @@
                     } else {
                         setDynamicallyConfigurableProperties(info);
                     }
+                    UserState userState = getUserStateLocked(mUserId);
+                    onUserStateChangedLocked(userState);
                 }
             } finally {
                 Binder.restoreCallingIdentity(identity);
@@ -1774,15 +1736,24 @@
 
         @Override
         public void onServiceConnected(ComponentName componentName, IBinder service) {
-            mService = service;
-            mServiceInterface = IAccessibilityServiceClient.Stub.asInterface(service);
-            try {
-                mServiceInterface.setConnection(this, mId);
-                synchronized (mLock) {
-                    tryAddServiceLocked(this, mUserId);
+            final int connectionId;
+            synchronized (mLock) {
+                connectionId = mId;
+                mService = service;
+                mServiceInterface = IAccessibilityServiceClient.Stub.asInterface(service);
+                UserState userState = getUserStateLocked(mUserId);
+                if (!userState.mBindingServices.contains(mComponentName)) {
+                    binderDied();
+                } else {
+                    userState.mBindingServices.remove(mComponentName);
+                    addServiceLocked(this, userState);
+                    onUserStateChangedLocked(userState);
                 }
+            }
+            try {
+                mServiceInterface.setConnection(this, connectionId);
             } catch (RemoteException re) {
-                Slog.w(LOG_TAG, "Error while setting Controller for service: " + service, re);
+                Slog.w(LOG_TAG, "Error while setting connection for service: " + service, re);
             }
         }
 
@@ -2128,13 +2099,15 @@
         public void binderDied() {
             synchronized (mLock) {
                 // The death recipient is unregistered in tryRemoveServiceLocked
-                tryRemoveServiceLocked(this);
-                // We no longer have an automation service, so restore
-                // the state based on values in the settings database.
+                removeServiceLocked(this);
+                UserState userState = getUserStateLocked(mUserId);
                 if (mIsAutomation) {
-                    mUiAutomationService = null;
-                    recreateInternalStateLocked(getUserStateLocked(mUserId));
+                    // We no longer have an automation service, so restore
+                    // the state based on values in the settings database.
+                    userState.mUiAutomationService = null;
+                    userState.mUiAutomationServiceClient = null;
                 }
+                onUserStateChangedLocked(userState);
             }
         }
 
@@ -2585,7 +2558,7 @@
     private class UserState {
         public final int mUserId;
 
-        public final CopyOnWriteArrayList<Service> mServices = new CopyOnWriteArrayList<Service>();
+        public final CopyOnWriteArrayList<Service> mBoundServices = new CopyOnWriteArrayList<Service>();
 
         public final RemoteCallbackList<IAccessibilityManagerClient> mClients =
             new RemoteCallbackList<IAccessibilityManagerClient>();
@@ -2596,6 +2569,8 @@
         public final List<AccessibilityServiceInfo> mInstalledServices =
                 new ArrayList<AccessibilityServiceInfo>();
 
+        public final Set<ComponentName> mBindingServices = new HashSet<ComponentName>();
+
         public final Set<ComponentName> mEnabledServices = new HashSet<ComponentName>();
 
         public final Set<ComponentName> mTouchExplorationGrantedServices =
@@ -2609,57 +2584,30 @@
 
         public int mHandledFeedbackTypes = 0;
 
+        public int mLastSentClientState;
+
         public boolean mIsAccessibilityEnabled;
         public boolean mIsTouchExplorationEnabled;
         public boolean mIsEnhancedWebAccessibilityEnabled;
         public boolean mIsDisplayMagnificationEnabled;
 
+        private Service mUiAutomationService;
+        private IAccessibilityServiceClient mUiAutomationServiceClient;
+
         public UserState(int userId) {
             mUserId = userId;
         }
-    }
 
-    private class TempUserStateChangeMemento {
-        public int mUserId = UserHandle.USER_NULL;
-        public boolean mIsAccessibilityEnabled;
-        public boolean mIsTouchExplorationEnabled;
-        public boolean mIsEnhancedWebAccessibilityEnabled;
-        public boolean mIsDisplayMagnificationEnabled;
-        public final Set<ComponentName> mEnabledServices = new HashSet<ComponentName>();
-        public final Set<ComponentName> mTouchExplorationGrantedServices =
-                new HashSet<ComponentName>();
-
-        public void initialize(UserState userState) {
-            mUserId = userState.mUserId;
-            mIsAccessibilityEnabled = userState.mIsAccessibilityEnabled;
-            mIsTouchExplorationEnabled = userState.mIsTouchExplorationEnabled;
-            mIsEnhancedWebAccessibilityEnabled = userState.mIsEnhancedWebAccessibilityEnabled;
-            mIsDisplayMagnificationEnabled = userState.mIsDisplayMagnificationEnabled;
-            mEnabledServices.clear();
-            mEnabledServices.addAll(userState.mEnabledServices);
-            mTouchExplorationGrantedServices.clear();
-            mTouchExplorationGrantedServices.addAll(userState.mTouchExplorationGrantedServices);
-        }
-
-        public void applyTo(UserState userState) {
-            userState.mIsAccessibilityEnabled = mIsAccessibilityEnabled;
-            userState.mIsTouchExplorationEnabled = mIsTouchExplorationEnabled;
-            userState.mIsEnhancedWebAccessibilityEnabled = mIsEnhancedWebAccessibilityEnabled;
-            userState.mIsDisplayMagnificationEnabled = mIsDisplayMagnificationEnabled;
-            userState.mEnabledServices.clear();
-            userState.mEnabledServices.addAll(mEnabledServices);
-            userState.mTouchExplorationGrantedServices.clear();
-            userState.mTouchExplorationGrantedServices.addAll(mTouchExplorationGrantedServices);
-        }
-
-        public void clear() {
-            mUserId = UserHandle.USER_NULL;
-            mIsAccessibilityEnabled = false;
-            mIsTouchExplorationEnabled = false;
-            mIsEnhancedWebAccessibilityEnabled = false;
-            mIsDisplayMagnificationEnabled = false;
-            mEnabledServices.clear();
-            mTouchExplorationGrantedServices.clear();
+        public int getClientState() {
+            int clientState = 0;
+            if (mIsAccessibilityEnabled) {
+                clientState |= AccessibilityManager.STATE_FLAG_ACCESSIBILITY_ENABLED;
+            }
+            // Touch exploration relies on enabled accessibility.
+            if (mIsAccessibilityEnabled && mIsTouchExplorationEnabled) {
+                clientState |= AccessibilityManager.STATE_FLAG_TOUCH_EXPLORATION_ENABLED;
+            }
+            return clientState;
         }
     }
 
@@ -2680,7 +2628,7 @@
         private final Uri mTouchExplorationGrantedAccessibilityServicesUri = Settings.Secure
                 .getUriFor(Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES);
 
-        private final Uri mAccessibilityScriptInjectionUri = Settings.Secure
+        private final Uri mEnhancedWebAccessibilityUri = Settings.Secure
                 .getUriFor(Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION);
 
         public AccessibilityContentObserver(Handler handler) {
@@ -2699,7 +2647,7 @@
             contentResolver.registerContentObserver(
                     mTouchExplorationGrantedAccessibilityServicesUri,
                     false, this, UserHandle.USER_ALL);
-            contentResolver.registerContentObserver(mAccessibilityScriptInjectionUri,
+            contentResolver.registerContentObserver(mEnhancedWebAccessibilityUri,
                     false, this, UserHandle.USER_ALL);
         }
 
@@ -2708,58 +2656,61 @@
             if (mAccessibilityEnabledUri.equals(uri)) {
                 synchronized (mLock) {
                     // We will update when the automation service dies.
-                    if (mUiAutomationService == null) {
-                        UserState userState = getCurrentUserStateLocked();
-                        handleAccessibilityEnabledSettingChangedLocked(userState);
-                        performServiceManagementLocked(userState);
-                        scheduleUpdateInputFilter(userState);
-                        scheduleSendStateToClientsLocked(userState);
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readAccessibilityEnabledSettingLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
                     }
                 }
             } else if (mTouchExplorationEnabledUri.equals(uri)) {
                 synchronized (mLock) {
                     // We will update when the automation service dies.
-                    if (mUiAutomationService == null) {
-                        UserState userState = getCurrentUserStateLocked();
-                        handleTouchExplorationEnabledSettingChangedLocked(userState);
-                        scheduleUpdateInputFilter(userState);
-                        scheduleSendStateToClientsLocked(userState);
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readTouchExplorationEnabledSettingLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
                     }
                 }
             } else if (mDisplayMagnificationEnabledUri.equals(uri)) {
                 synchronized (mLock) {
                     // We will update when the automation service dies.
-                    if (mUiAutomationService == null) {
-                        UserState userState = getCurrentUserStateLocked();
-                        handleDisplayMagnificationEnabledSettingChangedLocked(userState);
-                        scheduleUpdateInputFilter(userState);
-                        scheduleSendStateToClientsLocked(userState);
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readDisplayMagnificationEnabledSettingLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
                     }
                 }
             } else if (mEnabledAccessibilityServicesUri.equals(uri)) {
                 synchronized (mLock) {
                     // We will update when the automation service dies.
-                    if (mUiAutomationService == null) {
-                        UserState userState = getCurrentUserStateLocked();
-                        populateEnabledAccessibilityServicesLocked(userState);
-                        manageServicesLocked(userState);
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readEnabledAccessibilityServicesLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
                     }
                 }
             } else if (mTouchExplorationGrantedAccessibilityServicesUri.equals(uri)) {
                 synchronized (mLock) {
                     // We will update when the automation service dies.
-                    if (mUiAutomationService == null) {
-                        UserState userState = getCurrentUserStateLocked();
-                        populateTouchExplorationGrantedAccessibilityServicesLocked(userState);
-                        handleTouchExplorationGrantedAccessibilityServicesChangedLocked(userState);
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readTouchExplorationGrantedAccessibilityServicesLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
                     }
                 }
-            } else if (mAccessibilityScriptInjectionUri.equals(uri)) {
+            } else if (mEnhancedWebAccessibilityUri.equals(uri)) {
                 synchronized (mLock) {
                     // We will update when the automation service dies.
-                    if (mUiAutomationService == null) {
-                        UserState userState = getCurrentUserStateLocked();
-                        populatedEnhancedWebAccessibilityEnabledChangedLocked(userState);
+                    UserState userState = getCurrentUserStateLocked();
+                    if (userState.mUiAutomationService == null) {
+                        if (readEnhancedWebAccessibilityEnabledChangedLocked(userState)) {
+                            onUserStateChangedLocked(userState);
+                        }
                     }
                 }
             }
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 1ede6e9..9a64a7e 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -37,6 +37,7 @@
 
 import android.app.Activity;
 import android.app.ActivityManager;
+import android.app.ActivityManager.RunningTaskInfo;
 import android.app.ActivityManagerNative;
 import android.app.ActivityOptions;
 import android.app.ActivityThread;
@@ -196,7 +197,7 @@
     static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || false;
     static final boolean DEBUG_MU = localLOGV || false;
     static final boolean DEBUG_IMMERSIVE = localLOGV || false;
-    static final boolean VALIDATE_TOKENS = false;
+    static final boolean VALIDATE_TOKENS = true;
     static final boolean SHOW_ACTIVITY_START_TIME = true;
     
     // Control over CPU and battery monitoring.
@@ -328,7 +329,7 @@
     /**
      * List of intents that were used to start the most recent tasks.
      */
-    final ArrayList<TaskRecord> mRecentTasks = new ArrayList<TaskRecord>();
+    private final ArrayList<TaskRecord> mRecentTasks = new ArrayList<TaskRecord>();
 
     public class PendingActivityExtras extends Binder implements Runnable {
         public final ActivityRecord activity;
@@ -596,13 +597,8 @@
      * List of PendingThumbnailsRecord objects of clients who are still
      * waiting to receive all of the thumbnails for a task.
      */
-    final ArrayList mPendingThumbnails = new ArrayList();
-
-    /**
-     * List of HistoryRecord objects that have been finished and must
-     * still report back to a pending thumbnail receiver.
-     */
-    final ArrayList mCancelledThumbnails = new ArrayList();
+    final ArrayList<PendingThumbnailsRecord> mPendingThumbnails =
+            new ArrayList<PendingThumbnailsRecord>();
 
     final ProviderMap mProviderMap;
 
@@ -2932,22 +2928,13 @@
         }
     }
 
+    @Override
     public boolean willActivityBeVisible(IBinder token) {
         synchronized(this) {
-            int i;
-            for (i=mMainStack.mHistory.size()-1; i>=0; i--) {
-                ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
-                if (r.appToken == token) {
-                    return true;
-                }
-                if (r.fullscreen && !r.finishing) {
-                    return false;
-                }
-            }
-            return true;
+            return mMainStack.willActivityBeVisibleLocked(token);
         }
     }
-    
+
     public void overridePendingTransition(IBinder token, String packageName,
             int enterAnim, int exitAnim) {
         synchronized(this) {
@@ -3717,13 +3704,7 @@
         }
         mWindowManager.closeSystemDialogs(reason);
 
-        for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
-            ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
-            if ((r.info.flags&ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS) != 0) {
-                r.stack.finishActivityLocked(r, i,
-                        Activity.RESULT_CANCELED, null, "close-sys", true);
-            }
-        }
+        mMainStack.closeSystemDialogsLocked();
 
         broadcastIntentLocked(null, null, intent, null,
                 null, 0, null, null, null, AppOpsManager.OP_NONE, false, false, -1,
@@ -3930,37 +3911,12 @@
         boolean didSomething = killPackageProcessesLocked(name, appId, userId,
                 -100, callerWillRestart, true, doit, evenPersistent,
                 name == null ? ("force stop user " + userId) : ("force stop " + name));
-        
-        TaskRecord lastTask = null;
-        for (i=0; i<mMainStack.mHistory.size(); i++) {
-            ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
-            final boolean samePackage = r.packageName.equals(name)
-                    || (name == null && r.userId == userId);
-            if ((userId == UserHandle.USER_ALL || r.userId == userId)
-                    && (samePackage || r.task == lastTask)
-                    && (r.app == null || evenPersistent || !r.app.persistent)) {
-                if (!doit) {
-                    if (r.finishing) {
-                        // If this activity is just finishing, then it is not
-                        // interesting as far as something to stop.
-                        continue;
-                    }
-                    return true;
-                }
-                didSomething = true;
-                Slog.i(TAG, "  Force finishing activity " + r);
-                if (samePackage) {
-                    if (r.app != null) {
-                        r.app.removed = true;
-                    }
-                    r.app = null;
-                }
-                lastTask = r.task;
-                if (r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
-                        null, "force-stop", true)) {
-                    i--;
-                }
+
+        if (mMainStack.forceStopPackageLocked(name, doit, evenPersistent, userId)) {
+            if (!doit) {
+                return true;
             }
+            didSomething = true;
         }
 
         if (mServices.forceStopLocked(name, userId, evenPersistent, doit)) {
@@ -5670,12 +5626,12 @@
     // TASK MANAGEMENT
     // =========================================================
 
-    public List getTasks(int maxNum, int flags,
+    @Override
+    public List<RunningTaskInfo> getTasks(int maxNum, int flags,
                          IThumbnailReceiver receiver) {
-        ArrayList list = new ArrayList();
+        ArrayList<RunningTaskInfo> list = new ArrayList<RunningTaskInfo>();
 
-        PendingThumbnailsRecord pending = null;
-        IApplicationThread topThumbnail = null;
+        PendingThumbnailsRecord pending = new PendingThumbnailsRecord(receiver);
         ActivityRecord topRecord = null;
 
         synchronized(this) {
@@ -5701,88 +5657,19 @@
                 throw new SecurityException(msg);
             }
 
-            int pos = mMainStack.mHistory.size()-1;
-            ActivityRecord next =
-                pos >= 0 ? (ActivityRecord)mMainStack.mHistory.get(pos) : null;
-            ActivityRecord top = null;
-            TaskRecord curTask = null;
-            int numActivities = 0;
-            int numRunning = 0;
-            while (pos >= 0 && maxNum > 0) {
-                final ActivityRecord r = next;
-                pos--;
-                next = pos >= 0 ? (ActivityRecord)mMainStack.mHistory.get(pos) : null;
+            topRecord = mMainStack.getTasksLocked(maxNum, receiver, pending, list);
 
-                // Initialize state for next task if needed.
-                if (top == null ||
-                        (top.state == ActivityState.INITIALIZING
-                            && top.task == r.task)) {
-                    top = r;
-                    curTask = r.task;
-                    numActivities = numRunning = 0;
-                }
-
-                // Add 'r' into the current task.
-                numActivities++;
-                if (r.app != null && r.app.thread != null) {
-                    numRunning++;
-                }
-
-                if (localLOGV) Slog.v(
-                    TAG, r.intent.getComponent().flattenToShortString()
-                    + ": task=" + r.task);
-
-                // If the next one is a different task, generate a new
-                // TaskInfo entry for what we have.
-                if (next == null || next.task != curTask) {
-                    ActivityManager.RunningTaskInfo ci
-                            = new ActivityManager.RunningTaskInfo();
-                    ci.id = curTask.taskId;
-                    ci.baseActivity = r.intent.getComponent();
-                    ci.topActivity = top.intent.getComponent();
-                    if (top.thumbHolder != null) {
-                        ci.description = top.thumbHolder.lastDescription;
-                    }
-                    ci.numActivities = numActivities;
-                    ci.numRunning = numRunning;
-                    //System.out.println(
-                    //    "#" + maxNum + ": " + " descr=" + ci.description);
-                    if (ci.thumbnail == null && receiver != null) {
-                        if (localLOGV) Slog.v(
-                            TAG, "State=" + top.state + "Idle=" + top.idle
-                            + " app=" + top.app
-                            + " thr=" + (top.app != null ? top.app.thread : null));
-                        if (top.state == ActivityState.RESUMED
-                                || top.state == ActivityState.PAUSING) {
-                            if (top.idle && top.app != null
-                                && top.app.thread != null) {
-                                topRecord = top;
-                                topThumbnail = top.app.thread;
-                            } else {
-                                top.thumbnailNeeded = true;
-                            }
-                        }
-                        if (pending == null) {
-                            pending = new PendingThumbnailsRecord(receiver);
-                        }
-                        pending.pendingRecords.add(top);
-                    }
-                    list.add(ci);
-                    maxNum--;
-                    top = null;
-                }
-            }
-
-            if (pending != null) {
+            if (!pending.pendingRecords.isEmpty()) {
                 mPendingThumbnails.add(pending);
             }
         }
 
         if (localLOGV) Slog.v(TAG, "We have pending thumbnails: " + pending);
 
-        if (topThumbnail != null) {
+        if (topRecord != null) {
             if (localLOGV) Slog.v(TAG, "Requesting top thumbnail");
             try {
+                IApplicationThread topThumbnail = topRecord.app.thread;
                 topThumbnail.requestThumbnail(topRecord.appToken);
             } catch (Exception e) {
                 Slog.w(TAG, "Exception thrown when requesting thumbnail", e);
@@ -6017,43 +5904,6 @@
         return false;
     }
     
-    private final int findAffinityTaskTopLocked(int startIndex, String affinity) {
-        int j;
-        TaskRecord startTask = ((ActivityRecord)mMainStack.mHistory.get(startIndex)).task; 
-        TaskRecord jt = startTask;
-        
-        // First look backwards
-        for (j=startIndex-1; j>=0; j--) {
-            ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(j);
-            if (r.task != jt) {
-                jt = r.task;
-                if (affinity.equals(jt.affinity)) {
-                    return j;
-                }
-            }
-        }
-        
-        // Now look forwards
-        final int N = mMainStack.mHistory.size();
-        jt = startTask;
-        for (j=startIndex+1; j<N; j++) {
-            ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(j);
-            if (r.task != jt) {
-                if (affinity.equals(jt.affinity)) {
-                    return j;
-                }
-                jt = r.task;
-            }
-        }
-        
-        // Might it be at the top?
-        if (affinity.equals(((ActivityRecord)mMainStack.mHistory.get(N-1)).task.affinity)) {
-            return N-1;
-        }
-        
-        return -1;
-    }
-    
     /**
      * TODO: Add mController hook
      */
@@ -6082,20 +5932,8 @@
                     mMainStack.moveTaskToFrontLocked(tr, null, options);
                     return;
                 }
-                for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
-                    ActivityRecord hr = (ActivityRecord)mMainStack.mHistory.get(i);
-                    if (hr.task.taskId == task) {
-                        if ((flags&ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) {
-                            mMainStack.mUserLeaving = true;
-                        }
-                        if ((flags&ActivityManager.MOVE_TASK_WITH_HOME) != 0) {
-                            // Caller wants the home activity moved with it.  To accomplish this,
-                            // we'll just move the home task to the top first.
-                            mMainStack.moveHomeToFrontLocked();
-                        }
-                        mMainStack.moveTaskToFrontLocked(hr.task, null, options);
-                        return;
-                    }
+                if (mMainStack.findTaskToMoveToFrontLocked(task, flags, options)) {
+                    return;
                 }
             } finally {
                 Binder.restoreCallingIdentity(origId);
@@ -6135,7 +5973,7 @@
         enforceNotIsolatedCaller("moveActivityTaskToBack");
         synchronized(this) {
             final long origId = Binder.clearCallingIdentity();
-            int taskId = getTaskForActivityLocked(token, !nonRoot);
+            int taskId = mMainStack.getTaskForActivityLocked(token, !nonRoot);
             if (taskId >= 0) {
                 return mMainStack.moveTaskToBackLocked(taskId, null);
             }
@@ -6165,27 +6003,10 @@
 
     public int getTaskForActivity(IBinder token, boolean onlyRoot) {
         synchronized(this) {
-            return getTaskForActivityLocked(token, onlyRoot);
+            return mMainStack.getTaskForActivityLocked(token, onlyRoot);
         }
     }
 
-    int getTaskForActivityLocked(IBinder token, boolean onlyRoot) {
-        final int N = mMainStack.mHistory.size();
-        TaskRecord lastTask = null;
-        for (int i=0; i<N; i++) {
-            ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
-            if (r.appToken == token) {
-                if (!onlyRoot || lastTask != r.task) {
-                    return r.task.taskId;
-                }
-                return -1;
-            }
-            lastTask = r.task;
-        }
-
-        return -1;
-    }
-
     // =========================================================
     // THUMBNAILS
     // =========================================================
@@ -7091,13 +6912,10 @@
                 "unhandledBack()");
 
         synchronized(this) {
-            int count = mMainStack.mHistory.size();
-            if (DEBUG_SWITCH) Slog.d(
-                TAG, "Performing unhandledBack(): stack size = " + count);
-            if (count > 1) {
-                final long origId = Binder.clearCallingIdentity();
-                mMainStack.finishActivityLocked((ActivityRecord)mMainStack.mHistory.get(count-1),
-                        count-1, Activity.RESULT_CANCELED, null, "unhandled-back", true);
+            final long origId = Binder.clearCallingIdentity();
+            try {
+                mMainStack.unhandledBackLocked();
+            } finally {
                 Binder.restoreCallingIdentity(origId);
             }
         }
@@ -8158,15 +7976,7 @@
                     + " has crashed too many times: killing!");
             EventLog.writeEvent(EventLogTags.AM_PROCESS_CRASHED_TOO_MUCH,
                     app.userId, app.info.processName, app.uid);
-            for (int i=mMainStack.mHistory.size()-1; i>=0; i--) {
-                ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(i);
-                if (r.app == app) {
-                    Slog.w(TAG, "  Force finishing activity "
-                        + r.intent.getComponent().flattenToShortString());
-                    r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
-                            null, "crashed", false);
-                }
-            }
+            mMainStack.handleAppCrashLocked(app);
             if (!app.persistent) {
                 // We don't want to start this process again until the user
                 // explicitly does so...  but for persistent process, we really
@@ -8205,7 +8015,7 @@
                 // re-start our crashing activity once it gets resumed again.
                 index--;
                 if (index >= 0) {
-                    r = (ActivityRecord)mMainStack.mHistory.get(index);
+                    r = mMainStack.getActivityAtIndex(index);
                     if (r.state == ActivityState.RESUMED
                             || r.state == ActivityState.PAUSING
                             || r.state == ActivityState.PAUSED) {
@@ -9236,8 +9046,7 @@
             int opti, boolean dumpAll, boolean dumpClient, String dumpPackage) {
         pw.println("ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)");
         pw.println("  Main stack:");
-        dumpHistoryList(fd, pw, mMainStack.mHistory, "  ", "Hist", true, !dumpAll, dumpClient,
-                dumpPackage);
+        mMainStack.dumpActivitiesLocked(fd, pw, dumpAll, dumpClient, dumpPackage);
         pw.println(" ");
         pw.println("  Running activities (most recent first):");
         dumpHistoryList(fd, pw, mMainStack.mLRUActivities, "  ", "Run", false, !dumpAll, false,
@@ -9767,32 +9576,10 @@
      */
     protected boolean dumpActivity(FileDescriptor fd, PrintWriter pw, String name, String[] args,
             int opti, boolean dumpAll) {
-        ArrayList<ActivityRecord> activities = new ArrayList<ActivityRecord>();
-
-        if ("all".equals(name)) {
-            synchronized (this) {
-                for (ActivityRecord r1 : (ArrayList<ActivityRecord>)mMainStack.mHistory) {
-                    activities.add(r1);
-                }
-            }
-        } else if ("top".equals(name)) {
-            synchronized (this) {
-                final int N = mMainStack.mHistory.size();
-                if (N > 0) {
-                    activities.add((ActivityRecord)mMainStack.mHistory.get(N-1));
-                }
-            }
-        } else {
-            ItemMatcher matcher = new ItemMatcher();
-            matcher.build(name);
-
-            synchronized (this) {
-                for (ActivityRecord r1 : (ArrayList<ActivityRecord>)mMainStack.mHistory) {
-                    if (matcher.match(r1, r1.intent.getComponent())) {
-                        activities.add(r1);
-                    }
-                }
-            }
+        ArrayList<ActivityRecord> activities;
+        
+        synchronized (this) {
+            activities = mMainStack.getDumpActivitiesLocked(name);
         }
 
         if (activities.size() <= 0) {
@@ -10044,7 +9831,7 @@
         return needSep;
     }
 
-    private static final void dumpHistoryList(FileDescriptor fd, PrintWriter pw, List list,
+    static final void dumpHistoryList(FileDescriptor fd, PrintWriter pw, List list,
             String prefix, String label, boolean complete, boolean brief, boolean client,
             String dumpPackage) {
         TaskRecord lastTask = null;
@@ -12584,8 +12371,8 @@
             if (srec == null) {
                 return false;
             }
-            ArrayList<ActivityRecord> history = srec.stack.mHistory;
-            final int start = history.indexOf(srec);
+            ActivityStack stack = srec.stack;
+            final int start = stack.indexOfActivityLocked(srec);
             if (start < 0) {
                 // Current activity is not in history stack; do nothing.
                 return false;
@@ -12596,13 +12383,13 @@
             if (dest != null) {
                 TaskRecord tr = srec.task;
                 for (int i = start - 1; i >= 0; i--) {
-                    ActivityRecord r = history.get(i);
+                    ActivityRecord r = stack.getActivityAtIndex(i);
                     if (tr != r.task) {
                         // Couldn't find parent in the same task; stop at the one above this.
                         // (Root of current task; in-app "home" behavior)
                         // Always at least finish the current activity.
                         finishTo = Math.min(start - 1, i + 1);
-                        parent = history.get(finishTo);
+                        parent = stack.getActivityAtIndex(finishTo);
                         break;
                     } else if (r.info.packageName.equals(dest.getPackageName()) &&
                             r.info.name.equals(dest.getClassName())) {
@@ -12632,7 +12419,7 @@
             }
             final long origId = Binder.clearCallingIdentity();
             for (int i = start; i > finishTo; i--) {
-                ActivityRecord r = history.get(i);
+                ActivityRecord r = stack.getActivityAtIndex(i);
                 mMainStack.requestFinishActivityLocked(r.appToken, resultCode, resultData,
                         "navigate-up", true);
                 // Only return the supplied result for the first activity finished
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 526b24f..d969709 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -21,6 +21,7 @@
 
 import com.android.internal.app.HeavyWeightSwitcherActivity;
 import com.android.internal.os.BatteryStatsImpl;
+import com.android.server.am.ActivityManagerService.ItemMatcher;
 import com.android.server.am.ActivityManagerService.PendingActivityLaunch;
 import com.android.server.wm.AppTransition;
 
@@ -29,10 +30,12 @@
 import android.app.ActivityOptions;
 import android.app.AppGlobals;
 import android.app.IActivityManager;
+import android.app.IThumbnailReceiver;
 import android.app.IThumbnailRetriever;
 import android.app.IApplicationThread;
 import android.app.PendingIntent;
 import android.app.ResultInfo;
+import android.app.ActivityManager.RunningTaskInfo;
 import android.app.IActivityManager.WaitResult;
 import android.content.ComponentName;
 import android.content.Context;
@@ -63,7 +66,9 @@
 import android.util.Slog;
 import android.view.Display;
 
+import java.io.FileDescriptor;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -150,14 +155,14 @@
     
     /**
      * The back history of all previous (and possibly still
-     * running) activities.  It contains HistoryRecord objects.
+     * running) activities.  It contains #ActivityRecord objects.
      */
-    final ArrayList<ActivityRecord> mHistory = new ArrayList<ActivityRecord>();
+    private final ArrayList<ActivityRecord> mHistory = new ArrayList<ActivityRecord>();
 
     /**
      * Used for validating app tokens with window manager.
      */
-    final ArrayList<IBinder> mValidateAppTokens = new ArrayList<IBinder>();
+    final ArrayList<TaskGroup> mValidateAppTokens = new ArrayList<TaskGroup>();
 
     /**
      * List of running activities, sorted by recent usage.
@@ -289,6 +294,12 @@
     private ActivityRecord mLastScreenshotActivity = null;
     private Bitmap mLastScreenshotBitmap = null;
 
+    /**
+     * List of ActivityRecord objects that have been finished and must
+     * still report back to a pending thumbnail receiver.
+     */
+    private final ArrayList<ActivityRecord> mCancelledThumbnails = new ArrayList<ActivityRecord>();
+
     int mThumbnailWidth = -1;
     int mThumbnailHeight = -1;
 
@@ -506,6 +517,31 @@
         return null;
     }
 
+    // TODO: This exposes mHistory too much, replace usage with ActivityStack methods. 
+    final ActivityRecord getActivityAtIndex(int index) {
+        if (index >= 0 && index < mHistory.size()) {
+            return mHistory.get(index);
+        }
+        return null;
+    }
+
+    int getTaskForActivityLocked(IBinder token, boolean onlyRoot) {
+        TaskRecord lastTask = null;
+        final int N = mHistory.size();
+        for (int i = 0; i < N; i++) {
+            ActivityRecord r = mHistory.get(i);
+            if (r.appToken == token) {
+                if (!onlyRoot || lastTask != r.task) {
+                    return r.task.taskId;
+                }
+                return -1;
+            }
+            lastTask = r.task;
+        }
+
+        return -1;
+    }
+
     private final boolean updateLRUListLocked(ActivityRecord r) {
         final boolean hadit = mLRUActivities.remove(r);
         mLRUActivities.add(r);
@@ -1959,8 +1995,17 @@
     final void validateAppTokensLocked() {
         mValidateAppTokens.clear();
         mValidateAppTokens.ensureCapacity(mHistory.size());
+        int taskId = Integer.MIN_VALUE;
+        TaskGroup task = null;
         for (int i=0; i<mHistory.size(); i++) {
-            mValidateAppTokens.add(mHistory.get(i).appToken);
+            final ActivityRecord r = mHistory.get(i);
+            if (taskId != r.task.taskId) {
+                taskId = r.task.taskId;
+                task = new TaskGroup();
+                task.taskId = taskId;
+                mValidateAppTokens.add(task);
+            }
+            task.tokens.add(r.appToken);
         }
         mService.mWindowManager.validateAppTokens(mValidateAppTokens);
     }
@@ -3579,9 +3624,9 @@
                 finishes = new ArrayList<ActivityRecord>(mFinishingActivities);
                 mFinishingActivities.clear();
             }
-            if ((NT=mService.mCancelledThumbnails.size()) > 0) {
-                thumbnails = new ArrayList<ActivityRecord>(mService.mCancelledThumbnails);
-                mService.mCancelledThumbnails.clear();
+            if ((NT=mCancelledThumbnails.size()) > 0) {
+                thumbnails = new ArrayList<ActivityRecord>(mCancelledThumbnails);
+                mCancelledThumbnails.clear();
             }
 
             if (mMainStack) {
@@ -3804,7 +3849,7 @@
             // There are clients waiting to receive thumbnails so, in case
             // this is an activity that someone is waiting for, add it
             // to the pending list so we can correctly update the clients.
-            mService.mCancelledThumbnails.add(r);
+            mCancelledThumbnails.add(r);
         }
 
         if (immediate) {
@@ -3964,7 +4009,7 @@
             // There are clients waiting to receive thumbnails so, in case
             // this is an activity that someone is waiting for, add it
             // to the pending list so we can correctly update the clients.
-            mService.mCancelledThumbnails.add(r);
+            mCancelledThumbnails.add(r);
         }
 
         // Get rid of any pending idle timeouts.
@@ -4312,6 +4357,25 @@
         mService.mWindowManager.prepareAppTransition(transit, false);
     }
 
+    final boolean findTaskToMoveToFrontLocked(int taskId, int flags, Bundle options) {
+        for (int i = mHistory.size() - 1; i >= 0; i--) {
+            ActivityRecord hr = mHistory.get(i);
+            if (hr.task.taskId == taskId) {
+                if ((flags & ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) {
+                    mUserLeaving = true;
+                }
+                if ((flags & ActivityManager.MOVE_TASK_WITH_HOME) != 0) {
+                    // Caller wants the home activity moved with it.  To accomplish this,
+                    // we'll just move the home task to the top first.
+                    moveHomeToFrontLocked();
+                }
+                moveTaskToFrontLocked(hr.task, null, options);
+                return true;
+            }
+        }
+        return false;
+    }
+
     final void moveTaskToFrontLocked(TaskRecord tr, ActivityRecord reason, Bundle options) {
         if (DEBUG_SWITCH) Slog.v(TAG, "moveTaskToFront: " + tr);
 
@@ -4777,4 +4841,204 @@
     public void dismissKeyguardOnNextActivityLocked() {
         mDismissKeyguardOnNextActivity = true;
     }
+
+    boolean willActivityBeVisibleLocked(IBinder token) {
+        int i;
+        for (i = mHistory.size() - 1; i >= 0; i--) {
+            ActivityRecord r = mHistory.get(i);
+            if (r.appToken == token) {
+                    return true;
+            }
+            if (r.fullscreen && !r.finishing) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    void closeSystemDialogsLocked() {
+        for (int i = mHistory.size() - 1; i >= 0; i--) {
+            ActivityRecord r = mHistory.get(i);
+            if ((r.info.flags&ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS) != 0) {
+                r.stack.finishActivityLocked(r, i,
+                        Activity.RESULT_CANCELED, null, "close-sys", true);
+            }
+        }
+    }
+
+    boolean forceStopPackageLocked(String name, boolean doit, boolean evenPersistent, int userId) {
+        boolean didSomething = false;
+        TaskRecord lastTask = null;
+        final int N = mHistory.size();
+        for (int i = 0; i < N; i++) {
+            ActivityRecord r = mHistory.get(i);
+            final boolean samePackage = r.packageName.equals(name)
+                    || (name == null && r.userId == userId);
+            if ((userId == UserHandle.USER_ALL || r.userId == userId)
+                    && (samePackage || r.task == lastTask)
+                    && (r.app == null || evenPersistent || !r.app.persistent)) {
+                if (!doit) {
+                    if (r.finishing) {
+                        // If this activity is just finishing, then it is not
+                        // interesting as far as something to stop.
+                        continue;
+                    }
+                    return true;
+                }
+                didSomething = true;
+                Slog.i(TAG, "  Force finishing activity " + r);
+                if (samePackage) {
+                    if (r.app != null) {
+                        r.app.removed = true;
+                    }
+                    r.app = null;
+                }
+                lastTask = r.task;
+                if (r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
+                        null, "force-stop", true)) {
+                    i--;
+                }
+            }
+        }
+        return didSomething;
+    }
+
+    ActivityRecord getTasksLocked(int maxNum, IThumbnailReceiver receiver,
+        PendingThumbnailsRecord pending, List<RunningTaskInfo> list) {
+        ActivityRecord topRecord = null;
+        int pos = mHistory.size() - 1;
+        ActivityRecord next = pos >= 0 ? mHistory.get(pos) : null;
+        ActivityRecord top = null;
+        TaskRecord curTask = null;
+        int numActivities = 0;
+        int numRunning = 0;
+        while (pos >= 0 && maxNum > 0) {
+            final ActivityRecord r = next;
+            pos--;
+            next = pos >= 0 ? mHistory.get(pos) : null;
+
+            // Initialize state for next task if needed.
+            if (top == null || (top.state == ActivityState.INITIALIZING && top.task == r.task)) {
+                top = r;
+                curTask = r.task;
+                numActivities = numRunning = 0;
+            }
+
+            // Add 'r' into the current task.
+            numActivities++;
+            if (r.app != null && r.app.thread != null) {
+                numRunning++;
+            }
+
+            if (localLOGV) Slog.v(
+                TAG, r.intent.getComponent().flattenToShortString()
+                + ": task=" + r.task);
+
+            // If the next one is a different task, generate a new
+            // TaskInfo entry for what we have.
+            if (next == null || next.task != curTask) {
+                RunningTaskInfo ci = new RunningTaskInfo();
+                ci.id = curTask.taskId;
+                ci.baseActivity = r.intent.getComponent();
+                ci.topActivity = top.intent.getComponent();
+                if (top.thumbHolder != null) {
+                    ci.description = top.thumbHolder.lastDescription;
+                }
+                ci.numActivities = numActivities;
+                ci.numRunning = numRunning;
+                //System.out.println(
+                //    "#" + maxNum + ": " + " descr=" + ci.description);
+                if (receiver != null) {
+                    if (localLOGV) Slog.v(
+                        TAG, "State=" + top.state + "Idle=" + top.idle
+                        + " app=" + top.app
+                        + " thr=" + (top.app != null ? top.app.thread : null));
+                    if (top.state == ActivityState.RESUMED || top.state == ActivityState.PAUSING) {
+                        if (top.idle && top.app != null && top.app.thread != null) {
+                            topRecord = top;
+                        } else {
+                            top.thumbnailNeeded = true;
+                        }
+                    }
+                    pending.pendingRecords.add(top);
+                }
+                list.add(ci);
+                maxNum--;
+                top = null;
+            }
+        }
+        return topRecord;
+    }
+
+    public void unhandledBackLocked() {
+        int top = mHistory.size() - 1;
+        if (DEBUG_SWITCH) Slog.d(
+            TAG, "Performing unhandledBack(): top activity at " + top);
+        if (top > 0) {
+            finishActivityLocked(mHistory.get(top),
+                        top, Activity.RESULT_CANCELED, null, "unhandled-back", true);
+        }
+    }
+
+    void handleAppCrashLocked(ProcessRecord app) {
+        for (int i = mHistory.size() - 1; i >= 0; i--) {
+            ActivityRecord r = mHistory.get(i);
+            if (r.app == app) {
+                Slog.w(TAG, "  Force finishing activity "
+                    + r.intent.getComponent().flattenToShortString());
+                r.stack.finishActivityLocked(r, i, Activity.RESULT_CANCELED,
+                        null, "crashed", false);
+            }
+        }
+    }
+
+    void dumpActivitiesLocked(FileDescriptor fd, PrintWriter pw, boolean dumpAll,
+            boolean dumpClient, String dumpPackage) {
+        ActivityManagerService.dumpHistoryList(fd, pw, mHistory, "  ", "Hist", true, !dumpAll,
+            dumpClient, dumpPackage);
+    }
+
+    ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) {
+        ArrayList<ActivityRecord> activities = new ArrayList<ActivityRecord>();
+
+        if ("all".equals(name)) {
+            for (ActivityRecord r1 : mHistory) {
+                activities.add(r1);
+            }
+        } else if ("top".equals(name)) {
+            final int N = mHistory.size();
+            if (N > 0) {
+                activities.add(mHistory.get(N-1));
+            }
+        } else {
+            ItemMatcher matcher = new ItemMatcher();
+            matcher.build(name);
+
+            for (ActivityRecord r1 : mHistory) {
+                if (matcher.match(r1, r1.intent.getComponent())) {
+                    activities.add(r1);
+                }
+            }
+        }
+
+        return activities;
+    }
+
+    ActivityRecord restartPackage(String packageName) {
+        ActivityRecord starting = topRunningActivityLocked(null);
+
+        // All activities that came from the package must be
+        // restarted as if there was a config change.
+        for (int i = mHistory.size() - 1; i >= 0; i--) {
+            ActivityRecord a = mHistory.get(i);
+            if (a.info.packageName.equals(packageName)) {
+                a.forceNewConfig = true;
+                if (starting != null && a == starting && a.visible) {
+                    a.startFreezingScreenLocked(starting.app, ActivityInfo.CONFIG_SCREEN_LAYOUT);
+                }
+            }
+        }
+
+        return starting;
+    }
 }
diff --git a/services/java/com/android/server/am/CompatModePackages.java b/services/java/com/android/server/am/CompatModePackages.java
index 3a6492e..863bdad 100644
--- a/services/java/com/android/server/am/CompatModePackages.java
+++ b/services/java/com/android/server/am/CompatModePackages.java
@@ -295,20 +295,8 @@
             Message msg = mHandler.obtainMessage(MSG_WRITE);
             mHandler.sendMessageDelayed(msg, 10000);
 
-            ActivityRecord starting = mService.mMainStack.topRunningActivityLocked(null);
-
-            // All activities that came from the package must be
-            // restarted as if there was a config change.
-            for (int i=mService.mMainStack.mHistory.size()-1; i>=0; i--) {
-                ActivityRecord a = (ActivityRecord)mService.mMainStack.mHistory.get(i);
-                if (a.info.packageName.equals(packageName)) {
-                    a.forceNewConfig = true;
-                    if (starting != null && a == starting && a.visible) {
-                        a.startFreezingScreenLocked(starting.app,
-                                ActivityInfo.CONFIG_SCREEN_LAYOUT);
-                    }
-                }
-            }
+            
+            ActivityRecord starting = mService.mMainStack.restartPackage(packageName);
 
             // Tell all processes that loaded this package about the change.
             for (int i=mService.mLruProcesses.size()-1; i>=0; i--) {
diff --git a/services/java/com/android/server/am/PendingThumbnailsRecord.java b/services/java/com/android/server/am/PendingThumbnailsRecord.java
index ed478c9..c460791 100644
--- a/services/java/com/android/server/am/PendingThumbnailsRecord.java
+++ b/services/java/com/android/server/am/PendingThumbnailsRecord.java
@@ -27,13 +27,13 @@
 class PendingThumbnailsRecord
 {
     final IThumbnailReceiver receiver;   // who is waiting.
-    HashSet pendingRecords; // HistoryRecord objects we still wait for.
+    final HashSet<ActivityRecord> pendingRecords; // HistoryRecord objects we still wait for.
     boolean finished;       // Is pendingRecords empty?
 
     PendingThumbnailsRecord(IThumbnailReceiver _receiver)
     {
         receiver = _receiver;
-        pendingRecords = new HashSet();
+        pendingRecords = new HashSet<ActivityRecord>();
         finished = false;
     }
 }
diff --git a/services/java/com/android/server/am/TaskGroup.java b/services/java/com/android/server/am/TaskGroup.java
new file mode 100644
index 0000000..7574103
--- /dev/null
+++ b/services/java/com/android/server/am/TaskGroup.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2013 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 com.android.server.am;
+
+import android.view.IApplicationToken;
+
+import java.util.ArrayList;
+
+public class TaskGroup {
+    public int taskId = -1;
+    public ArrayList<IApplicationToken> tokens = new ArrayList<IApplicationToken>();
+}
diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java
index c1e4a32..3552b6a 100644
--- a/services/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/java/com/android/server/location/GpsLocationProvider.java
@@ -1468,7 +1468,8 @@
                 if (networkType == TelephonyManager.NETWORK_TYPE_UMTS
                     || networkType == TelephonyManager.NETWORK_TYPE_HSDPA
                     || networkType == TelephonyManager.NETWORK_TYPE_HSUPA
-                    || networkType == TelephonyManager.NETWORK_TYPE_HSPA) {
+                    || networkType == TelephonyManager.NETWORK_TYPE_HSPA
+                    || networkType == TelephonyManager.NETWORK_TYPE_HSPAP) {
                     type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID;
                 } else {
                     type = AGPS_REF_LOCATION_TYPE_GSM_CELLID;
diff --git a/services/java/com/android/server/wm/AppWindowToken.java b/services/java/com/android/server/wm/AppWindowToken.java
index 0ada604..8fd5209 100644
--- a/services/java/com/android/server/wm/AppWindowToken.java
+++ b/services/java/com/android/server/wm/AppWindowToken.java
@@ -30,6 +30,10 @@
 import android.view.WindowManager;
 
 import java.io.PrintWriter;
+import java.util.ArrayList;
+
+class AppTokenList extends ArrayList<AppWindowToken> {
+}
 
 /**
  * Version of WindowToken that is specifically for a particular application (or
diff --git a/services/java/com/android/server/wm/DisplayContent.java b/services/java/com/android/server/wm/DisplayContent.java
index 59e4b0e..906ea57 100644
--- a/services/java/com/android/server/wm/DisplayContent.java
+++ b/services/java/com/android/server/wm/DisplayContent.java
@@ -16,6 +16,7 @@
 
 package com.android.server.wm;
 
+import android.util.SparseArray;
 import android.view.Display;
 import android.view.DisplayInfo;
 
@@ -33,6 +34,7 @@
  * WindowManagerService.mWindowMap.
  */
 class DisplayContent {
+//    private final static String TAG = "DisplayContent";
 
     /** Unique identifier of this stack. */
     private final int mDisplayId;
@@ -67,6 +69,38 @@
     final boolean isDefaultDisplay;
 
     /**
+     * List controlling the ordering of windows in different applications which must
+     * be kept in sync with ActivityManager.
+     */
+    final AppTokenList mAppTokens = new AppTokenList();
+
+    /**
+     * AppWindowTokens in the Z order they were in at the start of an animation. Between
+     * animations this list is maintained in the exact order of mAppTokens. If tokens
+     * are added to mAppTokens during an animation an attempt is made to insert them at the same
+     * logical location in this list. Note that this list is always in sync with mWindows.
+     */
+    AppTokenList mAnimatingAppTokens = new AppTokenList();
+
+    /**
+     * Window tokens that are in the process of exiting, but still
+     * on screen for animations.
+     */
+    final ArrayList<WindowToken> mExitingTokens = new ArrayList<WindowToken>();
+
+    /**
+     * Application tokens that are in the process of exiting, but still
+     * on screen for animations.
+     */
+    final AppTokenList mExitingAppTokens = new AppTokenList();
+
+    /**
+     * Sorted most recent at top, oldest at [0].
+     */
+//    ArrayList<TaskList> mTaskLists = new ArrayList<TaskList>();
+    SparseArray<TaskList> mTaskIdToTaskList = new SparseArray<TaskList>();
+
+    /**
      * @param display May not be null.
      */
     DisplayContent(Display display) {
@@ -96,6 +130,71 @@
         mDisplay.getDisplayInfo(mDisplayInfo);
     }
 
+    /**
+     *  Find the location to insert a new AppWindowToken into the window-ordered app token list.
+     * @param addPos The location the token was inserted into in mAppTokens.
+     * @param atoken The token to insert.
+     */
+    void addAppToken(final int addPos, final AppWindowToken atoken) {
+        mAppTokens.add(addPos, atoken);
+
+        if (addPos == 0 || addPos == mAnimatingAppTokens.size()) {
+            // It was inserted into the beginning or end of mAppTokens. Honor that.
+            mAnimatingAppTokens.add(addPos, atoken);
+        } else {
+            // Find the item immediately above the mAppTokens insertion point and put the token
+            // immediately below that one in mAnimatingAppTokens.
+            final AppWindowToken aboveAnchor = mAppTokens.get(addPos + 1);
+            mAnimatingAppTokens.add(mAnimatingAppTokens.indexOf(aboveAnchor), atoken);
+        }
+
+        TaskList task = mTaskIdToTaskList.get(atoken.groupId);
+        if (task == null) {
+            mTaskIdToTaskList.put(atoken.groupId, new TaskList(atoken));
+        }
+    }
+
+    void removeAppToken(final AppWindowToken wtoken) {
+        mAppTokens.remove(wtoken);
+        mAnimatingAppTokens.remove(wtoken);
+        final int taskId = wtoken.groupId;
+        final TaskList task = mTaskIdToTaskList.get(taskId);
+        if (task != null) {
+            AppTokenList appTokens = task.mAppTokens;
+            appTokens.remove(wtoken);
+            if (appTokens.size() == 0) {
+                mTaskIdToTaskList.delete(taskId);
+            }
+        }
+    }
+
+    void refillAnimatingAppTokens() {
+        mAnimatingAppTokens.clear();
+        mAnimatingAppTokens.addAll(mAppTokens);
+    }
+
+    void setAppTaskId(AppWindowToken wtoken, int newTaskId) {
+        final int taskId = wtoken.groupId;
+        TaskList task = mTaskIdToTaskList.get(taskId);
+        if (task != null) {
+            AppTokenList appTokens = task.mAppTokens;
+            appTokens.remove(wtoken);
+            if (appTokens.size() == 0) {
+                mTaskIdToTaskList.delete(taskId);
+            }
+        }
+
+        task = mTaskIdToTaskList.get(newTaskId);
+        if (task == null) {
+            task = new TaskList(wtoken);
+            mTaskIdToTaskList.put(newTaskId, task);
+        } else {
+            task.mAppTokens.add(wtoken);
+        }
+
+        wtoken.groupId = newTaskId;
+    }
+
     public void dump(String prefix, PrintWriter pw) {
         pw.print(prefix); pw.print("Display: mDisplayId="); pw.println(mDisplayId);
         final String subPrefix = "  " + prefix;
@@ -119,7 +218,48 @@
             pw.print("x"); pw.print(mDisplayInfo.smallestNominalAppHeight);
             pw.print("-"); pw.print(mDisplayInfo.largestNominalAppWidth);
             pw.print("x"); pw.println(mDisplayInfo.largestNominalAppHeight);
-        pw.print(subPrefix); pw.print("layoutNeeded="); pw.print(layoutNeeded);
+            if (mAppTokens.size() > 0) {
+                pw.println();
+                pw.println("  Application tokens in Z order:");
+                for (int i=mAppTokens.size()-1; i>=0; i--) {
+                    pw.print("  App #"); pw.print(i);
+                            pw.print(' '); pw.print(mAppTokens.get(i)); pw.println(":");
+                    mAppTokens.get(i).dump(pw, "    ");
+                }
+            }
+            if (mExitingTokens.size() > 0) {
+                pw.println();
+                pw.println("  Exiting tokens:");
+                for (int i=mExitingTokens.size()-1; i>=0; i--) {
+                    WindowToken token = mExitingTokens.get(i);
+                    pw.print("  Exiting #"); pw.print(i);
+                    pw.print(' '); pw.print(token);
+                    pw.println(':');
+                    token.dump(pw, "    ");
+                }
+            }
+            if (mExitingAppTokens.size() > 0) {
+                pw.println();
+                pw.println("  Exiting application tokens:");
+                for (int i=mExitingAppTokens.size()-1; i>=0; i--) {
+                    WindowToken token = mExitingAppTokens.get(i);
+                    pw.print("  Exiting App #"); pw.print(i);
+                      pw.print(' '); pw.print(token);
+                      pw.println(':');
+                      token.dump(pw, "    ");
+                }
+            }
+            if (mTaskIdToTaskList.size() > 0) {
+                pw.println();
+                for (int i = 0; i < mTaskIdToTaskList.size(); ++i) {
+                    pw.print("  TaskList #"); pw.print(i);
+                      pw.print(" taskId="); pw.println(mTaskIdToTaskList.keyAt(i));
+                    pw.print("    mAppTokens=");
+                      pw.println(mTaskIdToTaskList.valueAt(i).mAppTokens);
+                    pw.println();
+                }
+            }
+        pw.print(subPrefix); pw.print("layoutNeeded="); pw.println(layoutNeeded);
         pw.println();
     }
 }
diff --git a/services/java/com/android/server/wm/DisplayMagnifier.java b/services/java/com/android/server/wm/DisplayMagnifier.java
index 6e876f6..61093ad 100644
--- a/services/java/com/android/server/wm/DisplayMagnifier.java
+++ b/services/java/com/android/server/wm/DisplayMagnifier.java
@@ -86,8 +86,8 @@
         mContext = windowManagerService.mContext;
         mWindowManagerService = windowManagerService;
         mCallbacks = callbacks;
-        mMagnifedViewport = new MagnifiedViewport();
         mHandler = new MyHandler(mWindowManagerService.mH.getLooper());
+        mMagnifedViewport = new MagnifiedViewport();
         mLongAnimationDuration = mContext.getResources().getInteger(
                 com.android.internal.R.integer.config_longAnimTime);
     }
@@ -273,6 +273,7 @@
                             mContext.getResources().getDisplayMetrics());
             mHalfBorderWidth = (int) (mBorderWidth + 0.5) / 2;
             mWindow = new ViewportWindow(mContext);
+            recomputeBoundsLocked();
         }
 
         public void updateMagnificationSpecLocked(MagnificationSpec spec) {
diff --git a/services/java/com/android/server/wm/TaskList.java b/services/java/com/android/server/wm/TaskList.java
new file mode 100644
index 0000000..fe12b98
--- /dev/null
+++ b/services/java/com/android/server/wm/TaskList.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2013 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 com.android.server.wm;
+
+import com.android.server.am.TaskGroup;
+
+class TaskList extends TaskGroup {
+//    private final String TAG = "TaskGroup";
+    AppTokenList mAppTokens = new AppTokenList();
+
+    TaskList(AppWindowToken wtoken) {
+        taskId = wtoken.groupId;
+        tokens.add(wtoken.appToken);
+        mAppTokens.add(wtoken);
+    }
+}
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index d42221e..546bf2f 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -171,9 +171,10 @@
         }
     }
 
-    private void updateAppWindowsLocked() {
+    private void updateAppWindowsLocked(int displayId) {
         int i;
-        final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
+        final DisplayContent displayContent = mService.getDisplayContentLocked(displayId);
+        final AppTokenList appTokens = displayContent.mAnimatingAppTokens;
         final int NAT = appTokens.size();
         for (i=0; i<NAT; i++) {
             final AppWindowAnimator appAnimator = appTokens.get(i).mAppAnimator;
@@ -190,9 +191,10 @@
             }
         }
 
-        final int NEAT = mService.mExitingAppTokens.size();
+        final AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
+        final int NEAT = exitingAppTokens.size();
         for (i=0; i<NEAT; i++) {
-            final AppWindowAnimator appAnimator = mService.mExitingAppTokens.get(i).mAppAnimator;
+            final AppWindowAnimator appAnimator = exitingAppTokens.get(i).mAppAnimator;
             final boolean wasAnimating = appAnimator.animation != null
                     && appAnimator.animation != AppWindowAnimator.sDummyAnimation;
             if (appAnimator.stepAnimationLocked(mCurrentTime)) {
@@ -453,10 +455,11 @@
 
     /** See if any windows have been drawn, so they (and others associated with them) can now be
      *  shown. */
-    private void testTokenMayBeDrawnLocked() {
+    private void testTokenMayBeDrawnLocked(int displayId) {
         // See if any windows have been drawn, so they (and others
         // associated with them) can now be shown.
-        final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
+        final AppTokenList appTokens =
+                mService.getDisplayContentLocked(displayId).mAnimatingAppTokens;
         final int NT = appTokens.size();
         for (int i=0; i<NT; i++) {
             AppWindowToken wtoken = appTokens.get(i);
@@ -529,11 +532,10 @@
         Surface.openTransaction();
         Surface.setAnimationTransaction();
         try {
-            updateAppWindowsLocked();
-
             final int numDisplays = mDisplayContentsAnimators.size();
             for (int i = 0; i < numDisplays; i++) {
                 final int displayId = mDisplayContentsAnimators.keyAt(i);
+                updateAppWindowsLocked(displayId);
                 DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i);
 
                 final ScreenRotationAnimation screenRotationAnimation =
@@ -559,10 +561,11 @@
                 }
             }
 
-            testTokenMayBeDrawnLocked();
-
             for (int i = 0; i < numDisplays; i++) {
                 final int displayId = mDisplayContentsAnimators.keyAt(i);
+
+                testTokenMayBeDrawnLocked(displayId);
+
                 DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i);
 
                 final ScreenRotationAnimation screenRotationAnimation =
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 4409762..62eccdf 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -54,6 +54,7 @@
 import com.android.server.EventLogTags;
 import com.android.server.Watchdog;
 import com.android.server.am.BatteryStatsService;
+import com.android.server.am.TaskGroup;
 import com.android.server.display.DisplayManagerService;
 import com.android.server.input.InputManagerService;
 import com.android.server.power.PowerManagerService;
@@ -180,7 +181,7 @@
     static final boolean DEBUG_INPUT_METHOD = false;
     static final boolean DEBUG_VISIBILITY = false;
     static final boolean DEBUG_WINDOW_MOVEMENT = false;
-    static final boolean DEBUG_TOKEN_MOVEMENT = false;
+    static final boolean DEBUG_TOKEN_MOVEMENT = true;
     static final boolean DEBUG_ORIENTATION = false;
     static final boolean DEBUG_APP_ORIENTATION = false;
     static final boolean DEBUG_CONFIGURATION = false;
@@ -333,32 +334,6 @@
             new HashMap<IBinder, WindowToken>();
 
     /**
-     * Window tokens that are in the process of exiting, but still
-     * on screen for animations.
-     */
-    final ArrayList<WindowToken> mExitingTokens = new ArrayList<WindowToken>();
-
-    /**
-     * List controlling the ordering of windows in different applications which must
-     * be kept in sync with ActivityManager.
-     */
-    final ArrayList<AppWindowToken> mAppTokens = new ArrayList<AppWindowToken>();
-
-    /**
-     * AppWindowTokens in the Z order they were in at the start of an animation. Between
-     * animations this list is maintained in the exact order of mAppTokens. If tokens
-     * are added to mAppTokens during an animation an attempt is made to insert them at the same
-     * logical location in this list. Note that this list is always in sync with mWindows.
-     */
-    ArrayList<AppWindowToken> mAnimatingAppTokens = new ArrayList<AppWindowToken>();
-
-    /**
-     * Application tokens that are in the process of exiting, but still
-     * on screen for animations.
-     */
-    final ArrayList<AppWindowToken> mExitingAppTokens = new ArrayList<AppWindowToken>();
-
-    /**
      * List of window tokens that have finished starting their application,
      * and now need to have the policy remove their windows.
      */
@@ -441,8 +416,10 @@
 
     String mLastANRState;
 
-    /** All DisplayDontents in the world, kept here */
+    /** All DisplayContents in the world, kept here */
     private SparseArray<DisplayContent> mDisplayContents = new SparseArray<DisplayContent>();
+    private SparseArray<DisplayContent> mTaskIdToDisplayContents =
+            new SparseArray<DisplayContent>();
 
     int mRotation = 0;
     int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
@@ -953,10 +930,11 @@
                         + client.asBinder() + " (token=" + token + ")");
                     // Figure out where the window should go, based on the
                     // order of applications.
-                    final int NA = mAnimatingAppTokens.size();
+                    AppTokenList animatingAppTokens = displayContent.mAnimatingAppTokens;
+                    final int NA = animatingAppTokens.size();
                     WindowState pos = null;
                     for (i=NA-1; i>=0; i--) {
-                        AppWindowToken t = mAnimatingAppTokens.get(i);
+                        AppWindowToken t = animatingAppTokens.get(i);
                         if (t == token) {
                             i--;
                             break;
@@ -992,8 +970,8 @@
                         // Continue looking down until we find the first
                         // token that has windows on this display.
                         while (i >= 0) {
-                            AppWindowToken t = mAnimatingAppTokens.get(i);
-                            tokenWindowList = getTokenWindowsOnDisplay(t, win.mDisplayContent);
+                            AppWindowToken t = animatingAppTokens.get(i);
+                            tokenWindowList = getTokenWindowsOnDisplay(t, displayContent);
                             final int NW = tokenWindowList.size();
                             if (NW > 0) {
                                 pos = tokenWindowList.get(NW-1);
@@ -3096,28 +3074,56 @@
     // Application Window Tokens
     // -------------------------------------------------------------
 
-    public void validateAppTokens(List<IBinder> tokens) {
-        int v = tokens.size()-1;
-        int m = mAppTokens.size()-1;
-        while (v >= 0 && m >= 0) {
-            AppWindowToken atoken = mAppTokens.get(m);
-            if (atoken.removed) {
+    public void validateAppTokens(List<TaskGroup> tasks) {
+        int t = tasks.size() - 1;
+        if (t < 0) {
+            Slog.w(TAG, "validateAppTokens: empty task list");
+            return;
+        }
+
+        TaskGroup task = tasks.get(0);
+        int taskId = task.taskId;
+        DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+        if (displayContent == null) {
+            Slog.w(TAG, "validateAppTokens: no Display for taskId=" + taskId);
+            return;
+        }
+        AppTokenList appTokens = displayContent.mAppTokens;
+        int m = appTokens.size() - 1;
+
+        for ( ; t >= 0; --t) {
+            task = tasks.get(t);
+            List<IApplicationToken> tokens = task.tokens;
+            int v = task.tokens.size() - 1;
+
+            DisplayContent lastDisplayContent = displayContent;
+            displayContent = mTaskIdToDisplayContents.get(taskId);
+            if (displayContent != lastDisplayContent) {
+                Slog.w(TAG, "validateAppTokens: displayContent changed in TaskGroup list!");
+                return;
+            }
+
+            while (v >= 0 && m >= 0) {
+                AppWindowToken atoken = appTokens.get(m);
+                if (atoken.removed) {
+                    m--;
+                    continue;
+                }
+                if (tokens.get(v) != atoken.token) {
+                    Slog.w(TAG, "Tokens out of sync: external is " + tokens.get(v)
+                          + " @ " + v + ", internal is " + atoken.token + " @ " + m);
+                }
+                v--;
                 m--;
-                continue;
             }
-            if (tokens.get(v) != atoken.token) {
-                Slog.w(TAG, "Tokens out of sync: external is " + tokens.get(v)
-                      + " @ " + v + ", internal is " + atoken.token + " @ " + m);
+            while (v >= 0) {
+                Slog.w(TAG, "External token not found: " + tokens.get(v) + " @ " + v);
+                v--;
             }
-            v--;
-            m--;
         }
-        while (v >= 0) {
-            Slog.w(TAG, "External token not found: " + tokens.get(v) + " @ " + v);
-            v--;
-        }
+
         while (m >= 0) {
-            AppWindowToken atoken = mAppTokens.get(m);
+            AppWindowToken atoken = appTokens.get(m);
             if (!atoken.removed) {
                 Slog.w(TAG, "Invalid internal atoken: " + atoken.token + " @ " + m);
             }
@@ -3185,6 +3191,7 @@
 
         final long origId = Binder.clearCallingIdentity();
         synchronized(mWindowMap) {
+            DisplayContent displayContent = null;
             WindowToken wtoken = mTokenMap.remove(token);
             if (wtoken != null) {
                 boolean delayed = false;
@@ -3194,6 +3201,7 @@
 
                     for (int i=0; i<N; i++) {
                         WindowState win = wtoken.windows.get(i);
+                        displayContent = win.mDisplayContent;
 
                         if (win.mWinAnimator.isAnimating()) {
                             delayed = true;
@@ -3203,13 +3211,12 @@
                             win.mWinAnimator.applyAnimationLocked(WindowManagerPolicy.TRANSIT_EXIT,
                                     false);
                             //TODO (multidisplay): Magnification is supported only for the default
-                            if (mDisplayMagnifier != null
-                                    && win.getDisplayId() == Display.DEFAULT_DISPLAY) {
+                            if (mDisplayMagnifier != null && win.isDefaultDisplay()) {
                                 mDisplayMagnifier.onWindowTransitionLocked(win,
                                         WindowManagerPolicy.TRANSIT_EXIT);
                             }
                             changed = true;
-                            win.mDisplayContent.layoutNeeded = true;
+                            displayContent.layoutNeeded = true;
                         }
                     }
 
@@ -3222,7 +3229,7 @@
                     }
 
                     if (delayed) {
-                        mExitingTokens.add(wtoken);
+                        displayContent.mExitingTokens.add(wtoken);
                     } else if (wtoken.windowType == TYPE_WALLPAPER) {
                         mWallpaperTokens.remove(wtoken);
                     }
@@ -3236,27 +3243,9 @@
         Binder.restoreCallingIdentity(origId);
     }
 
-    /**
-     *  Find the location to insert a new AppWindowToken into the window-ordered app token list.
-     *  Note that mAppTokens.size() == mAnimatingAppTokens.size() + 1.
-     * @param addPos The location the token was inserted into in mAppTokens.
-     * @param atoken The token to insert.
-     */
-    private void addAppTokenToAnimating(final int addPos, final AppWindowToken atoken) {
-        if (addPos == 0 || addPos == mAnimatingAppTokens.size()) {
-            // It was inserted into the beginning or end of mAppTokens. Honor that.
-            mAnimatingAppTokens.add(addPos, atoken);
-            return;
-        }
-        // Find the item immediately above the mAppTokens insertion point and put the token
-        // immediately below that one in mAnimatingAppTokens.
-        final AppWindowToken aboveAnchor = mAppTokens.get(addPos + 1);
-        mAnimatingAppTokens.add(mAnimatingAppTokens.indexOf(aboveAnchor), atoken);
-    }
-
     @Override
     public void addAppToken(int addPos, IApplicationToken token,
-            int groupId, int requestedOrientation, boolean fullscreen, boolean showWhenLocked) {
+            int taskId, int requestedOrientation, boolean fullscreen, boolean showWhenLocked) {
         if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
                 "addAppToken()")) {
             throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
@@ -3284,15 +3273,21 @@
             }
             atoken = new AppWindowToken(this, token);
             atoken.inputDispatchingTimeoutNanos = inputDispatchingTimeoutNanos;
-            atoken.groupId = groupId;
+            atoken.groupId = taskId;
             atoken.appFullscreen = fullscreen;
             atoken.showWhenLocked = showWhenLocked;
             atoken.requestedOrientation = requestedOrientation;
             if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken
                     + " at " + addPos);
-            mAppTokens.add(addPos, atoken);
-            addAppTokenToAnimating(addPos, atoken);
+
+            DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId);
+            if (displayContent == null) {
+                displayContent = getDefaultDisplayContentLocked();
+                mTaskIdToDisplayContents.put(taskId, displayContent);
+            }
+            displayContent.addAppToken(addPos, atoken);
             mTokenMap.put(token.asBinder(), atoken);
+            mTaskIdToDisplayContents.put(taskId, displayContent);
 
             // Application tokens start out hidden.
             atoken.hidden = true;
@@ -3315,7 +3310,7 @@
                 Slog.w(TAG, "Attempted to set group id of non-existing app token: " + token);
                 return;
             }
-            atoken.groupId = groupId;
+            mTaskIdToDisplayContents.get(atoken.groupId).setAppTaskId(atoken, groupId);
         }
     }
 
@@ -3361,8 +3356,11 @@
         boolean findingBehind = false;
         boolean haveGroup = false;
         boolean lastFullscreen = false;
-        for (int pos = mAppTokens.size() - 1; pos >= 0; pos--) {
-            AppWindowToken atoken = mAppTokens.get(pos);
+        // TODO: Multi window.
+        DisplayContent displayContent = getDefaultDisplayContentLocked();
+        AppTokenList appTokens = displayContent.mAppTokens;
+        for (int pos = appTokens.size() - 1; pos >= 0; pos--) {
+            AppWindowToken atoken = appTokens.get(pos);
 
             if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + atoken);
 
@@ -4275,7 +4273,7 @@
                     // set the token aside because it has an active animation to be finished
                     if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
                             "removeAppToken make exiting: " + wtoken);
-                    mExitingAppTokens.add(wtoken);
+                    mTaskIdToDisplayContents.get(wtoken.groupId).mExitingAppTokens.add(wtoken);
                 } else {
                     // Make sure there is no animation running on this token,
                     // so any windows associated with it will be removed as
@@ -4285,8 +4283,7 @@
                 }
                 if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
                         "removeAppToken: " + wtoken);
-                mAppTokens.remove(wtoken);
-                mAnimatingAppTokens.remove(wtoken);
+                mTaskIdToDisplayContents.get(wtoken.groupId).removeAppToken(wtoken);
                 wtoken.removed = true;
                 if (wtoken.startingData != null) {
                     startingToken = wtoken;
@@ -4338,14 +4335,26 @@
     }
 
     void dumpAppTokensLocked() {
-        for (int i=mAppTokens.size()-1; i>=0; i--) {
-            Slog.v(TAG, "  #" + i + ": " + mAppTokens.get(i).token);
+        DisplayContentsIterator iterator = new DisplayContentsIterator();
+        while (iterator.hasNext()) {
+            DisplayContent displayContent = iterator.next();
+            Slog.v(TAG, "  Display " + displayContent.getDisplayId());
+            AppTokenList appTokens = displayContent.mAppTokens;
+            for (int i=appTokens.size()-1; i>=0; i--) {
+                Slog.v(TAG, "  #" + i + ": " + appTokens.get(i).token);
+            }
         }
     }
 
     void dumpAnimatingAppTokensLocked() {
-        for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
-            Slog.v(TAG, "  #" + i + ": " + mAnimatingAppTokens.get(i).token);
+        DisplayContentsIterator iterator = new DisplayContentsIterator();
+        while (iterator.hasNext()) {
+            DisplayContent displayContent = iterator.next();
+            Slog.v(TAG, "  Display " + displayContent.getDisplayId());
+            AppTokenList appTokens = displayContent.mAnimatingAppTokens;
+            for (int i=appTokens.size()-1; i>=0; i--) {
+                Slog.v(TAG, "  #" + i + ": " + appTokens.get(i).token);
+            }
         }
     }
 
@@ -4358,10 +4367,11 @@
         }
     }
 
-    private int findWindowOffsetLocked(WindowList windows, int tokenPos) {
+    private int findWindowOffsetLocked(DisplayContent displayContent, int tokenPos) {
+        final WindowList windows = displayContent.getWindowList();
         final int NW = windows.size();
 
-        if (tokenPos >= mAnimatingAppTokens.size()) {
+        if (tokenPos >= displayContent.mAnimatingAppTokens.size()) {
             int i = NW;
             while (i > 0) {
                 i--;
@@ -4372,10 +4382,11 @@
             }
         }
 
+        final AppTokenList appTokens = displayContent.mAppTokens;
         while (tokenPos > 0) {
             // Find the first app token below the new position that has
             // a window displayed.
-            final AppWindowToken wtoken = mAppTokens.get(tokenPos-1);
+            final AppWindowToken wtoken = appTokens.get(tokenPos-1);
             if (DEBUG_REORDER) Slog.v(TAG, "Looking for lower windows @ "
                     + tokenPos + " -- " + wtoken.token);
             if (wtoken.sendingToBottom) {
@@ -4469,28 +4480,29 @@
             if (DEBUG_REORDER) Slog.v(TAG, "Initial app tokens:");
             if (DEBUG_REORDER) dumpAppTokensLocked();
             final AppWindowToken wtoken = findAppWindowToken(token);
-            final int oldIndex = mAppTokens.indexOf(wtoken);
+            DisplayContent displayContent = mTaskIdToDisplayContents.get(wtoken.groupId);
+            final AppTokenList appTokens = displayContent.mAppTokens;
+            final AppTokenList animatingAppTokens = displayContent.mAnimatingAppTokens;
+            final int oldIndex = appTokens.indexOf(wtoken);
             if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG,
                     "Start moving token " + wtoken + " initially at "
                     + oldIndex);
             if (oldIndex > index && mAppTransition.isTransitionSet()) {
                 // animation towards back has not started, copy old list for duration of animation.
-                mAnimatingAppTokens.clear();
-                mAnimatingAppTokens.addAll(mAppTokens);
+                displayContent.refillAnimatingAppTokens();
             }
-            if (wtoken == null || !mAppTokens.remove(wtoken)) {
+            if (wtoken == null || !appTokens.remove(wtoken)) {
                 Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
                       + token + " (" + wtoken + ")");
                 return;
             }
-            mAppTokens.add(index, wtoken);
+            appTokens.add(index, wtoken);
             if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":");
             else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index);
             if (DEBUG_REORDER) dumpAppTokensLocked();
             if (!mAppTransition.isTransitionSet()) {
                 // Not animating, bring animating app list in line with mAppTokens.
-                mAnimatingAppTokens.clear();
-                mAnimatingAppTokens.addAll(mAppTokens);
+                displayContent.refillAnimatingAppTokens();
 
                 // Bring window ordering, window focus and input window in line with new app token
                 final long origId = Binder.clearCallingIdentity();
@@ -4501,9 +4513,8 @@
                     if (DEBUG_REORDER) dumpWindowsLocked();
                     DisplayContentsIterator iterator = new DisplayContentsIterator();
                     while(iterator.hasNext()) {
-                        final DisplayContent displayContent = iterator.next();
-                        final WindowList windows = displayContent.getWindowList();
-                        final int pos = findWindowOffsetLocked(windows, index);
+                        displayContent = iterator.next();
+                        final int pos = findWindowOffsetLocked(displayContent, index);
                         final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken);
                         if (pos != newPos) {
                             displayContent.layoutNeeded = true;
@@ -4530,18 +4541,22 @@
         for (int i=0; i<N; i++) {
             IBinder token = tokens.get(i);
             final AppWindowToken wtoken = findAppWindowToken(token);
-            if (DEBUG_REORDER || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
-                    "Temporarily removing " + wtoken + " from " + mAppTokens.indexOf(wtoken));
-            if (!mAppTokens.remove(wtoken)) {
-                Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
-                      + token + " (" + wtoken + ")");
-                i--;
-                N--;
+            if (wtoken != null) {
+                final DisplayContent displayContent = mTaskIdToDisplayContents.get(wtoken.groupId);
+                if (DEBUG_REORDER || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Temporarily removing "
+                        + wtoken + " from " + displayContent.mAppTokens.indexOf(wtoken));
+                if (!displayContent.mAppTokens.remove(wtoken)) {
+                    Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
+                            + token + " (" + wtoken + ")");
+                    i--;
+                    N--;
+                }
             }
         }
     }
 
-    private void moveAppWindowsLocked(List<IBinder> tokens, int tokenPos) {
+    private void moveAppWindowsLocked(List<IBinder> tokens, DisplayContent displayContent,
+            int tokenPos) {
         // First remove all of the windows from the list.
         final int N = tokens.size();
         int i;
@@ -4553,26 +4568,21 @@
         }
 
         // And now add them back at the correct place.
-        DisplayContentsIterator iterator = new DisplayContentsIterator();
-        while (iterator.hasNext()) {
-            final DisplayContent displayContent = iterator.next();
-            final WindowList windows = displayContent.getWindowList();
-            // Where to start adding?
-            int pos = findWindowOffsetLocked(windows, tokenPos);
-            for (i=0; i<N; i++) {
-                WindowToken token = mTokenMap.get(tokens.get(i));
-                if (token != null) {
-                    final int newPos = reAddAppWindowsLocked(displayContent, pos, token);
-                    if (newPos != pos) {
-                        displayContent.layoutNeeded = true;
-                    }
-                    pos = newPos;
+        // Where to start adding?
+        int pos = findWindowOffsetLocked(displayContent, tokenPos);
+        for (i=0; i<N; i++) {
+            WindowToken token = mTokenMap.get(tokens.get(i));
+            if (token != null) {
+                final int newPos = reAddAppWindowsLocked(displayContent, pos, token);
+                if (newPos != pos) {
+                    displayContent.layoutNeeded = true;
                 }
+                pos = newPos;
             }
-            if (!updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
-                    false /*updateInputWindows*/)) {
-                assignLayersLocked(windows);
-            }
+        }
+        if (!updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
+            false /*updateInputWindows*/)) {
+            assignLayersLocked(displayContent.getWindowList());
         }
 
         mInputMonitor.setUpdateInputWindowsNeededLw();
@@ -4594,23 +4604,28 @@
 
         final long origId = Binder.clearCallingIdentity();
         synchronized(mWindowMap) {
+            DisplayContent displayContent = null;
             removeAppTokensLocked(tokens);
             final int N = tokens.size();
             for (int i=0; i<N; i++) {
                 AppWindowToken wt = findAppWindowToken(tokens.get(i));
                 if (wt != null) {
-                    if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG,
-                            "Adding next to top: " + wt);
-                    mAppTokens.add(wt);
+                    if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) {
+                        Slog.v(TAG, "Adding next to top: " + wt);
+                        if (displayContent != null &&
+                                displayContent != mTaskIdToDisplayContents.get(wt.groupId)) Slog.e(
+                                    TAG, "moveAppTokensToTop: Not all tokens on same display");
+                    }
+                    displayContent = mTaskIdToDisplayContents.get(wt.groupId);
+                    displayContent.mAppTokens.add(wt);
                     if (mAppTransition.isTransitionSet()) {
                         wt.sendingToBottom = false;
                     }
                 }
             }
 
-            mAnimatingAppTokens.clear();
-            mAnimatingAppTokens.addAll(mAppTokens);
-            moveAppWindowsLocked(tokens, mAppTokens.size());
+            displayContent.refillAnimatingAppTokens();
+            moveAppWindowsLocked(tokens, displayContent, displayContent.mAppTokens.size());
         }
         Binder.restoreCallingIdentity(origId);
     }
@@ -4624,20 +4639,29 @@
 
         final long origId = Binder.clearCallingIdentity();
         synchronized(mWindowMap) {
+            DisplayContent displayContent = null;
             final int N = tokens.size();
             if (N > 0) {
                 // animating towards back, hang onto old list for duration of animation.
-                mAnimatingAppTokens.clear();
-                mAnimatingAppTokens.addAll(mAppTokens);
+                AppWindowToken wt = findAppWindowToken(tokens.get(0));
+                if (wt != null) {
+                    displayContent = mTaskIdToDisplayContents.get(wt.groupId);
+                    displayContent.refillAnimatingAppTokens();
+                }
             }
             removeAppTokensLocked(tokens);
             int pos = 0;
             for (int i=0; i<N; i++) {
                 AppWindowToken wt = findAppWindowToken(tokens.get(i));
                 if (wt != null) {
-                    if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
-                            "Adding next to bottom: " + wt + " at " + pos);
-                    mAppTokens.add(pos, wt);
+                    if (DEBUG_TOKEN_MOVEMENT) {
+                        Slog.v(TAG, "Adding next to bottom: " + wt + " at " + pos);
+                        if (displayContent != null &&
+                                displayContent != mTaskIdToDisplayContents.get(wt.groupId)) Slog.e(
+                                    TAG, "moveAppTokensToBottom: Not all tokens on same display");
+                    }
+                    displayContent = mTaskIdToDisplayContents.get(wt.groupId);
+                    displayContent.mAppTokens.add(pos, wt);
                     if (mAppTransition.isTransitionSet()) {
                         wt.sendingToBottom = true;
                     }
@@ -4645,9 +4669,8 @@
                 }
             }
 
-            mAnimatingAppTokens.clear();
-            mAnimatingAppTokens.addAll(mAppTokens);
-            moveAppWindowsLocked(tokens, 0);
+            displayContent.refillAnimatingAppTokens();
+            moveAppWindowsLocked(tokens, displayContent, 0);
         }
         Binder.restoreCallingIdentity(origId);
     }
@@ -6894,8 +6917,7 @@
                         if (mAppTransition.isTransitionSet()) {
                             if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "*** APP TRANSITION TIMEOUT");
                             mAppTransition.setTimeout();
-                            mAnimatingAppTokens.clear();
-                            mAnimatingAppTokens.addAll(mAppTokens);
+                            getDefaultDisplayContentLocked().refillAnimatingAppTokens();
                             performLayoutAndPlaceSurfacesLocked();
                         }
                     }
@@ -6940,10 +6962,12 @@
                 case APP_FREEZE_TIMEOUT: {
                     synchronized (mWindowMap) {
                         Slog.w(TAG, "App freeze timeout expired.");
-                        int i = mAppTokens.size();
+                        DisplayContent displayContent = getDefaultDisplayContentLocked();
+                        AppTokenList appTokens = displayContent.mAppTokens;
+                        int i = appTokens.size();
                         while (i > 0) {
                             i--;
-                            AppWindowToken tok = mAppTokens.get(i);
+                            AppWindowToken tok = appTokens.get(i);
                             if (tok.mAppAnimator.freezingScreen) {
                                 Slog.w(TAG, "Force clearing freeze: " + tok);
                                 unsetAppFreezingScreenLocked(tok, true, true);
@@ -7397,15 +7421,17 @@
         // in the main app list, but still have windows shown.  We put them
         // in the back because now that the animation is over we no longer
         // will care about them.
-        int NT = mExitingAppTokens.size();
+        AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
+        int NT = exitingAppTokens.size();
         for (int j=0; j<NT; j++) {
-            i = reAddAppWindowsLocked(displayContent, i, mExitingAppTokens.get(j));
+            i = reAddAppWindowsLocked(displayContent, i, exitingAppTokens.get(j));
         }
 
         // And add in the still active app tokens in Z order.
-        NT = mAnimatingAppTokens.size();
+        AppTokenList animatingAppTokens = displayContent.mAnimatingAppTokens;
+        NT = animatingAppTokens.size();
         for (int j=0; j<NT; j++) {
-            i = reAddAppWindowsLocked(displayContent, i, mAnimatingAppTokens.get(j));
+            i = reAddAppWindowsLocked(displayContent, i, animatingAppTokens.get(j));
         }
 
         i -= lastBelow;
@@ -8071,11 +8097,12 @@
 
         mAppTransition.setIdle();
         // Restore window app tokens to the ActivityManager views
-        for (int i = mAnimatingAppTokens.size() - 1; i >= 0; i--) {
-            mAnimatingAppTokens.get(i).sendingToBottom = false;
+        final DisplayContent displayContent = getDefaultDisplayContentLocked();
+        final AppTokenList animatingAppTokens = displayContent.mAnimatingAppTokens;
+        for (int i = animatingAppTokens.size() - 1; i >= 0; i--) {
+            animatingAppTokens.get(i).sendingToBottom = false;
         }
-        mAnimatingAppTokens.clear();
-        mAnimatingAppTokens.addAll(mAppTokens);
+        displayContent.refillAnimatingAppTokens();
         rebuildAppWindowListLocked();
 
         changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
@@ -8229,10 +8256,10 @@
         }
     }
 
-    private void updateAllDrawnLocked() {
+    private void updateAllDrawnLocked(DisplayContent displayContent) {
         // See if any windows have been drawn, so they (and others
         // associated with them) can now be shown.
-        final ArrayList<AppWindowToken> appTokens = mAnimatingAppTokens;
+        final AppTokenList appTokens = displayContent.mAnimatingAppTokens;
         final int NT = appTokens.size();
         for (int i=0; i<NT; i++) {
             AppWindowToken wtoken = appTokens.get(i);
@@ -8267,13 +8294,17 @@
         }
 
         // Initialize state of exiting tokens.
-        for (i=mExitingTokens.size()-1; i>=0; i--) {
-            mExitingTokens.get(i).hasVisible = false;
-        }
+        DisplayContentsIterator iterator = new DisplayContentsIterator();
+        while (iterator.hasNext()) {
+            final DisplayContent displayContent = iterator.next();
+            for (i=displayContent.mExitingTokens.size()-1; i>=0; i--) {
+                displayContent.mExitingTokens.get(i).hasVisible = false;
+            }
 
-        // Initialize state of exiting applications.
-        for (i=mExitingAppTokens.size()-1; i>=0; i--) {
-            mExitingAppTokens.get(i).hasVisible = false;
+            // Initialize state of exiting applications.
+            for (i=displayContent.mExitingAppTokens.size()-1; i>=0; i--) {
+                displayContent.mExitingAppTokens.get(i).hasVisible = false;
+            }
         }
 
         mInnerFields.mHoldScreen = null;
@@ -8302,10 +8333,10 @@
             }
 
             boolean focusDisplayed = false;
-            boolean updateAllDrawn = false;
 
-            DisplayContentsIterator iterator = new DisplayContentsIterator();
+            iterator = new DisplayContentsIterator();
             while (iterator.hasNext()) {
+                boolean updateAllDrawn = false;
                 final DisplayContent displayContent = iterator.next();
                 WindowList windows = displayContent.getWindowList();
                 DisplayInfo displayInfo = displayContent.getDisplayInfo();
@@ -8549,10 +8580,10 @@
                 if (!mInnerFields.mDimming && mAnimator.isDimmingLocked(displayId)) {
                     stopDimmingLocked(displayId);
                 }
-            }
 
-            if (updateAllDrawn) {
-                updateAllDrawnLocked();
+                if (updateAllDrawn) {
+                    updateAllDrawnLocked(displayContent);
+                }
             }
 
             if (focusDisplayed) {
@@ -8697,30 +8728,36 @@
         }
 
         // Time to remove any exiting tokens?
-        for (i=mExitingTokens.size()-1; i>=0; i--) {
-            WindowToken token = mExitingTokens.get(i);
-            if (!token.hasVisible) {
-                mExitingTokens.remove(i);
-                if (token.windowType == TYPE_WALLPAPER) {
-                    mWallpaperTokens.remove(token);
+        iterator = new DisplayContentsIterator();
+        while (iterator.hasNext()) {
+            final DisplayContent displayContent = iterator.next();
+            ArrayList<WindowToken> exitingTokens = displayContent.mExitingTokens;
+            for (i = exitingTokens.size() - 1; i >= 0; i--) {
+                WindowToken token = exitingTokens.get(i);
+                if (!token.hasVisible) {
+                    exitingTokens.remove(i);
+                    if (token.windowType == TYPE_WALLPAPER) {
+                        mWallpaperTokens.remove(token);
+                    }
                 }
             }
-        }
 
-        // Time to remove any exiting applications?
-        for (i=mExitingAppTokens.size()-1; i>=0; i--) {
-            AppWindowToken token = mExitingAppTokens.get(i);
-            if (!token.hasVisible && !mClosingApps.contains(token)) {
-                // Make sure there is no animation running on this token,
-                // so any windows associated with it will be removed as
-                // soon as their animations are complete
-                token.mAppAnimator.clearAnimation();
-                token.mAppAnimator.animating = false;
-                if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
-                        "performLayout: App token exiting now removed" + token);
-                mAppTokens.remove(token);
-                mAnimatingAppTokens.remove(token);
-                mExitingAppTokens.remove(i);
+            // Time to remove any exiting applications?
+            AppTokenList exitingAppTokens = displayContent.mExitingAppTokens;
+            for (i = exitingAppTokens.size() - 1; i >= 0; i--) {
+                AppWindowToken token = exitingAppTokens.get(i);
+                if (!token.hasVisible && !mClosingApps.contains(token)) {
+                    // Make sure there is no animation running on this token,
+                    // so any windows associated with it will be removed as
+                    // soon as their animations are complete
+                    token.mAppAnimator.clearAnimation();
+                    token.mAppAnimator.animating = false;
+                    if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
+                            "performLayout: App token exiting now removed" + token);
+                    displayContent.mAppTokens.remove(token);
+                    displayContent.mAnimatingAppTokens.remove(token);
+                    exitingAppTokens.remove(i);
+                }
             }
         }
 
@@ -8740,7 +8777,7 @@
             defaultDisplay.layoutNeeded = true;
         }
 
-        DisplayContentsIterator iterator = new DisplayContentsIterator();
+        iterator = new DisplayContentsIterator();
         while (iterator.hasNext()) {
             DisplayContent displayContent = iterator.next();
             if (displayContent.pendingLayoutChanges != 0) {
@@ -9155,8 +9192,9 @@
     }
 
     private WindowState findFocusedWindowLocked(DisplayContent displayContent) {
-        int nextAppIndex = mAppTokens.size()-1;
-        WindowToken nextApp = nextAppIndex >= 0 ? mAppTokens.get(nextAppIndex) : null;
+        final AppTokenList appTokens = displayContent.mAppTokens;
+        int nextAppIndex = appTokens.size()-1;
+        WindowToken nextApp = nextAppIndex >= 0 ? appTokens.get(nextAppIndex) : null;
 
         final WindowList windows = displayContent.getWindowList();
         for (int i = windows.size() - 1; i >= 0; i--) {
@@ -9192,7 +9230,7 @@
                         return null;
                     }
                     nextAppIndex--;
-                    nextApp = mAppTokens.get(nextAppIndex);
+                    nextApp = appTokens.get(nextAppIndex);
                     if (nextApp == thisApp) {
                         break;
                     }
@@ -9202,7 +9240,7 @@
                     // happen, but if it does we can get totally hosed...
                     // so restart at the original app.
                     nextAppIndex = origAppIndex;
-                    nextApp = mAppTokens.get(nextAppIndex);
+                    nextApp = appTokens.get(nextAppIndex);
                 }
             }
 
@@ -9567,15 +9605,6 @@
                 }
             }
         }
-        if (mAppTokens.size() > 0) {
-            pw.println();
-            pw.println("  Application tokens in Z order:");
-            for (int i=mAppTokens.size()-1; i>=0; i--) {
-                pw.print("  App #"); pw.print(i);
-                        pw.print(' '); pw.print(mAppTokens.get(i)); pw.println(":");
-                mAppTokens.get(i).dump(pw, "    ");
-            }
-        }
         if (mFinishedStarting.size() > 0) {
             pw.println();
             pw.println("  Finishing start of application tokens:");
@@ -9591,41 +9620,13 @@
                 }
             }
         }
-        if (mExitingTokens.size() > 0) {
-            pw.println();
-            pw.println("  Exiting tokens:");
-            for (int i=mExitingTokens.size()-1; i>=0; i--) {
-                WindowToken token = mExitingTokens.get(i);
-                pw.print("  Exiting #"); pw.print(i);
-                        pw.print(' '); pw.print(token);
-                if (dumpAll) {
-                    pw.println(':');
-                    token.dump(pw, "    ");
-                } else {
-                    pw.println();
-                }
-            }
-        }
-        if (mExitingAppTokens.size() > 0) {
-            pw.println();
-            pw.println("  Exiting application tokens:");
-            for (int i=mExitingAppTokens.size()-1; i>=0; i--) {
-                WindowToken token = mExitingAppTokens.get(i);
-                pw.print("  Exiting App #"); pw.print(i);
-                        pw.print(' '); pw.print(token);
-                if (dumpAll) {
-                    pw.println(':');
-                    token.dump(pw, "    ");
-                } else {
-                    pw.println();
-                }
-            }
-        }
-        if (mAppTransition.isRunning() && mAnimatingAppTokens.size() > 0) {
+        final AppTokenList animatingAppTokens =
+                getDefaultDisplayContentLocked().mAnimatingAppTokens;
+        if (mAppTransition.isRunning() && animatingAppTokens.size() > 0) {
             pw.println();
             pw.println("  Application tokens during animation:");
-            for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
-                WindowToken token = mAnimatingAppTokens.get(i);
+            for (int i=animatingAppTokens.size()-1; i>=0; i--) {
+                WindowToken token = animatingAppTokens.get(i);
                 pw.print("  App moving to bottom #"); pw.print(i);
                         pw.print(' '); pw.print(token);
                 if (dumpAll) {
diff --git a/services/java/com/android/server/wm/WindowToken.java b/services/java/com/android/server/wm/WindowToken.java
index bd0ace8..2267123 100644
--- a/services/java/com/android/server/wm/WindowToken.java
+++ b/services/java/com/android/server/wm/WindowToken.java
@@ -19,7 +19,6 @@
 import android.os.IBinder;
 
 import java.io.PrintWriter;
-import java.util.ArrayList;
 
 /**
  * Container of a set of related windows in the window manager.  Often this
diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl
new file mode 100644
index 0000000..647f014
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/ISms.aidl
@@ -0,0 +1,218 @@
+/*
+** 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 com.android.internal.telephony;
+
+import android.app.PendingIntent;
+import com.android.internal.telephony.SmsRawData;
+
+/** Interface for applications to access the ICC phone book.
+ *
+ * <p>The following code snippet demonstrates a static method to
+ * retrieve the ISms interface from Android:</p>
+ * <pre>private static ISms getSmsInterface()
+            throws DeadObjectException {
+    IServiceManager sm = ServiceManagerNative.getDefault();
+    ISms ss;
+    ss = ISms.Stub.asInterface(sm.getService("isms"));
+    return ss;
+}
+ * </pre>
+ */
+
+interface ISms {
+    /**
+     * Retrieves all messages currently stored on ICC.
+     *
+     * @return list of SmsRawData of all sms on ICC
+     */
+     List<SmsRawData> getAllMessagesFromIccEf(String callingPkg);
+
+    /**
+     * Update the specified message on the ICC.
+     *
+     * @param messageIndex record index of message to update
+     * @param newStatus new message status (STATUS_ON_ICC_READ,
+     *                  STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT,
+     *                  STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE)
+     * @param pdu the raw PDU to store
+     * @return success or not
+     *
+     */
+     boolean updateMessageOnIccEf(String callingPkg, int messageIndex, int newStatus,
+            in byte[] pdu);
+
+    /**
+     * Copy a raw SMS PDU to the ICC.
+     *
+     * @param pdu the raw PDU to store
+     * @param status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD,
+     *               STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT)
+     * @return success or not
+     *
+     */
+    boolean copyMessageToIccEf(String callingPkg, int status, in byte[] pdu, in byte[] smsc);
+
+    /**
+     * Send a data SMS.
+     *
+     * @param smsc the SMSC to send the message through, or NULL for the
+     *  default SMSC
+     * @param data the body of the message to send
+     * @param sentIntent if not NULL this <code>PendingIntent</code> is
+     *  broadcast when the message is sucessfully sent, or failed.
+     *  The result code will be <code>Activity.RESULT_OK<code> for success,
+     *  or one of these errors:<br>
+     *  <code>RESULT_ERROR_GENERIC_FAILURE</code><br>
+     *  <code>RESULT_ERROR_RADIO_OFF</code><br>
+     *  <code>RESULT_ERROR_NULL_PDU</code><br>
+     *  For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include
+     *  the extra "errorCode" containing a radio technology specific value,
+     *  generally only useful for troubleshooting.<br>
+     *  The per-application based SMS control checks sentIntent. If sentIntent
+     *  is NULL the caller will be checked against all unknown applicaitons,
+     *  which cause smaller number of SMS to be sent in checking period.
+     * @param deliveryIntent if not NULL this <code>PendingIntent</code> is
+     *  broadcast when the message is delivered to the recipient.  The
+     *  raw pdu of the status report is in the extended data ("pdu").
+     */
+    void sendData(String callingPkg, in String destAddr, in String scAddr, in int destPort,
+            in byte[] data, in PendingIntent sentIntent, in PendingIntent deliveryIntent);
+
+    /**
+     * Send an SMS.
+     *
+     * @param smsc the SMSC to send the message through, or NULL for the
+     *  default SMSC
+     * @param text the body of the message to send
+     * @param sentIntent if not NULL this <code>PendingIntent</code> is
+     *  broadcast when the message is sucessfully sent, or failed.
+     *  The result code will be <code>Activity.RESULT_OK<code> for success,
+     *  or one of these errors:<br>
+     *  <code>RESULT_ERROR_GENERIC_FAILURE</code><br>
+     *  <code>RESULT_ERROR_RADIO_OFF</code><br>
+     *  <code>RESULT_ERROR_NULL_PDU</code><br>
+     *  For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include
+     *  the extra "errorCode" containing a radio technology specific value,
+     *  generally only useful for troubleshooting.<br>
+     *  The per-application based SMS control checks sentIntent. If sentIntent
+     *  is NULL the caller will be checked against all unknown applications,
+     *  which cause smaller number of SMS to be sent in checking period.
+     * @param deliveryIntent if not NULL this <code>PendingIntent</code> is
+     *  broadcast when the message is delivered to the recipient.  The
+     *  raw pdu of the status report is in the extended data ("pdu").
+     */
+    void sendText(String callingPkg, in String destAddr, in String scAddr, in String text,
+            in PendingIntent sentIntent, in PendingIntent deliveryIntent);
+
+    /**
+     * Send a multi-part text based SMS.
+     *
+     * @param destinationAddress the address to send the message to
+     * @param scAddress is the service center address or null to use
+     *   the current default SMSC
+     * @param parts an <code>ArrayList</code> of strings that, in order,
+     *   comprise the original message
+     * @param sentIntents if not null, an <code>ArrayList</code> of
+     *   <code>PendingIntent</code>s (one for each message part) that is
+     *   broadcast when the corresponding message part has been sent.
+     *   The result code will be <code>Activity.RESULT_OK<code> for success,
+     *   or one of these errors:
+     *   <code>RESULT_ERROR_GENERIC_FAILURE</code>
+     *   <code>RESULT_ERROR_RADIO_OFF</code>
+     *   <code>RESULT_ERROR_NULL_PDU</code>.
+     * @param deliveryIntents if not null, an <code>ArrayList</code> of
+     *   <code>PendingIntent</code>s (one for each message part) that is
+     *   broadcast when the corresponding message part has been delivered
+     *   to the recipient.  The raw pdu of the status report is in the
+     *   extended data ("pdu").
+     */
+    void sendMultipartText(String callingPkg, in String destinationAddress, in String scAddress,
+            in List<String> parts, in List<PendingIntent> sentIntents,
+            in List<PendingIntent> deliveryIntents);
+
+    /**
+     * Enable reception of cell broadcast (SMS-CB) messages with the given
+     * message identifier. Note that if two different clients enable the same
+     * message identifier, they must both disable it for the device to stop
+     * receiving those messages.
+     *
+     * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @return true if successful, false otherwise
+     *
+     * @see #disableCellBroadcast(int)
+     */
+    boolean enableCellBroadcast(int messageIdentifier);
+
+    /**
+     * Disable reception of cell broadcast (SMS-CB) messages with the given
+     * message identifier. Note that if two different clients enable the same
+     * message identifier, they must both disable it for the device to stop
+     * receiving those messages.
+     *
+     * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @return true if successful, false otherwise
+     *
+     * @see #enableCellBroadcast(int)
+     */
+    boolean disableCellBroadcast(int messageIdentifier);
+
+    /*
+     * Enable reception of cell broadcast (SMS-CB) messages with the given
+     * message identifier range. Note that if two different clients enable
+     * a message identifier range, they must both disable it for the device
+     * to stop receiving those messages.
+     *
+     * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @return true if successful, false otherwise
+     *
+     * @see #disableCellBroadcastRange(int, int)
+     */
+    boolean enableCellBroadcastRange(int startMessageId, int endMessageId);
+
+    /**
+     * Disable reception of cell broadcast (SMS-CB) messages with the given
+     * message identifier range. Note that if two different clients enable
+     * a message identifier range, they must both disable it for the device
+     * to stop receiving those messages.
+     *
+     * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @return true if successful, false otherwise
+     *
+     * @see #enableCellBroadcastRange(int, int)
+     */
+    boolean disableCellBroadcastRange(int startMessageId, int endMessageId);
+
+    /**
+     * Returns the premium SMS send permission for the specified package.
+     * Requires system permission.
+     */
+    int getPremiumSmsPermission(String packageName);
+
+    /**
+     * Set the SMS send permission for the specified package.
+     * Requires system permission.
+     */
+    void setPremiumSmsPermission(String packageName, int permission);
+}
diff --git a/telephony/java/com/android/internal/telephony/SmsRawData.aidl b/telephony/java/com/android/internal/telephony/SmsRawData.aidl
new file mode 100644
index 0000000..b0b3e4f
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/SmsRawData.aidl
@@ -0,0 +1,19 @@
+/*
+** 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 com.android.internal.telephony;
+
+parcelable SmsRawData;
diff --git a/telephony/java/com/android/internal/telephony/SmsRawData.java b/telephony/java/com/android/internal/telephony/SmsRawData.java
new file mode 100644
index 0000000..891d942
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/SmsRawData.java
@@ -0,0 +1,62 @@
+/*
+** 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 com.android.internal.telephony;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ *  A parcelable holder class of byte[] for ISms aidl implementation
+ */
+public class SmsRawData implements Parcelable {
+    byte[] data;
+
+    //Static Methods
+    public static final Parcelable.Creator<SmsRawData> CREATOR
+            = new Parcelable.Creator<SmsRawData> (){
+        public SmsRawData createFromParcel(Parcel source) {
+            int size;
+            size = source.readInt();
+            byte[] data = new byte[size];
+            source.readByteArray(data);
+            return new SmsRawData(data);
+        }
+
+        public SmsRawData[] newArray(int size) {
+            return new SmsRawData[size];
+        }
+    };
+
+    // Constructor
+    public SmsRawData(byte[] data) {
+        this.data = data;
+    }
+
+    public byte[] getBytes() {
+        return data;
+    }
+
+    public int describeContents() {
+        return 0;
+    }
+
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(data.length);
+        dest.writeByteArray(data);
+    }
+}