Merge "glFinish to flush deletes" into lmp-dev
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 5f3ed61..25c4897 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -745,6 +745,11 @@
         public View findViewById(int id) {
             return Activity.this.findViewById(id);
         }
+        @Override
+        public boolean hasView() {
+            Window window = Activity.this.getWindow();
+            return (window != null && window.peekDecorView() != null);
+        }
     };
 
     // Most recent call to requestVisibleBehind().
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index 137f77d..540376e 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -219,7 +219,9 @@
 
     protected void viewsReady(ArrayMap<String, View> sharedElements) {
         sharedElements.retainAll(mAllSharedElementNames);
-        mListener.onMapSharedElements(mAllSharedElementNames, sharedElements);
+        if (mListener != null) {
+            mListener.onMapSharedElements(mAllSharedElementNames, sharedElements);
+        }
         mSharedElementNames.addAll(sharedElements.keySet());
         mSharedElements.addAll(sharedElements.values());
         if (getViewsTransition() != null && mTransitioningViews != null) {
@@ -461,7 +463,8 @@
         if (sharedElementState != null) {
             Matrix tempMatrix = new Matrix();
             RectF tempRect = new RectF();
-            for (int i = 0; i < mSharedElementNames.size(); i++) {
+            final int numSharedElements = mSharedElements.size();
+            for (int i = 0; i < numSharedElements; i++) {
                 View sharedElement = mSharedElements.get(i);
                 String name = mSharedElementNames.get(i);
                 SharedElementOriginalState originalState = getOldSharedElementState(sharedElement,
@@ -471,12 +474,16 @@
                         tempMatrix, tempRect, null);
             }
         }
-        mListener.onSharedElementStart(mSharedElementNames, mSharedElements, snapshots);
+        if (mListener != null) {
+            mListener.onSharedElementStart(mSharedElementNames, mSharedElements, snapshots);
+        }
         return originalImageState;
     }
 
     protected void notifySharedElementEnd(ArrayList<View> snapshots) {
-        mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, snapshots);
+        if (mListener != null) {
+            mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, snapshots);
+        }
     }
 
     protected void scheduleSetSharedElementEnd(final ArrayList<View> snapshots) {
@@ -544,7 +551,7 @@
             if (sharedElementBundle != null) {
                 Parcelable parcelable = sharedElementBundle.getParcelable(KEY_SNAPSHOT);
                 View snapshot = null;
-                if (parcelable != null) {
+                if (parcelable != null && mListener != null) {
                     snapshot = mListener.onCreateSnapshotView(context, parcelable);
                 }
                 if (snapshot != null) {
@@ -659,7 +666,11 @@
         sharedElementBundle.putFloat(KEY_TRANSLATION_Z, view.getTranslationZ());
         sharedElementBundle.putFloat(KEY_ELEVATION, view.getElevation());
 
-        Parcelable bitmap = mListener.onCaptureSharedElementSnapshot(view, tempMatrix, tempBounds);
+        Parcelable bitmap = null;
+        if (mListener != null) {
+            bitmap = mListener.onCaptureSharedElementSnapshot(view, tempMatrix, tempBounds);
+        }
+
         if (bitmap != null) {
             sharedElementBundle.putParcelable(KEY_SNAPSHOT, bitmap);
         }
diff --git a/core/java/android/app/BackStackRecord.java b/core/java/android/app/BackStackRecord.java
index 832e1e3..8644c3d 100644
--- a/core/java/android/app/BackStackRecord.java
+++ b/core/java/android/app/BackStackRecord.java
@@ -868,6 +868,9 @@
      */
     private void calculateFragments(SparseArray<Fragment> firstOutFragments,
             SparseArray<Fragment> lastInFragments) {
+        if (!mManager.mContainer.hasView()) {
+            return; // nothing to see, so no transitions
+        }
         Op op = mHead;
         while (op != null) {
             switch (op.cmd) {
@@ -923,6 +926,9 @@
      */
     public void calculateBackFragments(SparseArray<Fragment> firstOutFragments,
             SparseArray<Fragment> lastInFragments) {
+        if (!mManager.mContainer.hasView()) {
+            return; // nothing to see, so no transitions
+        }
         Op op = mHead;
         while (op != null) {
             switch (op.cmd) {
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index 16a3575..216d6ba 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -306,7 +306,9 @@
         ArrayList<String> rejectedNames = new ArrayList<String>(mAllSharedElementNames);
         rejectedNames.removeAll(mSharedElementNames);
         ArrayList<View> rejectedSnapshots = createSnapshots(sharedElementState, rejectedNames);
-        mListener.onRejectSharedElements(rejectedSnapshots);
+        if (mListener != null) {
+            mListener.onRejectSharedElements(rejectedSnapshots);
+        }
         startRejectedAnimations(rejectedSnapshots);
 
         // Now start shared element transition
diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java
index 812dfdb..d4d3eda 100644
--- a/core/java/android/app/ExitTransitionCoordinator.java
+++ b/core/java/android/app/ExitTransitionCoordinator.java
@@ -181,7 +181,10 @@
                 });
         setGhostVisibility(View.INVISIBLE);
         scheduleGhostVisibilityChange(View.INVISIBLE);
-        mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, sharedElementSnapshots);
+        if (mListener != null) {
+            mListener.onSharedElementEnd(mSharedElementNames, mSharedElements,
+                    sharedElementSnapshots);
+        }
         TransitionManager.beginDelayedTransition(decorView, transition);
         scheduleGhostVisibilityChange(View.VISIBLE);
         setGhostVisibility(View.VISIBLE);
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index a95abab..5196834 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -2015,6 +2015,11 @@
                 }
                 return mView.findViewById(id);
             }
+
+            @Override
+            public boolean hasView() {
+                return (mView != null);
+            }
         }, this);
     }
 
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index ef69fdd..fc761fe 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -395,6 +395,7 @@
  */
 interface FragmentContainer {
     public View findViewById(int id);
+    public boolean hasView();
 }
 
 /**
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 027eb2c..2eba29a 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -2408,8 +2408,8 @@
     }
 
     /**
-     * Sets the name of the Managed profile. In the device owner case it sets the name of the user
-     * which it is called from. Only the profile owner or device owner can call this. If this is
+     * Sets the name of the profile. In the device owner case it sets the name of the user
+     * which it is called from. Only a profile owner or device owner can call this. If this is
      * never called by the profile or device owner, the name will be set to default values.
      *
      * @see #isProfileOwnerApp
@@ -2428,9 +2428,9 @@
 }
 
     /**
-     * Used to determine if a particular package is registered as the Profile Owner for the
+     * Used to determine if a particular package is registered as the profile owner for the
      * current user. A profile owner is a special device admin that has additional privileges
-     * within the managed profile.
+     * within the profile.
      *
      * @param packageName The package name of the app to compare with the registered profile owner.
      * @return Whether or not the package is registered as the profile owner.
@@ -2568,7 +2568,7 @@
 
     /**
      * Called by a profile or device owner to set the application restrictions for a given target
-     * application running in the managed profile.
+     * application running in the profile.
      *
      * <p>The provided {@link Bundle} consists of key-value pairs, where the types of values may be
      * boolean, int, String, or String[].
@@ -2643,8 +2643,8 @@
     }
 
     /**
-     * Called by a profile owner to set whether caller-Id information from the managed
-     * profile will be shown for incoming calls.
+     * Called by a profile owner of a managed profile to set whether caller-Id information from
+     * the managed profile will be shown in the parent profile, for incoming calls.
      *
      * <p>The calling device admin must be a profile owner. If it is not, a
      * security exception will be thrown.
@@ -2663,7 +2663,8 @@
     }
 
     /**
-     * Determine whether or not caller-Id information has been disabled.
+     * Called by a profile owner of a managed profile to determine whether or not caller-Id
+     * information has been disabled.
      *
      * <p>The calling device admin must be a profile owner. If it is not, a
      * security exception will be thrown.
@@ -2699,8 +2700,8 @@
     }
 
     /**
-     * Called by the profile owner so that some intents sent in the managed profile can also be
-     * resolved in the parent, or vice versa.
+     * Called by the profile owner of a managed profile so that some intents sent in the managed
+     * profile can also be resolved in the parent, or vice versa.
      * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
      * @param filter The {@link IntentFilter} the intent has to match to be also resolved in the
      * other profile
@@ -2718,8 +2719,8 @@
     }
 
     /**
-     * Called by a profile owner to remove the cross-profile intent filters that go from the
-     * managed profile to the parent, or from the parent to the managed profile.
+     * Called by a profile owner of a managed profile to remove the cross-profile intent filters
+     * that go from the managed profile to the parent, or from the parent to the managed profile.
      * Only removes those that have been set by the profile owner.
      * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
      */
@@ -2980,7 +2981,7 @@
 
     /**
      * Called by a profile or device owner to get the application restrictions for a given target
-     * application running in the managed profile.
+     * application running in the profile.
      *
      * <p>The calling device admin must be a profile or device owner; if it is not, a security
      * exception will be thrown.
@@ -3088,8 +3089,7 @@
 
     /**
      * Called by profile or device owner to re-enable a system app that was disabled by default
-     * when the managed profile was created. This can only be called from a profile or device
-     * owner running within a managed profile.
+     * when the user was initialized.
      *
      * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
      * @param packageName The package to be re-enabled in the current profile.
@@ -3106,8 +3106,7 @@
 
     /**
      * Called by profile or device owner to re-enable system apps by intent that were disabled
-     * by default when the managed profile was created. This can only be called from a profile
-     * or device owner running within a managed profile.
+     * by default when the user was initialized.
      *
      * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
      * @param intent An intent matching the app(s) to be installed. All apps that resolve for this
@@ -3389,10 +3388,10 @@
     }
 
     /**
-     * Called by the profile owner to enable widget providers from a given package
-     * to be available in the parent profile. As a result the user will be able to
+     * Called by the profile owner of a managed profile to enable widget providers from a
+     * given package to be available in the parent profile. As a result the user will be able to
      * add widgets from the white-listed package running under the profile to a widget
-     * host which runs under the device owner, for example the home screen. Note that
+     * host which runs under the parent profile, for example the home screen. Note that
      * a package may have zero or more provider components, where each component
      * provides a different widget type.
      * <p>
@@ -3418,8 +3417,8 @@
     }
 
     /**
-     * Called by the profile owner to disable widget providers from a given package
-     * to be available in the parent profile. For this method to take effect the
+     * Called by the profile owner of a managed profile to disable widget providers from a given
+     * package to be available in the parent profile. For this method to take effect the
      * package should have been added via {@link #addCrossProfileWidgetProvider(
      * android.content.ComponentName, String)}.
      * <p>
@@ -3446,7 +3445,7 @@
     }
 
     /**
-     * Called by the profile owner to query providers from which packages are
+     * Called by the profile owner of a managed profile to query providers from which packages are
      * available in the parent profile.
      *
      * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 82016c3..2315c74 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -123,7 +123,8 @@
 
     /**
      * Specifies if a user is disallowed from transferring files over
-     * USB. This can only be set by device owners. The default value is <code>false</code>.
+     * USB. This can only be set by device owners and profile owners on the primary user.
+     * The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -178,8 +179,8 @@
 
     /**
      * Specifies if a user is disallowed from configuring Tethering
-     * & portable hotspots. This can only be set by device owners. The default value is
-     * <code>false</code>.
+     * & portable hotspots. This can only be set by device owners and profile owners on the
+     * primary user. The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -190,8 +191,8 @@
 
     /**
      * Specifies if a user is disallowed from factory resetting
-     * from Settings. This can only be set by device owners. The default value is
-     * <code>false</code>.
+     * from Settings. This can only be set by device owners and profile owners on the primary user.
+     * The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -202,7 +203,8 @@
 
     /**
      * Specifies if a user is disallowed from adding new users and
-     * profiles. This can only be set by device owners. The default value is <code>false</code>.
+     * profiles. This can only be set by device owners and profile owners on the primary user.
+     * The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -224,7 +226,8 @@
 
     /**
      * Specifies if a user is disallowed from configuring cell
-     * broadcasts. This can only be set by device owners. The default value is <code>false</code>.
+     * broadcasts. This can only be set by device owners and profile owners on the primary user.
+     * The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -235,7 +238,8 @@
 
     /**
      * Specifies if a user is disallowed from configuring mobile
-     * networks. This can only be set by device owners. The default value is <code>false</code>.
+     * networks. This can only be set by device owners and profile owners on the primary user.
+     * The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -266,8 +270,8 @@
 
     /**
      * Specifies if a user is disallowed from mounting
-     * physical external media. This can only be set by device owners. The default value is
-     * <code>false</code>.
+     * physical external media. This can only be set by device owners and profile owners on the
+     * primary user. The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -278,8 +282,8 @@
 
     /**
      * Specifies if a user is disallowed from adjusting microphone
-     * volume. If set, the microphone will be muted. This can only be set by device owners.
-     * The default value is <code>false</code>.
+     * volume. If set, the microphone will be muted. This can only be set by device owners
+     * and profile owners on the primary user. The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -290,8 +294,8 @@
 
     /**
      * Specifies if a user is disallowed from adjusting the master
-     * volume. If set, the master volume will be muted. This can only be set by device owners.
-     * The default value is <code>false</code>.
+     * volume. If set, the master volume will be muted. This can only be set by device owners
+     * and profile owners on the primary user. The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -314,7 +318,7 @@
 
     /**
      * Specifies that the user is not allowed to send or receive
-     * SMS messages. This can only be set by device owners. The default value is <code>false</code>.
+     * SMS messages. The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
@@ -333,7 +337,8 @@
      * <li>{@link LayoutParams#TYPE_SYSTEM_ERROR}</li>
      * <li>{@link LayoutParams#TYPE_SYSTEM_OVERLAY}</li>
      *
-     * <p>This can only be set by device owners. The default value is <code>false</code>.
+     * <p>This can only be set by device owners and profile owners on the primary user.
+     * The default value is <code>false</code>.
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
diff --git a/core/res/res/values-mcc204-mnc04/config.xml b/core/res/res/values-mcc204-mnc04/config.xml
index 7a48342..b89a311 100644
--- a/core/res/res/values-mcc204-mnc04/config.xml
+++ b/core/res/res/values-mcc204-mnc04/config.xml
@@ -25,4 +25,9 @@
     -->
     <integer name="config_mobile_mtu">1358</integer>
 
+    <!-- service number convert map in roaming network. -->
+    <!-- [dialstring],[replacement][,optional gid] -->
+    <string-array translatable="false" name="dial_string_replace">
+        <item>"*611:+19085594899,BAE0000000000000"</item>
+    </string-array>
 </resources>
diff --git a/core/res/res/values-mcc311-mnc480/config.xml b/core/res/res/values-mcc311-mnc480/config.xml
index cf19235..d01d9f8 100644
--- a/core/res/res/values-mcc311-mnc480/config.xml
+++ b/core/res/res/values-mcc311-mnc480/config.xml
@@ -44,4 +44,8 @@
     <bool name="config_carrier_volte_vt_available">false</bool>
 
     <bool name="config_auto_attach_data_on_creation">false</bool>
+    <!-- service number convert map in roaming network. -->
+    <string-array translatable="false" name="dial_string_replace">
+        <item>"*611:+19085594899,"</item>
+    </string-array>
 </resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 949c38c..c5d3c57 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1814,4 +1814,9 @@
 
     <!--SIM does not save, but the voice mail number to be changed. -->
     <bool name="editable_voicemailnumber">false</bool>
+
+    <!-- service number convert map in roaming network. -->
+    <!-- [dialstring],[replacement][,optional gid] -->
+    <string-array translatable="false" name="dial_string_replace">
+    </string-array>
 </resources>
diff --git a/core/res/res/values/removed.xml b/core/res/res/values/removed.xml
deleted file mode 100644
index 8eaca29..0000000
--- a/core/res/res/values/removed.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<!-- Placeholder resources to be removed before release. -->
-<resources>
-    <style name="__removed1" />
-    <attr name="__removed2" />
-    <style name="__removed3" />
-    <style name="__removed4" />
-    <style name="__removed5" />
-    <style name="__removed6" />
-    <style name="__removed7" />
-</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index ed43faf..edcfb8b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2065,4 +2065,5 @@
   <java-symbol type="integer" name="config_cdma_3waycall_flash_delay"/>
   <java-symbol type="attr" name="windowBackgroundFallback" />
   <java-symbol type="id" name="textSpacerNoButtons" />
+  <java-symbol type="array" name="dial_string_replace" />
 </resources>
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 25ea729..ce1d09f 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -134,6 +134,8 @@
         , mExtensions(Extensions::getInstance())
         , mRenderState(renderState)
         , mScissorOptimizationDisabled(false)
+        , mSuppressTiling(false)
+        , mFirstFrameAfterResize(true)
         , mCountOverdraw(false)
         , mLightCenter((Vector3){FLT_MIN, FLT_MIN, FLT_MIN})
         , mLightRadius(FLT_MIN)
@@ -179,6 +181,7 @@
     glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
 
     glEnableVertexAttribArray(Program::kBindingPosition);
+    mFirstFrameAfterResize = true;
 }
 
 void OpenGLRenderer::setupFrameState(float left, float top,
@@ -202,7 +205,9 @@
     // Functors break the tiling extension in pretty spectacular ways
     // This ensures we don't use tiling when a functor is going to be
     // invoked during the frame
-    mSuppressTiling = mCaches.hasRegisteredFunctors();
+    mSuppressTiling = mCaches.hasRegisteredFunctors()
+            || mFirstFrameAfterResize;
+    mFirstFrameAfterResize = false;
 
     startTilingCurrentClip(true);
 
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index e295b1a..47ef1a9 100755
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -1013,6 +1013,7 @@
 
     // No-ops start/endTiling when set
     bool mSuppressTiling;
+    bool mFirstFrameAfterResize;
 
     // If true, this renderer will setup drawing to emulate
     // an increment stencil buffer in the color buffer
diff --git a/libs/hwui/StatefulBaseRenderer.cpp b/libs/hwui/StatefulBaseRenderer.cpp
index 12b8c8d..88d6f68 100644
--- a/libs/hwui/StatefulBaseRenderer.cpp
+++ b/libs/hwui/StatefulBaseRenderer.cpp
@@ -49,6 +49,13 @@
     mHeight = height;
     mFirstSnapshot->initializeViewport(width, height);
     onViewportInitialized();
+
+    // create a temporary 1st snapshot, so old snapshots are released,
+    // and viewport can be queried safely.
+    // TODO: remove, combine viewport + save stack initialization
+    mSnapshot = new Snapshot(mFirstSnapshot,
+            SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
+    mSaveCount = 1;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 832d170..1c416a7 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -119,10 +119,10 @@
     stopDrawing();
 }
 
+// TODO: don't pass viewport size, it's automatic via EGL
 void CanvasContext::setup(int width, int height, const Vector3& lightCenter, float lightRadius,
         uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) {
     if (!mCanvas) return;
-    mCanvas->setViewport(width, height);
     mCanvas->initLight(lightCenter, lightRadius, ambientShadowAlpha, spotShadowAlpha);
 }
 
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
index 33cab8f..2b40903 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
@@ -146,7 +146,7 @@
     /**
      * Called when the emergency call button is pressed.
      */
-    void onEmergencyCallAction() { }
+    public void onEmergencyCallAction() { }
 
     /**
      * Called when the transport background changes.
diff --git a/packages/SettingsProvider/res/values-af/defaults.xml b/packages/SettingsProvider/res/values-af/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-af/defaults.xml
+++ b/packages/SettingsProvider/res/values-af/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-am/defaults.xml b/packages/SettingsProvider/res/values-am/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-am/defaults.xml
+++ b/packages/SettingsProvider/res/values-am/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-bg/defaults.xml b/packages/SettingsProvider/res/values-bg/defaults.xml
index 5e46120..aee229e 100644
--- a/packages/SettingsProvider/res/values-bg/defaults.xml
+++ b/packages/SettingsProvider/res/values-bg/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s от %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-bn-rBD/defaults.xml b/packages/SettingsProvider/res/values-bn-rBD/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-bn-rBD/defaults.xml
+++ b/packages/SettingsProvider/res/values-bn-rBD/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ca/defaults.xml b/packages/SettingsProvider/res/values-ca/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ca/defaults.xml
+++ b/packages/SettingsProvider/res/values-ca/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-cs/defaults.xml b/packages/SettingsProvider/res/values-cs/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-cs/defaults.xml
+++ b/packages/SettingsProvider/res/values-cs/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-da/defaults.xml b/packages/SettingsProvider/res/values-da/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-da/defaults.xml
+++ b/packages/SettingsProvider/res/values-da/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-de/defaults.xml b/packages/SettingsProvider/res/values-de/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-de/defaults.xml
+++ b/packages/SettingsProvider/res/values-de/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-el/defaults.xml b/packages/SettingsProvider/res/values-el/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-el/defaults.xml
+++ b/packages/SettingsProvider/res/values-el/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-en-rGB/defaults.xml b/packages/SettingsProvider/res/values-en-rGB/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-en-rGB/defaults.xml
+++ b/packages/SettingsProvider/res/values-en-rGB/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-en-rIN/defaults.xml b/packages/SettingsProvider/res/values-en-rIN/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-en-rIN/defaults.xml
+++ b/packages/SettingsProvider/res/values-en-rIN/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-es-rUS/defaults.xml b/packages/SettingsProvider/res/values-es-rUS/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-es-rUS/defaults.xml
+++ b/packages/SettingsProvider/res/values-es-rUS/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-es/defaults.xml b/packages/SettingsProvider/res/values-es/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-es/defaults.xml
+++ b/packages/SettingsProvider/res/values-es/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-et-rEE/defaults.xml b/packages/SettingsProvider/res/values-et-rEE/defaults.xml
index 790297a..71e91ae 100644
--- a/packages/SettingsProvider/res/values-et-rEE/defaults.xml
+++ b/packages/SettingsProvider/res/values-et-rEE/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s, %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-eu-rES/defaults.xml b/packages/SettingsProvider/res/values-eu-rES/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-eu-rES/defaults.xml
+++ b/packages/SettingsProvider/res/values-eu-rES/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-fi/defaults.xml b/packages/SettingsProvider/res/values-fi/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-fi/defaults.xml
+++ b/packages/SettingsProvider/res/values-fi/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-fr-rCA/defaults.xml b/packages/SettingsProvider/res/values-fr-rCA/defaults.xml
index 15da9d2..beba56e 100644
--- a/packages/SettingsProvider/res/values-fr-rCA/defaults.xml
+++ b/packages/SettingsProvider/res/values-fr-rCA/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s de %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-fr/defaults.xml b/packages/SettingsProvider/res/values-fr/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-fr/defaults.xml
+++ b/packages/SettingsProvider/res/values-fr/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-gl-rES/defaults.xml b/packages/SettingsProvider/res/values-gl-rES/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-gl-rES/defaults.xml
+++ b/packages/SettingsProvider/res/values-gl-rES/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-hi/defaults.xml b/packages/SettingsProvider/res/values-hi/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-hi/defaults.xml
+++ b/packages/SettingsProvider/res/values-hi/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-hr/defaults.xml b/packages/SettingsProvider/res/values-hr/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-hr/defaults.xml
+++ b/packages/SettingsProvider/res/values-hr/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-hu/defaults.xml b/packages/SettingsProvider/res/values-hu/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-hu/defaults.xml
+++ b/packages/SettingsProvider/res/values-hu/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-hy-rAM/defaults.xml b/packages/SettingsProvider/res/values-hy-rAM/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-hy-rAM/defaults.xml
+++ b/packages/SettingsProvider/res/values-hy-rAM/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-in/defaults.xml b/packages/SettingsProvider/res/values-in/defaults.xml
index 3627c9b..012a65f 100644
--- a/packages/SettingsProvider/res/values-in/defaults.xml
+++ b/packages/SettingsProvider/res/values-in/defaults.xml
@@ -20,6 +20,7 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
+    <!-- String.format failed for translation -->
     <!-- no translation found for def_device_name_simple (9037785625140748221) -->
     <skip />
 </resources>
diff --git a/packages/SettingsProvider/res/values-is-rIS/defaults.xml b/packages/SettingsProvider/res/values-is-rIS/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-is-rIS/defaults.xml
+++ b/packages/SettingsProvider/res/values-is-rIS/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-it/defaults.xml b/packages/SettingsProvider/res/values-it/defaults.xml
index 18d0b93..3ea32a1 100644
--- a/packages/SettingsProvider/res/values-it/defaults.xml
+++ b/packages/SettingsProvider/res/values-it/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ja/defaults.xml b/packages/SettingsProvider/res/values-ja/defaults.xml
index 18d0b93..3ea32a1 100644
--- a/packages/SettingsProvider/res/values-ja/defaults.xml
+++ b/packages/SettingsProvider/res/values-ja/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ka-rGE/defaults.xml b/packages/SettingsProvider/res/values-ka-rGE/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ka-rGE/defaults.xml
+++ b/packages/SettingsProvider/res/values-ka-rGE/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml b/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml
+++ b/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-km-rKH/defaults.xml b/packages/SettingsProvider/res/values-km-rKH/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-km-rKH/defaults.xml
+++ b/packages/SettingsProvider/res/values-km-rKH/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-kn-rIN/defaults.xml b/packages/SettingsProvider/res/values-kn-rIN/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-kn-rIN/defaults.xml
+++ b/packages/SettingsProvider/res/values-kn-rIN/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ko/defaults.xml b/packages/SettingsProvider/res/values-ko/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ko/defaults.xml
+++ b/packages/SettingsProvider/res/values-ko/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ky-rKG/defaults.xml b/packages/SettingsProvider/res/values-ky-rKG/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ky-rKG/defaults.xml
+++ b/packages/SettingsProvider/res/values-ky-rKG/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-lo-rLA/defaults.xml b/packages/SettingsProvider/res/values-lo-rLA/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-lo-rLA/defaults.xml
+++ b/packages/SettingsProvider/res/values-lo-rLA/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-lt/defaults.xml b/packages/SettingsProvider/res/values-lt/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-lt/defaults.xml
+++ b/packages/SettingsProvider/res/values-lt/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-lv/defaults.xml b/packages/SettingsProvider/res/values-lv/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-lv/defaults.xml
+++ b/packages/SettingsProvider/res/values-lv/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-mk-rMK/defaults.xml b/packages/SettingsProvider/res/values-mk-rMK/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-mk-rMK/defaults.xml
+++ b/packages/SettingsProvider/res/values-mk-rMK/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ml-rIN/defaults.xml b/packages/SettingsProvider/res/values-ml-rIN/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ml-rIN/defaults.xml
+++ b/packages/SettingsProvider/res/values-ml-rIN/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-mn-rMN/defaults.xml b/packages/SettingsProvider/res/values-mn-rMN/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-mn-rMN/defaults.xml
+++ b/packages/SettingsProvider/res/values-mn-rMN/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-mr-rIN/defaults.xml b/packages/SettingsProvider/res/values-mr-rIN/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-mr-rIN/defaults.xml
+++ b/packages/SettingsProvider/res/values-mr-rIN/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ms-rMY/defaults.xml b/packages/SettingsProvider/res/values-ms-rMY/defaults.xml
index 3627c9b..012a65f 100644
--- a/packages/SettingsProvider/res/values-ms-rMY/defaults.xml
+++ b/packages/SettingsProvider/res/values-ms-rMY/defaults.xml
@@ -20,6 +20,7 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
+    <!-- String.format failed for translation -->
     <!-- no translation found for def_device_name_simple (9037785625140748221) -->
     <skip />
 </resources>
diff --git a/packages/SettingsProvider/res/values-nb/defaults.xml b/packages/SettingsProvider/res/values-nb/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-nb/defaults.xml
+++ b/packages/SettingsProvider/res/values-nb/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ne-rNP/defaults.xml b/packages/SettingsProvider/res/values-ne-rNP/defaults.xml
index 3627c9b..012a65f 100644
--- a/packages/SettingsProvider/res/values-ne-rNP/defaults.xml
+++ b/packages/SettingsProvider/res/values-ne-rNP/defaults.xml
@@ -20,6 +20,7 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
+    <!-- String.format failed for translation -->
     <!-- no translation found for def_device_name_simple (9037785625140748221) -->
     <skip />
 </resources>
diff --git a/packages/SettingsProvider/res/values-nl/defaults.xml b/packages/SettingsProvider/res/values-nl/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-nl/defaults.xml
+++ b/packages/SettingsProvider/res/values-nl/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-pl/defaults.xml b/packages/SettingsProvider/res/values-pl/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-pl/defaults.xml
+++ b/packages/SettingsProvider/res/values-pl/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-pt-rPT/defaults.xml b/packages/SettingsProvider/res/values-pt-rPT/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-pt-rPT/defaults.xml
+++ b/packages/SettingsProvider/res/values-pt-rPT/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-pt/defaults.xml b/packages/SettingsProvider/res/values-pt/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-pt/defaults.xml
+++ b/packages/SettingsProvider/res/values-pt/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ro/defaults.xml b/packages/SettingsProvider/res/values-ro/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ro/defaults.xml
+++ b/packages/SettingsProvider/res/values-ro/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ru/defaults.xml b/packages/SettingsProvider/res/values-ru/defaults.xml
index 18d0b93..3ea32a1 100644
--- a/packages/SettingsProvider/res/values-ru/defaults.xml
+++ b/packages/SettingsProvider/res/values-ru/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-si-rLK/defaults.xml b/packages/SettingsProvider/res/values-si-rLK/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-si-rLK/defaults.xml
+++ b/packages/SettingsProvider/res/values-si-rLK/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-sk/defaults.xml b/packages/SettingsProvider/res/values-sk/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-sk/defaults.xml
+++ b/packages/SettingsProvider/res/values-sk/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-sl/defaults.xml b/packages/SettingsProvider/res/values-sl/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-sl/defaults.xml
+++ b/packages/SettingsProvider/res/values-sl/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-sr/defaults.xml b/packages/SettingsProvider/res/values-sr/defaults.xml
index 18d0b93..3ea32a1 100644
--- a/packages/SettingsProvider/res/values-sr/defaults.xml
+++ b/packages/SettingsProvider/res/values-sr/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-sv/defaults.xml b/packages/SettingsProvider/res/values-sv/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-sv/defaults.xml
+++ b/packages/SettingsProvider/res/values-sv/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-sw/defaults.xml b/packages/SettingsProvider/res/values-sw/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-sw/defaults.xml
+++ b/packages/SettingsProvider/res/values-sw/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ta-rIN/defaults.xml b/packages/SettingsProvider/res/values-ta-rIN/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ta-rIN/defaults.xml
+++ b/packages/SettingsProvider/res/values-ta-rIN/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-te-rIN/defaults.xml b/packages/SettingsProvider/res/values-te-rIN/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-te-rIN/defaults.xml
+++ b/packages/SettingsProvider/res/values-te-rIN/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-th/defaults.xml b/packages/SettingsProvider/res/values-th/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-th/defaults.xml
+++ b/packages/SettingsProvider/res/values-th/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-tl/defaults.xml b/packages/SettingsProvider/res/values-tl/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-tl/defaults.xml
+++ b/packages/SettingsProvider/res/values-tl/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-tr/defaults.xml b/packages/SettingsProvider/res/values-tr/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-tr/defaults.xml
+++ b/packages/SettingsProvider/res/values-tr/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-uk/defaults.xml b/packages/SettingsProvider/res/values-uk/defaults.xml
index 7da1c93..7655a19 100644
--- a/packages/SettingsProvider/res/values-uk/defaults.xml
+++ b/packages/SettingsProvider/res/values-uk/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%2$s о %1$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-ur-rPK/defaults.xml b/packages/SettingsProvider/res/values-ur-rPK/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-ur-rPK/defaults.xml
+++ b/packages/SettingsProvider/res/values-ur-rPK/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml b/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml
+++ b/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-vi/defaults.xml b/packages/SettingsProvider/res/values-vi/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-vi/defaults.xml
+++ b/packages/SettingsProvider/res/values-vi/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-zh-rHK/defaults.xml b/packages/SettingsProvider/res/values-zh-rHK/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-zh-rHK/defaults.xml
+++ b/packages/SettingsProvider/res/values-zh-rHK/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SettingsProvider/res/values-zh-rTW/defaults.xml b/packages/SettingsProvider/res/values-zh-rTW/defaults.xml
index 3627c9b..22443a5 100644
--- a/packages/SettingsProvider/res/values-zh-rTW/defaults.xml
+++ b/packages/SettingsProvider/res/values-zh-rTW/defaults.xml
@@ -20,6 +20,5 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string>
-    <!-- no translation found for def_device_name_simple (9037785625140748221) -->
-    <skip />
+    <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string>
 </resources>
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
new file mode 100644
index 0000000..3bf86a0
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.doze;
+
+import android.content.Context;
+import android.os.Build;
+import android.util.Log;
+import android.util.TimeUtils;
+
+import com.android.keyguard.KeyguardUpdateMonitor;
+import com.android.keyguard.KeyguardUpdateMonitorCallback;
+
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class DozeLog {
+    private static final String TAG = "DozeLog";
+    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+    private static final boolean ENABLED = true;
+    private static final int SIZE = Build.IS_DEBUGGABLE ? 400 : 50;
+    private static final SimpleDateFormat FORMAT = new SimpleDateFormat("MM-dd HH:mm:ss.SSS");
+
+    private static long[] sTimes;
+    private static String[] sMessages;
+    private static int sPosition;
+    private static int sCount;
+    private static boolean sPulsing;
+
+    private static long sSince;
+    private static SummaryStats sPickupPulseNearVibrationStats;
+    private static SummaryStats sPickupPulseNotNearVibrationStats;
+    private static SummaryStats sNotificationPulseStats;
+    private static SummaryStats sScreenOnPulsingStats;
+    private static SummaryStats sScreenOnNotPulsingStats;
+    private static SummaryStats sEmergencyCallStats;
+
+    public static void tracePickupPulse(boolean withinVibrationThreshold) {
+        if (!ENABLED) return;
+        log("pickupPulse withinVibrationThreshold=" + withinVibrationThreshold);
+        (withinVibrationThreshold ? sPickupPulseNearVibrationStats
+                : sPickupPulseNotNearVibrationStats).append();
+    }
+
+    public static void tracePulseStart() {
+        if (!ENABLED) return;
+        sPulsing = true;
+        log("pulseStart");
+    }
+
+    public static void tracePulseFinish() {
+        if (!ENABLED) return;
+        sPulsing = false;
+        log("pulseFinish");
+    }
+
+    public static void traceNotificationPulse(long instance) {
+        if (!ENABLED) return;
+        log("notificationPulse instance=" + instance);
+        sNotificationPulseStats.append();
+    }
+
+    public static void traceDozing(Context context, boolean dozing) {
+        if (!ENABLED) return;
+        sPulsing = false;
+        synchronized (DozeLog.class) {
+            if (dozing && sMessages == null) {
+                sTimes = new long[SIZE];
+                sMessages = new String[SIZE];
+                sSince = System.currentTimeMillis();
+                sPickupPulseNearVibrationStats = new SummaryStats();
+                sPickupPulseNotNearVibrationStats = new SummaryStats();
+                sNotificationPulseStats = new SummaryStats();
+                sScreenOnPulsingStats = new SummaryStats();
+                sScreenOnNotPulsingStats = new SummaryStats();
+                sEmergencyCallStats = new SummaryStats();
+                log("init");
+                KeyguardUpdateMonitor.getInstance(context)
+                        .registerCallback(new KeyguardUpdateMonitorCallback() {
+                    @Override
+                    public void onEmergencyCallAction() {
+                        traceEmergencyCall();
+                    }
+                    @Override
+                    public void onKeyguardBouncerChanged(boolean bouncer) {
+                        traceKeyguardBouncerChanged(bouncer);
+                    }
+                    @Override
+                    public void onScreenTurnedOn() {
+                        traceScreenOn();
+                    }
+                    @Override
+                    public void onScreenTurnedOff(int why) {
+                        traceScreenOff(why);
+                    }
+                    @Override
+                    public void onKeyguardVisibilityChanged(boolean showing) {
+                        traceKeyguard(showing);
+                    }
+                });
+            }
+        }
+        log("dozing " + dozing);
+    }
+
+    public static void traceFling(boolean expand, boolean aboveThreshold, boolean thresholdNeeded) {
+        if (!ENABLED) return;
+        log("fling expand=" + expand + " aboveThreshold=" + aboveThreshold + " thresholdNeeded="
+                + thresholdNeeded);
+    }
+
+    public static void traceEmergencyCall() {
+        if (!ENABLED) return;
+        log("emergencyCall");
+    }
+
+    public static void traceKeyguardBouncerChanged(boolean showing) {
+        if (!ENABLED) return;
+        log("bouncer " + showing);
+    }
+
+    public static void traceScreenOn() {
+        if (!ENABLED) return;
+        log("screenOn pulsing=" + sPulsing);
+        (sPulsing ? sScreenOnPulsingStats : sScreenOnNotPulsingStats).append();
+        sPulsing = false;
+    }
+
+    public static void traceScreenOff(int why) {
+        if (!ENABLED) return;
+        log("screenOff why=" + why);
+    }
+
+    public static void traceKeyguard(boolean showing) {
+        if (!ENABLED) return;
+        log("keyguard " + showing);
+        if (!showing) {
+            sPulsing = false;
+        }
+    }
+
+    public static void dump(PrintWriter pw) {
+        synchronized (DozeLog.class) {
+            if (sMessages == null) return;
+            pw.println("  Doze log:");
+            final int start = (sPosition - sCount + SIZE) % SIZE;
+            for (int i = 0; i < sCount; i++) {
+                final int j = (start + i) % SIZE;
+                pw.print("    ");
+                pw.print(FORMAT.format(new Date(sTimes[j])));
+                pw.print(' ');
+                pw.println(sMessages[j]);
+            }
+            pw.print("  Doze summary stats (for ");
+            TimeUtils.formatDuration(System.currentTimeMillis() - sSince, pw);
+            pw.println("):");
+            sPickupPulseNearVibrationStats.dump(pw, "Pickup pulse (near vibration)");
+            sPickupPulseNotNearVibrationStats.dump(pw, "Pickup pulse (not near vibration)");
+            sNotificationPulseStats.dump(pw, "Notification pulse");
+            sScreenOnPulsingStats.dump(pw, "Screen on (pulsing)");
+            sScreenOnNotPulsingStats.dump(pw, "Screen on (not pulsing)");
+            sEmergencyCallStats.dump(pw, "Emergency call");
+        }
+    }
+
+    private static void log(String msg) {
+        synchronized (DozeLog.class) {
+            if (sMessages == null) return;
+            sTimes[sPosition] = System.currentTimeMillis();
+            sMessages[sPosition] = msg;
+            sPosition = (sPosition + 1) % SIZE;
+            sCount = Math.min(sCount + 1, SIZE);
+        }
+        if (DEBUG) Log.d(TAG, msg);
+    }
+
+    private static class SummaryStats {
+        private int mCount;
+
+        public void append() {
+            mCount++;
+        }
+
+        public void dump(PrintWriter pw, String type) {
+            pw.print("    ");
+            pw.print(type);
+            pw.print(": n=");
+            pw.print(mCount);
+            pw.print(" (");
+            final double perHr = (double) mCount / (System.currentTimeMillis() - sSince)
+                    * 1000 * 60 * 60;
+            pw.print(perHr);
+            pw.print("/hr)");
+            pw.println();
+        }
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
index e2c8ff9..e429801 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
@@ -49,6 +49,7 @@
     private static final String ACTION_BASE = "com.android.systemui.doze";
     private static final String PULSE_ACTION = ACTION_BASE + ".pulse";
     private static final String NOTIFICATION_PULSE_ACTION = ACTION_BASE + ".notification_pulse";
+    private static final String EXTRA_INSTANCE = "instance";
 
     private final String mTag = String.format(TAG + ".%08x", hashCode());
     private final Context mContext = this;
@@ -67,7 +68,6 @@
     private boolean mDisplayStateSupported;
     private int mDisplayStateWhenOn;
     private boolean mNotificationLightOn;
-    private PendingIntent mNotificationPulseIntent;
     private boolean mPowerSaveActive;
     private long mNotificationPulseTime;
     private int mScheduleResetsRemaining;
@@ -115,9 +115,6 @@
         mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, mTag);
         mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
         mDisplayStateSupported = mDozeParameters.getDisplayStateSupported();
-        mNotificationPulseIntent = PendingIntent.getBroadcast(mContext, 0,
-                new Intent(NOTIFICATION_PULSE_ACTION).setPackage(getPackageName()),
-                PendingIntent.FLAG_UPDATE_CURRENT);
         mDisplayStateWhenOn = mDisplayStateSupported ? Display.STATE_DOZE : Display.STATE_ON;
         mDisplayOff.run();
     }
@@ -257,9 +254,17 @@
         rescheduleNotificationPulse(true /*predicate*/);
     }
 
