Merge tag 'android-12.1.0_r7' into staging/lineage-19.1_merge-android-12.1.0_r7

Android 12.1.0 Release 7 (SQ3A.220605.009.A1)

# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCYp57OgAKCRDorT+BmrEO
# eFbSAJ44oj9T9RtgeR5pQBUwrn6Kn6i9JACfeCAnsOP9LNbznsboMlh0qOfYujE=
# =d3nx
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Jun  7 01:10:02 2022 EEST
# gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [marginal]
# gpg: initial-contribution@android.com: Verified 1188 signatures in the past
#      7 months.  Encrypted 4 messages in the past 4 months.
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 4340 D135 70EF 945E 8381  0964 E8AD 3F81 9AB1 0E78

# By Bill Yi
# Via Android Build Coastguard Worker (3) and others
* tag 'android-12.1.0_r7':
  Import translations. DO NOT MERGE ANYWHERE
  Import translations. DO NOT MERGE ANYWHERE
  Import translations. DO NOT MERGE ANYWHERE
  Import translations. DO NOT MERGE ANYWHERE
  Import translations. DO NOT MERGE ANYWHERE

Change-Id: I3e43483f0f1c29902b4bd76543b350c755f1af33
diff --git a/Android.bp b/Android.bp
index 57d30ce..28749ea 100644
--- a/Android.bp
+++ b/Android.bp
@@ -97,5 +97,28 @@
     platform_apis: true,
     manifest: "AndroidManifest.xml",
     additional_manifests: [":WallpaperPicker2_Manifest"],
-    overrides: ["WallpaperPicker2"],
+    overrides: [
+        "WallpaperCropper",
+        "WallpaperPicker2",
+    ],
+    required: [
+        "default_permissions_com.android.wallpaper",
+        "privapp_whitelist_com.android.wallpaper"
+    ],
+}
+
+prebuilt_etc {
+    name: "default_permissions_com.android.wallpaper",
+    system_ext_specific: true,
+    src: "default_permissions_com.android.wallpaper.xml",
+    sub_dir: "default-permissions",
+    filename_from_src: true,
+}
+
+prebuilt_etc {
+    name: "privapp_whitelist_com.android.wallpaper",
+    system_ext_specific: true,
+    src: "privapp_whitelist_com.android.wallpaper.xml",
+    sub_dir: "permissions",
+    filename_from_src: true,
 }
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c6e79a9..a86d70a 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -8,6 +8,7 @@
     <uses-permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES"/>
     <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
     <uses-permission android:name="android.permission.SET_WALLPAPER_COMPONENT" />
+    <uses-permission android:name="android.permission.BIND_WALLPAPER" />
 
     <uses-permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE" />
 
@@ -35,13 +36,21 @@
         <intent>
             <action android:name="com.android.launcher3.action.PARTNER_CUSTOMIZATION" />
         </intent>
+        <!-- Intent filter with action used to discover launcher -->
+        <intent>
+            <action android:name="android.intent.action.MAIN" />
+            <category android:name="android.intent.category.HOME" />
+        </intent>
     </queries>
 
+    <uses-permission android:name="com.android.launcher3.permission.READ_SETTINGS" />
+    <uses-permission android:name="com.android.launcher3.permission.WRITE_SETTINGS" />
+
     <application
         tools:replace="android:icon,android:name"
         android:extractNativeLibs="false"
         android:hardwareAccelerated="true"
-        android:icon="@drawable/ic_home"
+        android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:requiredForAllUsers="true"
         android:restoreAnyVersion="true"
