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

@@ -92,20 +92,24 @@ public class PrivateSpaceAuthenticationActivity extends FragmentActivity {
}
}
/** Show private space settings page on device lock authentications */
/** Starts private space setup flow or the PS settings page on device lock authentication */
@VisibleForTesting
public void onLockAuthentication(Context context) {
new SubSettingLauncher(context)
.setDestination(PrivateSpaceDashboardFragment.class.getName())
.setTransitionType(
SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE)
.setSourceMetricsCategory(SettingsEnums.PRIVATE_SPACE_SETTINGS)
.launch();
if (mPrivateSpaceMaintainer.doesPrivateSpaceExist()) {
new SubSettingLauncher(context)
.setDestination(PrivateSpaceDashboardFragment.class.getName())
.setTransitionType(
SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE)
.setSourceMetricsCategory(SettingsEnums.PRIVATE_SPACE_SETTINGS)
.launch();
} else {
startActivity(new Intent(context, PrivateSpaceSetupActivity.class));
}
}
@VisibleForTesting
public void setPrivateSpaceMaintainer(Injector injector) {
mPrivateSpaceMaintainer = injector.injectPrivateSpaceMaintainer(getApplicationContext());
mPrivateSpaceMaintainer = injector.injectPrivateSpaceMaintainer(this);
}
private void promptToSetDeviceLock() {