+    private PendingIntent notificationPulseIntent(long instance) {
+        return PendingIntent.getBroadcast(mContext, 0,
+                new Intent(NOTIFICATION_PULSE_ACTION).setPackage(getPackageName())
+                        .putExtra(EXTRA_INSTANCE, instance),
+                PendingIntent.FLAG_UPDATE_CURRENT);
+    }
+
     private void rescheduleNotificationPulse(boolean predicate) {
         if (DEBUG) Log.d(TAG, "rescheduleNotificationPulse predicate=" + predicate);
-        mAlarmManager.cancel(mNotificationPulseIntent);
+        final PendingIntent notificationPulseIntent = notificationPulseIntent(0);
+        mAlarmManager.cancel(notificationPulseIntent);
         if (!predicate) {
             if (DEBUG) Log.d(TAG, "  don't reschedule: predicate is false");
             return;
@@ -280,8 +285,10 @@
             if (DEBUG) Log.d(TAG, "  don't reschedule: delta is " + delta);
             return;
         }
-        if (DEBUG) Log.d(TAG, "Scheduling pulse in " + delta + "ms for " + new Date(time));
-        mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, time, mNotificationPulseIntent);
+        final long instance = time - mNotificationPulseTime;
+        if (DEBUG) Log.d(TAG, "Scheduling pulse " + instance + " in " + delta + "ms for "
+                + new Date(time));
+        mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, time, notificationPulseIntent(instance));
     }
 
     private static String triggerEventToString(TriggerEvent event) {
@@ -313,7 +320,9 @@
                 requestPulse();
             }
             if (NOTIFICATION_PULSE_ACTION.equals(intent.getAction())) {
-                if (DEBUG) Log.d(mTag, "Received notification pulse intent");
+                final long instance = intent.getLongExtra(EXTRA_INSTANCE, -1);
+                if (DEBUG) Log.d(mTag, "Received notification pulse intent instance=" + instance);
+                DozeLog.traceNotificationPulse(instance);
                 requestPulse();
                 rescheduleNotificationPulse(mNotificationLightOn);
             }
