Use canAddPrivateProfile() to enable PS delete from Reset
This change adds canAddPrivateProfile() check to enable/disable Private space delete controller in Reset options. Matches the availability to delete private space from reset options with the conditions used to show the private space entry point. In Settings Reset options preference to delete private space will be shown only when private space creation is allowed on the device or if private space already exists on the device. Bug: 330396315 Test: ResetOptionsDeletePrivateSpaceControllerTest Change-Id: I63232556f7927aeb07b73e8732bbb8b1d2423456
This commit is contained in:
@@ -52,9 +52,7 @@ public final class PrivateSpaceSafetySource {
|
||||
// Do not add the entry point when
|
||||
// -Private Profile is not present and
|
||||
// -Private Profile cannot be added.
|
||||
if (!privateSpaceMaintainer.doesPrivateSpaceExist()
|
||||
&& userManager != null
|
||||
&& !userManager.canAddPrivateProfile()) {
|
||||
if (!privateSpaceMaintainer.isPrivateSpaceEntryPointEnabled()) {
|
||||
Log.i(TAG, "Private Space not allowed for user " + context.getUser());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user