Add an additional flag guard for Private Space implementation
This a layer of flag guarding only for the implementation of Private Space features excluding the APIs. The MVP flag allow_private_profile still guards all the features including the APIs. Bug: 326060689 Test: Manual - a few verifications that some feeatures are unavailable when this flag is disabled Test: Run presubmits and verify that nothing breaks Change-Id: I05f7e2f20c6132b33484bb133ce03a933ece485f
This commit is contained in:
@@ -118,7 +118,8 @@ public class SettingsInitialize extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
private void privateProfileSetup(Context context, PackageManager pm, UserInfo userInfo) {
|
||||
if (Flags.allowPrivateProfile()) {
|
||||
if (Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
if (userInfo == null || !userInfo.isPrivateProfile()) {
|
||||
return;
|
||||
}
|
||||
|
@@ -1228,6 +1228,7 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
UserProperties userProperties = userManager.getUserProperties(userHandle);
|
||||
if (userProperties.getShowInSettings() == UserProperties.SHOW_IN_SETTINGS_SEPARATE) {
|
||||
if (Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userProperties.getShowInQuietMode()
|
||||
== UserProperties.SHOW_IN_QUIET_MODE_HIDDEN) {
|
||||
if (!userManager.isQuietModeEnabled(userHandle)) {
|
||||
|
@@ -311,11 +311,10 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
// should be shown or not.
|
||||
if (((profile.isManagedProfile()
|
||||
&& (mType & ProfileSelectFragment.ProfileType.WORK) != 0)
|
||||
|| (Flags.allowPrivateProfile()
|
||||
&& profile.isPrivateProfile()
|
||||
|| (isPrivateProfile(profile)
|
||||
&& (mType & ProfileSelectFragment.ProfileType.PRIVATE) != 0)
|
||||
|| (!profile.isManagedProfile()
|
||||
&& !(Flags.allowPrivateProfile() && profile.isPrivateProfile())
|
||||
&& !isPrivateProfile(profile)
|
||||
&& (mType & ProfileSelectFragment.ProfileType.PERSONAL) != 0))
|
||||
&& !(mUm.getUserProperties(profile.getUserHandle())
|
||||
.getShowInQuietMode() == UserProperties.SHOW_IN_QUIET_MODE_HIDDEN
|
||||
@@ -338,6 +337,12 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
mFragment.forceUpdatePreferences();
|
||||
}
|
||||
|
||||
private static boolean isPrivateProfile(UserInfo profile) {
|
||||
return Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& profile.isPrivateProfile();
|
||||
}
|
||||
|
||||
private void updateProfileUi(final UserInfo userInfo) {
|
||||
if (mFragment.getPreferenceManager() == null) {
|
||||
return;
|
||||
|
@@ -169,6 +169,7 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle
|
||||
private boolean shouldSkipProfile(UserHandle profile) {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& mUm.isQuietModeEnabled(profile)
|
||||
&& mUm.getUserProperties(profile).getShowInQuietMode()
|
||||
== UserProperties.SHOW_IN_QUIET_MODE_HIDDEN;
|
||||
|
@@ -238,7 +238,9 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
|
||||
return WORK_TAB;
|
||||
}
|
||||
UserInfo userInfo = UserManager.get(activity).getUserInfo(userId);
|
||||
if (Flags.allowPrivateProfile() && userInfo != null && userInfo.isPrivateProfile()) {
|
||||
if (Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userInfo != null && userInfo.isPrivateProfile()) {
|
||||
return PRIVATE_TAB;
|
||||
}
|
||||
}
|
||||
@@ -248,7 +250,9 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
|
||||
return WORK_TAB;
|
||||
}
|
||||
UserInfo userInfo = UserManager.get(activity).getUserInfo(intentUser);
|
||||
if (Flags.allowPrivateProfile() && userInfo != null && userInfo.isPrivateProfile()) {
|
||||
if (Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userInfo != null && userInfo.isPrivateProfile()) {
|
||||
return PRIVATE_TAB;
|
||||
}
|
||||
|
||||
@@ -259,7 +263,7 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
|
||||
final DevicePolicyManager devicePolicyManager =
|
||||
getContext().getSystemService(DevicePolicyManager.class);
|
||||
|
||||
if (Flags.allowPrivateProfile()) {
|
||||
if (Flags.allowPrivateProfile() && android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
int tabForPosition =
|
||||
((ViewPagerAdapter) mViewPager.getAdapter()).getTabForPosition(position);
|
||||
|
||||
@@ -330,7 +334,9 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
|
||||
ProfileType.WORK,
|
||||
bundle != null ? bundle.deepCopy() : new Bundle(),
|
||||
workFragmentConstructor));
|
||||
} else if (Flags.allowPrivateProfile() && userInfo.isPrivateProfile()) {
|
||||
} else if (Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userInfo.isPrivateProfile()) {
|
||||
if (!privateSpaceInfoProvider.isPrivateSpaceLocked(context)) {
|
||||
fragments.add(createAndGetFragment(
|
||||
ProfileType.PRIVATE,
|
||||
|
@@ -87,6 +87,7 @@ public class UserAdapter extends BaseAdapter {
|
||||
return resources.getString(WORK_CATEGORY_HEADER,
|
||||
() -> context.getString(com.android.settingslib.R.string.category_work));
|
||||
} else if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& mUserManager.getUserInfo(userId).isPrivateProfile()) {
|
||||
return resources.getString(PRIVATE_CATEGORY_HEADER,
|
||||
() -> context.getString(com.android.settingslib.R.string.category_private));
|
||||
|
@@ -257,6 +257,7 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
|
||||
private boolean shouldSkipProfile(UserInfo userInfo) {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userInfo.isQuietModeEnabled()
|
||||
&& mUm.getUserProperties(userInfo.getUserHandle()).getShowInQuietMode()
|
||||
== UserProperties.SHOW_IN_QUIET_MODE_HIDDEN;
|
||||
|
@@ -416,6 +416,7 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
public String getHint(Context context, boolean isAlpha, int type, ProfileType profile) {
|
||||
if (isAlpha) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& profile.equals(ProfileType.Private)) {
|
||||
return context.getString(alphaHintForPrivateProfile);
|
||||
} else if (type == TYPE_FINGERPRINT) {
|
||||
@@ -433,6 +434,7 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
}
|
||||
} else {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& profile.equals(ProfileType.Private)) {
|
||||
return context.getString(numericHintForPrivateProfile);
|
||||
} else if (type == TYPE_FINGERPRINT) {
|
||||
@@ -1147,7 +1149,9 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
/*flags=*/0).getSystemService(UserManager.class);
|
||||
if (userManager.isManagedProfile()) {
|
||||
return ProfileType.Managed;
|
||||
} else if (android.os.Flags.allowPrivateProfile() && userManager.isPrivateProfile()) {
|
||||
} else if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userManager.isPrivateProfile()) {
|
||||
return ProfileType.Private;
|
||||
} else if (userManager.isProfile()) {
|
||||
return ProfileType.Other;
|
||||
|
@@ -478,7 +478,9 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
.getString(SET_WORK_PROFILE_PATTERN_HEADER,
|
||||
() -> getString(
|
||||
R.string.lockpassword_choose_your_profile_pattern_header));
|
||||
} else if (android.os.Flags.allowPrivateProfile() && isPrivateProfile()) {
|
||||
} else if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& isPrivateProfile()) {
|
||||
msg = getString(R.string.private_space_choose_your_pattern_header);
|
||||
} else {
|
||||
msg = getString(R.string.lockpassword_choose_your_pattern_header);
|
||||
|
@@ -300,6 +300,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
launchedCDC = true;
|
||||
}
|
||||
} else if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userProperties != null
|
||||
&& userProperties.isAuthAlwaysRequiredToDisableQuietMode()
|
||||
&& isInternalActivity()) {
|
||||
@@ -413,7 +414,8 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
|
||||
private boolean doesUserStateEnforceStrongAuth(int userId) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()) {
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
// Check if CE storage for user is locked since biometrics can't unlock fbe/keystore of
|
||||
// the profile user using verifyTiedProfileChallenge. Biometrics can still be used if
|
||||
// the user is stopped with delayed locking (i.e., with storage unlocked), so the user
|
||||
|
@@ -105,7 +105,8 @@ public class ConfirmDeviceCredentialUtils {
|
||||
|
||||
private static boolean isBiometricUnlockEnabledForPrivateSpace() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace();
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -104,7 +104,8 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
if (android.os.Flags.allowPrivateProfile()) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,10 @@ public class HidePrivateSpaceController extends TogglePreferenceController {
|
||||
@Override
|
||||
@AvailabilityStatus
|
||||
public int getAvailabilityStatus() {
|
||||
return android.os.Flags.allowPrivateProfile() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -52,6 +52,7 @@ public class HidePrivateSpaceSensitiveNotificationsController extends TogglePref
|
||||
public int getAvailabilityStatus() {
|
||||
if (!android.os.Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePsSensitiveNotificationsToggle()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
|| !mPrivateSpaceMaintainer.doesPrivateSpaceExist()) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
@@ -27,7 +27,8 @@ public class HidePrivateSpaceSettings extends DashboardFragment{
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
if (android.os.Flags.allowPrivateProfile()) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onCreate(icicle);
|
||||
}
|
||||
}
|
||||
|
@@ -36,7 +36,10 @@ public final class HidePrivateSpaceSummaryController extends BasePreferenceContr
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return android.os.Flags.allowPrivateProfile() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -59,7 +59,8 @@ public class PrivateProfileContextHelperActivity extends FragmentActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (!android.os.Flags.allowPrivateProfile()) {
|
||||
if (!android.os.Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return;
|
||||
}
|
||||
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
|
||||
|
@@ -77,7 +77,8 @@ public class PrivateSpaceAuthenticationActivity extends FragmentActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (Flags.allowPrivateProfile()) {
|
||||
if (Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
ThemeHelper.trySetDynamicColor(this);
|
||||
mPrivateSpaceMaintainer =
|
||||
new Injector().injectPrivateSpaceMaintainer(getApplicationContext());
|
||||
|
@@ -32,7 +32,8 @@ public class PrivateSpaceDashboardFragment extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
if (android.os.Flags.allowPrivateProfile()) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onCreate(icicle);
|
||||
if (icicle == null
|
||||
&& getIntent().getBooleanExtra(EXTRA_SHOW_PRIVATE_SPACE_UNLOCKED, false)) {
|
||||
|
@@ -43,7 +43,8 @@ public class PrivateSpaceEducation extends InstrumentedFragment {
|
||||
LayoutInflater inflater,
|
||||
@Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
if (!android.os.Flags.allowPrivateProfile()) {
|
||||
if (!android.os.Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return null;
|
||||
}
|
||||
GlifLayout rootView =
|
||||
|
@@ -78,7 +78,8 @@ public class PrivateSpaceMaintainer {
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public final synchronized boolean createPrivateSpace() {
|
||||
if (!Flags.allowPrivateProfile()) {
|
||||
if (!Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return false;
|
||||
}
|
||||
// Check if Private space already exists
|
||||
@@ -146,7 +147,8 @@ public class PrivateSpaceMaintainer {
|
||||
|
||||
/** Returns true if the Private space exists. */
|
||||
public synchronized boolean doesPrivateSpaceExist() {
|
||||
if (!Flags.allowPrivateProfile()) {
|
||||
if (!Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return false;
|
||||
}
|
||||
if (mUserHandle != null) {
|
||||
@@ -322,6 +324,7 @@ public class PrivateSpaceMaintainer {
|
||||
|
||||
private boolean isPrivateSpaceAutoLockSupported() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.supportAutolockForPrivateSpace();
|
||||
&& android.multiuser.Flags.supportAutolockForPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures();
|
||||
}
|
||||
}
|
||||
|
@@ -51,7 +51,8 @@ public final class PrivateSpaceSafetySource {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Flags.allowPrivateProfile()) {
|
||||
if (!Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
// Setting null safetySourceData so that an old entry gets cleared out and this way
|
||||
// provide a response since SC always expects one on rescan.
|
||||
SafetyCenterManagerWrapper.get().setSafetySourceData(
|
||||
|
@@ -51,7 +51,8 @@ public class PrivateSpaceSetLockFragment extends InstrumentedFragment {
|
||||
LayoutInflater inflater,
|
||||
@Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
if (!android.os.Flags.allowPrivateProfile()) {
|
||||
if (!android.os.Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return null;
|
||||
}
|
||||
GlifLayout rootView =
|
||||
|
@@ -42,7 +42,8 @@ public class PrivateSpaceSetupActivity extends FragmentActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (!android.os.Flags.allowPrivateProfile()) {
|
||||
if (!android.os.Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return;
|
||||
}
|
||||
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
|
||||
|
@@ -47,7 +47,8 @@ public class SetupSuccessFragment extends InstrumentedFragment {
|
||||
LayoutInflater inflater,
|
||||
@Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
if (!android.os.Flags.allowPrivateProfile()) {
|
||||
if (!android.os.Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return null;
|
||||
}
|
||||
GlifLayout rootView =
|
||||
|
@@ -41,6 +41,7 @@ public class AutoLockPreferenceController extends BasePreferenceController {
|
||||
public int getAvailabilityStatus() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.supportAutolockForPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
@@ -45,7 +45,8 @@ public class AutoLockSettingsFragment extends RadioButtonPickerFragment {
|
||||
@Override
|
||||
public void onCreate(@NonNull Bundle icicle) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.supportAutolockForPrivateSpace()) {
|
||||
&& android.multiuser.Flags.supportAutolockForPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onCreate(icicle);
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,10 @@ public class DeletePrivateSpaceController extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return android.os.Flags.allowPrivateProfile() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -35,7 +35,8 @@ public class PrivateSpaceDeleteActivity extends InstrumentedActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (!android.os.Flags.allowPrivateProfile()) {
|
||||
if (!android.os.Flags.allowPrivateProfile()
|
||||
|| !android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
return;
|
||||
}
|
||||
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
|
||||
|
@@ -56,7 +56,8 @@ public class PrivateSpaceDeleteFragment extends InstrumentedFragment {
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle icicle) {
|
||||
if (android.os.Flags.allowPrivateProfile()) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onCreate(icicle);
|
||||
}
|
||||
}
|
||||
|
@@ -62,7 +62,8 @@ public class PrivateSpaceDeletionProgressFragment extends InstrumentedFragment {
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
if (android.os.Flags.allowPrivateProfile()) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
}
|
||||
|
@@ -42,6 +42,7 @@ public class FaceFingerprintUnlockController extends CombinedBiometricStatusPref
|
||||
protected boolean isUserSupported() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& mProfileUserId != UserHandle.USER_NULL;
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,8 @@ public class PrivateSpaceBiometricSettings extends BiometricsSettingsBase {
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()) {
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onAttach(context);
|
||||
UserHandle privateProfileHandle =
|
||||
PrivateSpaceMaintainer.getInstance(context).getPrivateProfileHandle();
|
||||
|
@@ -45,6 +45,7 @@ public class PrivateSpaceFacePreferenceController extends BiometricFaceStatusPre
|
||||
protected boolean isUserSupported() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& getUserId() != UserHandle.USER_NULL;
|
||||
}
|
||||
|
||||
@@ -64,6 +65,7 @@ public class PrivateSpaceFacePreferenceController extends BiometricFaceStatusPre
|
||||
public int getAvailabilityStatus() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
@@ -47,6 +47,7 @@ public class PrivateSpaceFingerprintPreferenceController
|
||||
protected boolean isUserSupported() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& getUserId() != UserHandle.USER_NULL;
|
||||
}
|
||||
|
||||
@@ -66,6 +67,7 @@ public class PrivateSpaceFingerprintPreferenceController
|
||||
public int getAvailabilityStatus() {
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
@@ -74,7 +74,8 @@ public class PrivateSpaceLockController extends AbstractPreferenceController {
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return android.os.Flags.allowPrivateProfile();
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -45,7 +45,10 @@ public class UseOneLockController extends BasePreferenceController {
|
||||
}
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return android.os.Flags.allowPrivateProfile() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -95,7 +95,8 @@ public class UseOneLockControllerSwitch extends AbstractPreferenceController
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return android.os.Flags.allowPrivateProfile();
|
||||
return android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -39,7 +39,8 @@ public class UseOneLockSettingsFragment extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
if (android.os.Flags.allowPrivateProfile()) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()) {
|
||||
super.onCreate(icicle);
|
||||
}
|
||||
}
|
||||
|
@@ -62,7 +62,9 @@ public final class BiometricsSafetySource {
|
||||
}
|
||||
final Context profileParentContext =
|
||||
context.createContextAsUser(profileParentUserHandle, 0);
|
||||
if (android.os.Flags.allowPrivateProfile() && userManager.isPrivateProfile()) {
|
||||
if (android.os.Flags.allowPrivateProfile()
|
||||
&& android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||
&& userManager.isPrivateProfile()) {
|
||||
// SC always expects a response from the source if the broadcast has been sent for this
|
||||
// source, therefore, we need to send a null SafetySourceData.
|
||||
SafetyCenterManagerWrapper.get().setSafetySourceData(
|
||||
|
Reference in New Issue
Block a user