diff --git a/default_permissions_com.android.wallpaper.xml b/default_permissions_com.android.wallpaper.xml
new file mode 100644
index 0000000..41b23ce
--- /dev/null
+++ b/default_permissions_com.android.wallpaper.xml
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<!--
+     Copyright (C) 2019-2020 The LineageOS 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.
+-->
+
+<!--
+    This file contains permissions to be granted by default. Default
+    permissions are granted to special platform components and to apps
+    that are approved to get default grants. The special components
+    are apps that are expected to work out-of-the-box as they provide
+    core use cases such as default dialer, default email, etc. These
+    grants are managed by the platform. The apps that are additionally
+    approved for default grants are ones that provide carrier specific
+    functionality, ones legally required at some location, ones providing
+    alternative disclosure and opt-out UI, ones providing highlight features
+    of a dedicated device, etc. This file contains only the latter exceptions.
+    Fixed permissions cannot be controlled by the user and need a special
+    approval. Typically these are to ensure either legally mandated functions
+    or the app is considered a part of the OS.
+-->
+<exceptions>
+    <exception package="com.android.wallpaper">
+        <permission name="android.permission.READ_EXTERNAL_STORAGE" fixed="false"/>
+    </exception>
+</exceptions>
diff --git a/privapp_whitelist_com.android.wallpaper.xml b/privapp_whitelist_com.android.wallpaper.xml
new file mode 100644
index 0000000..0ae3fbb
--- /dev/null
+++ b/privapp_whitelist_com.android.wallpaper.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2019 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
+  -->
+<permissions>
+    <privapp-permissions package="com.android.wallpaper">
+        <permission name="android.permission.BIND_WALLPAPER"/>
+        <permission name="android.permission.CHANGE_OVERLAY_PACKAGES"/>
+        <permission name="android.permission.MODIFY_DAY_NIGHT_MODE"/>
+        <permission name="android.permission.SET_WALLPAPER_COMPONENT"/>
+        <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
+    </privapp-permissions>
+</permissions>
diff --git a/res/drawable/ic_home.xml b/res/drawable/ic_home.xml
deleted file mode 100644
index be8f1fe..0000000
--- a/res/drawable/ic_home.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
-    <background android:drawable="?android:colorAccent" />
-    <foreground>
-        <inset android:inset="16.6%" android:drawable="@drawable/icon_foreground" />
-    </foreground>
-</adaptive-icon>
diff --git a/res/drawable/ic_launcher_background.xml b/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..5112859
--- /dev/null
+++ b/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     SPDX-FileCopyrightText: 2022 The LineageOS Project
+     SPDX-License-Identifier: Apache-2.0
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+  <path
+      android:pathData="M0,0h108v108h-108z"
+      android:fillColor="#0092E4"/>
+  <path
+      android:pathData="M54,76C41.878,76 32,66.122 32,54C32,41.878 41.878,32 54,32C66.122,32 76,40.888 76,51.8C76,59.082 70.082,64 62.8,64H59C52.925,64 53.5,67 55,68C56.5,69 60,69 60,72C60,75 57.036,76 54,76Z"
+      android:fillColor="#ffffff"/>
+</vector>
diff --git a/res/drawable/ic_launcher_foreground.xml b/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..8fef075
--- /dev/null
+++ b/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     SPDX-FileCopyrightText: 2022 The LineageOS Project
+     SPDX-License-Identifier: Apache-2.0
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:aapt="http://schemas.android.com/aapt"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+  <group>
+    <clip-path
+        android:pathData="M0,0h108v108h-108z"/>
+    <path
+        android:pathData="M68,50m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
+        android:fillColor="#CBDEFB"/>
+    <path
+        android:pathData="M40,50m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
+        android:fillColor="#00354A"/>
+    <path
+        android:pathData="M60,41m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
+        android:fillColor="#0092E4"/>
+    <path
+        android:pathData="M48,41m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
+        android:fillColor="#00689B"/>
+    <path
+        android:pathData="M28.54,28.54m-72,0a72,72 0,1 1,144 0a72,72 0,1 1,-144 0"
+        android:fillAlpha="0.6">
+      <aapt:attr name="android:fillColor">
+        <gradient
+            android:gradientRadius="72"
+            android:centerX="28.54"
+            android:centerY="28.54"
+            android:type="radial">
+          <item android:offset="0" android:color="#19FFFFFF"/>
+          <item android:offset="1" android:color="#00FFFFFF"/>
+        </gradient>
+      </aapt:attr>
+    </path>
+  </group>
+</vector>
diff --git a/res/drawable/icon_foreground.xml b/res/drawable/icon_foreground.xml
deleted file mode 100644
index 1138c56..0000000
--- a/res/drawable/icon_foreground.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-<vector android:height="72dp" android:viewportHeight="512"
-    android:viewportWidth="512" android:width="72dp"
-    xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
-    <path android:pathData="M512.25,248.55l-118,-118 -4.86,-4.86c-1.72,-1.65 -3.47,-3.28 -5.26,-4.86 -33,-29.29 -78.25,-47.41 -128.1,-47.41 -100.59,0 -182.56,82 -182.56,182.56a181.9,181.9 0,0 0,50.09 125.42h0l0.14,0.14q3.39,3.58 7,7L254.16,512H512.25Z">
-        <aapt:attr name="android:fillColor">
-            <gradient android:endX="512.25" android:endY="292.69"
-                android:startX="73.44" android:startY="292.69" android:type="linear">
-                <item android:color="#331C3AA9" android:offset="0"/>
-                <item android:color="#051C3AA9" android:offset="1"/>
-            </gradient>
-        </aapt:attr>
-    </path>
-    <path android:fillAlpha="0.2" android:fillColor="#1a237e"
-        android:pathData="M256,438.51c-100.59,0 -182.56,-82 -182.56,-182.56S155.41,73.39 256,73.39s182.56,73.75 182.56,164.3A109.63,109.63 0,0 1,329 347.23L296.71,347.23a9,9 0,0 0,-9.13 9.12,9.65 9.65,0 0,0 2.38,6 46.46,46.46 0,0 1,11.68 30.49A45.66,45.66 0,0 1,256 438.51ZM155.59,274.2a27.38,27.38 0,1 0,-27.38 -27.38A27.38,27.38 0,0 0,155.59 274.2ZM210.36,201.2A27.39,27.39 0,1 0,183 173.8,27.38 27.38,0 0,0 210.36,201.18ZM301.64,201.2a27.39,27.39 0,1 0,-27.38 -27.38A27.38,27.38 0,0 0,301.64 201.18ZM356.41,274.2A27.38,27.38 0,1 0,329 246.82,27.38 27.38,0 0,0 356.41,274.2Z" android:strokeAlpha="0.2"/>
-    <path android:fillColor="#fff" android:pathData="M389.36,125.66l4.86,4.86C392.64,128.87 391,127.25 389.36,125.66Z"/>
-    <path android:fillColor="#eee" android:pathData="M256,438.51c-100.59,0 -182.56,-82 -182.56,-182.56S155.41,73.39 256,73.39s182.56,73.75 182.56,164.3A109.63,109.63 0,0 1,329 347.23L296.71,347.23a9,9 0,0 0,-9.13 9.12,9.65 9.65,0 0,0 2.38,6 46.46,46.46 0,0 1,11.68 30.49A45.66,45.66 0,0 1,256 438.51ZM155.59,274.2a27.38,27.38 0,1 0,-27.38 -27.38A27.38,27.38 0,0 0,155.59 274.2ZM210.36,201.2A27.39,27.39 0,1 0,183 173.8,27.38 27.38,0 0,0 210.36,201.18ZM301.64,201.2a27.39,27.39 0,1 0,-27.38 -27.38A27.38,27.38 0,0 0,301.64 201.18ZM356.41,274.2A27.38,27.38 0,1 0,329 246.82,27.38 27.38,0 0,0 356.41,274.2Z"/>
-    <path android:fillAlpha="0.4" android:fillColor="#fff" android:pathData="M256,75.39c100.24,0 182,73.24 182.55,163.36 0,-0.36 0,-0.71 0,-1.06 0,-90.55 -82,-164.3 -182.56,-164.3S73.44,155.36 73.44,256c0,0.33 0,0.66 0,1C74,156.82 155.74,75.39 256,75.39Z"/>
-    <path android:fillAlpha="0.1" android:fillColor="#212121" android:pathData="M329,345.23H296.71a9,9 0,0 0,-9.13 9.12,7.45 7.45,0 0,0 0.07,0.95 9,9 0,0 1,9.06 -8.07H329A109.63,109.63 0,0 0,438.56 237.69c0,-0.31 0,-0.63 0,-0.94A109.62,109.62 0,0 1,329 345.23Z"/>
-    <path android:fillAlpha="0.1" android:fillColor="#212121" android:pathData="M256,436.51C155.74,436.51 74,355.08 73.45,255c0,0.33 0,0.66 0,1 0,100.59 82,182.56 182.56,182.56a45.66,45.66 0,0 0,45.64 -45.64c0,-0.35 0,-0.69 0,-1A45.66,45.66 0,0 1,256 436.51Z"/>
-    <path android:fillAlpha="0.1" android:fillColor="#212121" android:pathData="M356.41,221.44a27.38,27.38 0,0 1,27.36 26.38c0,-0.33 0,-0.67 0,-1a27.39,27.39 0,0 0,-54.77 0c0,0.33 0,0.67 0,1A27.38,27.38 0,0 1,356.41 221.44Z"/>
-    <path android:fillAlpha="0.1" android:fillColor="#212121" android:pathData="M301.64,148.41A27.39,27.39 0,0 1,329 174.8c0,-0.34 0,-0.67 0,-1a27.38,27.38 0,1 0,-54.76 0c0,0.33 0,0.66 0,1A27.39,27.39 0,0 1,301.64 148.41Z"/>
-    <path android:fillColor="#8ab4f8" android:pathData="M155.59,246.82m-27.38,0a27.38,27.38 0,1 1,54.76 0a27.38,27.38 0,1 1,-54.76 0"/>
-    <path android:fillAlpha="0.6" android:fillColor="#8ab4f8"
-        android:pathData="M210.36,173.8m-27.38,0a27.38,27.38 0,1 1,54.76 0a27.38,27.38 0,1 1,-54.76 0" android:strokeAlpha="0.6"/>
-    <path android:fillAlpha="0.3" android:fillColor="#8ab4f8"
-        android:pathData="M301.64,173.8m-27.38,0a27.38,27.38 0,1 1,54.76 0a27.38,27.38 0,1 1,-54.76 0" android:strokeAlpha="0.3"/>
-    <path android:fillColor="#1a73e8" android:pathData="M356.41,246.82m-27.38,0a27.38,27.38 0,1 1,54.76 0a27.38,27.38 0,1 1,-54.76 0"/>
-    <path android:fillAlpha="0.1" android:fillColor="#212121" android:pathData="M155.59,274.2A27.38,27.38 0,0 0,183 246.82c0,-0.34 0,-0.67 0,-1a27.38,27.38 0,0 1,-54.72 0c0,0.33 0,0.66 0,1A27.38,27.38 0,0 0,155.59 274.2Z"/>
-    <path android:fillAlpha="0.24000001" android:fillColor="#fff"
-        android:pathData="M155.59,219.44a27.38,27.38 0,0 0,-27.38 27.38c0,0.33 0,0.67 0,1a27.38,27.38 0,0 1,54.72 0c0,-0.33 0,-0.67 0,-1A27.38,27.38 0,0 0,155.59 219.44Z" android:strokeAlpha="0.6"/>
-    <path android:fillAlpha="0.24000001" android:fillColor="#fff"
-        android:pathData="M210.36,146.41A27.38,27.38 0,0 0,183 173.8c0,0.33 0,0.66 0,1a27.38,27.38 0,0 1,54.72 0c0,-0.34 0,-0.67 0,-1A27.38,27.38 0,0 0,210.36 146.41Z" android:strokeAlpha="0.6"/>
-    <path android:fillAlpha="0.1" android:fillColor="#212121" android:pathData="M210.36,201.18a27.38,27.38 0,0 0,27.38 -27.38c0,-0.34 0,-0.67 0,-1a27.38,27.38 0,0 1,-54.72 0c0,0.33 0,0.66 0,1A27.38,27.38 0,0 0,210.36 201.18Z"/>
-    <path android:fillAlpha="0.1" android:fillColor="#212121" android:pathData="M301.64,199.18a27.38,27.38 0,0 1,-27.36 -26.38c0,0.33 0,0.66 0,1a27.38,27.38 0,0 0,54.76 0c0,-0.34 0,-0.67 0,-1A27.38,27.38 0,0 1,301.64 199.18Z"/>
-    <path android:fillAlpha="0.24000001" android:fillColor="#fff"
-        android:pathData="M301.64,148.41A27.39,27.39 0,0 1,329 174.8c0,-0.34 0,-0.67 0,-1a27.38,27.38 0,1 0,-54.76 0c0,0.33 0,0.66 0,1A27.39,27.39 0,0 1,301.64 148.41Z" android:strokeAlpha="0.6"/>
-    <path android:fillAlpha="0.24000001" android:fillColor="#fff"
-        android:pathData="M356.41,221.44a27.38,27.38 0,0 1,27.36 26.38c0,-0.33 0,-0.67 0,-1a27.39,27.39 0,0 0,-54.77 0c0,0.33 0,0.67 0,1A27.38,27.38 0,0 1,356.41 221.44Z" android:strokeAlpha="0.6"/>
-    <path android:fillAlpha="0.1" android:fillColor="#FF000000" android:pathData="M356.41,272.2a27.38,27.38 0,0 1,-27.36 -26.38c0,0.33 0,0.66 0,1a27.39,27.39 0,0 0,54.77 0c0,-0.34 0,-0.67 0,-1A27.38,27.38 0,0 1,356.41 272.2Z"/>
-    <path android:pathData="M0,0.07V512H512V0Z">
-        <aapt:attr name="android:fillColor">
-            <gradient android:centerX="16.842121"
-                android:centerY="53.77451"
-                android:gradientRadius="512.5738" android:type="radial">
-                <item android:color="#19FFFFFF" android:offset="0"/>
-                <item android:color="#00FFFFFF" android:offset="1"/>
-            </gradient>
-        </aapt:attr>
-    </path>
-</vector>
diff --git a/res/mipmap-anydpi/ic_launcher.xml b/res/mipmap-anydpi/ic_launcher.xml
new file mode 100644
index 0000000..3d90bc5
--- /dev/null
+++ b/res/mipmap-anydpi/ic_launcher.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     SPDX-FileCopyrightText: 2022 The LineageOS Project
+     SPDX-License-Identifier: Apache-2.0
+-->
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background"/>
+    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
+</adaptive-icon>