Prompt user to Setup a device lock if not set

This add below changes on selecting private space setting:
1. Prompt user to setup device lock if not already set
2. If device lock is set authenticate user first before displaying private space settings page

Screenshot - https://screenshot.googleplex.com/4SrYHbBMJfVuoRy.png
https://screenshot.googleplex.com/6vNWm7Lg83vfnH8.png
RecordingLink - https://drive.google.com/file/d/1r4zb3ILPRqwvP5tlwfjQ9GgnDAW4vZg6/view?usp=drive_link

Bug: 289016927
Test: atest PrivateSpaceSettingsAuthenticatorTest , atest SecuritySettingsTest
Change-Id: I0e5dfb30213843c0dec60a17d01c30cd91db89b0
This commit is contained in:
josephpv
2023-10-04 18:14:20 +00:00
parent 852ec4e22d
commit 31b044ed6a
10 changed files with 416 additions and 15 deletions

View File

@@ -17,7 +17,6 @@
package com.android.settings.privatespace;
import android.app.PendingIntent;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Flags;
@@ -28,9 +27,7 @@ import android.safetycenter.SafetySourceStatus;
import android.util.Log;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.safetycenter.SafetyCenterManagerWrapper;
import com.android.settingslib.transition.SettingsTransitionHelper;
/** Private Space safety source for the Safety Center */
public final class PrivateSpaceSafetySource {
@@ -86,18 +83,15 @@ public final class PrivateSpaceSafetySource {
}
private static PendingIntent getPendingIntentForPsDashboard(Context context) {
Intent privateSpaceDashboardIntent = new SubSettingLauncher(context)
.setDestination(PrivateSpaceDashboardFragment.class.getName())
.setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE)
.setSourceMetricsCategory(SettingsEnums.PRIVATE_SPACE_SETTINGS)
.toIntent()
.setIdentifier(SAFETY_SOURCE_ID);
Intent privateSpaceAuthenticationIntent =
new Intent(context, PrivateSpaceAuthenticationActivity.class)
.setIdentifier(SAFETY_SOURCE_ID);
return PendingIntent
.getActivity(
context,
/* requestCode */ 0,
privateSpaceDashboardIntent,
privateSpaceAuthenticationIntent,
PendingIntent.FLAG_IMMUTABLE);
}
}