diff --git a/tests/uitests/Android.bp b/tests/uitests/Android.bp
index f149519..4a47c90 100644
--- a/tests/uitests/Android.bp
+++ b/tests/uitests/Android.bp
@@ -47,7 +47,8 @@
         "settings-helper",
         "sysui-helper",
         "timeresult-helper-lib",
-        "truth",
+        "truth-prebuilt",
+        "flag-junit",
     ],
 
     //sdk_version: "current",
diff --git a/tests/uitests/src/com/android/settings/ui/SecuritySettingsTest.kt b/tests/uitests/src/com/android/settings/ui/SecuritySettingsTest.kt
index 5339e95..b5a4fe9 100644
--- a/tests/uitests/src/com/android/settings/ui/SecuritySettingsTest.kt
+++ b/tests/uitests/src/com/android/settings/ui/SecuritySettingsTest.kt
@@ -16,6 +16,9 @@
 
 package com.android.settings.ui
 
+import android.os.Flags
+import android.platform.test.annotations.RequiresFlagsEnabled
+import android.platform.test.flag.junit.DeviceFlagsValueProvider
 import android.provider.Settings
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.platform.app.InstrumentationRegistry
@@ -23,13 +26,18 @@
 import com.android.settings.ui.testutils.SettingsTestUtils.assertHasTexts
 import com.android.settings.ui.testutils.SettingsTestUtils.startMainActivityFromHomeScreen
 import org.junit.Before
+import org.junit.Rule
 import org.junit.Test
 import org.junit.runner.RunWith
 