@@ -415,11 +424,16 @@
             // reset the notification pulse schedule, but only if we think we were not triggered
             // by a notification-related vibration
             final long timeSinceNotification = System.currentTimeMillis() - mNotificationPulseTime;
-            if (timeSinceNotification < mDozeParameters.getPickupVibrationThreshold()) {
+            final boolean withinVibrationThreshold =
+                    timeSinceNotification < mDozeParameters.getPickupVibrationThreshold();
+            if (withinVibrationThreshold) {
                if (DEBUG) Log.d(mTag, "Not resetting schedule, recent notification");
             } else {
                 resetNotificationResets();
             }
+            if (mSensor.getType() == Sensor.TYPE_PICK_UP_GESTURE) {
+                DozeLog.tracePickupPulse(withinVibrationThreshold);
+            }
         }
     }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java
index 8d7edb9..3574877 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java
@@ -298,10 +298,11 @@
         if (mDual) {
             mDualLabel.setText(state.label);
             mDualLabel.setContentDescription(state.dualLabelContentDescription);
+            mTopBackgroundView.setContentDescription(state.contentDescription);
         } else {
             mLabel.setText(state.label);
+            setContentDescription(state.contentDescription);
         }
-        setContentDescription(state.contentDescription);
     }
 
     public void onStateChanged(QSTile.State state) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 873d528..67c7723 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -33,6 +33,7 @@
 import android.widget.FrameLayout;
 
 import com.android.systemui.R;
