Start private space setup when there is no private space set

This change handles as below based on if private space already exists on device:
1. If PS doesn't exist then start the setup flow which shows a PS education screen. On setup button creates the private space.
2. If PS already exists on device then display PS settings page.

Bug: 299069146
Test: atest PrivateSpaceSettingsAuthenticatorTest
Change-Id: I46bdbaeb0210fd5b41a426f852e3f455b62c1c29
This commit is contained in:
josephpv
2023-10-05 21:42:43 +00:00
committed by Joseph Vincent
parent 1ef91389e2
commit ee5e1ceb03
14 changed files with 578 additions and 15 deletions

View File

@@ -0,0 +1,101 @@
<!--
~ 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: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"
app:sucHeaderText="@string/privatespace_setup_title"
app:sudDescriptionText="@string/privatespace_hide_apps_summary"
android:icon="@drawable/ic_privatespace_icon">
<ScrollView
android:id="@+id/main_clear_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/sud_layout_icon_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/placeholder_image"
style="@style/SudContentIllustration"
android:layout_width="match_parent"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:layout_height="wrap_content"
android:src="@drawable/privatespace_placeholder_image"/>
<TextView
style="@style/PrivateSpaceSetupSubHeaderStyle"
android:text="@string/privatespace_how_title"/>
<RelativeLayout
style="@style/PrivateSpaceSetupBulletPointLayoutStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/appsIcon"
style="@style/PrivateSpaceBulletPointIconStyle"
android:src="@drawable/ic_apps" />
<TextView
style="@style/PrivateSpaceBulletPointTextFontStyle"
android:layout_toRightOf="@+id/appsIcon"
android:text="@string/privatespace_access_bottom_text"/>
</RelativeLayout>
<RelativeLayout
style="@style/PrivateSpaceSetupBulletPointLayoutStyle">
<ImageView
android:id="@+id/lockIcon"
style="@style/PrivateSpaceBulletPointIconStyle"
android:src="@drawable/ic_lock_closed" />
<TextView
style="@style/PrivateSpaceBulletPointTextFontStyle"
android:layout_toRightOf="@+id/lockIcon"
android:text="@string/privatespace_protected_lock_text"/>
</RelativeLayout>
<RelativeLayout
style="@style/PrivateSpaceSetupBulletPointLayoutStyle">
<ImageView
android:id="@+id/bellIcon"
style="@style/PrivateSpaceBulletPointIconStyle"
android:src="@drawable/ic_notifications" />
<TextView
style="@style/PrivateSpaceBulletPointTextFontStyle"
android:layout_toRightOf="@+id/bellIcon"
android:text="@string/privatespace_hidden_notifications_text"/>
</RelativeLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="16dp"/>
<RelativeLayout
style="@style/PrivateSpaceSetupBulletPointLayoutStyle">
<ImageView
android:id="@+id/infoIcon"
style="@style/PrivateSpaceBulletPointIconStyle"
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@drawable/ic_info_outline_24dp" />
<TextView
style="@style/PrivateSpaceBulletPointTextFontStyle"
android:textSize = "14sp"
android:layout_toRightOf="@+id/infoIcon"
android:text="@string/privatespace_apps_permission_text"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</com.google.android.setupdesign.GlifLayout>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MergeRootFrame">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/ps_nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true" />
</FrameLayout>