Merge "Improve TrustManagerService user lifecycle" into lmp-mr1-dev
diff --git a/core/java/android/view/RenderNodeAnimator.java b/core/java/android/view/RenderNodeAnimator.java
index debf45d..b95f9a4 100644
--- a/core/java/android/view/RenderNodeAnimator.java
+++ b/core/java/android/view/RenderNodeAnimator.java
@@ -219,7 +219,7 @@
 
     @Override
     public void cancel() {
-        if (mState != STATE_FINISHED) {
+        if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
             if (mState == STATE_DELAYED) {
                 getHelper().removeDelayedAnimation(this);
                 notifyStartListeners();
diff --git a/docs/html/design/tv/patterns.jd b/docs/html/design/tv/patterns.jd
index 768dcfc..be7ae31 100644
--- a/docs/html/design/tv/patterns.jd
+++ b/docs/html/design/tv/patterns.jd
@@ -41,6 +41,8 @@
       language, you must provide versions of the banner image for each supported language.</li>
 </ul>
 
+<p>See <a href="{@docRoot}training/tv/start/start.html#banner">Provide a home screen banner</a>
+in Get Started with TV Apps for more information.</p>
 
 <h3>Recommendation Icons</h3>
 
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index ade05c9..7374a67 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -9,6 +9,7 @@
           android:<a href="#reparent">allowTaskReparenting</a>=["true" | "false"]
           android:<a href="#always">alwaysRetainTaskState</a>=["true" | "false"]
           android:<a href="#autoremrecents">autoRemoveFromRecents</a>=["true" | "false"]
+          android:<a href="#banner">banner</a>="<i>drawable resource</i>"
           android:<a href="#clear">clearTaskOnLaunch</a>=["true" | "false"]
           android:<a href="#config">configChanges</a>=["mcc", "mnc", "locale",
                                  "touchscreen", "keyboard", "keyboardHidden",
@@ -153,6 +154,29 @@
 "{@code true}" or "{@code false}".</dd>
 
 
+<dt><a name="banner"></a>{@code android:banner}</dt>
+<dd>A <a href="{@docRoot}guide/topics/resources/drawable-resource.html">drawable resource</a>
+providing an extended graphical banner for its associated item. Use with the
+{@code &lt;activity&gt;} tag to supply a default banner for a specific activity, or with the
+<a href="{@docRoot}guide/topics/manifest/application-element.html"><code>&lt;application&gt;</code></a>
+tag to supply a banner for all application activities.
+
+<p>The system uses the banner to represent an app in
+the Android TV home screen. Since the banner is displayed only in the home screen, it
+should only be specified by applications with an activity that handles the
+{@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER} intent.</p>
+
+<p>This attribute must be set as a reference to a drawable resource containing
+the image (for example {@code "&#64;drawable/banner"}). There is no default banner.
+</p>
+
+<p>
+See <a href="{@docRoot}design/tv/patterns.html#banner">
+Banners</a> in the UI Patterns for TV design guide, and <a href="{@docRoot}training/tv/start/start.html#banner">
+Provide a home screen banner</a> in Get Started with TV Apps for more information.
+</p></dd>
+
+
 <dt><a name="clear"></a>{@code android:clearTaskOnLaunch}</dt>
 <dd>Whether or not all activities will be removed from the task, except for
 the root activity, whenever it is re-launched from the home screen &mdash;
diff --git a/docs/html/guide/topics/manifest/application-element.jd b/docs/html/guide/topics/manifest/application-element.jd
index 33f6bce..8a0e837 100644
--- a/docs/html/guide/topics/manifest/application-element.jd
+++ b/docs/html/guide/topics/manifest/application-element.jd
@@ -7,12 +7,14 @@
 <dd><pre class="stx">&lt;application android:<a href="#reparent">allowTaskReparenting</a>=["true" | "false"]
              android:<a href="#allowbackup">allowBackup</a>=["true" | "false"]
              android:<a href="#agent">backupAgent</a>="<i>string</i>"
+             android:<a href="#banner">banner</a>="<i>drawable resource</i>"
              android:<a href="#debug">debuggable</a>=["true" | "false"]
              android:<a href="#desc">description</a>="<i>string resource</i>"
              android:<a href="#enabled">enabled</a>=["true" | "false"]
              android:<a href="#code">hasCode</a>=["true" | "false"]
              android:<a href="#hwaccel">hardwareAccelerated</a>=["true" | "false"]
              android:<a href="#icon">icon</a>="<i>drawable resource</i>"
+             android:<a href="#isGame">isGame</a>=["true" | "false"]
              android:<a href="#killrst">killAfterRestore</a>=["true" | "false"]
              android:<a href="#largeHeap">largeHeap</a>=["true" | "false"]
              android:<a href="#label">label</a>="<i>string resource</i>"
@@ -48,13 +50,13 @@
 
 <dt>description:</dt>
 <dd itemprop="description">The declaration of the application.  This element contains subelements
-that declare each of the application's components and has attributes 
-that can affect all the components.  Many of these attributes (such as 
-{@code icon}, {@code label}, {@code permission}, {@code process}, 
-{@code taskAffinity}, and {@code allowTaskReparenting}) set default values 
+that declare each of the application's components and has attributes
+that can affect all the components.  Many of these attributes (such as
+{@code icon}, {@code label}, {@code permission}, {@code process},
+{@code taskAffinity}, and {@code allowTaskReparenting}) set default values
 for corresponding attributes of the component elements.  Others (such as
-{@code debuggable}, {@code enabled}, {@code description}, and 
-{@code allowClearUserData})  set values for the application as a whole and 
+{@code debuggable}, {@code enabled}, {@code description}, and
+{@code allowClearUserData})  set values for the application as a whole and
 cannot be overridden by the components.</dd>
 
 
@@ -65,18 +67,18 @@
 <dd><dl class="attr">
 
 <dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt>
-<dd>Whether or not activities that the application defines can move from 
-the task that started them to the task they have an affinity for when that task 
-is next brought to the front &mdash; {@code "true"} if they can move, and 
-{@code "false"} if they must remain with the task where they started.  
+<dd>Whether or not activities that the application defines can move from
+the task that started them to the task they have an affinity for when that task
+is next brought to the front &mdash; {@code "true"} if they can move, and
+{@code "false"} if they must remain with the task where they started.
 The default value is {@code "false"}.
 
 <p>
-The 
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> 
-element has its own 
+The
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>
+element has its own
 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
-attribute that can override the value set here.  See that attribute for more 
+attribute that can override the value set here.  See that attribute for more
 information.
 </p></dd>
 
@@ -92,46 +94,68 @@
 <dt><a name="agent"></a>{@code android:backupAgent}</dt>
 <dd>The name of the class that implement's the application's backup agent,
 a subclass of {@link android.app.backup.BackupAgent}.  The attribute value should be
-a fully qualified  class name (such as, {@code "com.example.project.MyBackupAgent"}).  
-However, as a shorthand, if the first character of the name is a period 
-(for example, {@code ".MyBackupAgent"}), it is appended to the 
-package name specified in the 
-<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code> 
+a fully qualified  class name (such as, {@code "com.example.project.MyBackupAgent"}).
+However, as a shorthand, if the first character of the name is a period
+(for example, {@code ".MyBackupAgent"}), it is appended to the
+package name specified in the
+<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
 element.
 
 <p>
 There is no default.  The name must be specified.
 </p></dd>
 
+<dt><a name="banner"></a>{@code android:banner}</dt>
+<dd>A <a href="{@docRoot}guide/topics/resources/drawable-resource.html">drawable resource</a>
+providing an extended graphical banner for its associated item. Use with the
+{@code &lt;application&gt;} tag to supply a default banner for all application activities, or with the
+<a href="{@docRoot}guide/topics/manifest/activity-element.html"><code>&lt;activity&gt;</code></a>
+tag to supply a banner for a specific activity.
+
+<p>The system uses the banner to represent an app in
+the Android TV home screen. Since the banner is displayed only in the home screen, it
+should only be specified by applications with an activity that handles the
+{@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER} intent.</p>
+
+<p>This attribute must be set as a reference to a drawable resource containing
+the image (for example {@code "&#64;drawable/banner"}). There is no default banner.
+</p>
+
+<p>
+See <a href="{@docRoot}design/tv/patterns.html#banner">
+Banners</a> in the UI Patterns for TV design guide, and <a href="{@docRoot}training/tv/start/start.html#banner">
+Provide a home screen banner</a> in Get Started with TV Apps for more information.
+</p></dd>
+
 <dt><a name="debug"></a>{@code android:debuggable}</dt>
-<dd>Whether or not the application can be debugged, even when running 
+<dd>Whether or not the application can be debugged, even when running
 on a device in user mode &mdash; {@code "true"} if it can be, and {@code "false"}
-if not.  The default value is {@code "false"}.</dd> 
+if not.  The default value is {@code "false"}.</dd>
 
 <dt><a name="desc"></a>{@code android:description}</dt>
 <dd>User-readable text about the application, longer and more descriptive than the application label.  The value must be set as a reference to a string resource.  Unlike the label, it cannot be a raw string.  There is no default value.</dd>
 
 <dt><a name="enabled"></a>{@code android:enabled}</dt>
-<dd>Whether or not the Android system can instantiate components of 
-the application &mdash; {@code "true"} if it can, and {@code "false"} 
-if not.  If the value is {@code "true"}, each component's 
-{@code enabled} attribute determines whether that component is enabled 
-or not.  If the value is {@code "false"}, it overrides the 
+<dd>Whether or not the Android system can instantiate components of
+the application &mdash; {@code "true"} if it can, and {@code "false"}
+if not.  If the value is {@code "true"}, each component's
+{@code enabled} attribute determines whether that component is enabled
+or not.  If the value is {@code "false"}, it overrides the
 component-specific values; all components are disabled.
 
 <p>
 The default value is {@code "true"}.
-</p></dd>  
+</p></dd>
 
 <dt><a name="code"></a>{@code android:hasCode}</dt>
-<dd>Whether or not the application contains any code &mdash; {@code "true"} 
-if it does, and {@code "false"} if not.  When the value is {@code "false"}, 
-the system does not try to load any application code when launching components.  
+<dd>Whether or not the application contains any code &mdash; {@code "true"}
+if it does, and {@code "false"} if not.  When the value is {@code "false"},
+the system does not try to load any application code when launching components.
 The default value is {@code "true"}.
 
 <p>
 An application would not have any code of its own only if it's using nothing
-but built-in component classes, such as an activity that uses the {@link 
+but built-in component classes, such as an activity that uses the {@link
 android.app.AliasActivity} class, a rare occurrence.</p>
 </dd>
 
@@ -140,7 +164,7 @@
 activities and views in this application &mdash; {@code "true"} if it
 should be enabled, and {@code "false"} if not. The default value is {@code "true"} if you've set
 either <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>
-or <a 
+or <a
 href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a>
 to {@code "14"} or higher; otherwise, it's {@code "false"}.
 
@@ -161,20 +185,26 @@
 </dd>
 
 <dt><a name="icon"></a>{@code android:icon}</dt>
-<dd>An icon for the application as whole, and the default icon for 
-each of the application's components.  See the individual 
-{@code icon} attributes for 
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>, 
+<dd>An icon for the application as whole, and the default icon for
+each of the application's components.  See the individual
+{@code icon} attributes for
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>,
 <code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></code>,
-<code><a href="{@docRoot}guide/topics/manifest/service-element.html">&lt;service&gt;</a></code>, 
+<code><a href="{@docRoot}guide/topics/manifest/service-element.html">&lt;service&gt;</a></code>,
 <code><a href="{@docRoot}guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></code>, and
 <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code> elements.
 
 <p>
 This attribute must be set as a reference to a drawable resource containing
-the image (for example {@code "@drawable/icon"}). There is no default icon.
+the image (for example {@code "&#64;drawable/icon"}). There is no default icon.
 </p></dd>
 
+<dt><a name="isGame"></a>{@code android:isGame}</dt>
+<dd>Whether or not the application is a game. The system may group together applications classifed
+as games or display them separately from other applications.
+
+<p>The default is {@code false}.</p></dd>
+
 <dt><a name="killrst"></a>{@code android:killAfterRestore}</dt>
 <dd>Whether the application in question should be terminated after its
 settings have been restored during a full-system restore operation.
@@ -202,65 +232,65 @@
 </dd>
 
 <dt><a name="label"></a>{@code android:label}</dt>
-<dd>A user-readable label for the application as a whole, and a default 
-label for each of the application's components.  See the individual 
-{@code label} attributes for 
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>, 
+<dd>A user-readable label for the application as a whole, and a default
+label for each of the application's components.  See the individual
+{@code label} attributes for
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>,
 <code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></code>,
-<code><a href="{@docRoot}guide/topics/manifest/service-element.html">&lt;service&gt;</a></code>, 
+<code><a href="{@docRoot}guide/topics/manifest/service-element.html">&lt;service&gt;</a></code>,
 <code><a href="{@docRoot}guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></code>, and
 <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code> elements.
 
 <p>
 The label should be set as a reference to a string resource, so that
-it can be localized like other strings in the user interface.  
-However, as a convenience while you're developing the application, 
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
 it can also be set as a raw string.
 </p></dd>
 
 <dt><a name="logo"></a>{@code android:logo}</dt>
 <dd>A logo for the application as whole, and the default logo for activities.
 <p>This attribute must be set as a reference to a drawable resource containing
-the image (for example {@code "@drawable/logo"}).  There is no default logo.</p></dd>
+the image (for example {@code "&#64;drawable/logo"}).  There is no default logo.</p></dd>
 
 <dt><a name="space"></a>{@code android:manageSpaceActivity}</dt>
-<dd>The fully qualified name of an Activity subclass that the system 
-can launch to let users manage the memory occupied by the application 
-on the device.  The activity should also be declared with an 
+<dd>The fully qualified name of an Activity subclass that the system
+can launch to let users manage the memory occupied by the application
+on the device.  The activity should also be declared with an
 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> element.
 </dd>
 
 <dt><a name="nm"></a>{@code android:name}</dt>
-<dd>The fully qualified name of an {@link android.app.Application} 
-subclass implemented for the application.  When the application process 
-is started, this class is instantiated before any of the application's 
-components.  
+<dd>The fully qualified name of an {@link android.app.Application}
+subclass implemented for the application.  When the application process
+is started, this class is instantiated before any of the application's
+components.
 
 <p>
 The subclass is optional; most applications won't need one.
-In the absence of a subclass, Android uses an instance of the base 
+In the absence of a subclass, Android uses an instance of the base
 Application class.
 </p></dd>
 
 <dt><a name="prmsn"></a>{@code android:permission}</dt>
-<dd>The name of a permission that clients must have in order to interact 
-with the application.  This attribute is a convenient way to set a 
-permission that applies to all of the application's components.  It can 
-be overwritten by setting the {@code permission} attributes of individual 
+<dd>The name of a permission that clients must have in order to interact
+with the application.  This attribute is a convenient way to set a
+permission that applies to all of the application's components.  It can
+be overwritten by setting the {@code permission} attributes of individual
 components.
 
 <p>
-For more information on permissions, see the 
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a> 
-section in the introduction and another document, 
+For more information on permissions, see the
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
+section in the introduction and another document,
 <a href="{@docRoot}guide/topics/security/security.html">Security and
 Permissions</a>.
 </p></dd>
 
 <dt><a name="persistent"></a>{@code android:persistent}</dt>
-<dd>Whether or not the application should remain running at all times &mdash; 
-{@code "true"} if it should, and {@code "false"} if not.  The default value 
-is {@code "false"}.  Applications should not normally set this flag; 
+<dd>Whether or not the application should remain running at all times &mdash;
+{@code "true"} if it should, and {@code "false"} if not.  The default value
+is {@code "false"}.  Applications should not normally set this flag;
 persistence mode is intended only for certain system applications.</dd>
 
 <dt><a name="proc"></a>{@code android:process}</dt>
@@ -282,9 +312,9 @@
 </p>
 
 <p>
-If the name assigned to this attribute begins with a colon (':'), a new 
+If the name assigned to this attribute begins with a colon (':'), a new
 process, private to the application, is created when it's needed.
-If the process name begins with a lowercase character, a global process 
+If the process name begins with a lowercase character, a global process
 of that name is created.  A global process can be shared with other
 applications, reducing resource usage.
 </p></dd>
@@ -307,7 +337,7 @@
 If your app requires an {@link android.accounts.Account}, the value for this attribute must
 correspond to the account authenticator
 type used by your app (as defined by {@link android.accounts.AuthenticatorDescription}),
-such as "com.google".  
+such as "com.google".
 
 <p>The default value is null and indicates that the application
 can work <em>without</em> any accounts.
@@ -369,13 +399,13 @@
 <dt><a name="aff"></a>{@code android:taskAffinity}</dt>
 <dd>An affinity name that applies to all activities within the application,
 except for those that set a different affinity with their own
-<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code> 
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code>
 attributes.  See that attribute for more information.
 
 <p>
-By default, all activities within an application share the same 
-affinity.  The name of that affinity is the same as the package name 
-set by the 
+By default, all activities within an application share the same
+affinity.  The name of that affinity is the same as the package name
+set by the
 <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code> element.
 </p></dd>
 
@@ -389,7 +419,7 @@
 <dt><a name="theme"></a>{@code android:theme}</dt>
 <dd>A reference to a style resource defining a default theme for all
 activities in the application.  Individual activities can override
-the default by setting their own <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#theme">theme</a></code> 
+the default by setting their own <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#theme">theme</a></code>
 attributes. For more information, see the <a
 href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> developer guide.
 </dd>
diff --git a/docs/html/training/tv/games/index.jd b/docs/html/training/tv/games/index.jd
index 2f510a9..8a998e0 100644
--- a/docs/html/training/tv/games/index.jd
+++ b/docs/html/training/tv/games/index.jd
@@ -194,22 +194,22 @@
 
 <p>There are a some special things games should include in the Android manifest.</p>
 
-<h3 id="Launcher">Show your game in the launcher</h3>
+<h3 id="Launcher">Show your game on the home screen</h3>
 <p>
-  The Android TV launcher home screen displays games in a separate row from regular apps.
-  To make your game appear in the list of games, add the
-  <a href="{@docRoot}guide/topics/manifest/meta-data-element.html"
-  ><code>&lt;meta-data></code></a> tag in your app manifest with <code>android:name</code>
-  set to <code>"isGame"</code> and <code>android:value</code>
-  set to <code>"true"</code>. For example:
+  The Android TV home screen displays games in a separate row from regular apps.
+  To make your game appear in the list of games, set the
+  <a href="{@docRoot}guide/topics/manifest/application-element.html#isGame">
+  {@code android:isGame}</a> attribute to <code>"true"</code> in your app manifest's
+  <a href="{@docRoot}guide/topics/manifest/application-element.html"><code>&lt;application&gt;</code>
+  </a> tag. For example:
 </p>
 
 <pre class="fragment">
-&lt;application&gt;
-  ...
-  &lt;meta-data android:name="isGame" android:value="true" &gt;
-  ...
-&lt;/application&gt;
+&lt;application
+    ...
+    android:isGame="true"
+    ...
+&gt;
 </pre>
 
 
diff --git a/docs/html/training/tv/start/start.jd b/docs/html/training/tv/start/start.jd
index bebeedd..3b26abf 100644
--- a/docs/html/training/tv/start/start.jd
+++ b/docs/html/training/tv/start/start.jd
@@ -100,7 +100,8 @@
 <p>The following code snippet shows how to include this intent filter in your manifest:</p>
 
 <pre>
-&lt;application&gt;
+&lt;application
+  android:banner="&#64;drawable/banner" &gt;
   ...
   &lt;activity
     android:name=&quot;com.example.android.MainActivity&quot;
@@ -141,6 +142,34 @@
   "{@docRoot}training/tv/start/layouts.html">Building TV Layouts</a>.
 </p>
 
+<h3 id="banner">Provide a home screen banner</h3>
+
+<p>
+  An application must provide a home screen banner if it includes a Leanback launcher intent
+  filter. The banner is the app launch point that appears on the home screen in the apps and
+  games rows. Desribe the banner in the manifest as follows:
+</p>
+
+<pre>
+&lt;application
+    . . .
+    android:banner="&#64;drawable/banner" &gt;
+    . . .
+&lt;/application&gt;
+</pre>
+
+<p>
+  Use the <a href="{@docRoot}guide/topics/manifest/application-element.html#banner">{@code android:banner}</a>
+  attribute with the <a href="{@docRoot}guide/topics/manifest/application.html"><code>&lt;application&gt;</code></a>
+  tag to supply a default banner for all application activities, or with the
+  <a href="{@docRoot}guide/topics/manifest/activity-element.html"><code>&lt;activity&gt;</code></a>
+  tag to supply a banner for a specific activity.
+</p>
+
+<p>
+  See <a href="{@docRoot}design/tv/patterns.html#banner">Banners</a> in the UI Patterns for TV
+  design guide.
+</p>
 
 <h3 id="tv-libraries">Add TV support libraries</h3>
 
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index ae8ccf3..6770cba 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -275,7 +275,7 @@
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Advarsel ved <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="recents_empty_message" msgid="8682129509540827999">"Dine seneste skærme vises her"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Oplysninger om applikationen"</string>
-    <string name="recents_lock_to_app_button_label" msgid="6942899049072506044">"skærmfastholdelse"</string>
+    <string name="recents_lock_to_app_button_label" msgid="6942899049072506044">"bliv i app"</string>
     <string name="recents_search_bar_label" msgid="8074997400187836677">"søg"</string>
     <string name="recents_launch_error_message" msgid="2969287838120550506">"<xliff:g id="APP">%s</xliff:g> kunne ikke startes."</string>
     <string name="expanded_header_battery_charged" msgid="5945855970267657951">"Opladet"</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 101b4cd..bffb405 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -275,7 +275,7 @@
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"Upozorenje <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
     <string name="recents_empty_message" msgid="8682129509540827999">"Ovdje se pojavljuju vaši nedavni zasloni"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"Informacije o aplikaciji"</string>
-    <string name="recents_lock_to_app_button_label" msgid="6942899049072506044">"prikačivanje zaslona"</string>
+    <string name="recents_lock_to_app_button_label" msgid="6942899049072506044">"prikvačivanje zaslona"</string>
     <string name="recents_search_bar_label" msgid="8074997400187836677">"pretraži"</string>
     <string name="recents_launch_error_message" msgid="2969287838120550506">"Aplikacija <xliff:g id="APP">%s</xliff:g> nije pokrenuta."</string>
     <string name="expanded_header_battery_charged" msgid="5945855970267657951">"Napunjeno"</string>
diff --git a/packages/SystemUI/res/values-ka-rGE/strings.xml b/packages/SystemUI/res/values-ka-rGE/strings.xml
index 9f4163f..5bf4867 100644
--- a/packages/SystemUI/res/values-ka-rGE/strings.xml
+++ b/packages/SystemUI/res/values-ka-rGE/strings.xml
@@ -275,8 +275,7 @@
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> გაფრთხილება"</string>
     <string name="recents_empty_message" msgid="8682129509540827999">"თქვენი ბოლო ეკრანები აქ გამოჩნდება"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"აპლიკაციის შესახებ"</string>
-    <!-- no translation found for recents_lock_to_app_button_label (6942899049072506044) -->
-    <skip />
+    <string name="recents_lock_to_app_button_label" msgid="6942899049072506044">"ეკრანზე ჩამაგრება"</string>
     <string name="recents_search_bar_label" msgid="8074997400187836677">"ძიება"</string>
     <string name="recents_launch_error_message" msgid="2969287838120550506">"<xliff:g id="APP">%s</xliff:g>-ის გამოძახება ვერ მოხერხდა."</string>
     <string name="expanded_header_battery_charged" msgid="5945855970267657951">"დატენილია"</string>
diff --git a/packages/SystemUI/res/values-kn-rIN/strings.xml b/packages/SystemUI/res/values-kn-rIN/strings.xml
index 99d8acd..ba13260 100644
--- a/packages/SystemUI/res/values-kn-rIN/strings.xml
+++ b/packages/SystemUI/res/values-kn-rIN/strings.xml
@@ -275,7 +275,7 @@
     <string name="quick_settings_cellular_detail_data_warning" msgid="2440098045692399009">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ಎಚ್ಚರಿಕೆ"</string>
     <string name="recents_empty_message" msgid="8682129509540827999">"ನಿಮ್ಮ ಇತ್ತೀಚಿನ ಪರದೆಗಳು ಇಲ್ಲಿ ಕಾಣಿಸಿಕೊಳ್ಳುತ್ತವೆ"</string>
     <string name="recents_app_info_button_label" msgid="2890317189376000030">"ಅಪ್ಲಿಕೇಶನ್ ಮಾಹಿತಿ"</string>
-    <string name="recents_lock_to_app_button_label" msgid="6942899049072506044">"ಪರದೆ ಪಿನ್ನಿಂಗ್"</string>
+    <string name="recents_lock_to_app_button_label" msgid="6942899049072506044">"ಸ್ಕ್ರೀನ್ ಪಿನ್ನಿಂಗ್"</string>
     <string name="recents_search_bar_label" msgid="8074997400187836677">"ಹುಡುಕಾಟ"</string>
     <string name="recents_launch_error_message" msgid="2969287838120550506">"<xliff:g id="APP">%s</xliff:g> ಪ್ರಾರಂಭಿಸಲು ಸಾದ್ಯವಿಲ್ಲ."</string>
     <string name="expanded_header_battery_charged" msgid="5945855970267657951">"ಚಾರ್ಜ್ ಆಗಿದೆ"</string>
diff --git a/packages/SystemUI/res/values-ne-rNP/strings.xml b/packages/SystemUI/res/values-ne-rNP/strings.xml
index 6caf070..4365cd5 100644
--- a/packages/SystemUI/res/values-ne-rNP/strings.xml
+++ b/packages/SystemUI/res/values-ne-rNP/strings.xml
@@ -26,8 +26,8 @@
     <string name="status_bar_no_recent_apps" msgid="7374907845131203189">"तपाईँको हालको स्क्रिन यहाँ प्रकट हुन्छ"</string>
     <string name="status_bar_accessibility_dismiss_recents" msgid="4576076075226540105">"नयाँ अनुप्रयोगहरू खारेज गर्नुहोस्"</string>
   <plurals name="status_bar_accessibility_recent_apps">
-    <item quantity="one" msgid="3969335317929254918">"अवलोकन मा १ पर्दा"</item>
-    <item quantity="other" msgid="5523506463832158203">"अवलोकन मा %%d स्क्रीन"</item>
+    <item quantity="one" msgid="3969335317929254918">"सारांशमा 1 पर्दा"</item>
+    <item quantity="other" msgid="5523506463832158203">"सारांशमा %d पर्दाहरू"</item>
   </plurals>
     <string name="status_bar_no_notifications_title" msgid="4755261167193833213">"कुनै सूचनाहरू छैन"</string>
     <string name="status_bar_ongoing_events_title" msgid="1682504513316879202">"चलिरहेको"</string>
@@ -80,7 +80,7 @@
     <string name="accessibility_back" msgid="567011538994429120">"पछाडि"</string>
     <string name="accessibility_home" msgid="8217216074895377641">"गृह"</string>
     <string name="accessibility_menu" msgid="316839303324695949">"मेनु"</string>
-    <string name="accessibility_recent" msgid="5208608566793607626">"अवलोकन"</string>
+    <string name="accessibility_recent" msgid="5208608566793607626">"सारांश"</string>
     <string name="accessibility_search_light" msgid="1103867596330271848">"खोज्नुहोस्"</string>
     <string name="accessibility_camera_button" msgid="8064671582820358152">"क्यामेरा"</string>
     <string name="accessibility_phone_button" msgid="6738112589538563574">"फोन"</string>
@@ -165,7 +165,7 @@
     <string name="accessibility_desc_quick_settings" msgid="6186378411582437046">"द्रुत सेटिङहरू"</string>
     <string name="accessibility_desc_lock_screen" msgid="5625143713611759164">"स्क्रीन बन्द गर्नुहोस्।"</string>
     <string name="accessibility_desc_settings" msgid="3417884241751434521">"सेटिङहरू"</string>
-    <string name="accessibility_desc_recent_apps" msgid="4876900986661819788">"अवलोकन।"</string>
+    <string name="accessibility_desc_recent_apps" msgid="4876900986661819788">"सारांश।"</string>
     <string name="accessibility_quick_settings_user" msgid="1104846699869476855">"प्रयोगकर्ता <xliff:g id="USER">%s</xliff:g>।"</string>
     <string name="accessibility_quick_settings_wifi" msgid="5518210213118181692">"<xliff:g id="SIGNAL">%1$s</xliff:g>।"</string>
     <string name="accessibility_quick_settings_wifi_changed_off" msgid="8716484460897819400">"वाइफाइ बन्द गरियो।"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 773ce0f..a9dcc39 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -298,7 +298,7 @@
     <string name="speed_bump_explanation" msgid="1288875699658819755">"較不緊急的通知會顯示在下方"</string>
     <string name="notification_tap_again" msgid="8524949573675922138">"再次輕觸即可開啟"</string>
     <string name="keyguard_unlock" msgid="8043466894212841998">"向上滑動即可解鎖"</string>
-    <string name="phone_hint" msgid="3101468054914424646">"向左滑動可使用手機功能"</string>
+    <string name="phone_hint" msgid="3101468054914424646">"向右滑動可使用手機功能"</string>
     <string name="camera_hint" msgid="5241441720959174226">"向左滑動可使用相機功能"</string>
     <string name="interruption_level_none" msgid="3831278883136066646">"無"</string>
     <string name="interruption_level_priority" msgid="6517366750688942030">"優先"</string>
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index a48d39f..b4e2778 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -73,6 +73,7 @@
 import android.graphics.Region;
 import android.hardware.display.DisplayManager;
 import android.hardware.display.DisplayManagerInternal;
+import android.net.Uri;
 import android.os.Binder;
 import android.os.Bundle;
 import android.os.Debug;
@@ -558,16 +559,26 @@
     SettingsObserver mSettingsObserver;
 
     private final class SettingsObserver extends ContentObserver {
+        private final Uri mShowImeWithHardKeyboardUri =
+                Settings.Secure.getUriFor(Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD);
+
+        private final Uri mDisplayInversionEnabledUri =
+                Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
+
         public SettingsObserver() {
             super(new Handler());
             ContentResolver resolver = mContext.getContentResolver();
-            resolver.registerContentObserver(Settings.Secure.getUriFor(
-                    Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD), false, this);
+            resolver.registerContentObserver(mShowImeWithHardKeyboardUri, false, this);
+            resolver.registerContentObserver(mDisplayInversionEnabledUri, false, this);
         }
 
         @Override
-        public void onChange(boolean selfChange) {
-            updateShowImeWithHardKeyboard();
+        public void onChange(boolean selfChange, Uri uri) {
+            if (mShowImeWithHardKeyboardUri.equals(uri)) {
+                updateShowImeWithHardKeyboard();
+            } else if (mDisplayInversionEnabledUri.equals(uri)) {
+                updateCircularDisplayMaskIfNeeded();
+            }
         }
     }
 
@@ -903,7 +914,7 @@
             SurfaceControl.closeTransaction();
         }
 
-        showCircularDisplayMaskIfNeeded();
+        updateCircularDisplayMaskIfNeeded();
         showEmulatorDisplayOverlayIfNeeded();
     }
 
@@ -5842,13 +5853,21 @@
         }
     }
 
-    public void showCircularDisplayMaskIfNeeded() {
+    public void updateCircularDisplayMaskIfNeeded() {
         // we're fullscreen and not hosted in an ActivityView
         if (mContext.getResources().getBoolean(
                 com.android.internal.R.bool.config_windowIsRound)
                 && mContext.getResources().getBoolean(
                 com.android.internal.R.bool.config_windowShowCircularMask)) {
-            mH.sendMessage(mH.obtainMessage(H.SHOW_CIRCULAR_DISPLAY_MASK));
+            // Device configuration calls for a circular display mask, but we only enable the mask
+            // if the accessibility color inversion feature is disabled, as the inverted mask
+            // causes artifacts.
+            int inversionState = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+                    Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 0, mCurrentUserId);
+            int showMask = (inversionState == 1) ? 0 : 1;
+            Message m = mH.obtainMessage(H.SHOW_CIRCULAR_DISPLAY_MASK);
+            m.arg1 = showMask;
+            mH.sendMessage(m);
         }
     }
 
@@ -5861,30 +5880,35 @@
         }
     }
 
