Merge "settings(nfc): Remove NFC beam settings" into main
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index dd49e8c..a08bda3 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -4982,6 +4982,7 @@
<activity android:name=".privatespace.PrivateSpaceAuthenticationActivity"
android:theme="@*android:style/Theme.DeviceDefault.Settings.Dialog.NoActionBar"
android:exported="false"/>
+ <activity android:name=".privatespace.PrivateProfileContextHelperActivity" android:exported="false"/>
<activity-alias android:name="UsageStatsActivity"
android:exported="true"
diff --git a/aconfig/settings_accessibility_flag_declarations.aconfig b/aconfig/settings_accessibility_flag_declarations.aconfig
index 10b536d..246f983 100644
--- a/aconfig/settings_accessibility_flag_declarations.aconfig
+++ b/aconfig/settings_accessibility_flag_declarations.aconfig
@@ -20,9 +20,16 @@
}
flag {
- name: "separate_accessibility_vibration_settings_fragments"
- namespace: "accessibility"
- description: "Splits VibrationSettings into two fragments, one per XML resource"
- bug: "289967175"
+ name: "separate_accessibility_vibration_settings_fragments"
+ namespace: "accessibility"
+ description: "Splits VibrationSettings into two fragments, one per XML resource"
+ bug: "289967175"
+}
+
+flag {
+ name: "new_hearing_device_pairing_page"
+ namespace: "accessibility"
+ description: "New hearing device pairing page with deny list method"
+ bug: "307473972"
}
diff --git a/res/drawable/ic_audio_calls_and_alarms.xml b/res/drawable/ic_audio_calls_and_alarms.xml
new file mode 100644
index 0000000..5da27c6
--- /dev/null
+++ b/res/drawable/ic_audio_calls_and_alarms.xml
@@ -0,0 +1,32 @@
+<!--
+ Copyright (C) 2018 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 xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0"
+ android:tint="?android:attr/colorControlNormal">
+ <path
+ android:pathData="M3,15V9H7L12,4V20L7,15H3ZM10,15.17V8.83L7.83,11H5V13H7.83L10,15.17Z"
+ android:fillType="evenOdd"
+ android:fillColor="?android:attr/colorPrimary"/>
+ <path
+ android:pathData="M16.5,12C16.5,10.23 15.48,8.71 14,7.97V16.02C15.48,15.29 16.5,13.77 16.5,12Z"
+ android:fillColor="?android:attr/colorPrimary"/>
+ <path
+ android:pathData="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.85 14,18.71V20.77C18.01,19.86 21,16.28 21,12C21,7.72 18.01,4.14 14,3.23Z"
+ android:fillColor="?android:attr/colorPrimary"/>
+</vector>
diff --git a/res/drawable/ic_privatespace_done.xml b/res/drawable/ic_privatespace_done.xml
new file mode 100644
index 0000000..aa0d5e6
--- /dev/null
+++ b/res/drawable/ic_privatespace_done.xml
@@ -0,0 +1,19 @@
+<!--
+ ~ Copyright (C) 2023 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 xmlns:android="http://schemas.android.com/apk/res/android" android:width="48dp" android:height="48dp" android:viewportWidth="960" android:viewportHeight="960" android:tint="?attr/colorControlNormal">
+ <path android:fillColor="@android:color/white" android:pathData="M378,714L154,490L197,447L378,628L762,244L805,287L378,714Z"/>
+</vector>
diff --git a/res/drawable/ic_warning_circle_red.xml b/res/drawable/ic_warning_circle_red.xml
new file mode 100644
index 0000000..4decf3a
--- /dev/null
+++ b/res/drawable/ic_warning_circle_red.xml
@@ -0,0 +1,20 @@
+<!--
+ ~ Copyright (C) 2023 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="24dp" android:viewportHeight="40"
+ android:viewportWidth="40" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#F2B8B5" android:pathData="M20,30C20.567,30 21.033,29.817 21.4,29.45C21.8,29.05 22,28.567 22,28C22,27.433 21.8,26.967 21.4,26.6C21.033,26.2 20.567,26 20,26C19.433,26 18.95,26.2 18.55,26.6C18.183,26.967 18,27.433 18,28C18,28.567 18.183,29.05 18.55,29.45C18.95,29.817 19.433,30 20,30ZM18,22H22V10H18V22ZM20,40C17.233,40 14.633,39.483 12.2,38.45C9.767,37.383 7.65,35.95 5.85,34.15C4.05,32.35 2.617,30.233 1.55,27.8C0.517,25.367 0,22.767 0,20C0,17.233 0.517,14.633 1.55,12.2C2.617,9.767 4.05,7.65 5.85,5.85C7.65,4.05 9.767,2.633 12.2,1.6C14.633,0.533 17.233,-0 20,-0C22.767,-0 25.367,0.533 27.8,1.6C30.233,2.633 32.35,4.05 34.15,5.85C35.95,7.65 37.367,9.767 38.4,12.2C39.467,14.633 40,17.233 40,20C40,22.767 39.467,25.367 38.4,27.8C37.367,30.233 35.95,32.35 34.15,34.15C32.35,35.95 30.233,37.383 27.8,38.45C25.367,39.483 22.767,40 20,40ZM20,36C24.467,36 28.25,34.45 31.35,31.35C34.45,28.25 36,24.467 36,20C36,15.533 34.45,11.75 31.35,8.65C28.25,5.55 24.467,4 20,4C15.533,4 11.75,5.55 8.65,8.65C5.55,11.75 4,15.533 4,20C4,24.467 5.55,28.25 8.65,31.35C11.75,34.45 15.533,36 20,36Z"/>
+</vector>
diff --git a/res/drawable/privatespace_lock_placeholder.xml b/res/drawable/privatespace_lock_placeholder.xml
new file mode 100644
index 0000000..815ffd7
--- /dev/null
+++ b/res/drawable/privatespace_lock_placeholder.xml
@@ -0,0 +1,78 @@
+<!--
+ ~ Copyright (C) 2023 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 xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="380dp"
+ android:height="276dp"
+ android:viewportWidth="380"
+ android:viewportHeight="276">
+ <path
+ android:pathData="M354.34,276H25.66C11.56,276 0,264.2 0,249.8V26.24C0,11.8 11.56,0 25.66,0H354.44C368.44,0 380,11.8 380,26.2V249.9C380,264.2 368.44,276 354.34,276Z"
+ android:fillColor="#000000"/>
+ <path
+ android:pathData="M190,37.72C185.34,37.71 180.72,38.64 176.42,40.45C170.09,43.12 164.69,47.58 160.89,53.3C157.1,59.01 155.09,65.72 155.1,72.57V90.07H155.29V111.34H161.68V72.57C161.67,67.12 163.23,61.79 166.18,57.2L166.04,57.11C166.1,57.01 166.16,56.92 166.23,56.82C169.33,52.16 173.74,48.5 178.91,46.33C185.11,43.73 192.03,43.39 198.45,45.38C204.88,47.37 210.39,51.55 214.02,57.2L214.01,57.2C216.96,61.79 218.52,67.12 218.51,72.57V111.34H224.9V72.57C224.92,65.9 223,59.37 219.4,53.76L215.27,56.4L219.39,53.76C216.24,48.83 211.89,44.78 206.76,41.98C201.62,39.17 195.86,37.71 190,37.72Z"
+ android:fillColor="#669DF6"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="M250.08,227.69H129.92C126.53,227.69 123.28,226.35 120.88,223.96C118.48,221.56 117.14,218.32 117.14,214.93V122.24C117.14,118.86 118.48,115.61 120.88,113.22C123.28,110.83 126.53,109.48 129.92,109.48H250.08C253.47,109.48 256.72,110.83 259.12,113.22C261.52,115.61 262.86,118.86 262.86,122.24V214.93C262.86,218.32 261.52,221.56 259.12,223.96C256.72,226.35 253.47,227.69 250.08,227.69ZM129.92,113.13C127.5,113.13 125.18,114.09 123.46,115.8C121.75,117.5 120.79,119.82 120.79,122.24V214.93C120.79,217.35 121.75,219.67 123.46,221.38C125.18,223.09 127.5,224.05 129.92,224.05H250.08C252.5,224.05 254.82,223.09 256.54,221.38C258.25,219.67 259.21,217.35 259.21,214.93V122.24C259.21,119.82 258.25,117.5 256.54,115.8C254.82,114.09 252.5,113.13 250.08,113.13H129.92Z"
+ android:fillColor="#80868B"/>
+ <path
+ android:pathData="M281.77,245.93C303.27,245.93 320.69,228.59 320.69,207.21C320.69,185.83 303.27,168.49 281.77,168.49C260.28,168.49 242.86,185.83 242.86,207.21C242.86,228.59 260.28,245.93 281.77,245.93Z"
+ android:fillColor="#000000"/>
+ <path
+ android:pathData="M281.77,168.36C260.2,168.36 242.57,185.76 242.57,207.37C242.57,228.97 260.06,246.37 281.77,246.37C303.49,246.37 320.97,228.97 320.97,207.37C320.97,185.76 303.35,168.36 281.77,168.36ZM281.77,238.37C264.57,238.37 250.47,224.34 250.47,207.22C250.47,190.11 264.57,176.08 281.77,176.08C298.98,176.08 313.08,190.11 313.08,207.22C313.08,224.48 298.98,238.37 281.77,238.37Z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M281.77,170.07C261.13,170.07 244.27,186.71 244.27,207.37C244.27,228.02 260.99,244.66 281.77,244.66C302.55,244.66 319.27,228.02 319.27,207.37C319.27,186.71 302.42,170.07 281.77,170.07ZM281.77,240.07C263.64,240.07 248.77,225.29 248.77,207.22C248.77,189.16 263.64,174.38 281.77,174.38C299.91,174.38 314.78,189.16 314.78,207.22C314.78,225.43 299.9,240.07 281.77,240.07ZM242.57,207.37C242.57,185.76 260.2,168.36 281.77,168.36C303.35,168.36 320.97,185.76 320.97,207.37C320.97,228.97 303.49,246.37 281.77,246.37C260.06,246.37 242.57,228.97 242.57,207.37ZM250.47,207.22C250.47,224.34 264.57,238.37 281.77,238.37C298.98,238.37 313.08,224.48 313.08,207.22C313.08,190.11 298.98,176.08 281.77,176.08C264.57,176.08 250.47,190.11 250.47,207.22Z"
+ android:fillColor="#000000"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="M301.48,193.25C301.48,191.56 300.44,190.07 298.85,189.48L283.36,183.85C282.49,183.54 281.54,183.54 280.66,183.85L265.14,189.48C263.56,190.07 262.52,191.56 262.52,193.25V203.97C262.56,205.8 262.68,207.57 262.93,209.4C264.07,217.18 268.46,226.02 280.46,232.19C281.41,232.68 282.56,232.68 283.51,232.19C295.52,225.99 299.9,217.18 301.05,209.4C301.29,207.59 301.43,205.8 301.46,203.97V193.25H301.48Z"
+ android:fillColor="#000000"/>
+ <path
+ android:pathData="M291.62,222.69C291.74,222.13 292.45,218.26 290.38,214.37C289.21,212.19 287.7,210.92 285.63,209.28C284.21,208.18 280.46,205.76 279.52,205.17C279.56,205.19 279.64,205.27 279.68,205.29C279.17,204.97 279.2,204.97 279.52,205.17C278.47,204.46 276.67,203.04 275.3,200.59C273.67,197.68 273.62,194.96 273.62,194.45C273.62,194.4 273.62,194.38 273.62,194.33C273.62,191.05 274.64,188.5 276.27,186.67C277.49,185.3 278.88,184.51 280.05,184.05L265.14,189.48C263.56,190.04 262.52,191.56 262.52,193.25V203.97C262.56,205.8 262.68,207.57 262.93,209.4C264.07,217.18 268.46,226.02 280.46,232.18C281.41,232.68 282.56,232.68 283.51,232.18C284.63,231.62 285.65,231.01 286.63,230.4C288.14,229.27 290.79,226.78 291.6,222.69H291.62Z"
+ android:fillColor="#3957E2"/>
+ <path
+ android:pathData="M279.69,205.29C279.69,205.29 279.57,205.19 279.52,205.17C279.2,204.97 279.17,204.97 279.69,205.29Z"
+ android:fillColor="#000000"/>
+ <path
+ android:pathData="M298.85,189.48L283.36,183.85C282.48,183.54 281.54,183.54 280.66,183.85L280.05,184.07C278.9,184.54 277.49,185.32 276.27,186.69C274.64,188.53 273.62,191.07 273.62,194.35C273.62,194.4 273.62,194.43 273.62,194.48C273.62,194.99 273.69,197.71 275.3,200.62C276.66,203.06 278.44,204.46 279.51,205.19C280.46,205.8 284.21,208.2 285.63,209.3C287.7,210.94 289.23,212.22 290.38,214.4C292.45,218.26 291.72,222.15 291.62,222.71C290.82,226.8 288.16,229.27 286.65,230.42C296.3,224.4 300.02,216.48 301.07,209.43C301.31,207.62 301.46,205.83 301.48,203.99V193.25C301.48,191.56 300.43,190.07 298.85,189.48Z"
+ android:fillColor="#698FF7"/>
+ <path
+ android:pathData="M157.35,137.23C157.97,136.58 158.83,136.2 159.73,136.17C160.63,136.14 161.5,136.47 162.16,137.08L162.31,137.22L163.18,138.14C163.57,138.57 164.07,138.88 164.62,139.06C165.17,139.24 165.76,139.26 166.32,139.15L167.53,138.91C168.42,138.74 169.34,138.93 170.09,139.44C170.84,139.95 171.36,140.73 171.54,141.61C171.54,141.68 171.55,141.74 171.59,141.8L171.73,143.06C171.8,143.62 172.01,144.17 172.35,144.63C172.69,145.09 173.14,145.46 173.66,145.7L174.77,146.27C175.58,146.66 176.21,147.36 176.52,148.2C176.83,149.05 176.79,149.98 176.41,150.8C176.37,150.84 176.37,150.94 176.32,150.99L175.74,152.05C175.45,152.55 175.3,153.11 175.3,153.69C175.3,154.26 175.46,154.82 175.74,155.32L176.32,156.43C176.74,157.22 176.84,158.16 176.58,159.02C176.32,159.89 175.73,160.62 174.94,161.06C174.89,161.1 174.8,161.1 174.75,161.15L173.63,161.68C173.11,161.92 172.66,162.29 172.32,162.76C171.99,163.22 171.77,163.76 171.71,164.33L171.56,165.59C171.44,166.48 170.97,167.28 170.26,167.84C169.54,168.38 168.64,168.63 167.74,168.53C167.68,168.54 167.61,168.52 167.55,168.48L166.38,168.24C165.82,168.15 165.23,168.19 164.69,168.36C164.14,168.54 163.64,168.85 163.24,169.25L162.39,170.13C161.76,170.78 160.91,171.16 160.01,171.19C159.11,171.22 158.23,170.89 157.57,170.28L157.43,170.14L156.55,169.22C156.16,168.8 155.66,168.49 155.1,168.31C154.54,168.14 153.95,168.12 153.39,168.25L152.18,168.49C151.29,168.66 150.37,168.47 149.62,167.96C148.87,167.46 148.35,166.67 148.17,165.79C148.18,165.72 148.16,165.65 148.12,165.6L147.98,164.34C147.91,163.77 147.7,163.23 147.36,162.77C147.02,162.3 146.57,161.93 146.05,161.69L144.94,161.16C144.53,160.97 144.16,160.7 143.85,160.37C143.55,160.03 143.32,159.64 143.16,159.21C143.01,158.78 142.94,158.33 142.96,157.88C142.99,157.43 143.1,156.99 143.3,156.58C143.34,156.53 143.34,156.44 143.39,156.39L143.97,155.28C144.26,154.78 144.4,154.22 144.4,153.65C144.4,153.07 144.26,152.51 143.97,152.01L143.39,150.9C142.97,150.1 142.88,149.17 143.13,148.3C143.39,147.44 143.98,146.71 144.77,146.28C144.82,146.23 144.91,146.23 144.96,146.18L146.08,145.65C146.6,145.41 147.05,145.04 147.39,144.57C147.72,144.11 147.94,143.57 148,143L148.15,141.75C148.27,140.86 148.74,140.05 149.46,139.5C150.17,138.95 151.07,138.7 151.97,138.81C152.04,138.8 152.1,138.82 152.16,138.86L153.37,139.1C153.93,139.19 154.51,139.15 155.06,138.97C155.6,138.8 156.1,138.49 156.5,138.09L157.35,137.24L157.35,137.23Z"
+ android:fillColor="#EE675C"/>
+ <path
+ android:pathData="M165.34,152.63L157.4,148.13C156.85,147.86 156.31,147.99 156.04,148.54C155.9,148.68 155.9,148.81 155.9,149.09V158.08C155.9,158.63 156.31,159.04 156.85,159.04C156.99,159.04 157.27,159.04 157.4,158.9L165.2,154.4C165.75,154.13 165.89,153.58 165.61,153.04C165.61,152.9 165.47,152.77 165.34,152.63Z"
+ android:fillColor="#ffffff"/>
+ <path
+ android:pathData="M236.54,176.53L226.88,171.29C226.21,170.97 225.55,171.13 225.22,171.77C225.05,171.93 225.05,172.09 225.05,172.4V182.89C225.05,183.53 225.55,184.01 226.21,184.01C226.39,184.01 226.72,184.01 226.88,183.85L236.37,178.6C237.04,178.28 237.21,177.65 236.87,177.01C236.87,176.85 236.7,176.7 236.54,176.53Z"
+ android:fillColor="#3C4043"/>
+ <path
+ android:pathData="M148.49,207.01C143.41,207.01 139.27,202.88 139.27,197.81C139.27,192.74 143.41,188.61 148.49,188.61C153.58,188.61 157.72,192.74 157.72,197.81C157.72,202.88 153.58,207.01 148.49,207.01Z"
+ android:fillColor="#3C4043"/>
+ <path
+ android:pathData="M224.65,129.5L213.61,128.09C212.49,127.95 211.34,128.11 210.3,128.56C209.26,129 208.34,129.71 207.66,130.61L200.9,139.5C200.21,140.4 199.78,141.48 199.63,142.61C199.49,143.74 199.65,144.89 200.09,145.93L204.37,156.22C204.81,157.27 205.52,158.18 206.42,158.87C207.33,159.55 208.4,159.99 209.52,160.13L220.56,161.52C221.69,161.67 222.83,161.51 223.88,161.07C224.93,160.63 225.84,159.92 226.53,159.01L233.26,150.14C233.95,149.23 234.39,148.16 234.53,147.03C234.67,145.9 234.52,144.75 234.08,143.7L229.79,133.42C229.35,132.37 228.65,131.45 227.74,130.76C226.84,130.07 225.77,129.64 224.65,129.5Z"
+ android:fillColor="#FCC934"/>
+ <path
+ android:pathData="M210.34,150.41L223.25,151.73L224.57,138.86L211.66,137.54L210.34,150.41ZM210.15,152.25C209.65,152.2 209.23,151.98 208.9,151.58C208.58,151.18 208.45,150.73 208.5,150.23L209.82,137.35C209.87,136.85 210.09,136.43 210.49,136.11C210.89,135.78 211.34,135.65 211.85,135.7L224.76,137.02C225.26,137.07 225.68,137.29 226.01,137.69C226.33,138.09 226.46,138.54 226.41,139.04L225.09,151.92C225.04,152.43 224.82,152.84 224.42,153.16C224.02,153.49 223.57,153.62 223.06,153.57L210.15,152.25ZM211.45,148.67L222.51,149.8L219.53,144.85L216.38,148.24L214.59,145.27L211.45,148.67L211.45,148.67ZM211.66,137.54L210.34,150.41L211.66,137.54Z"
+ android:fillColor="#ffffff"/>
+ <path
+ android:pathData="M178.53,187.68C174.35,181.53 179.88,173.46 187.15,175.11L188.35,175.38C190.56,175.88 192.89,175.44 194.77,174.17L195.79,173.48C201.96,169.32 210.05,174.84 208.4,182.08L208.13,183.28C207.62,185.49 208.06,187.81 209.34,189.69L210.02,190.7C214.2,196.85 208.67,204.93 201.41,203.28L200.21,203.01C197.99,202.5 195.66,202.94 193.78,204.21L192.76,204.9C186.6,209.07 178.5,203.55 180.15,196.3L180.43,195.1C180.93,192.9 180.5,190.57 179.22,188.7L178.53,187.68L178.53,187.68Z"
+ android:fillColor="#5BB974"/>
+ <path
+ android:pathData="M189.5,195.21C190.11,194.34 190.86,193.6 191.77,192.99C192.68,192.39 193.71,191.98 194.85,191.76C196,191.55 197.1,191.55 198.17,191.78C199.24,192.01 200.21,192.42 201.1,193.01L199.08,182.41L187.48,184.61L189.5,195.21ZM194.54,190.11C195.33,189.96 195.97,189.54 196.42,188.87C196.88,188.2 197.04,187.46 196.88,186.67C196.73,185.88 196.32,185.24 195.65,184.79C194.98,184.34 194.23,184.18 193.43,184.33C192.64,184.48 192,184.89 191.55,185.57C191.09,186.24 190.93,186.97 191.09,187.77C191.24,188.56 191.65,189.2 192.33,189.65C192.99,190.1 193.74,190.26 194.54,190.11ZM189.99,197.8C189.54,197.89 189.12,197.8 188.73,197.54C188.34,197.28 188.11,196.92 188.02,196.47L185.82,184.92C185.74,184.46 185.83,184.04 186.09,183.66C186.35,183.27 186.71,183.04 187.16,182.95L198.76,180.76C199.22,180.67 199.64,180.76 200.02,181.02C200.41,181.28 200.65,181.63 200.73,182.09L202.93,193.64C203.02,194.1 202.93,194.51 202.67,194.9C202.4,195.29 202.05,195.52 201.59,195.6L189.99,197.8ZM189.68,196.15L201.28,193.96L201.1,193C200.21,192.41 199.24,192.01 198.17,191.77C197.1,191.55 195.99,191.54 194.85,191.76C193.7,191.97 192.68,192.38 191.77,192.99C190.86,193.59 190.1,194.33 189.5,195.2L189.68,196.15ZM189.5,195.21L187.48,184.61L199.08,182.41L201.1,193.01C200.21,192.42 199.24,192.01 198.17,191.78C197.1,191.55 196,191.55 194.85,191.76C193.71,191.98 192.68,192.39 191.77,192.99C190.86,193.6 190.11,194.34 189.5,195.21Z"
+ android:fillColor="#ffffff"/>
+</vector>
diff --git a/res/drawable/privatespace_setup_flow_placeholder.xml b/res/drawable/privatespace_setup_flow_placeholder.xml
new file mode 100644
index 0000000..a4ff125
--- /dev/null
+++ b/res/drawable/privatespace_setup_flow_placeholder.xml
@@ -0,0 +1,48 @@
+<!--
+ ~ Copyright (C) 2023 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="265dp" android:viewportHeight="266"
+ android:viewportWidth="364" android:width="362.6316dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <group>
+ <clip-path android:pathData="M0,0.5h364v265h-364z"/>
+ <path android:fillColor="#000000" android:pathData="M339.42,265.5H24.58C11.07,265.5 0,254.17 0,240.34V25.69C0,11.83 11.07,0.5 24.58,0.5H339.52C352.93,0.5 364,11.83 364,25.66V240.44C364,254.17 352.93,265.5 339.42,265.5Z"/>
+ <path android:fillColor="#80868B" android:pathData="M242.66,86.8V78.4C242.66,77.85 242.44,77.31 242.05,76.92C241.66,76.52 241.12,76.3 240.57,76.3V32.2C240.57,29.42 239.46,26.75 237.49,24.78C235.52,22.81 232.85,21.7 230.06,21.7H133.41C130.62,21.7 127.95,22.81 125.98,24.78C124.01,26.75 122.9,29.42 122.9,32.2V233.8C122.9,236.58 124.01,239.25 125.98,241.22C127.95,243.19 130.62,244.3 133.41,244.3H230.06C232.85,244.3 235.52,243.19 237.49,241.22C239.46,239.25 240.57,236.58 240.57,233.8V130.9C241.12,130.9 241.65,130.68 242.05,130.29C242.44,129.89 242.66,129.36 242.66,128.8V107.8C242.66,107.24 242.44,106.71 242.05,106.32C241.66,105.92 241.12,105.7 240.57,105.7V88.91C240.84,88.91 241.12,88.86 241.37,88.75C241.63,88.64 241.86,88.49 242.05,88.29C242.25,88.1 242.4,87.86 242.5,87.61C242.61,87.35 242.66,87.08 242.66,86.8ZM238.46,233.8C238.46,236.02 237.58,238.16 236,239.74C234.43,241.31 232.29,242.2 230.06,242.2H133.41C131.18,242.2 129.04,241.31 127.47,239.74C125.89,238.16 125.01,236.02 125.01,233.8V32.2C125.01,29.98 125.89,27.84 127.47,26.27C129.04,24.69 131.18,23.8 133.41,23.8H230.06C232.29,23.8 234.43,24.69 236,26.27C237.58,27.84 238.46,29.98 238.46,32.2V233.8Z"/>
+ <path android:fillColor="#669DF6" android:pathData="M234.93,233.8C234.93,235.09 234.42,236.33 233.5,237.24C232.59,238.15 231.35,238.66 230.06,238.66H133.41C132.12,238.66 130.88,238.15 129.97,237.24C129.05,236.33 128.54,235.09 128.54,233.8V129.24H125.01V233.8C125.01,236.02 125.89,238.16 127.47,239.74C129.04,241.31 131.18,242.2 133.41,242.2H230.06C232.29,242.2 234.43,241.31 236,239.74C237.58,238.16 238.46,236.02 238.46,233.8V190.74H234.93V233.8Z"/>
+ <path android:fillColor="#A142F4" android:pathData="M230.06,23.8H133.41C131.18,23.8 129.04,24.69 127.47,26.26C125.89,27.84 125.01,29.97 125.01,32.2V129.24H128.54V32.2C128.54,30.91 129.05,29.67 129.97,28.76C130.88,27.85 132.12,27.34 133.41,27.34H230.06C231.35,27.34 232.59,27.85 233.5,28.76C234.42,29.67 234.93,30.91 234.93,32.2V190.74H238.46V32.2C238.46,29.97 237.58,27.84 236,26.26C234.43,24.69 232.29,23.8 230.06,23.8Z"/>
+ <path android:fillColor="#5BB974" android:pathData="M214.09,181.98H205.99C204.24,181.98 202.53,182.5 201.08,183.47C199.63,184.45 198.51,185.83 197.85,187.45C197.2,189.07 197.04,190.84 197.39,192.55C197.75,194.26 198.61,195.82 199.86,197.04L205.38,202.56L208.4,199.54H214.09C216.42,199.54 218.65,198.62 220.3,196.97C221.95,195.32 222.87,193.09 222.87,190.76C222.87,188.43 221.95,186.2 220.3,184.55C218.65,182.91 216.42,181.98 214.09,181.98Z"/>
+ <path android:fillColor="#000000" android:pathData="M204.83,192.48C205.78,192.48 206.54,191.71 206.54,190.76C206.54,189.82 205.78,189.05 204.83,189.05C203.88,189.05 203.12,189.82 203.12,190.76C203.12,191.71 203.88,192.48 204.83,192.48Z"/>
+ <path android:fillColor="#000000" android:pathData="M210.04,192.48C210.99,192.48 211.76,191.71 211.76,190.76C211.76,189.82 210.99,189.05 210.04,189.05C209.1,189.05 208.33,189.82 208.33,190.76C208.33,191.71 209.1,192.48 210.04,192.48Z"/>
+ <path android:fillColor="#000000" android:pathData="M215.25,192.48C216.19,192.48 216.96,191.71 216.96,190.76C216.96,189.82 216.19,189.05 215.25,189.05C214.3,189.05 213.53,189.82 213.53,190.76C213.53,191.71 214.3,192.48 215.25,192.48Z"/>
+ <path android:fillColor="#FCC934" android:pathData="M165.98,61.94H155.68C155.38,61.94 155.08,62 154.79,62.12C154.51,62.24 154.26,62.41 154.04,62.62C153.83,62.84 153.66,63.09 153.54,63.37C153.43,63.65 153.37,63.95 153.37,64.26V85.11C153.37,85.41 153.43,85.71 153.54,85.99C153.66,86.27 153.83,86.53 154.04,86.74C154.26,86.96 154.51,87.13 154.79,87.24C155.08,87.36 155.38,87.42 155.68,87.42H170C170.61,87.41 171.19,87.16 171.62,86.73C172.04,86.3 172.28,85.71 172.28,85.11V68.32L165.98,61.94Z"/>
+ <path android:fillColor="#000000" android:pathData="M168.63,72.01H157.05V74.33H168.63V72.01Z"/>
+ <path android:fillColor="#000000" android:pathData="M168.63,76.64H157.05V78.96H168.63V76.64Z"/>
+ <path android:fillColor="#000000" android:pathData="M168.63,81.28H157.05V83.6H168.63V81.28Z"/>
+ <path android:fillColor="#FEEFC3" android:pathData="M165.98,61.94V66.43C165.98,66.67 166.03,66.92 166.12,67.14C166.21,67.37 166.35,67.57 166.52,67.74C166.69,67.92 166.9,68.05 167.12,68.15C167.35,68.24 167.59,68.29 167.83,68.29H172.28L165.98,61.94Z"/>
+ <path android:fillColor="#FAD2CF" android:pathData="M206.01,53.5L201.44,61.45C201.29,61.7 201.21,61.99 201.22,62.28C201.22,62.58 201.29,62.86 201.44,63.12C201.59,63.37 201.8,63.58 202.05,63.73C202.31,63.87 202.59,63.95 202.89,63.95H212.04C212.33,63.95 212.62,63.87 212.87,63.73C213.13,63.58 213.34,63.37 213.49,63.12C213.63,62.86 213.71,62.58 213.71,62.28C213.71,61.99 213.63,61.7 213.48,61.45L208.9,53.5C208.76,53.25 208.54,53.04 208.29,52.89C208.04,52.74 207.75,52.67 207.46,52.67C207.16,52.67 206.88,52.74 206.62,52.89C206.37,53.04 206.16,53.25 206.01,53.5Z"/>
+ <path android:fillColor="#3C4043" android:pathData="M201.8,218.33L209.86,210.27C209.96,210.16 210.09,210.08 210.23,210.02C210.37,209.96 210.52,209.93 210.67,209.93C210.82,209.93 210.97,209.96 211.11,210.02C211.25,210.08 211.37,210.16 211.48,210.27L211.76,210.55C213.05,211.84 213.77,213.58 213.77,215.39C213.77,217.21 213.05,218.95 211.76,220.23C210.48,221.52 208.74,222.24 206.92,222.24C205.1,222.24 203.36,221.52 202.08,220.23L201.8,219.95C201.58,219.74 201.46,219.45 201.46,219.14C201.46,218.84 201.58,218.54 201.8,218.33Z"/>
+ <path android:fillColor="#3C4043" android:pathData="M200.11,90.52C202.66,90.52 204.73,88.45 204.73,85.9C204.73,83.35 202.66,81.28 200.11,81.28C197.56,81.28 195.49,83.35 195.49,85.9C195.49,88.45 197.56,90.52 200.11,90.52Z"/>
+ <path android:fillColor="#A142F4" android:pathData="M203.2,134.48C203.2,128.79 200.94,123.34 196.92,119.31C192.89,115.29 187.43,113.03 181.74,113.03V117.32C184.94,117.31 188.08,118.2 190.79,119.88C193.51,121.57 195.71,123.98 197.13,126.84C198.55,129.7 199.14,132.91 198.83,136.09C198.53,139.27 197.34,142.3 195.39,144.85C192.33,141.12 184.88,139.85 181.74,139.85V155.97C184.56,155.96 187.36,155.41 189.96,154.33C192.57,153.25 194.93,151.66 196.93,149.67C198.92,147.68 200.5,145.31 201.58,142.7C202.65,140.1 203.21,137.3 203.2,134.48Z"/>
+ <path android:fillColor="#A142F4" android:pathData="M189.26,129.12C189.26,128.14 189.07,127.16 188.7,126.25C188.32,125.33 187.77,124.51 187.07,123.81C186.37,123.11 185.54,122.56 184.63,122.18C183.72,121.81 182.74,121.61 181.75,121.61V136.63C182.74,136.63 183.72,136.44 184.63,136.06C185.54,135.69 186.37,135.13 187.07,134.44C187.77,133.74 188.32,132.91 188.7,132C189.07,131.09 189.26,130.11 189.26,129.12Z"/>
+ <path android:fillColor="#3C4043" android:pathData="M159.53,166.93H151.85C148.29,166.93 145.41,169.81 145.41,173.37C145.41,176.93 148.29,179.81 151.85,179.81H159.53C163.09,179.81 165.97,176.93 165.97,173.37C165.97,169.81 163.09,166.93 159.53,166.93Z"/>
+ <path android:fillColor="#FAD2CF" android:pathData="M164.93,198.9V197.48H163.16V198.89H152.85V197.48H151.08V198.9C150.56,198.9 150.07,199.11 149.71,199.48C149.35,199.84 149.15,200.34 149.15,200.85V214.61C149.15,214.87 149.2,215.13 149.3,215.36C149.4,215.6 149.54,215.82 149.72,216C149.9,216.19 150.12,216.33 150.36,216.43C150.6,216.53 150.85,216.58 151.11,216.58H164.88C165.4,216.58 165.9,216.37 166.27,216C166.64,215.63 166.85,215.13 166.85,214.61V200.85C166.85,200.34 166.64,199.85 166.29,199.48C165.93,199.12 165.44,198.91 164.93,198.9Z"/>
+ <path android:fillColor="#000000" android:pathData="M164.27,202.78H151.76C151.39,202.78 151.1,203.08 151.1,203.45V213.99C151.1,214.36 151.39,214.65 151.76,214.65H164.27C164.63,214.65 164.93,214.36 164.93,213.99V203.45C164.93,203.08 164.63,202.78 164.27,202.78Z"/>
+ <path android:fillColor="#EE675C" android:pathData="M156.79,205.13H152.85V207.73H156.79V205.13Z"/>
+ <path android:fillColor="#669DF6" android:pathData="M168.62,117.83C168.03,117.83 167.45,117.95 166.9,118.18C166.35,118.4 165.85,118.73 165.44,119.15C165.02,119.57 164.69,120.07 164.47,120.62C164.24,121.17 164.13,121.75 164.14,122.35V147.17C164.13,147.76 164.25,148.35 164.48,148.9C164.7,149.44 165.04,149.94 165.46,150.36C165.88,150.78 166.37,151.11 166.92,151.34C167.47,151.56 168.06,151.68 168.65,151.67H175.97V117.83H168.62Z"/>
+ <path android:fillColor="#80868B" android:pathData="M182.95,259.5C182.95,260.32 182.63,261.11 182.05,261.69C181.47,262.27 180.68,262.59 179.86,262.59C179.04,262.59 178.26,262.27 177.68,261.69C177.1,261.11 176.77,260.32 176.77,259.5V12.75C176.77,11.93 177.1,11.15 177.68,10.57C178.26,9.99 179.04,9.66 179.86,9.66C180.68,9.66 181.47,9.99 182.05,10.57C182.63,11.15 182.95,11.93 182.95,12.75"/>
+ <path android:fillColor="#000000" android:pathData="M179.86,10.99C180.33,10.99 180.78,11.17 181.11,11.5C181.44,11.83 181.63,12.28 181.63,12.75V259.5C181.63,259.97 181.44,260.42 181.11,260.75C180.78,261.08 180.33,261.27 179.86,261.27C179.39,261.27 178.94,261.08 178.61,260.75C178.28,260.42 178.1,259.97 178.1,259.5V12.75C178.1,12.28 178.28,11.83 178.61,11.5C178.94,11.17 179.39,10.99 179.86,10.99ZM179.86,8.34C178.69,8.34 177.57,8.8 176.74,9.63C175.91,10.46 175.44,11.58 175.44,12.75V259.5C175.44,260.67 175.91,261.8 176.74,262.63C177.57,263.45 178.69,263.92 179.86,263.92C181.03,263.92 182.16,263.45 182.99,262.63C183.81,261.8 184.28,260.67 184.28,259.5V12.75C184.28,11.58 183.81,10.46 182.99,9.63C182.16,8.8 181.03,8.34 179.86,8.34Z"/>
+ <path android:fillColor="#ffffff" android:pathData="M70.76,140V124.25H72.63V140H70.76ZM75.78,140V124.25H77.65V140H75.78ZM80.42,140V124.25H82.29V140H80.42ZM89.13,140.35C87.75,140.35 86.71,139.95 86.01,139.15C85.32,138.34 84.97,137.24 84.97,135.85V128.78H86.84V135.56C86.84,136.67 87.1,137.47 87.61,137.96C88.13,138.43 88.76,138.66 89.53,138.66C90.19,138.66 90.76,138.49 91.24,138.15C91.73,137.8 92.1,137.36 92.36,136.81C92.63,136.27 92.76,135.71 92.76,135.12V128.78H94.63V140H92.85V138.38H92.76C92.57,138.73 92.28,139.06 91.9,139.37C91.54,139.66 91.11,139.89 90.63,140.07C90.16,140.26 89.66,140.35 89.13,140.35ZM101.2,140.35C100.36,140.35 99.62,140.22 98.98,139.96C98.35,139.68 97.82,139.31 97.39,138.86C96.98,138.39 96.68,137.88 96.47,137.34L98.14,136.59C98.44,137.27 98.86,137.79 99.42,138.15C99.98,138.52 100.61,138.71 101.33,138.71C102.02,138.71 102.59,138.57 103.05,138.29C103.52,138.01 103.75,137.6 103.75,137.05C103.75,136.72 103.66,136.44 103.47,136.22C103.28,135.98 103,135.79 102.63,135.63C102.26,135.46 101.82,135.32 101.29,135.18L99.92,134.83C99.4,134.69 98.9,134.48 98.43,134.22C97.96,133.95 97.58,133.62 97.28,133.21C97.01,132.78 96.87,132.27 96.87,131.66C96.87,130.99 97.06,130.41 97.46,129.93C97.86,129.44 98.38,129.08 99.02,128.83C99.67,128.56 100.36,128.43 101.09,128.43C101.74,128.43 102.34,128.53 102.89,128.72C103.47,128.89 103.96,129.16 104.39,129.53C104.82,129.88 105.14,130.32 105.36,130.85L103.73,131.6C103.45,131.04 103.08,130.65 102.61,130.43C102.14,130.21 101.62,130.1 101.05,130.1C100.43,130.1 99.9,130.24 99.44,130.52C98.99,130.79 98.76,131.15 98.76,131.62C98.76,132.09 98.94,132.44 99.31,132.68C99.69,132.91 100.15,133.1 100.69,133.25L102.32,133.67C103.42,133.95 104.25,134.36 104.81,134.92C105.37,135.46 105.64,136.13 105.64,136.92C105.64,137.63 105.45,138.24 105.05,138.75C104.65,139.26 104.12,139.66 103.44,139.94C102.77,140.22 102.02,140.35 101.2,140.35ZM106.81,128.78H108.76V125.61H110.63V128.78H113.38V130.48H110.63V136.59C110.63,137.18 110.75,137.63 110.99,137.96C111.24,138.28 111.64,138.44 112.19,138.44C112.44,138.44 112.67,138.4 112.88,138.33C113.08,138.26 113.27,138.17 113.43,138.07V139.89C113.24,139.98 113.02,140.05 112.79,140.09C112.57,140.15 112.27,140.18 111.89,140.18C110.95,140.18 110.19,139.91 109.62,139.37C109.05,138.81 108.76,138.04 108.76,137.05V130.48H106.81V128.78ZM115.61,140V128.78H117.39V130.59H117.48C117.63,130.16 117.87,129.79 118.21,129.49C118.56,129.16 118.96,128.91 119.39,128.74C119.85,128.55 120.3,128.45 120.74,128.45C121.07,128.45 121.34,128.48 121.53,128.52C121.72,128.55 121.89,128.6 122.06,128.67V130.7C121.82,130.58 121.57,130.49 121.29,130.43C121.02,130.37 120.75,130.35 120.47,130.35C119.93,130.35 119.43,130.5 118.98,130.81C118.52,131.12 118.15,131.53 117.88,132.04C117.61,132.55 117.48,133.12 117.48,133.73V140H115.61ZM127.02,140.35C126.18,140.35 125.45,140.19 124.82,139.87C124.19,139.55 123.69,139.11 123.32,138.55C122.97,137.98 122.79,137.33 122.79,136.62C122.79,135.79 123.01,135.1 123.43,134.55C123.86,133.98 124.43,133.55 125.15,133.27C125.87,132.98 126.66,132.83 127.52,132.83C128.02,132.83 128.48,132.88 128.91,132.96C129.33,133.04 129.7,133.13 130.01,133.25C130.33,133.35 130.57,133.45 130.74,133.56V132.88C130.74,132.02 130.43,131.35 129.83,130.85C129.23,130.35 128.5,130.1 127.63,130.1C127.02,130.1 126.44,130.24 125.89,130.52C125.37,130.79 124.95,131.16 124.64,131.64L123.23,130.59C123.53,130.15 123.89,129.77 124.33,129.44C124.77,129.12 125.27,128.87 125.83,128.7C126.4,128.52 127,128.43 127.63,128.43C129.16,128.43 130.35,128.83 131.22,129.64C132.08,130.45 132.52,131.53 132.52,132.9V140H130.74V138.4H130.65C130.46,138.72 130.18,139.04 129.83,139.34C129.48,139.64 129.06,139.88 128.58,140.07C128.11,140.26 127.59,140.35 127.02,140.35ZM127.19,138.71C127.84,138.71 128.43,138.54 128.95,138.22C129.5,137.9 129.93,137.47 130.25,136.92C130.57,136.38 130.74,135.79 130.74,135.14C130.4,134.91 129.97,134.72 129.46,134.57C128.96,134.42 128.41,134.35 127.81,134.35C126.74,134.35 125.95,134.57 125.46,135.01C124.96,135.45 124.71,135.99 124.71,136.64C124.71,137.25 124.94,137.75 125.41,138.13C125.88,138.51 126.47,138.71 127.19,138.71ZM134.13,128.78H136.09V125.61H137.96V128.78H140.71V130.48H137.96V136.59C137.96,137.18 138.08,137.63 138.31,137.96C138.56,138.28 138.97,138.44 139.52,138.44C139.77,138.44 140,138.4 140.21,138.33C140.41,138.26 140.59,138.17 140.76,138.07V139.89C140.57,139.98 140.35,140.05 140.12,140.09C139.9,140.15 139.6,140.18 139.22,140.18C138.28,140.18 137.52,139.91 136.95,139.37C136.38,138.81 136.09,138.04 136.09,137.05V130.48H134.13V128.78ZM143.22,140V128.78H145.09V140H143.22ZM144.15,126.71C143.78,126.71 143.46,126.58 143.2,126.32C142.94,126.06 142.8,125.74 142.8,125.37C142.8,124.99 142.94,124.68 143.2,124.43C143.46,124.16 143.78,124.03 144.15,124.03C144.53,124.03 144.84,124.16 145.09,124.43C145.36,124.68 145.49,124.99 145.49,125.37C145.49,125.74 145.36,126.06 145.09,126.32C144.84,126.58 144.53,126.71 144.15,126.71ZM153.07,140.35C151.94,140.35 150.95,140.09 150.08,139.56C149.21,139.04 148.53,138.32 148.03,137.43C147.55,136.52 147.31,135.51 147.31,134.39C147.31,133.28 147.55,132.27 148.03,131.38C148.53,130.47 149.21,129.75 150.08,129.22C150.95,128.7 151.94,128.43 153.07,128.43C154.2,128.43 155.2,128.7 156.06,129.24C156.93,129.77 157.6,130.49 158.09,131.4C158.59,132.3 158.84,133.29 158.84,134.39C158.84,135.51 158.59,136.52 158.09,137.43C157.6,138.32 156.93,139.04 156.06,139.56C155.2,140.09 154.2,140.35 153.07,140.35ZM153.07,138.66C153.75,138.66 154.38,138.49 154.96,138.15C155.57,137.82 156.05,137.33 156.42,136.7C156.78,136.06 156.97,135.29 156.97,134.39C156.97,133.5 156.78,132.74 156.42,132.1C156.05,131.46 155.57,130.97 154.96,130.63C154.38,130.29 153.75,130.13 153.07,130.13C152.4,130.13 151.76,130.29 151.16,130.63C150.56,130.97 150.07,131.46 149.71,132.1C149.34,132.74 149.16,133.5 149.16,134.39C149.16,135.29 149.34,136.06 149.71,136.7C150.07,137.33 150.56,137.82 151.16,138.15C151.76,138.49 152.4,138.66 153.07,138.66ZM160.79,140V128.78H162.57V130.43H162.66C162.96,129.89 163.43,129.42 164.09,129.02C164.77,128.63 165.5,128.43 166.29,128.43C167.67,128.43 168.71,128.83 169.39,129.64C170.1,130.43 170.45,131.49 170.45,132.81V140H168.58V133.1C168.58,132.01 168.32,131.25 167.79,130.81C167.27,130.35 166.61,130.13 165.79,130.13C165.17,130.13 164.63,130.3 164.16,130.65C163.69,130.99 163.32,131.43 163.06,131.97C162.79,132.52 162.66,133.09 162.66,133.69V140H160.79ZM178.61,140V124.25H183.91C184.79,124.25 185.61,124.45 186.36,124.85C187.1,125.24 187.7,125.79 188.14,126.5C188.59,127.18 188.82,127.99 188.82,128.91C188.82,129.82 188.59,130.63 188.14,131.34C187.7,132.04 187.1,132.59 186.36,132.99C185.61,133.38 184.79,133.58 183.91,133.58H180.48V140H178.61ZM180.48,131.8H183.96C184.57,131.8 185.1,131.66 185.54,131.38C185.98,131.09 186.32,130.72 186.55,130.28C186.8,129.84 186.93,129.38 186.93,128.91C186.93,128.45 186.8,127.99 186.55,127.55C186.32,127.11 185.98,126.75 185.54,126.47C185.1,126.18 184.57,126.03 183.96,126.03H180.48V131.8ZM191.02,140V124.25H192.89V140H191.02ZM199.14,140.35C198.3,140.35 197.57,140.19 196.94,139.87C196.31,139.55 195.81,139.11 195.44,138.55C195.09,137.98 194.92,137.33 194.92,136.62C194.92,135.79 195.13,135.1 195.55,134.55C195.98,133.98 196.55,133.55 197.27,133.27C197.99,132.98 198.78,132.83 199.65,132.83C200.15,132.83 200.61,132.88 201.03,132.96C201.46,133.04 201.82,133.13 202.13,133.25C202.46,133.35 202.7,133.45 202.86,133.56V132.88C202.86,132.02 202.56,131.35 201.96,130.85C201.35,130.35 200.62,130.1 199.76,130.1C199.14,130.1 198.56,130.24 198.02,130.52C197.49,130.79 197.07,131.16 196.76,131.64L195.36,130.59C195.65,130.15 196.02,129.77 196.46,129.44C196.9,129.12 197.4,128.87 197.95,128.7C198.52,128.52 199.13,128.43 199.76,128.43C201.28,128.43 202.48,128.83 203.34,129.64C204.21,130.45 204.64,131.53 204.64,132.9V140H202.86V138.4H202.77C202.58,138.72 202.31,139.04 201.96,139.34C201.6,139.64 201.19,139.88 200.7,140.07C200.23,140.26 199.71,140.35 199.14,140.35ZM199.32,138.71C199.96,138.71 200.55,138.54 201.08,138.22C201.62,137.9 202.05,137.47 202.37,136.92C202.7,136.38 202.86,135.79 202.86,135.14C202.52,134.91 202.1,134.72 201.58,134.57C201.08,134.42 200.53,134.35 199.93,134.35C198.86,134.35 198.08,134.57 197.58,135.01C197.08,135.45 196.83,135.99 196.83,136.64C196.83,137.25 197.07,137.75 197.53,138.13C198,138.51 198.6,138.71 199.32,138.71ZM212.22,140.35C211.12,140.35 210.13,140.1 209.27,139.59C208.42,139.06 207.75,138.35 207.27,137.45C206.78,136.54 206.54,135.52 206.54,134.39C206.54,133.25 206.78,132.23 207.27,131.34C207.75,130.44 208.42,129.74 209.27,129.22C210.13,128.7 211.12,128.43 212.22,128.43C213.48,128.43 214.51,128.72 215.32,129.31C216.14,129.88 216.72,130.62 217.06,131.53L215.36,132.24C215.08,131.55 214.66,131.03 214.11,130.68C213.57,130.31 212.9,130.13 212.13,130.13C211.47,130.13 210.85,130.3 210.28,130.65C209.72,131.01 209.27,131.5 208.92,132.15C208.56,132.78 208.39,133.53 208.39,134.39C208.39,135.24 208.56,135.99 208.92,136.64C209.27,137.28 209.72,137.78 210.28,138.13C210.85,138.49 211.47,138.66 212.13,138.66C212.92,138.66 213.6,138.48 214.17,138.11C214.75,137.74 215.17,137.22 215.45,136.55L217.12,137.25C216.76,138.12 216.16,138.85 215.34,139.45C214.52,140.05 213.48,140.35 212.22,140.35ZM224.03,140.35C222.95,140.35 221.98,140.1 221.13,139.59C220.29,139.07 219.63,138.37 219.15,137.47C218.68,136.58 218.44,135.56 218.44,134.41C218.44,133.34 218.66,132.35 219.1,131.45C219.56,130.54 220.19,129.81 220.99,129.27C221.82,128.71 222.78,128.43 223.88,128.43C224.99,128.43 225.94,128.68 226.74,129.18C227.54,129.66 228.16,130.34 228.58,131.2C229.02,132.07 229.24,133.06 229.24,134.17C229.24,134.28 229.24,134.38 229.22,134.48C229.22,134.58 229.21,134.67 229.2,134.74H220.31C220.36,135.55 220.54,136.23 220.86,136.79C221.23,137.42 221.7,137.89 222.27,138.2C222.86,138.51 223.47,138.66 224.1,138.66C224.92,138.66 225.59,138.47 226.12,138.09C226.66,137.69 227.1,137.21 227.42,136.64L229,137.41C228.56,138.26 227.93,138.96 227.11,139.52C226.29,140.08 225.26,140.35 224.03,140.35ZM220.42,133.21H227.26C227.25,132.9 227.18,132.57 227.04,132.21C226.93,131.85 226.73,131.51 226.45,131.2C226.19,130.88 225.84,130.62 225.42,130.43C225.01,130.23 224.49,130.13 223.88,130.13C223.14,130.13 222.51,130.32 221.96,130.7C221.43,131.06 221.03,131.57 220.75,132.21C220.61,132.52 220.5,132.85 220.42,133.21ZM231.43,140V124.25H233.3V128.89L233.21,130.43H233.3C233.6,129.88 234.07,129.41 234.73,129.02C235.41,128.63 236.15,128.43 236.96,128.43C237.91,128.43 238.69,128.62 239.31,129C239.93,129.38 240.39,129.9 240.7,130.57C241,131.21 241.16,131.96 241.16,132.81V140H239.29V133.1C239.29,132.38 239.15,131.8 238.89,131.38C238.64,130.94 238.3,130.62 237.88,130.43C237.47,130.23 237.01,130.13 236.51,130.13C235.9,130.13 235.35,130.3 234.87,130.65C234.38,131.01 234,131.46 233.72,132.02C233.44,132.57 233.3,133.15 233.3,133.76V140H231.43ZM249.02,140.35C247.89,140.35 246.89,140.09 246.03,139.56C245.16,139.04 244.48,138.32 243.98,137.43C243.5,136.52 243.26,135.51 243.26,134.39C243.26,133.28 243.5,132.27 243.98,131.38C244.48,130.47 245.16,129.75 246.03,129.22C246.89,128.7 247.89,128.43 249.02,128.43C250.15,128.43 251.15,128.7 252.01,129.24C252.88,129.77 253.55,130.49 254.04,131.4C254.54,132.3 254.79,133.29 254.79,134.39C254.79,135.51 254.54,136.52 254.04,137.43C253.55,138.32 252.88,139.04 252.01,139.56C251.15,140.09 250.15,140.35 249.02,140.35ZM249.02,138.66C249.7,138.66 250.33,138.49 250.91,138.15C251.51,137.82 252,137.33 252.37,136.7C252.73,136.06 252.91,135.29 252.91,134.39C252.91,133.5 252.73,132.74 252.37,132.1C252,131.46 251.51,130.97 250.91,130.63C250.33,130.29 249.7,130.13 249.02,130.13C248.35,130.13 247.71,130.29 247.11,130.63C246.51,130.97 246.02,131.46 245.65,132.1C245.29,132.74 245.1,133.5 245.1,134.39C245.1,135.29 245.29,136.06 245.65,136.7C246.02,137.33 246.51,137.82 247.11,138.15C247.71,138.49 248.35,138.66 249.02,138.66ZM256.85,140V124.25H258.72V140H256.85ZM266.16,140.35C265.14,140.35 264.23,140.1 263.41,139.59C262.6,139.07 261.96,138.37 261.49,137.47C261.02,136.58 260.79,135.55 260.79,134.39C260.79,133.23 261.02,132.21 261.49,131.31C261.96,130.42 262.6,129.71 263.41,129.2C264.23,128.69 265.14,128.43 266.16,128.43C266.76,128.43 267.31,128.53 267.81,128.72C268.3,128.91 268.74,129.16 269.1,129.46C269.48,129.77 269.78,130.1 269.98,130.46H270.07L269.98,128.89V124.25H271.85V140H270.07V138.35H269.98C269.78,138.69 269.48,139.01 269.1,139.32C268.74,139.63 268.3,139.88 267.81,140.07C267.31,140.26 266.76,140.35 266.16,140.35ZM266.35,138.66C267,138.66 267.6,138.49 268.16,138.15C268.73,137.8 269.19,137.31 269.54,136.68C269.9,136.04 270.07,135.27 270.07,134.39C270.07,133.51 269.9,132.76 269.54,132.13C269.19,131.48 268.73,130.99 268.16,130.65C267.6,130.3 267,130.13 266.35,130.13C265.71,130.13 265.1,130.3 264.53,130.65C263.97,130.99 263.52,131.48 263.16,132.13C262.81,132.76 262.64,133.51 262.64,134.39C262.64,135.26 262.81,136.01 263.16,136.66C263.52,137.3 263.97,137.8 264.53,138.15C265.1,138.49 265.71,138.66 266.35,138.66ZM279.5,140.35C278.42,140.35 277.45,140.1 276.6,139.59C275.76,139.07 275.1,138.37 274.62,137.47C274.15,136.58 273.92,135.56 273.92,134.41C273.92,133.34 274.14,132.35 274.58,131.45C275.03,130.54 275.66,129.81 276.47,129.27C277.29,128.71 278.25,128.43 279.35,128.43C280.46,128.43 281.42,128.68 282.21,129.18C283.02,129.66 283.63,130.34 284.06,131.2C284.5,132.07 284.72,133.06 284.72,134.17C284.72,134.28 284.71,134.38 284.7,134.48C284.7,134.58 284.69,134.67 284.67,134.74H275.79C275.83,135.55 276.01,136.23 276.33,136.79C276.7,137.42 277.17,137.89 277.74,138.2C278.33,138.51 278.94,138.66 279.57,138.66C280.39,138.66 281.07,138.47 281.59,138.09C282.14,137.69 282.57,137.21 282.89,136.64L284.48,137.41C284.04,138.26 283.4,138.96 282.58,139.52C281.76,140.08 280.73,140.35 279.5,140.35ZM275.89,133.21H282.74C282.72,132.9 282.65,132.57 282.52,132.21C282.4,131.85 282.2,131.51 281.92,131.2C281.66,130.88 281.31,130.62 280.89,130.43C280.48,130.23 279.96,130.13 279.35,130.13C278.62,130.13 277.98,130.32 277.43,130.7C276.91,131.06 276.5,131.57 276.23,132.21C276.08,132.52 275.97,132.85 275.89,133.21ZM286.91,140V128.78H288.69V130.59H288.78C288.92,130.16 289.16,129.79 289.5,129.49C289.85,129.16 290.25,128.91 290.69,128.74C291.14,128.55 291.59,128.45 292.03,128.45C292.37,128.45 292.63,128.48 292.82,128.52C293.01,128.55 293.19,128.6 293.35,128.67V130.7C293.12,130.58 292.86,130.49 292.58,130.43C292.32,130.37 292.05,130.35 291.77,130.35C291.23,130.35 290.73,130.5 290.27,130.81C289.82,131.12 289.45,131.53 289.17,132.04C288.91,132.55 288.78,133.12 288.78,133.73V140H286.91Z"/>
+ </group>
+</vector>
diff --git a/res/layout/privatespace_advancing_screen.xml b/res/layout/privatespace_advancing_screen.xml
new file mode 100644
index 0000000..cebb6fa
--- /dev/null
+++ b/res/layout/privatespace_advancing_screen.xml
@@ -0,0 +1,59 @@
+<!--
+ ~ Copyright (C) 2023 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.
+ -->
+
+<com.google.android.setupdesign.GlifLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/privatesapce_autoadvance_screen"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:sucHeaderText="@string/privatespace_lock_protected_title"
+ android:icon="@drawable/ic_privatespace_icon">
+ <LinearLayout style="@style/SudContentFrame"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <ImageView
+ android:id="@+id/placeholder_image"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:contentDescription="@null"
+ android:src="@drawable/privatespace_setup_flow_placeholder"/>
+
+ <LinearLayout
+ android:id="@+id/setup_progress"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|right"
+ android:layout_margin="16dp"
+ android:orientation="horizontal">
+ <ProgressBar
+ android:id="@+id/progressBar_cyclic"
+ style="?android:attr/progressBarStyleSmall"
+ android:layout_width="20dp"
+ android:layout_height="20dp"
+ android:layout_gravity="center"/>
+ <TextView
+ android:id="@+id/createMessage"
+ style="@style/PrivateSpaceSetupTextFontStyle"
+ android:textSize="14sp"
+ android:text="@string/privatespace_setting_up_text"
+ android:layout_margin="8dp"/>
+ </LinearLayout>
+
+ </LinearLayout>
+</com.google.android.setupdesign.GlifLayout>
diff --git a/res/layout/privatespace_creation_error.xml b/res/layout/privatespace_creation_error.xml
new file mode 100644
index 0000000..af11f3a
--- /dev/null
+++ b/res/layout/privatespace_creation_error.xml
@@ -0,0 +1,27 @@
+<!--
+ ~ Copyright (C) 2023 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.
+ -->
+
+<com.google.android.setupdesign.GlifLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/privatespace_setup_error"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:filterTouchesWhenObscured="true"
+ app:sucHeaderText="@string/privatespace_error_screen_title"
+ app:sudDescriptionText="@string/privatespace_error_screen_summary"
+ android:icon="@drawable/ic_warning_circle_red">
+</com.google.android.setupdesign.GlifLayout>
diff --git a/res/layout/privatespace_education_screen.xml b/res/layout/privatespace_education_screen.xml
index e93ebfe..adb65c9 100644
--- a/res/layout/privatespace_education_screen.xml
+++ b/res/layout/privatespace_education_screen.xml
@@ -15,12 +15,12 @@
-->
<com.google.android.setupdesign.GlifLayout
- xmlns:aapt="http://schemas.android.com/aapt"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ps_education_screen"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:filterTouchesWhenObscured="true"
app:sucHeaderText="@string/privatespace_setup_title"
app:sudDescriptionText="@string/privatespace_hide_apps_summary"
android:icon="@drawable/ic_privatespace_icon">
diff --git a/res/layout/privatespace_setlock_screen.xml b/res/layout/privatespace_setlock_screen.xml
new file mode 100644
index 0000000..5caf4ae
--- /dev/null
+++ b/res/layout/privatespace_setlock_screen.xml
@@ -0,0 +1,43 @@
+<!--
+ ~ Copyright (C) 2023 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.
+ -->
+
+<com.google.android.setupdesign.GlifLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/ps_fragment_lock"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:filterTouchesWhenObscured="true"
+ app:sucHeaderText="@string/privatespace_lockscreen_title"
+ app:sudDescriptionText="@string/privatespace_lockscreen_summary"
+ android:icon="@drawable/ic_lock">
+ <com.google.android.setupdesign.view.FillContentLayout
+ style="@style/SudContentFrame"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:maxWidth="@dimen/animation_max_size"
+ android:maxHeight="@dimen/animation_max_size">
+
+ <ImageView
+ android:id="@+id/privatespace_lock_image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="fitCenter"
+ android:contentDescription="@null"
+ android:src="@drawable/privatespace_lock_placeholder"/>
+
+ </com.google.android.setupdesign.view.FillContentLayout>
+</com.google.android.setupdesign.GlifLayout>
\ No newline at end of file
diff --git a/res/layout/privatespace_setup_success.xml b/res/layout/privatespace_setup_success.xml
new file mode 100644
index 0000000..00b6fec
--- /dev/null
+++ b/res/layout/privatespace_setup_success.xml
@@ -0,0 +1,27 @@
+<!--
+ ~ Copyright (C) 2023 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.
+ -->
+
+<com.google.android.setupdesign.GlifLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/privatespace_setup_success"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:filterTouchesWhenObscured="true"
+ app:sucHeaderText="@string/privatespace_success_title"
+ app:sudDescriptionText="@string/privatespace_access_text"
+ android:icon="@drawable/ic_privatespace_done">
+</com.google.android.setupdesign.GlifLayout>
diff --git a/res/navigation/privatespace_main_context_nav.xml b/res/navigation/privatespace_main_context_nav.xml
index f92e572..5b2552a 100644
--- a/res/navigation/privatespace_main_context_nav.xml
+++ b/res/navigation/privatespace_main_context_nav.xml
@@ -21,5 +21,29 @@
app:startDestination="@id/ps_education_fragment">
<fragment android:id="@+id/ps_education_fragment"
android:name="com.android.settings.privatespace.PrivateSpaceEducation"
- android:label="fragment_ps_education"/>
+ android:label="fragment_ps_education">
+ <action
+ android:id="@+id/action_education_to_auto_advance"
+ app:destination="@id/ps_auto_advance_fragment"/>
+ </fragment>
+ <fragment android:id="@+id/ps_auto_advance_fragment"
+ android:name="com.android.settings.privatespace.AutoAdvanceSetupFragment"
+ android:label="fragment_ps_auto_advance">
+ <action
+ android:id="@+id/action_advance_profile_error"
+ app:destination="@id/ps_profile_error_fragment"/>
+ <action
+ android:id="@+id/action_advance_to_success"
+ app:destination="@id/ps_profile_success_fragment"/>
+ </fragment>
+ <fragment android:id="@+id/ps_profile_error_fragment"
+ android:name="com.android.settings.privatespace.PrivateProfileCreationError"
+ android:label="fragment_ps_error">
+ <action
+ android:id="@+id/action_retry_profile_creation"
+ app:destination="@id/ps_auto_advance_fragment"/>
+ </fragment>
+ <fragment android:id="@+id/ps_profile_success_fragment"
+ android:name="com.android.settings.privatespace.SetupSuccessFragment"
+ android:label="fragment_ps_success"/>
</navigation>
\ No newline at end of file
diff --git a/res/navigation/privatespace_private_context_nav.xml b/res/navigation/privatespace_private_context_nav.xml
new file mode 100644
index 0000000..3df8fa5
--- /dev/null
+++ b/res/navigation/privatespace_private_context_nav.xml
@@ -0,0 +1,24 @@
+<!--
+ ~ Copyright (C) 2023 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.
+ -->
+
+<navigation xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/private_space_navigation"
+ app:startDestination="@id/ps_profile_lock_fragment">
+ <fragment android:id="@+id/ps_profile_lock_fragment"
+ android:name="com.android.settings.privatespace.PrivateSpaceSetLockFragment"
+ android:label="fragment_ps_lock"/>
+</navigation>
diff --git a/res/values/config.xml b/res/values/config.xml
index 443f815..99052ca 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -529,8 +529,12 @@
<item>content://com.android.settings.slices/intent/media_output_indicator</item>
</string-array>
- <!-- List containing the apps cannot be changed the battery optimize modes -->
- <string-array name="config_disable_optimization_mode_apps" translatable="false">
+ <!-- List containing the apps keep in battery mode = "Optimized" -->
+ <string-array name="config_force_battery_optimize_mode_apps" translatable="false">
+ </string-array>
+
+ <!-- List containing the apps keep in battery mode = "Unrestricted" -->
+ <string-array name="config_force_battery_unrestrict_mode_apps" translatable="false">
</string-array>
<!-- Uri to query non-public Slice Uris. -->
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index aa14217..aed72dc 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -459,4 +459,7 @@
<dimen name="screen_flash_color_button_inner_circle_size">42dp</dimen>
<dimen name="screen_flash_color_button_inner_circle_padding">3dp</dimen>
<dimen name="screen_flash_color_button_inner_circle_stroke">1dp</dimen>
+
+ <!-- An arbitrarily large number to make the max size fit the parent -->
+ <dimen name="animation_max_size">1000dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f455ab5..ca69efa 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -292,6 +292,8 @@
<string name="audio_sharing_title">Audio sharing</string>
<!-- Title for audio sharing primary switch [CHAR LIMIT=none]-->
<string name="audio_sharing_switch_title">Share audio</string>
+ <!-- Title for calls and alarms device on audio sharing page [CHAR LIMIT=none]-->
+ <string name="calls_and_alarms_device_title">Calls and alarms</string>
<!-- Date & time settings screen title -->
<string name="date_and_time">Date & time</string>
@@ -1233,30 +1235,60 @@
<string name="private_space_delete_failed">Private Space could not be deleted</string>
<!-- Title of the Alert Dialog when no screen lock is set [CHAR LIMIT=30] -->
<string name="no_device_lock_title">Set a screen lock</string>
- <!-- Summary of the alert when no screen lock is set [CHAR LIMIT=60] -->
+ <!-- Summary of the alert when no screen lock is set [CHAR LIMIT=90] -->
<string name="no_device_lock_summary">To use Private Space, set a screen lock on this device.</string>
<!-- Action label for dialog when no screen lock is set [CHAR LIMIT=30] -->
<string name="no_device_lock_action_label">Set screen lock</string>
<!-- Action label to cancel Alert dialog when no screen lock is set [CHAR LIMIT=30] -->
<string name="no_device_lock_cancel">Cancel</string>
- <!-- Action label to cancel Private Space Setup flow [CHAR LIMIT=50] -->
+ <!-- Action label to cancel Private Space Setup flow [CHAR LIMIT=30] -->
<string name="privatespace_cancel_label">Cancel</string>
- <!-- Label for Private Space setup button to create Private Space [CHAR LIMIT=50] -->
+ <!-- Label for Private Space setup button to create Private Space [CHAR LIMIT=30] -->
<string name="privatespace_setup_button_label">Set up</string>
- <!-- Title for Private Space setup education screen. [CHAR LIMIT=60] -->
+ <!-- Title for Private Space setup education screen. [CHAR LIMIT=50] -->
<string name="privatespace_setup_title">Set up Private Space</string>
<!-- Summary for the Private Space setup education screen. [CHAR LIMIT=NONE] -->
<string name="privatespace_hide_apps_summary">Hide private apps in a secure space that only you can access</string>
- <!-- Text shown in Private Space setup screen which explains how the Private Space works [CHAR LIMIT=NONE] -->
+ <!-- Text shown in Private Space setup screen which explains how the Private Space works [CHAR LIMIT=50] -->
<string name="privatespace_how_title">How it works</string>
<!-- Text shown in Private Space setup screen which explains Private Space can be accessed from bottom of all apps list. [CHAR LIMIT=NONE] -->
<string name="privatespace_access_bottom_text">You can access Private Space from the bottom of your apps list</string>
- <!-- Text shown in Private Space setup screen which explains Private Space apps are protected by a lock. [CHAR LIMIT=NONE] -->
+ <!-- Text shown in Private Space setup screen which explains Private Space apps are protected by a lock. [CHAR LIMIT=60] -->
<string name="privatespace_protected_lock_text">Apps in Private Space are protected by a lock</string>
<!-- Text shown in Private Space setup screen which explains notifications from Private Space apps will not be shown when Private Space is locked. [CHAR LIMIT=NONE] -->
- <string name="privatespace_hidden_notifications_text">Notifications from apps in Private Space are hidden when it\'s locked</string>
+ <string name="privatespace_hidden_notifications_text">Notifications from apps in Private Space are hidden when it\u2019s locked</string>
<!-- Text shown in Private Space setup screen which explains that the permissions granted to Private Space apps will not be shown in settings when Private Space is locked. [CHAR LIMIT=NONE] -->
- <string name="privatespace_apps_permission_text">Private Space apps won\'t appear in permission manager, privacy dashboard, and other settings when Private Space is locked</string>
+ <string name="privatespace_apps_permission_text">Private Space apps won\u2019t appear in permission manager, privacy dashboard, and other settings when Private Space is locked</string>
+ <!-- Text shown at the bottom in Private Space auto advancing screens. [CHAR LIMIT=60] -->
+ <string name="privatespace_setting_up_text">Setting up Private Space\u2026</string>
+ <!-- Title for Private Space setup in auto advancing screen informing private space is protected by a lock. [CHAR LIMIT=60] -->
+ <string name="privatespace_lock_protected_title">Private Space is protected by a lock</string>
+ <!-- Title for Private Space setup in auto advancing screen informing private space is hidden when locked. [CHAR LIMIT=NONE] -->
+ <string name="privatespace_apps_hidden_title">Usage info for Private Space apps is hidden when it\u2019s locked</string>
+ <!-- Title for Private Space setup in auto advancing screen informing private space can be accessed from apps list. [CHAR LIMIT=60] -->
+ <string name="privatespace_access_from_apps_title">Access Private Space from your apps list</string>
+ <!-- Title for Private Space creation error screen. [CHAR LIMIT=60] -->
+ <string name="privatespace_error_screen_title">Couldn\u2019t set up Private Space</string>
+ <!-- Summary for the Private Space creation error screen. [CHAR LIMIT=60] -->
+ <string name="privatespace_error_screen_summary">Try again now, or come back later</string>
+ <!-- Label for button to retry creating private space again on creation error. [CHAR LIMIT=30] -->
+ <string name="privatespace_tryagain_label">Try Again</string>
+ <!-- Title for Private Space lock setup screen. [CHAR LIMIT=50] -->
+ <string name="privatespace_lockscreen_title">Use screen lock to unlock?</string>
+ <!-- Summary for the Private Space lock setup screen. [CHAR LIMIT=NONE] -->
+ <string name="privatespace_lockscreen_summary">You can unlock Private Space the same way you unlock your device, or choose a different lock</string>
+ <!-- Action label to use existing device lock for Private Space. [CHAR LIMIT=50] -->
+ <string name="privatespace_use_screenlock_label">Use screen lock</string>
+ <!-- Label for Private Space lock setup button to choose a new lock. [CHAR LIMIT=50] -->
+ <string name="privatespace_set_lock_label">Choose new lock</string>
+ <!-- Title for Private Space setup success screen. [CHAR LIMIT=30] -->
+ <string name="privatespace_success_title">All set!</string>
+ <!-- Summary for the Private Space setup success screen. [CHAR LIMIT=NONE] -->
+ <string name="privatespace_access_text">To access Private Space, swipe up from the bottom of your home screen, then scroll down</string>
+ <!-- Label for Private Space done button to show a toast, finish setup and launch All apps [CHAR LIMIT=30] -->
+ <string name="privatespace_done_label">Done</string>
+ <!-- Toast to show on private space setup completion informing user to scroll down All apps to access private space. [CHAR LIMIT=60] -->
+ <string name="scrolldown_to_access">Scroll down to access Private Space</string>
<!-- Text shown when "Add fingerprint" button is disabled -->
<string name="fingerprint_add_max">You can add up to <xliff:g id="count" example="5">%d</xliff:g> fingerprints</string>
@@ -2564,7 +2596,7 @@
<!-- Display settings screen, peak refresh rate settings title [CHAR LIMIT=30] -->
<string name="peak_refresh_rate_title">Smooth Display</string>
<!-- Display settings screen, peak refresh rate settings summary [CHAR LIMIT=NONE] -->
- <string name="peak_refresh_rate_summary">Automatically raises the refresh rate from 60 to <xliff:g name="refresh_rate" example="120">%1$s</xliff:g> Hz for some content. Increases battery usage.</string>
+ <string name="peak_refresh_rate_summary">Automatically raises the refresh rate up to <xliff:g name="refresh_rate" example="120">%1$d</xliff:g> Hz for some content. Increases battery usage.</string>
<!-- Display developer settings: Force to the highest refresh rate [CHAR LIMIT=NONE] -->
<string name="force_high_refresh_rate_toggle">Force peak refresh rate</string>
<!-- Display developer settings: Force to the highest refresh rate description [CHAR LIMIT=NONE]-->
diff --git a/res/xml/bluetooth_audio_sharing.xml b/res/xml/bluetooth_audio_sharing.xml
index a90da72..bf7593a 100644
--- a/res/xml/bluetooth_audio_sharing.xml
+++ b/res/xml/bluetooth_audio_sharing.xml
@@ -19,4 +19,10 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/audio_sharing_title">
+ <Preference
+ android:key="calls_and_alarms"
+ android:title="@string/calls_and_alarms_device_title"
+ android:icon="@drawable/ic_audio_calls_and_alarms"
+ settings:controller="com.android.settings.connecteddevice.audiosharing.CallsAndAlarmsPreferenceController"
+ android:summary=""/>
</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml
index c52140c..59c0c21 100644
--- a/res/xml/configure_notification_settings.xml
+++ b/res/xml/configure_notification_settings.xml
@@ -174,7 +174,7 @@
android:title="@string/notification_pulse_title"
settings:controller="com.android.settings.notification.PulseNotificationPreferenceController"/>
- <SwitchPreference
+ <SwitchPreferenceCompat
android:key="notification_assistant"
android:order="25"
android:title="@string/notification_assistant_title"
diff --git a/src/com/android/settings/connecteddevice/audiosharing/AudioSharingDashboardFragment.java b/src/com/android/settings/connecteddevice/audiosharing/AudioSharingDashboardFragment.java
index 370b69a..b9ef8f4 100644
--- a/src/com/android/settings/connecteddevice/audiosharing/AudioSharingDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/audiosharing/AudioSharingDashboardFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.connecteddevice.audiosharing;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
@@ -36,8 +37,7 @@
@Override
public int getMetricsCategory() {
- // TODO: update category id.
- return 0;
+ return SettingsEnums.AUDIO_SHARING_SETTINGS;
}
@Override
@@ -63,6 +63,7 @@
@Override
public void onAttach(Context context) {
super.onAttach(context);
+ use(CallsAndAlarmsPreferenceController.class).init(this);
}
@Override
diff --git a/src/com/android/settings/connecteddevice/audiosharing/CallsAndAlarmsDialogFragment.java b/src/com/android/settings/connecteddevice/audiosharing/CallsAndAlarmsDialogFragment.java
new file mode 100644
index 0000000..0577f70
--- /dev/null
+++ b/src/com/android/settings/connecteddevice/audiosharing/CallsAndAlarmsDialogFragment.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2023 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.settings.connecteddevice.audiosharing;
+
+import android.app.Dialog;
+import android.app.settings.SettingsEnums;
+import android.os.Bundle;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+
+import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
+import com.android.settings.flags.Flags;
+
+/** Provides a dialog to choose the active device for calls and alarms. */
+public class CallsAndAlarmsDialogFragment extends InstrumentedDialogFragment {
+ private static final String TAG = "CallsAndAlarmsDialog";
+
+ @Override
+ public int getMetricsCategory() {
+ return SettingsEnums.DIALOG_AUDIO_SHARING_SWITCH_ACTIVE;
+ }
+
+ /**
+ * Display the {@link CallsAndAlarmsDialogFragment} dialog.
+ *
+ * @param host The Fragment this dialog will be hosted.
+ */
+ public static void show(Fragment host) {
+ if (!Flags.enableLeAudioSharing()) return;
+ final FragmentManager manager = host.getChildFragmentManager();
+ if (manager.findFragmentByTag(TAG) == null) {
+ final CallsAndAlarmsDialogFragment dialog = new CallsAndAlarmsDialogFragment();
+ dialog.show(manager, TAG);
+ }
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // TODO: use real device names
+ String[] choices = {"Buds 1", "Buds 2"};
+ AlertDialog.Builder builder =
+ new AlertDialog.Builder(getActivity())
+ .setTitle(R.string.calls_and_alarms_device_title)
+ .setSingleChoiceItems(
+ choices,
+ 0, // TODO: set to current active device.
+ (dialog, which) -> {
+ // TODO: set device to active device for calls and alarms.
+ });
+ return builder.create();
+ }
+}
diff --git a/src/com/android/settings/connecteddevice/audiosharing/CallsAndAlarmsPreferenceController.java b/src/com/android/settings/connecteddevice/audiosharing/CallsAndAlarmsPreferenceController.java
new file mode 100644
index 0000000..480b257
--- /dev/null
+++ b/src/com/android/settings/connecteddevice/audiosharing/CallsAndAlarmsPreferenceController.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2023 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.settings.connecteddevice.audiosharing;
+
+import android.content.Context;
+import android.util.Log;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.flags.Flags;
+
+/** PreferenceController to control the dialog to choose the active device for calls and alarms */
+public class CallsAndAlarmsPreferenceController extends BasePreferenceController {
+
+ private static final String TAG = "CallsAndAlarmsPreferenceController";
+
+ private static final String PREF_KEY = "calls_and_alarms";
+
+ private Preference mPreference;
+ private DashboardFragment mFragment;
+
+ public CallsAndAlarmsPreferenceController(Context context) {
+ super(context, PREF_KEY);
+ }
+
+ @Override
+ public int getAvailabilityStatus() {
+ return Flags.enableLeAudioSharing() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+ }
+
+ @Override
+ public String getPreferenceKey() {
+ return PREF_KEY;
+ }
+
+ @Override
+ public void displayPreference(PreferenceScreen screen) {
+ super.displayPreference(screen);
+ mPreference = screen.findPreference(getPreferenceKey());
+ mPreference.setOnPreferenceClickListener(
+ preference -> {
+ if (mFragment != null) {
+ CallsAndAlarmsDialogFragment.show(mFragment);
+ } else {
+ Log.w(TAG, "Dialog fail to show due to null host.");
+ }
+ return true;
+ });
+ }
+
+ /**
+ * Initialize the controller.
+ *
+ * @param fragment The fragment to host the {@link CallsAndAlarmsDialogFragment} dialog.
+ */
+ public void init(DashboardFragment fragment) {
+ this.mFragment = fragment;
+ }
+}
diff --git a/src/com/android/settings/fuelgauge/BatteryBackupHelper.java b/src/com/android/settings/fuelgauge/BatteryBackupHelper.java
index 4dabe12..821501c 100644
--- a/src/com/android/settings/fuelgauge/BatteryBackupHelper.java
+++ b/src/com/android/settings/fuelgauge/BatteryBackupHelper.java
@@ -268,7 +268,7 @@
// Start to restore the app optimization mode data.
final int restoreCount = restoreOptimizationMode(mOptimizationModeBytes);
if (restoreCount > 0) {
- BatterySettingsMigrateChecker.verifyOptimizationModes(mContext);
+ BatterySettingsMigrateChecker.verifyBatteryOptimizeModes(mContext);
}
mOptimizationModeBytes = null; // clear data
}
@@ -342,7 +342,7 @@
private boolean isSystemOrDefaultApp(String packageName, int uid) {
return BatteryOptimizeUtils.isSystemOrDefaultApp(
- getPowerAllowlistBackend(), packageName, uid);
+ mContext, getPowerAllowlistBackend(), packageName, uid);
}
private ArraySet<ApplicationInfo> getInstalledApplications() {
diff --git a/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java b/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java
index 124840e..7b3a6ad 100644
--- a/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java
+++ b/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java
@@ -45,6 +45,10 @@
private static final String TAG = "BatteryOptimizeUtils";
private static final String UNKNOWN_PACKAGE = "unknown";
+ // Avoid reload the data again since it is predefined in the resource/config.
+ private static List<String> sBatteryOptimizeModeList = null;
+ private static List<String> sBatteryUnrestrictModeList = null;
+
@VisibleForTesting AppOpsManager mAppOpsManager;
@VisibleForTesting BatteryUtils mBatteryUtils;
@VisibleForTesting PowerAllowlistBackend mPowerAllowListBackend;
@@ -130,7 +134,7 @@
/** Return {@code true} if it is disabled for default optimized mode only. */
public boolean isDisabledForOptimizeModeOnly() {
- return getAllowList(mContext).contains(mPackageName)
+ return getForceBatteryOptimizeModeList(mContext).contains(mPackageName)
|| mBatteryUtils.getPackageUid(mPackageName) == BatteryUtils.UID_NULL;
}
@@ -139,7 +143,7 @@
*/
public boolean isSystemOrDefaultApp() {
mPowerAllowListBackend.refreshList();
- return isSystemOrDefaultApp(mPowerAllowListBackend, mPackageName, mUid);
+ return isSystemOrDefaultApp(mContext, mPowerAllowListBackend, mPackageName, mUid);
}
/**
@@ -191,7 +195,8 @@
// Ignores default optimized/unknown state or system/default apps.
if (optimizationMode == MODE_OPTIMIZED
|| optimizationMode == MODE_UNKNOWN
- || isSystemOrDefaultApp(allowlistBackend, info.packageName, info.uid)) {
+ || isSystemOrDefaultApp(
+ context, allowlistBackend, info.packageName, info.uid)) {
continue;
}
@@ -211,14 +216,32 @@
}
static boolean isSystemOrDefaultApp(
- PowerAllowlistBackend powerAllowlistBackend, String packageName, int uid) {
+ Context context,
+ PowerAllowlistBackend powerAllowlistBackend,
+ String packageName,
+ int uid) {
return powerAllowlistBackend.isSysAllowlisted(packageName)
+ // Always forced unrestricted apps are one type of system important apps.
+ || getForceBatteryUnrestrictModeList(context).contains(packageName)
|| powerAllowlistBackend.isDefaultActiveApp(packageName, uid);
}
- static List<String> getAllowList(Context context) {
- return Arrays.asList(context.getResources().getStringArray(
- R.array.config_disable_optimization_mode_apps));
+ static List<String> getForceBatteryOptimizeModeList(Context context) {
+ if (sBatteryOptimizeModeList == null) {
+ sBatteryOptimizeModeList = Arrays.asList(
+ context.getResources().getStringArray(
+ R.array.config_force_battery_optimize_mode_apps));
+ }
+ return sBatteryOptimizeModeList;
+ }
+
+ static List<String> getForceBatteryUnrestrictModeList(Context context) {
+ if (sBatteryUnrestrictModeList == null) {
+ sBatteryUnrestrictModeList = Arrays.asList(
+ context.getResources().getStringArray(
+ R.array.config_force_battery_unrestrict_mode_apps));
+ }
+ return sBatteryUnrestrictModeList;
}
private static void setAppUsageStateInternal(
diff --git a/src/com/android/settings/fuelgauge/BatterySettingsMigrateChecker.java b/src/com/android/settings/fuelgauge/BatterySettingsMigrateChecker.java
index 8697e43..b41e153 100644
--- a/src/com/android/settings/fuelgauge/BatterySettingsMigrateChecker.java
+++ b/src/com/android/settings/fuelgauge/BatterySettingsMigrateChecker.java
@@ -50,17 +50,27 @@
static void verifyConfiguration(Context context) {
context = context.getApplicationContext();
verifySaverConfiguration(context);
- verifyOptimizationModes(context);
+ verifyBatteryOptimizeModes(context);
}
/** Avoid users set important apps into the unexpected battery optimize modes */
- static void verifyOptimizationModes(Context context) {
+ static void verifyBatteryOptimizeModes(Context context) {
Log.d(TAG, "invoke verifyOptimizationModes()");
- verifyOptimizationModes(context, BatteryOptimizeUtils.getAllowList(context));
+ verifyBatteryOptimizeModeApps(
+ context,
+ BatteryOptimizeUtils.MODE_OPTIMIZED,
+ BatteryOptimizeUtils.getForceBatteryOptimizeModeList(context));
+ verifyBatteryOptimizeModeApps(
+ context,
+ BatteryOptimizeUtils.MODE_UNRESTRICTED,
+ BatteryOptimizeUtils.getForceBatteryUnrestrictModeList(context));
}
@VisibleForTesting
- static void verifyOptimizationModes(Context context, List<String> allowList) {
+ static void verifyBatteryOptimizeModeApps(
+ Context context,
+ @BatteryOptimizeUtils.OptimizationMode int optimizationMode,
+ List<String> allowList) {
allowList.forEach(packageName -> {
final BatteryOptimizeUtils batteryOptimizeUtils =
BatteryBackupHelper.newBatteryOptimizeUtils(context, packageName,
@@ -68,10 +78,10 @@
if (batteryOptimizeUtils == null) {
return;
}
- if (batteryOptimizeUtils.getAppOptimizationMode() !=
- BatteryOptimizeUtils.MODE_OPTIMIZED) {
- Log.w(TAG, "Reset optimization mode for: " + packageName);
- batteryOptimizeUtils.setAppUsageState(BatteryOptimizeUtils.MODE_OPTIMIZED,
+ if (batteryOptimizeUtils.getAppOptimizationMode() != optimizationMode) {
+ Log.w(TAG, "Reset " + packageName + " battery mode into " + optimizationMode);
+ batteryOptimizeUtils.setAppUsageState(
+ optimizationMode,
BatteryOptimizeHistoricalLogEntry.Action.FORCE_RESET);
}
});
diff --git a/src/com/android/settings/network/NetworkProviderSettings.java b/src/com/android/settings/network/NetworkProviderSettings.java
index 793fecc..bc271ca 100644
--- a/src/com/android/settings/network/NetworkProviderSettings.java
+++ b/src/com/android/settings/network/NetworkProviderSettings.java
@@ -49,9 +49,11 @@
import android.view.View;
import android.widget.Toast;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
+import androidx.core.view.MenuProvider;
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
@@ -249,6 +251,8 @@
ConnectedEthernetNetworkController mConnectedEthernetNetworkController;
@VisibleForTesting
FooterPreference mWifiStatusMessagePreference;
+ @VisibleForTesting
+ MenuProvider mMenuProvider;
/**
* Mobile networks list for provider model
@@ -306,6 +310,44 @@
mIsRestricted = isUiRestricted();
updateUserType();
+
+ mMenuProvider = new MenuProvider() {
+ @Override
+ public void onCreateMenu(@NonNull Menu menu, @NonNull MenuInflater menuInflater) {
+ MenuItem fixConnectivityItem = menu.add(0, MENU_FIX_CONNECTIVITY, 0,
+ R.string.fix_connectivity);
+ fixConnectivityItem.setIcon(R.drawable.ic_repair_24dp);
+ fixConnectivityItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+ }
+
+ @Override
+ public boolean onMenuItemSelected(@NonNull MenuItem menuItem) {
+ if (menuItem.getItemId() == MENU_FIX_CONNECTIVITY) {
+ if (isPhoneOnCall()) {
+ showResetInternetDialog();
+ return true;
+ }
+ fixConnectivity();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onPrepareMenu(@NonNull Menu menu) {
+ MenuProvider.super.onPrepareMenu(menu);
+
+ boolean isWifiEnabled = mWifiPickerTracker != null
+ && mWifiPickerTracker.getWifiState() == WifiManager.WIFI_STATE_ENABLED;
+ boolean isAirplaneModeOn =
+ mAirplaneModeEnabler != null && mAirplaneModeEnabler.isAirplaneModeOn();
+ MenuItem fixConnectivityItem = menu.findItem(MENU_FIX_CONNECTIVITY);
+ if (fixConnectivityItem == null) {
+ return;
+ }
+ fixConnectivityItem.setVisible(!mIsGuest && (!isAirplaneModeOn || isWifiEnabled));
+ }
+ };
}
private void updateUserType() {
@@ -425,7 +467,6 @@
}
}
};
- setHasOptionsMenu(true);
if (savedInstanceState != null) {
mDialogMode = savedInstanceState.getInt(SAVE_DIALOG_MODE);
@@ -444,12 +485,13 @@
if (mNetworkMobileProviderController != null) {
mNetworkMobileProviderController.setWifiPickerTrackerHelper(mWifiPickerTrackerHelper);
}
+
+ requireActivity().addMenuProvider(mMenuProvider);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
-
}
@Override
@@ -807,6 +849,9 @@
return;
}
+ // update the menu item
+ requireActivity().invalidateMenu();
+
switch (wifiState) {
case WifiManager.WIFI_STATE_ENABLED:
setWifiScanMessage(/* isWifiEnabled */ true);
@@ -1397,29 +1442,6 @@
return HelpUtils.getHelpIntent(context, helpUrlString, context.getClass().getName());
}
- @Override
- public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if (!mIsGuest && !mAirplaneModeEnabler.isAirplaneModeOn()) {
- MenuItem item = menu.add(0, MENU_FIX_CONNECTIVITY, 0, R.string.fix_connectivity);
- item.setIcon(R.drawable.ic_repair_24dp);
- item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
- }
- super.onCreateOptionsMenu(menu, inflater);
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem menuItem) {
- if (menuItem.getItemId() == MENU_FIX_CONNECTIVITY) {
- if (isPhoneOnCall()) {
- showResetInternetDialog();
- return true;
- }
- fixConnectivity();
- return true;
- }
- return super.onOptionsItemSelected(menuItem);
- }
-
@VisibleForTesting
void showResetInternetDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
@@ -1462,6 +1484,8 @@
@Override
public void onAirplaneModeChanged(boolean isAirplaneModeOn) {
updateAirplaneModeMsgPreference(isAirplaneModeOn /* visible */);
+ // update the menu item
+ requireActivity().invalidateMenu();
}
/**
diff --git a/src/com/android/settings/notification/NotificationAssistantPreferenceController.java b/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
index 3274aec..6f246b7 100644
--- a/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
+++ b/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
@@ -18,44 +18,31 @@
import android.content.ComponentName;
import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
import android.os.UserHandle;
-import android.os.UserManager;
import android.provider.Settings;
-import android.service.notification.NotificationAssistantService;
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settings.core.TogglePreferenceController;
-import com.android.settingslib.PrimarySwitchPreference;
import com.google.common.annotations.VisibleForTesting;
-import java.util.List;
-
public class NotificationAssistantPreferenceController extends TogglePreferenceController {
private static final String TAG = "NASPreferenceController";
static final String KEY_NAS = "notification_assistant";
- private final UserManager mUserManager;
- private final PackageManager mPackageManager;
private Fragment mFragment;
private int mUserId = UserHandle.myUserId();
@VisibleForTesting
protected NotificationBackend mNotificationBackend;
private ComponentName mDefaultNASComponent;
- private Intent mNASSettingIntent;
public NotificationAssistantPreferenceController(Context context) {
super(context, KEY_NAS);
- mUserManager = UserManager.get(context);
mNotificationBackend = new NotificationBackend();
- mPackageManager = context.getPackageManager();
getDefaultNASIntent();
}
@@ -118,12 +105,6 @@
@VisibleForTesting
void getDefaultNASIntent() {
mDefaultNASComponent = mNotificationBackend.getDefaultNotificationAssistant();
- if (mDefaultNASComponent != null) {
- mNASSettingIntent = new Intent(
- NotificationAssistantService.ACTION_NOTIFICATION_ASSISTANT_DETAIL_SETTINGS);
- mNASSettingIntent.setPackage(mDefaultNASComponent.getPackageName());
- mNASSettingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- }
}
@Override
@@ -136,7 +117,6 @@
super.updateState(preference);
if (mDefaultNASComponent == null) {
preference.setEnabled(false);
- ((PrimarySwitchPreference) preference).setSwitchEnabled(false);
}
}
}
diff --git a/src/com/android/settings/privatespace/AutoAdvanceSetupFragment.java b/src/com/android/settings/privatespace/AutoAdvanceSetupFragment.java
new file mode 100644
index 0000000..5456c01
--- /dev/null
+++ b/src/com/android/settings/privatespace/AutoAdvanceSetupFragment.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2023 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.settings.privatespace;
+
+import static com.android.settings.privatespace.PrivateSpaceSetupActivity.SET_LOCK_ACTION;
+
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.UserHandle;
+import android.util.Log;
+import android.util.Pair;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import androidx.activity.OnBackPressedCallback;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.navigation.fragment.NavHostFragment;
+
+import com.android.settings.R;
+
+import com.google.android.setupdesign.GlifLayout;
+import com.google.common.collect.ImmutableList;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/** Fragment to show screens that auto advance during private space setup flow */
+public class AutoAdvanceSetupFragment extends Fragment {
+ private static final String TAG = "AutoAdvanceFragment";
+ private static final String TITLE_INDEX = "title_index";
+ private static final int DELAY_BETWEEN_SCREENS = 5000; // 5 seconds in millis
+ private GlifLayout mRootView;
+ private Handler mHandler;
+ private int mScreenTitleIndex;
+ private static final List<Pair<Integer, Integer>> HEADER_IMAGE_PAIRS =
+ ImmutableList.of(
+ new Pair(R.string.privatespace_lock_protected_title,
+ R.drawable.privatespace_setup_flow_placeholder),
+ new Pair(R.string.privatespace_apps_hidden_title,
+ R.drawable.privatespace_setup_flow_placeholder),
+ new Pair(R.string.privatespace_access_from_apps_title,
+ R.drawable.privatespace_setup_flow_placeholder));
+
+ private Runnable mUpdateScreenResources =
+ new Runnable() {
+ @Override
+ public void run() {
+ if (getActivity() != null) {
+ if (++mScreenTitleIndex < HEADER_IMAGE_PAIRS.size()) {
+ updateHeaderAndImage();
+ mHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
+ } else {
+ PrivateSpaceMaintainer privateSpaceMaintainer = PrivateSpaceMaintainer
+ .getInstance(getActivity());
+ UserHandle userHandle;
+ if (privateSpaceMaintainer.doesPrivateSpaceExist() && (userHandle =
+ privateSpaceMaintainer.getPrivateProfileHandle()) != null) {
+ startActivityInPrivateUser(userHandle);
+ } else {
+ showPrivateSpaceErrorScreen();
+ }
+ }
+ }
+ }
+ };
+
+ @Override
+ public View onCreateView(
+ LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ if (savedInstanceState == null) {
+ if (PrivateSpaceMaintainer.getInstance(getActivity()).createPrivateSpace()) {
+ Log.i(TAG, "Private Space created");
+ }
+ } else {
+ mScreenTitleIndex = savedInstanceState.getInt(TITLE_INDEX);
+ if (mScreenTitleIndex >= HEADER_IMAGE_PAIRS.size()) {
+ return super.onCreateView(inflater, container, savedInstanceState);
+ }
+ }
+ mRootView =
+ (GlifLayout)
+ inflater.inflate(R.layout.privatespace_advancing_screen, container, false);
+ updateHeaderAndImage();
+ mHandler = new Handler(Looper.getMainLooper());
+ mHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
+ OnBackPressedCallback callback =
+ new OnBackPressedCallback(true /* enabled by default */) {
+ @Override
+ public void handleOnBackPressed() {
+ // Handle the back button event. We intentionally don't want to allow back
+ // button to work in this screen during the setup flow.
+ }
+ };
+ requireActivity().getOnBackPressedDispatcher().addCallback(this, callback);
+ return mRootView;
+ }
+
+ @Override
+ public void onSaveInstanceState(@NotNull Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putInt(TITLE_INDEX, mScreenTitleIndex);
+ }
+
+ @Override
+ public void onDestroy() {
+ mHandler.removeCallbacks(mUpdateScreenResources);
+ super.onDestroy();
+ }
+
+ @SuppressLint("MissingPermission")
+ private void startActivityInPrivateUser(UserHandle userHandle) {
+ /* Start new activity in private profile which is needed to set private profile lock */
+ Intent intent = new Intent(getContext(), PrivateProfileContextHelperActivity.class);
+ getActivity().startActivityForResultAsUser(intent, SET_LOCK_ACTION, userHandle);
+ }
+
+ private void showPrivateSpaceErrorScreen() {
+ NavHostFragment.findNavController(AutoAdvanceSetupFragment.this)
+ .navigate(R.id.action_advance_profile_error);
+ }
+
+ private void updateHeaderAndImage() {
+ mRootView.setHeaderText(HEADER_IMAGE_PAIRS.get(mScreenTitleIndex).first);
+ ((ImageView) mRootView.findViewById(R.id.placeholder_image))
+ .setImageResource(HEADER_IMAGE_PAIRS.get(mScreenTitleIndex).second);
+ }
+}
diff --git a/src/com/android/settings/privatespace/PrivateProfileContextHelperActivity.java b/src/com/android/settings/privatespace/PrivateProfileContextHelperActivity.java
new file mode 100644
index 0000000..c0d762a
--- /dev/null
+++ b/src/com/android/settings/privatespace/PrivateProfileContextHelperActivity.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 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.settings.privatespace;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.FragmentActivity;
+import androidx.navigation.fragment.NavHostFragment;
+
+import com.android.settings.R;
+import com.android.settings.SetupWizardUtils;
+
+import com.google.android.setupdesign.util.ThemeHelper;
+
+/** Activity that is started as private profile user that helps to set private profile lock. */
+public class PrivateProfileContextHelperActivity extends FragmentActivity {
+ private static final String TAG = "PrivateProfileHelper";
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ setTheme(SetupWizardUtils.getTheme(this, getIntent()));
+ ThemeHelper.trySetDynamicColor(this);
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.privatespace_setup_root);
+ NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager()
+ .findFragmentById(R.id.ps_nav_host_fragment);
+ navHostFragment.getNavController().setGraph(R.navigation.privatespace_private_context_nav);
+ }
+}
diff --git a/src/com/android/settings/privatespace/PrivateProfileCreationError.java b/src/com/android/settings/privatespace/PrivateProfileCreationError.java
new file mode 100644
index 0000000..80826dd
--- /dev/null
+++ b/src/com/android/settings/privatespace/PrivateProfileCreationError.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2023 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.settings.privatespace;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.activity.OnBackPressedCallback;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.navigation.fragment.NavHostFragment;
+
+import com.android.settings.R;
+
+import com.google.android.setupcompat.template.FooterBarMixin;
+import com.google.android.setupcompat.template.FooterButton;
+import com.google.android.setupdesign.GlifLayout;
+
+/** Fragment to display error screen if creation of private profile failed for any reason. */
+public class PrivateProfileCreationError extends Fragment {
+ @Override
+ public View onCreateView(
+ LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ GlifLayout rootView =
+ (GlifLayout)
+ inflater.inflate(R.layout.privatespace_creation_error, container, false);
+ final FooterBarMixin mixin = rootView.getMixin(FooterBarMixin.class);
+ mixin.setPrimaryButton(
+ new FooterButton.Builder(getContext())
+ .setText(R.string.privatespace_tryagain_label)
+ .setListener(onTryAgain())
+ .setButtonType(FooterButton.ButtonType.NEXT)
+ .setTheme(com.google.android.setupdesign.R.style.SudGlifButton_Primary)
+ .build());
+ mixin.setSecondaryButton(
+ new FooterButton.Builder(getContext())
+ .setText(R.string.privatespace_cancel_label)
+ .setListener(onCancel())
+ .setButtonType(FooterButton.ButtonType.CANCEL)
+ .setTheme(
+ androidx.appcompat.R.style
+ .Base_TextAppearance_AppCompat_Widget_Button)
+ .build());
+ OnBackPressedCallback callback =
+ new OnBackPressedCallback(true /* enabled by default */) {
+ @Override
+ public void handleOnBackPressed() {
+ // Handle the back button event. We intentionally don't want to allow back
+ // button to work in this screen during the setup flow.
+ }
+ };
+ requireActivity().getOnBackPressedDispatcher().addCallback(this, callback);
+
+ return rootView;
+ }
+
+ private View.OnClickListener onTryAgain() {
+ return v -> {
+ NavHostFragment.findNavController(PrivateProfileCreationError.this)
+ .navigate(R.id.action_retry_profile_creation);
+ };
+ }
+
+ private View.OnClickListener onCancel() {
+ return v -> {
+ Activity activity = getActivity();
+ if (activity != null) {
+ activity.finish();
+ }
+ };
+ }
+}
diff --git a/src/com/android/settings/privatespace/PrivateSpaceEducation.java b/src/com/android/settings/privatespace/PrivateSpaceEducation.java
index 96d0aa2..5dd0cfa 100644
--- a/src/com/android/settings/privatespace/PrivateSpaceEducation.java
+++ b/src/com/android/settings/privatespace/PrivateSpaceEducation.java
@@ -24,6 +24,7 @@
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
+import androidx.navigation.fragment.NavHostFragment;
import com.android.settings.R;
@@ -49,7 +50,6 @@
.setButtonType(FooterButton.ButtonType.NEXT)
.setTheme(com.google.android.setupdesign.R.style.SudGlifButton_Primary)
.build());
- mixin.getPrimaryButtonView().setFilterTouchesWhenObscured(true);
mixin.setSecondaryButton(
new FooterButton.Builder(getContext())
.setText(R.string.privatespace_cancel_label)
@@ -59,29 +59,24 @@
androidx.appcompat.R.style
.Base_TextAppearance_AppCompat_Widget_Button)
.build());
- mixin.getSecondaryButtonView().setFilterTouchesWhenObscured(true);
return rootView;
}
private View.OnClickListener onSetup() {
return v -> {
- if (PrivateSpaceMaintainer.getInstance(getContext()).createPrivateSpace()) {
- finishActivity();
- }
+ NavHostFragment.findNavController(PrivateSpaceEducation.this)
+ .navigate(R.id.action_education_to_auto_advance);
+
};
}
private View.OnClickListener onCancel() {
return v -> {
- finishActivity();
+ Activity activity = getActivity();
+ if (activity != null) {
+ activity.finish();
+ }
};
}
-
- private void finishActivity() {
- Activity activity = getActivity();
- if (activity != null) {
- activity.finish();
- }
- }
}
diff --git a/src/com/android/settings/privatespace/PrivateSpaceMaintainer.java b/src/com/android/settings/privatespace/PrivateSpaceMaintainer.java
index af2da5b..e6094ce 100644
--- a/src/com/android/settings/privatespace/PrivateSpaceMaintainer.java
+++ b/src/com/android/settings/privatespace/PrivateSpaceMaintainer.java
@@ -162,6 +162,15 @@
/* title= */ null, /* description= */ null);
}
+ /** Returns Private profile user handle if private profile exists otherwise returns null. */
+ @Nullable
+ public synchronized UserHandle getPrivateProfileHandle() {
+ if (doesPrivateSpaceExist()) {
+ return mUserHandle;
+ }
+ return null;
+ }
+
/** Returns the instance of {@link PrivateSpaceMaintainer} */
public static synchronized PrivateSpaceMaintainer getInstance(Context context) {
if (sPrivateSpaceMaintainer == null) {
diff --git a/src/com/android/settings/privatespace/PrivateSpaceSetLockFragment.java b/src/com/android/settings/privatespace/PrivateSpaceSetLockFragment.java
new file mode 100644
index 0000000..3d17638
--- /dev/null
+++ b/src/com/android/settings/privatespace/PrivateSpaceSetLockFragment.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2023 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.settings.privatespace;
+
+import static android.app.Activity.RESULT_OK;
+import static android.app.admin.DevicePolicyManager.ACTION_SET_NEW_PASSWORD;
+import static android.app.admin.DevicePolicyManager.EXTRA_PASSWORD_COMPLEXITY;
+import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_LOW;
+
+import android.app.Activity;
+import android.app.KeyguardManager;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.activity.OnBackPressedCallback;
+import androidx.activity.result.ActivityResult;
+import androidx.activity.result.ActivityResultLauncher;
+import androidx.activity.result.contract.ActivityResultContracts;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import com.android.settings.R;
+
+import com.google.android.setupcompat.template.FooterBarMixin;
+import com.google.android.setupcompat.template.FooterButton;
+import com.google.android.setupdesign.GlifLayout;
+
+/** Fragment that provides an option to user to choose between the existing screen lock or set a
+ * separate private profile lock. */
+public class PrivateSpaceSetLockFragment extends Fragment {
+ private final ActivityResultLauncher<Intent> mVerifyDeviceLock =
+ registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
+ this::onSetDeviceNewLock);
+
+ @Override
+ public View onCreateView(
+ LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ GlifLayout rootView =
+ (GlifLayout) inflater.inflate(
+ R.layout.privatespace_setlock_screen, container, false);
+ final FooterBarMixin mixin = rootView.getMixin(FooterBarMixin.class);
+ mixin.setPrimaryButton(
+ new FooterButton.Builder(getContext())
+ .setText(R.string.privatespace_use_screenlock_label)
+ .setListener(onClickUse())
+ .setButtonType(FooterButton.ButtonType.NEXT)
+ .setTheme(com.google.android.setupdesign.R.style.SudGlifButton_Primary)
+ .build());
+ mixin.setSecondaryButton(
+ new FooterButton.Builder(getContext())
+ .setText(R.string.privatespace_set_lock_label)
+ .setListener(onClickNewLock())
+ .setButtonType(FooterButton.ButtonType.NEXT)
+ .setTheme(
+ androidx.appcompat.R.style
+ .Base_TextAppearance_AppCompat_Widget_Button)
+ .build());
+ OnBackPressedCallback callback =
+ new OnBackPressedCallback(true /* enabled by default */) {
+ @Override
+ public void handleOnBackPressed() {
+ // Handle the back button event. We intentionally don't want to allow back
+ // button to work in this screen during the setup flow.
+ }
+ };
+ requireActivity().getOnBackPressedDispatcher().addCallback(this, callback);
+
+ return rootView;
+ }
+
+ private View.OnClickListener onClickUse() {
+ return v -> {
+ // Simply Use default screen lock. No need to handle
+ Activity activity = getActivity();
+ if (activity != null) {
+ activity.setResult(RESULT_OK);
+ activity.finish();
+ }
+ };
+ }
+
+ private View.OnClickListener onClickNewLock() {
+ return v -> {
+ createPrivateSpaceLock();
+ };
+ }
+
+ private void createPrivateSpaceLock() {
+ final Intent intent = new Intent(ACTION_SET_NEW_PASSWORD);
+ intent.putExtra(EXTRA_PASSWORD_COMPLEXITY, PASSWORD_COMPLEXITY_LOW);
+ mVerifyDeviceLock.launch(intent);
+ }
+
+ private void onSetDeviceNewLock(@Nullable ActivityResult result) {
+ // TODO(b/307281644) : Verify this for biometrics and check result code after new
+ // Authentication changes are merged.
+ if (result != null) {
+ Activity profileContextHelperActivity = getActivity();
+ if (profileContextHelperActivity != null && profileContextHelperActivity
+ .getSystemService(KeyguardManager.class).isDeviceSecure()) {
+ profileContextHelperActivity.setResult(RESULT_OK);
+ profileContextHelperActivity.finish();
+ }
+ }
+ }
+}
diff --git a/src/com/android/settings/privatespace/PrivateSpaceSetupActivity.java b/src/com/android/settings/privatespace/PrivateSpaceSetupActivity.java
index 79e19fc..3a58e9e 100644
--- a/src/com/android/settings/privatespace/PrivateSpaceSetupActivity.java
+++ b/src/com/android/settings/privatespace/PrivateSpaceSetupActivity.java
@@ -16,8 +16,10 @@
package com.android.settings.privatespace;
+import android.content.Intent;
import android.os.Bundle;
+import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import androidx.navigation.fragment.NavHostFragment;
@@ -26,15 +28,26 @@
import com.google.android.setupdesign.util.ThemeHelper;
+/** Activity class that helps in setting up of private space */
public class PrivateSpaceSetupActivity extends FragmentActivity {
+ public static final int SET_LOCK_ACTION = 1;
+ private NavHostFragment mNavHostFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
ThemeHelper.trySetDynamicColor(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.privatespace_setup_root);
- NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager()
+ mNavHostFragment = (NavHostFragment) getSupportFragmentManager()
.findFragmentById(R.id.ps_nav_host_fragment);
- navHostFragment.getNavController().setGraph(R.navigation.privatespace_main_context_nav);
+ mNavHostFragment.getNavController().setGraph(R.navigation.privatespace_main_context_nav);
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+ if (requestCode == SET_LOCK_ACTION && resultCode == RESULT_OK) {
+ mNavHostFragment.getNavController().navigate(R.id.action_advance_to_success);
+ }
+ super.onActivityResult(requestCode, resultCode, data);
}
}
diff --git a/src/com/android/settings/privatespace/SetupSuccessFragment.java b/src/com/android/settings/privatespace/SetupSuccessFragment.java
new file mode 100644
index 0000000..a8ca3f1
--- /dev/null
+++ b/src/com/android/settings/privatespace/SetupSuccessFragment.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2023 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.settings.privatespace;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Toast;
+
+import androidx.activity.OnBackPressedCallback;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import com.android.settings.R;
+
+import com.google.android.setupcompat.template.FooterBarMixin;
+import com.google.android.setupcompat.template.FooterButton;
+import com.google.android.setupdesign.GlifLayout;
+
+/** Fragment for the final screen shown on successful completion of private space setup. */
+public class SetupSuccessFragment extends Fragment {
+ private static final String TAG = "SetupSuccessFragment";
+
+ @Override
+ public View onCreateView(
+ LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ GlifLayout rootView =
+ (GlifLayout)
+ inflater.inflate(R.layout.privatespace_setup_success, container, false);
+ final FooterBarMixin mixin = rootView.getMixin(FooterBarMixin.class);
+ mixin.setPrimaryButton(
+ new FooterButton.Builder(getContext())
+ .setText(R.string.privatespace_done_label)
+ .setListener(onClickNext())
+ .setButtonType(FooterButton.ButtonType.NEXT)
+ .setTheme(com.google.android.setupdesign.R.style.SudGlifButton_Primary)
+ .build());
+ OnBackPressedCallback callback =
+ new OnBackPressedCallback(true /* enabled by default */) {
+ @Override
+ public void handleOnBackPressed() {
+ // Handle the back button event. We intentionally don't want to allow back
+ // button to work in this screen during the setup flow.
+ }
+ };
+ requireActivity().getOnBackPressedDispatcher().addCallback(this, callback);
+
+ return rootView;
+ }
+
+ private View.OnClickListener onClickNext() {
+ return v -> {
+ accessPrivateSpaceToast();
+ // TODO: Replace with the intent to launch PS/PS Launch Settings
+ Intent startMain = new Intent(Intent.ACTION_MAIN);
+ startMain.addCategory(Intent.CATEGORY_HOME);
+ startActivity(startMain);
+ Activity activity = getActivity();
+ if (activity != null) {
+ activity.finish();
+ }
+ };
+ }
+
+ private void accessPrivateSpaceToast() {
+ Toast.makeText(getContext(), R.string.scrolldown_to_access, Toast.LENGTH_SHORT).show();
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsMigrateCheckerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsMigrateCheckerTest.java
index c34dcec..e2058e7 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsMigrateCheckerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatterySettingsMigrateCheckerTest.java
@@ -151,12 +151,15 @@
}
@Test
- public void verifyOptimizationModes_inAllowList_resetOptimizationMode() throws Exception {
+ public void verifyBatteryOptimizeModeApps_inAllowList_resetOptimizationMode()
+ throws Exception {
doReturn(BatteryOptimizeUtils.MODE_RESTRICTED).when(mBatteryOptimizeUtils)
.getAppOptimizationMode();
- mBatterySettingsMigrateChecker.verifyOptimizationModes(
- mContext, Arrays.asList(PACKAGE_NAME));
+ mBatterySettingsMigrateChecker.verifyBatteryOptimizeModeApps(
+ mContext,
+ BatteryOptimizeUtils.MODE_OPTIMIZED,
+ Arrays.asList(PACKAGE_NAME));
final InOrder inOrder = inOrder(mBatteryOptimizeUtils);
inOrder.verify(mBatteryOptimizeUtils).getAppOptimizationMode();
@@ -166,23 +169,27 @@
}
@Test
- public void verifyOptimizationModes_optimizedMode_noAction() throws Exception {
+ public void verifyBatteryOptimizeModeApps_optimizedMode_noAction() throws Exception {
doReturn(BatteryOptimizeUtils.MODE_OPTIMIZED).when(mBatteryOptimizeUtils)
.getAppOptimizationMode();
- mBatterySettingsMigrateChecker.verifyOptimizationModes(
- mContext, Arrays.asList(PACKAGE_NAME));
+ mBatterySettingsMigrateChecker.verifyBatteryOptimizeModeApps(
+ mContext,
+ BatteryOptimizeUtils.MODE_OPTIMIZED,
+ Arrays.asList(PACKAGE_NAME));
verify(mBatteryOptimizeUtils, never()).setAppUsageState(anyInt(), any());
}
@Test
- public void verifyOptimizationModes_notInAllowList_noAction() throws Exception {
+ public void verifyBatteryOptimizeModeApps_notInAllowList_noAction() throws Exception {
doReturn(BatteryOptimizeUtils.MODE_RESTRICTED).when(mBatteryOptimizeUtils)
.getAppOptimizationMode();
- mBatterySettingsMigrateChecker.verifyOptimizationModes(
- mContext, new ArrayList<String>());
+ mBatterySettingsMigrateChecker.verifyBatteryOptimizeModeApps(
+ mContext,
+ BatteryOptimizeUtils.MODE_OPTIMIZED,
+ new ArrayList<String>());
verifyNoInteractions(mBatteryOptimizeUtils);
}
diff --git a/tests/robotests/src/com/android/settings/network/NetworkProviderSettingsTest.java b/tests/robotests/src/com/android/settings/network/NetworkProviderSettingsTest.java
index a91af12..b1bd41d 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkProviderSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkProviderSettingsTest.java
@@ -286,7 +286,8 @@
private void setUpForOnCreate() {
final FragmentActivity activity = mock(FragmentActivity.class);
- when(mNetworkProviderSettings.getActivity()).thenReturn(activity);
+ doReturn(activity).when(mNetworkProviderSettings).requireActivity();
+ doReturn(activity).when(mNetworkProviderSettings).getActivity();
final Resources.Theme theme = mContext.getTheme();
when(activity.getTheme()).thenReturn(theme);
UserManager userManager = mock(UserManager.class);
@@ -484,59 +485,95 @@
when(controller.getConfig()).thenReturn(config);
WifiDialog2.WifiDialog2Listener listener = mock(WifiDialog2.WifiDialog2Listener.class);
final WifiDialog2 wifiDialog2 = spy(new WifiDialog2(mContext, listener, mWifiEntry, mode));
- when(wifiDialog2.getController()).thenReturn(controller);
+ doReturn(controller).when(wifiDialog2).getController();
return wifiDialog2;
}
- @Test
- public void onCreateOptionsMenu_isGuest_neverAddFixConnectivityMenu() {
- mNetworkProviderSettings.mIsGuest = true;
+ private void mockMenuConditions(boolean isGuest, boolean isAirplaneModeOn, boolean isWifiOn) {
+ mNetworkProviderSettings.mIsGuest = isGuest;
+ doReturn(isAirplaneModeOn).when(mAirplaneModeEnabler).isAirplaneModeOn();
+ when(mMockWifiPickerTracker.getWifiState()).thenReturn(
+ isWifiOn ? WifiManager.WIFI_STATE_ENABLED : WifiManager.WIFI_STATE_DISABLED);
- mNetworkProviderSettings.onCreateOptionsMenu(mMenu, null /* inflater */);
+ doReturn(mMenuItem).when(mMenu).findItem(MENU_FIX_CONNECTIVITY);
+ mNetworkProviderSettings.mAirplaneModeEnabler = mAirplaneModeEnabler;
+ mNetworkProviderSettings.mWifiPickerTracker = mMockWifiPickerTracker;
- verify(mMenu, never()).add(anyInt(), eq(MENU_FIX_CONNECTIVITY), anyInt(), anyInt());
}
@Test
- public void onCreateOptionsMenu_isNotGuest_addFixConnectivityMenu() {
- mNetworkProviderSettings.mIsGuest = false;
+ public void onCreateOptionsMenu_isGuest_hideFixConnectivityMenu() {
+ setUpForOnCreate();
+ mNetworkProviderSettings.onCreate(null);
+ mockMenuConditions(/*isGuest=*/ true, /*isAirplaneModeOn=*/ false, /*isWifiOn=*/ true);
- mNetworkProviderSettings.onCreateOptionsMenu(mMenu, null /* inflater */);
+ mNetworkProviderSettings.mMenuProvider.onPrepareMenu(mMenu);
- verify(mMenu).add(anyInt(), eq(MENU_FIX_CONNECTIVITY), anyInt(), anyInt());
+ verify(mMenuItem).setVisible(false);
+
}
@Test
- public void onCreateOptionsMenu_isAirplaneModeOn_neverAddFixConnectivityMenu() {
- doReturn(true).when(mAirplaneModeEnabler).isAirplaneModeOn();
+ public void onCreateOptionsMenu_isNotGuest_showFixConnectivityMenu() {
+ setUpForOnCreate();
+ mNetworkProviderSettings.onCreate(null);
+ mockMenuConditions(/*isGuest=*/ false, /*isAirplaneModeOn=*/ false, /*isWifiOn=*/ true);
- mNetworkProviderSettings.onCreateOptionsMenu(mMenu, null /* inflater */);
+ mNetworkProviderSettings.mMenuProvider.onPrepareMenu(mMenu);
- verify(mMenu, never()).add(anyInt(), eq(MENU_FIX_CONNECTIVITY), anyInt(), anyInt());
+ verify(mMenuItem).setVisible(true);
+
}
@Test
- public void onCreateOptionsMenu_isNotAirplaneModeOn_addFixConnectivityMenu() {
- doReturn(false).when(mAirplaneModeEnabler).isAirplaneModeOn();
+ public void onCreateOptionsMenu_isAirplaneModeOnAndWifiOff_hideFixConnectivityMenu() {
+ setUpForOnCreate();
+ mNetworkProviderSettings.onCreate(null);
+ mockMenuConditions(/*isGuest=*/ false, /*isAirplaneModeOn=*/ true, /*isWifiOn=*/ false);
- mNetworkProviderSettings.onCreateOptionsMenu(mMenu, null /* inflater */);
+ mNetworkProviderSettings.mMenuProvider.onPrepareMenu(mMenu);
- verify(mMenu).add(anyInt(), eq(MENU_FIX_CONNECTIVITY), anyInt(), anyInt());
+ verify(mMenuItem).setVisible(false);
+ }
+
+ @Test
+ public void onCreateOptionsMenu_isAirplaneModeOnAndWifiOn_showFixConnectivityMenu() {
+ setUpForOnCreate();
+ mNetworkProviderSettings.onCreate(null);
+ mockMenuConditions(/*isGuest=*/ false, /*isAirplaneModeOn=*/ true, /*isWifiOn=*/ true);
+
+ mNetworkProviderSettings.mMenuProvider.onPrepareMenu(mMenu);
+
+ verify(mMenuItem).setVisible(true);
+ }
+
+ @Test
+ public void onCreateOptionsMenu_isNotAirplaneModeOn_showFixConnectivityMenu() {
+ setUpForOnCreate();
+ mNetworkProviderSettings.onCreate(null);
+ mockMenuConditions(/*isGuest=*/ false, /*isAirplaneModeOn=*/ false, /*isWifiOn=*/ true);
+
+ mNetworkProviderSettings.mMenuProvider.onPrepareMenu(mMenu);
+
+ verify(mMenuItem).setVisible(true);
}
@Test
public void onOptionsItemSelected_fixConnectivity_restartInternet() {
- mNetworkProviderSettings.mInternetResetHelper = mInternetResetHelper;
+ setUpForOnCreate();
doReturn(false).when(mNetworkProviderSettings).isPhoneOnCall();
- doReturn(NetworkProviderSettings.MENU_FIX_CONNECTIVITY).when(mMenuItem).getItemId();
+ doReturn(MENU_FIX_CONNECTIVITY).when(mMenuItem).getItemId();
+ mNetworkProviderSettings.onCreate(null);
+ mNetworkProviderSettings.mInternetResetHelper = mInternetResetHelper;
- mNetworkProviderSettings.onOptionsItemSelected(mMenuItem);
+ mNetworkProviderSettings.mMenuProvider.onMenuItemSelected(mMenuItem);
verify(mInternetResetHelper).restart();
}
@Test
public void onAirplaneModeChanged_apmIsOn_showApmMsg() {
+ setUpForOnCreate();
mNetworkProviderSettings.onAirplaneModeChanged(true);
verify(mAirplaneModeMsgPreference).setVisible(true);
@@ -544,6 +581,7 @@
@Test
public void onAirplaneModeChanged_apmIsOff_hideApmMsg() {
+ setUpForOnCreate();
mNetworkProviderSettings.onAirplaneModeChanged(false);
verify(mAirplaneModeMsgPreference).setVisible(false);
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
index 5f506b8..7606057 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
@@ -16,18 +16,12 @@
package com.android.settings.notification;
-import static android.service.notification.NotificationAssistantService.ACTION_NOTIFICATION_ASSISTANT_DETAIL_SETTINGS;
-
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
@@ -35,24 +29,19 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.os.UserManager;
import android.provider.Settings;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreferenceCompat;
+import androidx.preference.TwoStatePreference;
import androidx.test.core.app.ApplicationProvider;
import com.android.settings.testutils.shadow.ShadowSecureSettings;
-import com.android.settingslib.PrimarySwitchPreference;
import org.junit.Before;
import org.junit.Test;
@@ -61,12 +50,7 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
-import org.robolectric.Shadows;
import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowApplication;
-
-import java.util.ArrayList;
-import java.util.List;
@RunWith(RobolectricTestRunner.class)
@@ -86,27 +70,19 @@
private FragmentTransaction mFragmentTransaction;
@Mock
private NotificationBackend mBackend;
- @Mock
- private UserManager mUserManager;
- @Mock
- private PackageManager mPackageManager;
private NotificationAssistantPreferenceController mPreferenceController;
ComponentName mNASComponent = new ComponentName("pkgname", "clsname");
- private PrimarySwitchPreference mPreference;
- private ShadowApplication mShadowApplication;
+ private TwoStatePreference mPreference;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
- mPreference = spy(new PrimarySwitchPreference(mContext));
- mShadowApplication = ShadowApplication.getInstance();
- mShadowApplication.setSystemService(Context.USER_SERVICE, mUserManager);
+ mPreference = spy(new SwitchPreferenceCompat(mContext));
doReturn(mContext).when(mFragment).getContext();
when(mFragment.getFragmentManager()).thenReturn(mFragmentManager);
when(mFragmentManager.beginTransaction()).thenReturn(mFragmentTransaction);
when(mBackend.getDefaultNotificationAssistant()).thenReturn(mNASComponent);
- when(mContext.getPackageManager()).thenReturn(mPackageManager);
mPreferenceController = new NotificationAssistantPreferenceController(mContext);
mPreferenceController.setBackend(mBackend);
mPreferenceController.setFragment(mFragment);
@@ -117,19 +93,6 @@
mPreference.setKey(NotificationAssistantPreferenceController.KEY_NAS);
screen.addPreference(mPreference);
mPreferenceController.displayPreference(screen);
-
- when(mUserManager.getProfileIds(eq(0), anyBoolean())).thenReturn(new int[] {0, 10});
- when(mUserManager.getProfileIds(eq(20), anyBoolean())).thenReturn(new int[] {20});
-
- ActivityInfo activityInfo1 = new ActivityInfo();
- activityInfo1.packageName = "pkgname";
- activityInfo1.name = "name";
- ResolveInfo resolveInfo1 = new ResolveInfo();
- resolveInfo1.activityInfo = activityInfo1;
- List<ResolveInfo> resolvers1 = new ArrayList<>();
- resolvers1.add(resolveInfo1);
- when(mPackageManager.queryIntentActivities(any(Intent.class), any()))
- .thenReturn(resolvers1);
}
@Test