+import com.android.systemui.doze.DozeLog;
 import com.android.systemui.statusbar.FlingAnimationUtils;
 import com.android.systemui.statusbar.StatusBarState;
 
@@ -347,6 +348,8 @@
                     if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) {
                         Log.i(TAG, "Flinging: expand=" + expand);
                     }
+                    DozeLog.traceFling(expand, mTouchAboveFalsingThreshold,
+                            mStatusBar.isFalsingThresholdNeeded());
                     fling(vel, expand);
                     mUpdateFlingOnLayout = expand && mPanelClosedOnDown && !mHasLayoutedSinceDown;
                     if (mUpdateFlingOnLayout) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 353c887..624fea5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -115,6 +115,7 @@
 import com.android.systemui.EventLogTags;
 import com.android.systemui.FontSizeUtils;
 import com.android.systemui.R;
+import com.android.systemui.doze.DozeLog;
 import com.android.systemui.doze.DozeService;
 import com.android.systemui.keyguard.KeyguardViewMediator;
 import com.android.systemui.qs.QSPanel;
@@ -2101,8 +2102,8 @@
 
     public boolean isFalsingThresholdNeeded() {
         boolean onKeyguard = getBarState() == StatusBarState.KEYGUARD;
-        boolean isMethodInSecure = mUnlockMethodCache.isMethodInsecure();
-        return onKeyguard && isMethodInSecure;
+        boolean isMethodInsecure = mUnlockMethodCache.isMethodInsecure();
+        return onKeyguard && (isMethodInsecure || mDozing);
     }
 
     @Override  // NotificationData.Environment