+
 @RunWith(AndroidJUnit4::class)
 class SecuritySettingsTest {
     private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
 
+    @get:Rule
+    public val mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()
+
     @Before
     fun setUp() {
         device.startMainActivityFromHomeScreen(Settings.ACTION_SECURITY_SETTINGS)
@@ -40,6 +48,12 @@
         device.assertHasTexts(ON_SCREEN_TEXTS)
     }
 
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_ALLOW_PRIVATE_PROFILE)
+    fun privateSpace_ifFlagON() {
+        device.assertHasTexts(listOf("Private Space"))
+    }
+
     private companion object {
         // Items we really want to always show
         val ON_SCREEN_TEXTS = listOf(
diff --git a/tests/uitests/src/com/android/settings/ui/privatespace/PrivateSpaceAuthenticationActivityTest.kt b/tests/uitests/src/com/android/settings/ui/privatespace/PrivateSpaceAuthenticationActivityTest.kt
new file mode 100644
index 0000000..8751471
--- /dev/null
+++ b/tests/uitests/src/com/android/settings/ui/privatespace/PrivateSpaceAuthenticationActivityTest.kt
@@ -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.ui.privatespace
+
+
+import android.os.Flags
+import android.platform.test.annotations.RequiresFlagsEnabled
+import android.platform.test.flag.junit.DeviceFlagsValueProvider
+import android.provider.Settings
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.uiautomator.By
+import androidx.test.uiautomator.UiDevice
+import com.android.settings.ui.testutils.SettingsTestUtils.assertHasTexts
+import com.android.settings.ui.testutils.SettingsTestUtils.clickObject
+import com.android.settings.ui.testutils.SettingsTestUtils.startMainActivityFromHomeScreen
+import com.android.settings.ui.testutils.SettingsTestUtils.waitObject
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+
+@RunWith(AndroidJUnit4::class)
+@RequiresFlagsEnabled(Flags.FLAG_ALLOW_PRIVATE_PROFILE)
+class PrivateSpaceAuthenticationActivityTest {
+    private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
+
+    @get:Rule
+    public val mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()
+
+    @Before
+    fun setUp() {
+        device.startMainActivityFromHomeScreen(Settings.ACTION_SECURITY_SETTINGS)
+        device.assertHasTexts(listOf(PRIVATE_SPACE_SETTING))
+    }
+
+    @Test
+    fun showAuthenticationScreen() {
+        Thread.sleep(1000)
+        device.clickObject(By.text(PRIVATE_SPACE_SETTING))
+        device.waitObject(By.text(DIALOG_TITLE))
+        Thread.sleep(1000)
+        device.assertHasTexts(listOf("Set a screen lock","Cancel"))
+    }
+
+    @Test
+    fun onCancelLockExitSetup() {
+        Thread.sleep(1000)
+        device.clickObject(By.text(PRIVATE_SPACE_SETTING))
+        device.waitObject(By.text(DIALOG_TITLE))
+        Thread.sleep(1000)
+        device.assertHasTexts(listOf(SET_LOCK_BUTTON, CANCEL_TEXT))
+        device.clickObject(By.text(CANCEL_TEXT))
+        device.assertHasTexts(listOf(PRIVATE_SPACE_SETTING))
+    }
+
+    @Test
+    fun onSetupSetLock() {
+        Thread.sleep(1000)
+        device.clickObject(By.text(PRIVATE_SPACE_SETTING))
+        device.waitObject(By.text(DIALOG_TITLE))
+        Thread.sleep(1000)
+        device.assertHasTexts(listOf(SET_LOCK_BUTTON,CANCEL_TEXT))
+        device.clickObject(By.text(SET_LOCK_BUTTON))
+        device.assertHasTexts(listOf(LOCK_SCREEN_TITLE))
+    }
+
+    private companion object {
+        // Items we really want to always show
+        val PRIVATE_SPACE_SETTING = "Private Space"
+        const val SET_LOCK_BUTTON = "Set screen lock"
+        val CANCEL_TEXT = "Cancel"
+        val DIALOG_TITLE = "Set a screen lock"
+        val LOCK_SCREEN_TITLE = "Choose screen lock"
+    }
+}
diff --git a/tests/unit/src/com/android/settings/privatespace/PrivateSpaceAuthenticationActivityTest.java b/tests/unit/src/com/android/settings/privatespace/PrivateSpaceAuthenticationActivityTest.java
new file mode 100644
index 0000000..d2e1270
--- /dev/null
+++ b/tests/unit/src/com/android/settings/privatespace/PrivateSpaceAuthenticationActivityTest.java
@@ -0,0 +1,98 @@
+/*
+ * 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.PrivateSpaceSafetySource.SAFETY_SOURCE_ID;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Flags;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class PrivateSpaceAuthenticationActivityTest {
+    @Rule
+    public final CheckFlagsRule mCheckFlagsRule =
+            DeviceFlagsValueProvider.createCheckFlagsRule();
+    @Mock private PrivateSpaceMaintainer mPrivateSpaceMaintainer;
+    @Mock private Context mContext;
+    private PrivateSpaceAuthenticationActivity mPrivateSpaceAuthenticationActivity;
+    private Intent mDefaultIntent;
+
+    /** Required setup before a test. */
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = ApplicationProvider.getApplicationContext();
+        mDefaultIntent = new Intent();
+        mDefaultIntent.setClass(InstrumentationRegistry.getInstrumentation().getTargetContext(),
+                PrivateSpaceAuthenticationActivity.class);
+        InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
+            try {
+                mPrivateSpaceAuthenticationActivity =
+                        spy((PrivateSpaceAuthenticationActivity) InstrumentationRegistry
+                                .getInstrumentation().newActivity(
+                                        getClass().getClassLoader(),
+                                        PrivateSpaceAuthenticationActivity.class.getName(),
+                                        mDefaultIntent));
+            } catch (Exception e) {
+                throw new RuntimeException(e); // nothing to do
+            }
+        });
+        doNothing().when(mPrivateSpaceAuthenticationActivity).startActivity(any(Intent.class));
+        PrivateSpaceAuthenticationActivity.Injector injector =
+                new PrivateSpaceAuthenticationActivity.Injector() {
+                    @Override
+                    PrivateSpaceMaintainer injectPrivateSpaceMaintainer(Context context) {
+                        return mPrivateSpaceMaintainer;
+                    }
+                };
+        mPrivateSpaceAuthenticationActivity.setPrivateSpaceMaintainer(injector);
+    }
+
+    /** Tests that on lock authentication Private space settings is launched. */
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_ALLOW_PRIVATE_PROFILE)
+    public void deviceSecurePrivateSpaceExists() {
+        final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
+        mPrivateSpaceAuthenticationActivity.onLockAuthentication(mContext);
+        verify(mPrivateSpaceAuthenticationActivity).startActivity(intentCaptor.capture());
+        assertThat(intentCaptor.getValue().getIdentifier()).isEqualTo(SAFETY_SOURCE_ID);
+    }
+}
diff --git a/tests/unit/src/com/android/settings/privatespace/PrivateSpaceSafetySourceTest.java b/tests/unit/src/com/android/settings/privatespace/PrivateSpaceSafetySourceTest.java
index ddf5287..bb3f891 100644
--- a/tests/unit/src/com/android/settings/privatespace/PrivateSpaceSafetySourceTest.java
+++ b/tests/unit/src/com/android/settings/privatespace/PrivateSpaceSafetySourceTest.java
@@ -18,8 +18,11 @@
 
 
 import static android.safetycenter.SafetyEvent.SAFETY_EVENT_TYPE_DEVICE_REBOOTED;
+
 import static com.android.settings.privatespace.PrivateSpaceSafetySource.SAFETY_SOURCE_ID;
+
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.never;
@@ -122,9 +125,9 @@
         assertThat(safetySourceStatus.isEnabled()).isTrue();
     }
 
-    /** Tests that setSafetySourceData sets the PS settings page intent. */
+    /** Tests that setSafetySourceData sets the PS settings page authenticator intent. */
     @Test
-    public void setSafetySourceData_setsPsIntent() {
+    public void setSafetySourceData_setsPsAuthenticatorIntent() {
         when(mSafetyCenterManagerWrapper.isEnabled(mContext)).thenReturn(true);
         mSetFlagsRule.enableFlags(Flags.FLAG_ALLOW_PRIVATE_PROFILE);
 
@@ -135,7 +138,7 @@
                 any(), eq(SAFETY_SOURCE_ID), captor.capture(), eq(EVENT_TYPE_DEVICE_REBOOTED));
         SafetySourceData safetySourceData = captor.getValue();
         SafetySourceStatus safetySourceStatus = safetySourceData.getStatus();
-        assertThat(safetySourceStatus.getPendingIntent().getIntent().getIdentifier())
-                .isEqualTo(SAFETY_SOURCE_ID);
+        assertThat(safetySourceStatus.getPendingIntent().getIntent()
+                .equals(PrivateSpaceAuthenticationActivity.class));
     }
 }
