Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee5e1ceb authored by josephpv's avatar josephpv Committed by Joseph Vincent
Browse files

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
parent 1ef91389
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4991,6 +4991,11 @@
            </intent-filter>
        </provider>

        <activity
            android:name=".privatespace.PrivateSpaceSetupActivity"
            android:theme="@style/GlifV3Theme.Light"
            android:exported="false" />

        <activity android:name=".privatespace.PrivateSpaceAuthenticationActivity"
                  android:theme="@*android:style/Theme.DeviceDefault.Settings.Dialog.NoActionBar"
                  android:exported="false"/>
+27 −0
Original line number Diff line number Diff line
<!--
  ~ 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="24dp"
        android:height="24dp"
        android:viewportWidth="960"
        android:viewportHeight="960"
        android:tint="?attr/colorControlNormal">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M420,600L540,600L517,471Q537,461 548.5,442Q560,423 560,400Q560,367 536.5,343.5Q513,320 480,320Q447,320 423.5,343.5Q400,367 400,400Q400,423 411.5,442Q423,461 443,471L420,600ZM480,880Q341,845 250.5,720.5Q160,596 160,444L160,200L480,80L800,200L800,444Q800,596 709.5,720.5Q619,845 480,880ZM480,796Q584,763 652,664Q720,565 720,444L720,255L480,165L240,255L240,444Q240,565 308,664Q376,763 480,796ZM480,480Q480,480 480,480Q480,480 480,480L480,480L480,480L480,480L480,480Q480,480 480,480Q480,480 480,480Z"/>
</vector>
+143 −0
Original line number Diff line number Diff line
<?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.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="364dp"
        android:height="265dp"
        android:viewportWidth="364"
        android:viewportHeight="265">
    <group>
        <clip-path
            android:pathData="M0,0h364v265h-364z"/>
        <path
            android:pathData="M339.42,265H24.58C11.07,265 0,253.67 0,239.84V25.19C0,11.33 11.07,0 24.58,0H339.52C352.93,0 364,11.33 364,25.16V239.94C364,253.67 352.93,265 339.42,265Z"
            android:fillColor="#000000"/>
        <path
            android:pathData="M247.65,93.87V85.83C247.65,84.73 246.73,83.82 245.61,83.82V41.94C245.61,36.42 241.02,32 235.5,32H142.1C136.49,32 132,36.52 132,41.94V233.67C132,239.2 136.59,243.62 142.1,243.62H235.5C241.12,243.62 245.61,239.1 245.61,233.67V135.85C246.73,135.85 247.65,134.95 247.65,133.84V113.86C247.65,112.75 246.73,111.85 245.61,111.85V95.88C246.84,95.88 247.65,94.97 247.65,93.87ZM243.67,233.67C243.67,238.09 240,241.71 235.5,241.71H142.1C137.61,241.71 133.94,238.09 133.94,233.67V41.94C133.94,37.52 137.61,33.91 142.1,33.91H235.5C240,33.91 243.67,37.52 243.67,41.94V233.67Z"
            android:fillColor="#DADCE0"/>
        <path
            android:pathData="M151.68,46.76L225.5,46.76A7.38,7.38 0,0 1,232.89 54.15L232.89,54.15A7.38,7.38 0,0 1,225.5 61.53L151.68,61.53A7.38,7.38 0,0 1,144.3 54.15L144.3,54.15A7.38,7.38 0,0 1,151.68 46.76z"
            android:fillColor="#444746"/>
        <path
            android:pathData="M147.42,187.02L228.54,187.02A8.04,8.04 0,0 1,236.58 195.06L236.58,226.97A8.04,8.04 0,0 1,228.54 235L147.42,235A8.04,8.04 0,0 1,139.38 226.97L139.38,195.06A8.04,8.04 0,0 1,147.42 187.02z"
            android:fillColor="#1F1F1F"/>
        <path
            android:pathData="M154.15,77.52m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M177.52,77.52m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M200.9,77.52m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M224.27,77.52m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M154.15,99.67m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M154.15,121.81m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M154.15,143.96m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M154.15,166.11m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M177.52,99.67m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M177.52,121.81m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M177.52,143.96m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M177.52,166.11m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M200.9,99.67m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M200.9,121.81m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M200.9,143.96m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M200.9,166.11m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M224.27,99.67m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M224.27,121.81m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M224.27,143.96m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M224.27,166.11m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#D9D9D9"
            android:fillAlpha="0.4"/>
        <path
            android:pathData="M154.15,199.32m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
        <path
            android:pathData="M154.15,220.24m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
        <path
            android:pathData="M177.52,199.32m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
        <path
            android:pathData="M177.52,220.24m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
        <path
            android:pathData="M200.9,199.32m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
        <path
            android:pathData="M200.9,220.24m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
        <path
            android:pathData="M224.27,199.32m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
        <path
            android:pathData="M224.27,220.24m-7.38,0a7.38,7.38 0,1 1,14.76 0a7.38,7.38 0,1 1,-14.76 0"
            android:fillColor="#0B57D0"/>
    </group>
</vector>
+101 −0
Original line number Diff line number Diff line
<!--
  ~ 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>
+33 −0
Original line number Diff line number Diff line
<?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>
 No newline at end of file
Loading