Adds Google account login during private space setup

This has the following changes:
1. On profile creation starts intent to add google account to the private profile for Pixel only devices.
2. On accout sign in failed show an error screen with message to try again.
3. Moves the lock setup fragment from private to main user which now calls the helper Activity as a private user which helps to setup lock. This activity can now also be called from the planned Secondary Auth settings page to set up private profile lock.
4. On set up complete use SHOW_WORK_APPS intent as a workaroud to start launcher.

Bug: 308397617
Test: Manual setup
Change-Id: I19b95375409f015b2a5d30fdad766c2f6baa634b
This commit is contained in:
josephpv
2023-10-30 11:29:26 +00:00
committed by Joseph Vincent
parent b4890641b0
commit 380ac9a48e
18 changed files with 335 additions and 54 deletions

View File

@@ -31,6 +31,8 @@ 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;
public static final int ACCOUNT_LOGIN_ACTION = 2;
public static final String EXTRA_ACTION_TYPE = "action_type";
private NavHostFragment mNavHostFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -46,7 +48,13 @@ public class PrivateSpaceSetupActivity extends FragmentActivity {
@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);
mNavHostFragment.getNavController().navigate(R.id.action_success_fragment);
} else if (requestCode == ACCOUNT_LOGIN_ACTION) {
if (resultCode == RESULT_OK) {
mNavHostFragment.getNavController().navigate(R.id.action_set_lock_fragment);
} else {
mNavHostFragment.getNavController().navigate(R.id.action_advance_login_error);
}
}
super.onActivityResult(requestCode, resultCode, data);
}