@@ -2874,6 +2875,8 @@
             mNotificationPanel.dump(fd, pw, args);
         }
 
+        DozeLog.dump(pw);
+
         if (DUMPTRUCK) {
             synchronized (mNotificationData) {
                 mNotificationData.dump(pw, "  ");
@@ -4108,6 +4111,7 @@
             mCurrentDozeService = dozeService;
             if (!mDozing) {
                 mDozing = true;
+                DozeLog.traceDozing(mContext, mDozing);
                 updateDozingState();
             }
             mCurrentDozeService.startDozing();
@@ -4125,6 +4129,7 @@
             }
             if (mDozing) {
                 mDozing = false;
+                DozeLog.traceDozing(mContext, mDozing);
                 updateDozingState();
             }
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 3ff11d2..ddb03e7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -30,6 +30,7 @@
 import android.view.animation.Interpolator;
 
 import com.android.systemui.R;
+import com.android.systemui.doze.DozeLog;
 
 /**
  * Controls both the scrim behind the notifications and in front of the notifications (when a
@@ -309,6 +310,7 @@
         public void run() {
             if (DEBUG) Log.d(TAG, "Pulse in, mDozing=" + mDozing);
             if (!mDozing) return;
+            DozeLog.tracePulseStart();
             mDurationOverride = mDozeParameters.getPulseInDuration();
             mAnimationDelay = 0;
             mAnimateChange = true;
@@ -343,6 +345,7 @@
         @Override
         public void run() {
             if (DEBUG) Log.d(TAG, "Pulse out finished");
+            DozeLog.tracePulseFinish();
             mPulseEndTime = 0;
         }
     };
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index d38074f..3f83a02 100755
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -24,6 +24,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import android.os.Build;
 import android.os.DeadObjectException;
 import android.os.Handler;
 import android.os.Looper;
@@ -590,6 +591,8 @@
                         r.cancelNotification();
                         r.foregroundId = 0;
                         r.foregroundNoti = null;
+                    } else if (r.appInfo.targetSdkVersion >= Build.VERSION_CODES.L) {
+                        r.stripForegroundServiceFlagFromNotification();
                     }
                 }
             }
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 741cffe..190c16c 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -7528,8 +7528,8 @@
 
         // Does the caller have this permission on the URI?
         if (!checkHoldingPermissionsLocked(pm, pi, grantUri, callingUid, modeFlags)) {
-            // Have they don't have direct access to the URI, then revoke any URI
-            // permissions that have been granted to them.
+            // If they don't have direct access to the URI, then revoke any
+            // ownerless URI permissions that have been granted to them.
             final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.get(callingUid);
             if (perms != null) {
                 boolean persistChanged = false;
@@ -7538,10 +7538,10 @@
                     if (perm.uri.sourceUserId == grantUri.sourceUserId
                             && perm.uri.uri.isPathPrefixMatch(grantUri.uri)) {
                         if (DEBUG_URI_PERMISSION)
-                            Slog.v(TAG,
-                                    "Revoking " + perm.targetUid + " permission to " + perm.uri);
+                            Slog.v(TAG, "Revoking non-owned " + perm.targetUid +
+                                    " permission to " + perm.uri);
                         persistChanged |= perm.revokeModes(
-                                modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
+                                modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, false);
                         if (perm.modeFlags == 0) {
                             it.remove();
                         }
@@ -7573,7 +7573,7 @@
                         Slog.v(TAG,
                                 "Revoking " + perm.targetUid + " permission to " + perm.uri);
                     persistChanged |= perm.revokeModes(
-                            modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
+                            modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, true);
                     if (perm.modeFlags == 0) {
                         it.remove();
                     }
@@ -7661,8 +7661,8 @@
                     // Only inspect grants matching package
                     if (packageName == null || perm.sourcePkg.equals(packageName)
                             || perm.targetPkg.equals(packageName)) {
-                        persistChanged |= perm.revokeModes(
-                                persistable ? ~0 : ~Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
+                        persistChanged |= perm.revokeModes(persistable
+                                ? ~0 : ~Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, true);
 
                         // Only remove when no modes remain; any persisted grants
                         // will keep this alive.
diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java
index 0a66a5c..d4a378b 100644
--- a/services/core/java/com/android/server/am/ServiceRecord.java
+++ b/services/core/java/com/android/server/am/ServiceRecord.java
@@ -517,6 +517,31 @@
             });
         }
     }
+
+    public void stripForegroundServiceFlagFromNotification() {
+        if (foregroundId == 0) {
+            return;
+        }
+
+        final int localForegroundId = foregroundId;
+        final int localUserId = userId;
+        final String localPackageName = packageName;
+
+        // Do asynchronous communication with notification manager to
+        // avoid deadlocks.
+        ams.mHandler.post(new Runnable() {
+            @Override
+            public void run() {
+                NotificationManagerInternal nmi = LocalServices.getService(
+                        NotificationManagerInternal.class);
+                if (nmi == null) {
+                    return;
+                }
+                nmi.removeForegroundServiceFlagFromNotification(localPackageName, localForegroundId,
+                        localUserId);
+            }
+        });
+    }
     
     public void clearDeliveredStartsLocked() {
         for (int i=deliveredStarts.size()-1; i>=0; i--) {
diff --git a/services/core/java/com/android/server/am/UriPermission.java b/services/core/java/com/android/server/am/UriPermission.java
index 284086d..91daf77 100644
--- a/services/core/java/com/android/server/am/UriPermission.java
+++ b/services/core/java/com/android/server/am/UriPermission.java
@@ -180,7 +180,7 @@
     /**
      * @return if mode changes should trigger persisting.
      */
-    boolean revokeModes(int modeFlags) {
+    boolean revokeModes(int modeFlags, boolean includingOwners) {
         final boolean persistable = (modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0;
         modeFlags &= (Intent.FLAG_GRANT_READ_URI_PERMISSION
                 | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
@@ -193,7 +193,7 @@
                 persistedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION;
             }
             globalModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION;
-            if (mReadOwners != null) {
+            if (mReadOwners != null && includingOwners) {
                 ownedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION;
                 for (UriPermissionOwner r : mReadOwners) {
                     r.removeReadPermission(this);
@@ -207,7 +207,7 @@
                 persistedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
             }
             globalModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
-            if (mWriteOwners != null) {
+            if (mWriteOwners != null && includingOwners) {
                 ownedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
                 for (UriPermissionOwner r : mWriteOwners) {
                     r.removeWritePermission(this);
diff --git a/services/core/java/com/android/server/notification/NotificationManagerInternal.java b/services/core/java/com/android/server/notification/NotificationManagerInternal.java
index b695b68..c6b0d36 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerInternal.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerInternal.java
@@ -21,4 +21,6 @@
 public interface NotificationManagerInternal {
     void enqueueNotification(String pkg, String basePkg, int callingUid, int callingPid,
             String tag, int id, Notification notification, int[] idReceived, int userId);
+
+    void removeForegroundServiceFlagFromNotification(String pkg, int notificationId, int userId);
 }
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 14587e6..2829e2b 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1610,6 +1610,30 @@
             enqueueNotificationInternal(pkg, opPkg, callingUid, callingPid, tag, id, notification,
                     idReceived, userId);
         }
+
+        @Override
+        public void removeForegroundServiceFlagFromNotification(String pkg, int notificationId,
+                int userId) {
+            checkCallerIsSystem();
+            synchronized (mNotificationList) {
+                int i = indexOfNotificationLocked(pkg, null, notificationId, userId);
+                if (i < 0) {
+                    Log.d(TAG, "stripForegroundServiceFlag: Could not find notification with "
+                            + "pkg=" + pkg + " / id=" + notificationId + " / userId=" + userId);
+                    return;
+                }
+                NotificationRecord r = mNotificationList.get(i);
+                StatusBarNotification sbn = r.sbn;
+                // NoMan adds flags FLAG_NO_CLEAR and FLAG_ONGOING_EVENT when it sees
+                // FLAG_FOREGROUND_SERVICE. Hence it's not enough to remove FLAG_FOREGROUND_SERVICE,
+                // we have to revert to the flags we received initially *and* force remove
+                // FLAG_FOREGROUND_SERVICE.
+                sbn.getNotification().flags =
+                        (r.mOriginalFlags & ~Notification.FLAG_FOREGROUND_SERVICE);
+                mRankingHelper.sort(mNotificationList);
+                mListeners.notifyPostedLocked(sbn, sbn /* oldSbn */);
+            }
+        }
     };
 
     void enqueueNotificationInternal(final String pkg, final String opPkg, final int callingUid,
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index fd34aa5..ea6f2db 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -45,6 +45,8 @@
  */
 public final class NotificationRecord {
     final StatusBarNotification sbn;
+    final int mOriginalFlags;
+
     NotificationUsageStats.SingleNotificationStats stats;
     boolean isCanceled;
     int score;
@@ -73,6 +75,7 @@
     {
         this.sbn = sbn;
         this.score = score;
+        mOriginalFlags = sbn.getNotification().flags;
         mRankingTimeMs = calculateRankingTimeMs(0L);
     }
 
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 60ed93a..59d3dc8 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -4662,7 +4662,8 @@
             ActiveAdmin activeAdmin =
                     getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
             boolean isDeviceOwner = isDeviceOwner(activeAdmin.info.getPackageName());
-            if (!isDeviceOwner && DEVICE_OWNER_USER_RESTRICTIONS.contains(key)) {
+            if (!isDeviceOwner && userHandle != UserHandle.USER_OWNER
+                    && DEVICE_OWNER_USER_RESTRICTIONS.contains(key)) {
                 throw new SecurityException("Profile owners cannot set user restriction " + key);
             }
             boolean alreadyRestricted = mUserManager.hasUserRestriction(key, user);