Add auto advancing screens for private space setup

This includes changes for
1. To add auto avancing screens to PS setup
2. Screen to set a different Private profile lock or use existing lock
3. Success screen on setup completion
4. Shows Error screen if profile creation failed for some reason
5. Send intent towards launcher, show a Toast message to access PS from bottom of All apps and exit.

Bug: 299069146
Test: Manual setup
Change-Id: If4e5dd5a42abb11259bc40506189c7c750324139
This commit is contained in:
josephpv
2023-10-06 15:50:21 +00:00
committed by Joseph Vincent
parent 149a36a4df
commit 84944ba6f0
22 changed files with 939 additions and 24 deletions

View File

@@ -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.android.settings.SetupWizardUtils;
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);
}
}