-    public void showCircularMask() {
+    public void showCircularMask(boolean visible) {
         synchronized(mWindowMap) {
 
             if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
-                    ">>> OPEN TRANSACTION showCircularMask");
+                    ">>> OPEN TRANSACTION showCircularMask(visible=" + visible + ")");
             SurfaceControl.openTransaction();
             try {
-                // TODO(multi-display): support multiple displays
-                if (mCircularDisplayMask == null) {
-                    int screenOffset = mContext.getResources().getDimensionPixelSize(
-                            com.android.internal.R.dimen.circular_display_mask_offset);
+                if (visible) {
+                    // TODO(multi-display): support multiple displays
+                    if (mCircularDisplayMask == null) {
+                        int screenOffset = mContext.getResources().getDimensionPixelSize(
+                                com.android.internal.R.dimen.circular_display_mask_offset);
 
-                    mCircularDisplayMask = new CircularDisplayMask(
-                            getDefaultDisplayContentLocked().getDisplay(),
-                            mFxSession,
-                            mPolicy.windowTypeToLayerLw(
-                                    WindowManager.LayoutParams.TYPE_POINTER)
-                                    * TYPE_LAYER_MULTIPLIER + 10, screenOffset);
+                        mCircularDisplayMask = new CircularDisplayMask(
+                                getDefaultDisplayContentLocked().getDisplay(),
+                                mFxSession,
+                                mPolicy.windowTypeToLayerLw(
+                                        WindowManager.LayoutParams.TYPE_POINTER)
+                                        * TYPE_LAYER_MULTIPLIER + 10, screenOffset);
+                    }
+                    mCircularDisplayMask.setVisibility(true);
+                } else if (mCircularDisplayMask != null) {
+                    mCircularDisplayMask.setVisibility(false);
+                    mCircularDisplayMask = null;
                 }
-                mCircularDisplayMask.setVisibility(true);
             } finally {
                 SurfaceControl.closeTransaction();
                 if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
-                        "<<< CLOSE TRANSACTION showCircularMask");
+                        "<<< CLOSE TRANSACTION showCircularMask(visible=" + visible + ")");
             }
         }
     }
@@ -7955,7 +7979,7 @@
                 }
 
                 case SHOW_CIRCULAR_DISPLAY_MASK: {
-                    showCircularMask();
+                    showCircularMask(msg.arg1 == 1);
                     break;
                 }