Face and fingerprint unlock strings for private space
Recordings: b/326399895#comment10 Bug: 326399895 Test: Manual Change-Id: I9f4449439639c93a10475333a91059f855bce07b
This commit is contained in:
@@ -1240,6 +1240,28 @@
|
|||||||
<string name="private_space_fingerprint_unlock_title">Fingerprint Unlock for private space</string>
|
<string name="private_space_fingerprint_unlock_title">Fingerprint Unlock for private space</string>
|
||||||
<!-- Title for the Face unlock for private space preference. [CHAR LIMIT=60] -->
|
<!-- Title for the Face unlock for private space preference. [CHAR LIMIT=60] -->
|
||||||
<string name="private_space_face_unlock_title">Face Unlock for private space</string>
|
<string name="private_space_face_unlock_title">Face Unlock for private space</string>
|
||||||
|
<!-- Title for the Face and Fingerprint preference for private space. [CHAR LIMIT=60] -->
|
||||||
|
<string name="private_space_biometric_unlock_title">Face & Fingerprint Unlock for private space</string>
|
||||||
|
<!-- Introduction title shown in private space fingerprint enrollment [CHAR LIMIT=90] -->
|
||||||
|
<string name="private_space_fingerprint_enroll_introduction_title">Set up Fingerprint Unlock for private space</string>
|
||||||
|
<!-- Introduction detail message shown in private space fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
|
||||||
|
<string name ="private_space_fingerprint_enroll_introduction_message">Use your fingerprint to unlock your private space or verify it\u2019s you, like when you sign in to apps or approve a purchase</string>
|
||||||
|
<!-- Introduction description message shown in private space fingerprint enrollment introduction screen. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="private_space_fingerprint_enroll_introduction_footer_message">Your private space can be unlocked when you don\u2019t intend to, like if someone holds up your phone to your finger.</string>
|
||||||
|
<!-- Message shown in fingerprint enrollment dialog once enrollment is completed (private space) [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="private_space_fingerprint_enroll_finish_message">Use your fingerprint to unlock your private space or to approve purchases</string>
|
||||||
|
<!-- Introduction title shown in private space face enrollment [CHAR LIMIT=90] -->
|
||||||
|
<string name="private_space_face_enroll_introduction_title">Set up Face Unlock for private space</string>
|
||||||
|
<!-- Introduction detail message shown in private space face enrollment dialog [CHAR LIMIT=NONE]-->
|
||||||
|
<string name ="private_space_face_enroll_introduction_message">Use your face to unlock your private space or verify it\u2019s you, like when you sign in to apps or approve a purchase</string>
|
||||||
|
<!-- Message on the face enrollment introduction page for private space that provides information about what could cause the phone to unlock. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="private_space_face_enroll_introduction_info_looking">Looking at the phone can unlock private space even when you don\u2019t intend to. Your private space can also be unlocked by someone who looks a lot like you, like an identical sibling, or if someone holds the device up to your face.</string>
|
||||||
|
<!-- Message on the face enrollment introduction page for private space that provides information about the relative security of face for unlocking the phone. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="private_space_face_enroll_introduction_info_less_secure">Using your face to unlock your private space may be less secure than a strong pattern, PIN, or password</string>
|
||||||
|
<!-- Text shown on the details of a toggle which disables/enables face unlock for private space, depending if the user's eyes are open. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="private_space_face_settings_require_attention_details">To unlock private space, your eyes must be open. For best results, take off sunglasses.</string>
|
||||||
|
<!-- Text shown in face settings in private space explaining what your face can be used for. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="private_space_face_settings_footer">Use your face to unlock your private space.\n\nKeep in mind:\nYou can only have one face set up at a time. To add another face, delete the current one.\n\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour private space can be unlocked by someone else if your device is held up to your face.\n\nYour private space can be unlocked by someone who looks a lot like you, like an identical sibling.</string>
|
||||||
<!-- Biometric category title - biometric options for unlocking the device. [CHAR LIMIT=50] -->
|
<!-- Biometric category title - biometric options for unlocking the device. [CHAR LIMIT=50] -->
|
||||||
<string name="private_space_category_ways_to_unlock">Ways to unlock</string>
|
<string name="private_space_category_ways_to_unlock">Ways to unlock</string>
|
||||||
<!-- Summary for one lock when device screen lock is used as private profile lock. [CHAR LIMIT=40] -->
|
<!-- Summary for one lock when device screen lock is used as private profile lock. [CHAR LIMIT=40] -->
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||||
android:title="@string/private_space_biometric_title"
|
android:title="@string/private_space_biometric_unlock_title"
|
||||||
settings:searchable="false">
|
settings:searchable="false">
|
||||||
|
|
||||||
<com.android.settingslib.widget.TopIntroPreference
|
<com.android.settingslib.widget.TopIntroPreference
|
||||||
|
@@ -1400,6 +1400,16 @@ public final class Utils extends com.android.settingslib.Utils {
|
|||||||
&& userManager.isQuietModeEnabled(userHandle);
|
&& userManager.isQuietModeEnabled(userHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the userId is a private profile, false otherwise.
|
||||||
|
*/
|
||||||
|
public static boolean isPrivateProfile(int userId, @NonNull Context context) {
|
||||||
|
final UserManager userManager = context.getSystemService(UserManager.class);
|
||||||
|
UserInfo userInfo = userManager.getUserInfo(userId);
|
||||||
|
return Flags.allowPrivateProfile() && android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||||
|
&& userInfo.isPrivateProfile();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable new edge to edge feature.
|
* Enable new edge to edge feature.
|
||||||
*
|
*
|
||||||
|
@@ -93,7 +93,10 @@ public class CombinedBiometricStatusUtils {
|
|||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
UserManager userManager = mContext.getSystemService(UserManager.class);
|
UserManager userManager = mContext.getSystemService(UserManager.class);
|
||||||
if (userManager != null && userManager.isProfile()) {
|
if (userManager != null && userManager.isProfile()) {
|
||||||
return mContext.getString(R.string.security_settings_work_biometric_preference_title);
|
return mContext.getString(
|
||||||
|
Utils.isPrivateProfile(mUserId, mContext)
|
||||||
|
? R.string.private_space_biometric_unlock_title
|
||||||
|
: R.string.security_settings_work_biometric_preference_title);
|
||||||
} else {
|
} else {
|
||||||
return mContext.getString(R.string.security_settings_biometric_preference_title);
|
return mContext.getString(R.string.security_settings_biometric_preference_title);
|
||||||
}
|
}
|
||||||
|
@@ -365,7 +365,9 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
protected int getInfoMessageLooking() {
|
protected int getInfoMessageLooking() {
|
||||||
return R.string.security_settings_face_enroll_introduction_info_looking;
|
return isPrivateProfile()
|
||||||
|
? R.string.private_space_face_enroll_introduction_info_looking
|
||||||
|
: R.string.security_settings_face_enroll_introduction_info_looking;
|
||||||
}
|
}
|
||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
@@ -390,7 +392,10 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
protected int getLessSecureMessage() {
|
protected int getLessSecureMessage() {
|
||||||
return R.string.security_settings_face_enroll_introduction_info_less_secure;
|
return isPrivateProfile()
|
||||||
|
? R.string.private_space_face_enroll_introduction_info_less_secure
|
||||||
|
: R.string.security_settings_face_enroll_introduction_info_less_secure;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -411,6 +416,9 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getHeaderResDefault() {
|
protected int getHeaderResDefault() {
|
||||||
|
if (isPrivateProfile()) {
|
||||||
|
return R.string.private_space_face_enroll_introduction_title;
|
||||||
|
}
|
||||||
return R.string.security_settings_face_enroll_introduction_title;
|
return R.string.security_settings_face_enroll_introduction_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -577,7 +585,10 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateDescriptionText() {
|
protected void updateDescriptionText() {
|
||||||
if (mIsFaceStrong) {
|
if (isPrivateProfile()) {
|
||||||
|
setDescriptionText(getString(
|
||||||
|
R.string.private_space_face_enroll_introduction_message));
|
||||||
|
} else if (mIsFaceStrong) {
|
||||||
setDescriptionText(getString(
|
setDescriptionText(getString(
|
||||||
R.string.security_settings_face_enroll_introduction_message_class3));
|
R.string.security_settings_face_enroll_introduction_message_class3));
|
||||||
}
|
}
|
||||||
@@ -608,4 +619,8 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
}
|
}
|
||||||
updateDescriptionText();
|
updateDescriptionText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isPrivateProfile() {
|
||||||
|
return Utils.isPrivateProfile(mUserId, getApplicationContext());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -211,6 +211,8 @@ public class FaceSettings extends DashboardFragment {
|
|||||||
((FaceSettingsPreferenceController) controller).setUserId(mUserId);
|
((FaceSettingsPreferenceController) controller).setUserId(mUserId);
|
||||||
} else if (controller instanceof FaceSettingsEnrollButtonPreferenceController) {
|
} else if (controller instanceof FaceSettingsEnrollButtonPreferenceController) {
|
||||||
((FaceSettingsEnrollButtonPreferenceController) controller).setUserId(mUserId);
|
((FaceSettingsEnrollButtonPreferenceController) controller).setUserId(mUserId);
|
||||||
|
} else if (controller instanceof FaceSettingsFooterPreferenceController) {
|
||||||
|
((FaceSettingsFooterPreferenceController) controller).setUserId(mUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mRemoveController.setUserId(mUserId);
|
mRemoveController.setUserId(mUserId);
|
||||||
@@ -367,6 +369,7 @@ public class FaceSettings extends DashboardFragment {
|
|||||||
controllers.add(new FaceSettingsRemoveButtonPreferenceController(context));
|
controllers.add(new FaceSettingsRemoveButtonPreferenceController(context));
|
||||||
controllers.add(new FaceSettingsConfirmPreferenceController(context));
|
controllers.add(new FaceSettingsConfirmPreferenceController(context));
|
||||||
controllers.add(new FaceSettingsEnrollButtonPreferenceController(context));
|
controllers.add(new FaceSettingsEnrollButtonPreferenceController(context));
|
||||||
|
controllers.add(new FaceSettingsFooterPreferenceController(context));
|
||||||
return controllers;
|
return controllers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,10 +24,12 @@ import android.hardware.face.FaceManager.GetFeatureCallback;
|
|||||||
import android.hardware.face.FaceManager.SetFeatureCallback;
|
import android.hardware.face.FaceManager.SetFeatureCallback;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
import androidx.preference.TwoStatePreference;
|
import androidx.preference.TwoStatePreference;
|
||||||
|
|
||||||
|
import com.android.settings.R;
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,6 +100,18 @@ public class FaceSettingsAttentionPreferenceController extends FaceSettingsPrefe
|
|||||||
mPreference = screen.findPreference(KEY);
|
mPreference = screen.findPreference(KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateState(@Nullable Preference preference) {
|
||||||
|
if (preference == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.updateState(preference);
|
||||||
|
if (Utils.isPrivateProfile(getUserId(), mContext)) {
|
||||||
|
preference.setSummary(mContext.getString(
|
||||||
|
R.string.private_space_face_settings_require_attention_details));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isChecked() {
|
public boolean isChecked() {
|
||||||
if (!FaceSettings.isFaceHardwareDetected(mContext)) {
|
if (!FaceSettings.isFaceHardwareDetected(mContext)) {
|
||||||
|
@@ -30,6 +30,7 @@ import androidx.preference.Preference;
|
|||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.Utils;
|
||||||
import com.android.settings.core.BasePreferenceController;
|
import com.android.settings.core.BasePreferenceController;
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
import com.android.settings.utils.AnnotationSpan;
|
import com.android.settings.utils.AnnotationSpan;
|
||||||
@@ -41,12 +42,17 @@ import java.util.List;
|
|||||||
* Footer for face settings showing the help text and help link.
|
* Footer for face settings showing the help text and help link.
|
||||||
*/
|
*/
|
||||||
public class FaceSettingsFooterPreferenceController extends BasePreferenceController {
|
public class FaceSettingsFooterPreferenceController extends BasePreferenceController {
|
||||||
|
private static final String KEY = "security_face_footer";
|
||||||
private static final String TAG = "FaceSettingsFooterPreferenceController";
|
private static final String TAG = "FaceSettingsFooterPreferenceController";
|
||||||
private static final String ANNOTATION_URL = "url";
|
private static final String ANNOTATION_URL = "url";
|
||||||
private final FaceFeatureProvider mProvider;
|
private final FaceFeatureProvider mProvider;
|
||||||
private Preference mPreference;
|
private Preference mPreference;
|
||||||
private boolean mIsFaceStrong;
|
private boolean mIsFaceStrong;
|
||||||
|
private int mUserId;
|
||||||
|
|
||||||
|
public FaceSettingsFooterPreferenceController(@NonNull Context context) {
|
||||||
|
this(context, KEY);
|
||||||
|
}
|
||||||
public FaceSettingsFooterPreferenceController(Context context, String preferenceKey) {
|
public FaceSettingsFooterPreferenceController(Context context, String preferenceKey) {
|
||||||
super(context, preferenceKey);
|
super(context, preferenceKey);
|
||||||
mProvider = FeatureFactory.getFeatureFactory().getFaceFeatureProvider();
|
mProvider = FeatureFactory.getFeatureFactory().getFaceFeatureProvider();
|
||||||
@@ -79,7 +85,9 @@ public class FaceSettingsFooterPreferenceController extends BasePreferenceContro
|
|||||||
|
|
||||||
int footerRes;
|
int footerRes;
|
||||||
boolean isAttentionSupported = mProvider.isAttentionSupported(mContext);
|
boolean isAttentionSupported = mProvider.isAttentionSupported(mContext);
|
||||||
if (mIsFaceStrong) {
|
if (Utils.isPrivateProfile(mUserId, mContext)) {
|
||||||
|
footerRes = R.string.private_space_face_settings_footer;
|
||||||
|
} else if (mIsFaceStrong) {
|
||||||
footerRes = isAttentionSupported
|
footerRes = isAttentionSupported
|
||||||
? R.string.security_settings_face_settings_footer_class3
|
? R.string.security_settings_face_settings_footer_class3
|
||||||
: R.string.security_settings_face_settings_footer_attention_not_supported;
|
: R.string.security_settings_face_settings_footer_attention_not_supported;
|
||||||
@@ -92,6 +100,10 @@ public class FaceSettingsFooterPreferenceController extends BasePreferenceContro
|
|||||||
mContext.getText(footerRes), linkInfo));
|
mContext.getText(footerRes), linkInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUserId(int userId) {
|
||||||
|
mUserId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
private void addAuthenticatorsRegisteredCallback(Context context) {
|
private void addAuthenticatorsRegisteredCallback(Context context) {
|
||||||
final FaceManager faceManager = context.getSystemService(FaceManager.class);
|
final FaceManager faceManager = context.getSystemService(FaceManager.class);
|
||||||
faceManager.addAuthenticatorsRegisteredCallback(
|
faceManager.addAuthenticatorsRegisteredCallback(
|
||||||
|
@@ -67,7 +67,10 @@ public class FaceStatusUtils {
|
|||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
UserManager userManager = mContext.getSystemService(UserManager.class);
|
UserManager userManager = mContext.getSystemService(UserManager.class);
|
||||||
if (userManager != null && userManager.isProfile()) {
|
if (userManager != null && userManager.isProfile()) {
|
||||||
return mContext.getString(R.string.security_settings_face_profile_preference_title);
|
return mContext.getString(
|
||||||
|
Utils.isPrivateProfile(mUserId, mContext)
|
||||||
|
? R.string.private_space_face_unlock_title
|
||||||
|
: R.string.security_settings_face_profile_preference_title);
|
||||||
} else {
|
} else {
|
||||||
return mContext.getString(R.string.security_settings_face_preference_title);
|
return mContext.getString(R.string.security_settings_face_preference_title);
|
||||||
}
|
}
|
||||||
|
@@ -78,7 +78,10 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
|
|||||||
setContentView(R.layout.fingerprint_enroll_finish);
|
setContentView(R.layout.fingerprint_enroll_finish);
|
||||||
}
|
}
|
||||||
setHeaderText(R.string.security_settings_fingerprint_enroll_finish_title);
|
setHeaderText(R.string.security_settings_fingerprint_enroll_finish_title);
|
||||||
setDescriptionText(R.string.security_settings_fingerprint_enroll_finish_v2_message);
|
setDescriptionText(Utils.isPrivateProfile(mUserId, getApplicationContext())
|
||||||
|
? R.string.private_space_fingerprint_enroll_finish_message
|
||||||
|
: R.string.security_settings_fingerprint_enroll_finish_v2_message);
|
||||||
|
|
||||||
final String sfpsDescription = mSfpsRestToUnlockFeature != null
|
final String sfpsDescription = mSfpsRestToUnlockFeature != null
|
||||||
? mSfpsRestToUnlockFeature.getDescriptionForSfps(this)
|
? mSfpsRestToUnlockFeature.getDescriptionForSfps(this)
|
||||||
: null;
|
: null;
|
||||||
|
@@ -176,7 +176,9 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
@Override
|
@Override
|
||||||
protected void initViews() {
|
protected void initViews() {
|
||||||
setDescriptionText(getString(
|
setDescriptionText(getString(
|
||||||
R.string.security_settings_fingerprint_enroll_introduction_v3_message,
|
isPrivateProfile()
|
||||||
|
? R.string.private_space_fingerprint_enroll_introduction_message
|
||||||
|
: R.string.security_settings_fingerprint_enroll_introduction_v3_message,
|
||||||
DeviceHelper.getDeviceName(this)));
|
DeviceHelper.getDeviceName(this)));
|
||||||
|
|
||||||
super.initViews();
|
super.initViews();
|
||||||
@@ -261,6 +263,9 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
protected int getFooterMessage5() {
|
protected int getFooterMessage5() {
|
||||||
|
if (isPrivateProfile()) {
|
||||||
|
return R.string.private_space_fingerprint_enroll_introduction_footer_message;
|
||||||
|
}
|
||||||
return R.string.security_settings_fingerprint_v2_enroll_introduction_footer_message_5;
|
return R.string.security_settings_fingerprint_v2_enroll_introduction_footer_message_5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,6 +297,9 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getHeaderResDefault() {
|
protected int getHeaderResDefault() {
|
||||||
|
if (isPrivateProfile()) {
|
||||||
|
return R.string.private_space_fingerprint_enroll_introduction_title;
|
||||||
|
}
|
||||||
return R.string.security_settings_fingerprint_enroll_introduction_title;
|
return R.string.security_settings_fingerprint_enroll_introduction_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,4 +485,8 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
data.putExtra(MultiBiometricEnrollHelper.EXTRA_SKIP_PENDING_ENROLL, true);
|
data.putExtra(MultiBiometricEnrollHelper.EXTRA_SKIP_PENDING_ENROLL, true);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isPrivateProfile() {
|
||||||
|
return Utils.isPrivateProfile(mUserId, getApplicationContext());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -510,8 +510,9 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
mFooterColumns.add(column2);
|
mFooterColumns.add(column2);
|
||||||
} else {
|
} else {
|
||||||
final FooterColumn column = new FooterColumn();
|
final FooterColumn column = new FooterColumn();
|
||||||
column.mTitle = getString(
|
column.mTitle = getString(isPrivateProfile()
|
||||||
R.string.security_settings_fingerprint_enroll_introduction_v3_message,
|
? R.string.private_space_fingerprint_enroll_introduction_message
|
||||||
|
: R.string.security_settings_fingerprint_enroll_introduction_v3_message,
|
||||||
DeviceHelper.getDeviceName(getActivity()));
|
DeviceHelper.getDeviceName(getActivity()));
|
||||||
column.mLearnMoreClickListener = learnMoreClickListener;
|
column.mLearnMoreClickListener = learnMoreClickListener;
|
||||||
column.mLearnMoreOverrideText = getText(
|
column.mLearnMoreOverrideText = getText(
|
||||||
@@ -1130,6 +1131,10 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private boolean isPrivateProfile() {
|
||||||
|
return Utils.isPrivateProfile(mUserId, getContext());
|
||||||
|
}
|
||||||
|
|
||||||
public static class DeleteFingerprintDialog extends InstrumentedDialogFragment
|
public static class DeleteFingerprintDialog extends InstrumentedDialogFragment
|
||||||
implements DialogInterface.OnClickListener {
|
implements DialogInterface.OnClickListener {
|
||||||
|
|
||||||
|
@@ -68,7 +68,10 @@ public class FingerprintStatusUtils {
|
|||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
UserManager userManager = mContext.getSystemService(UserManager.class);
|
UserManager userManager = mContext.getSystemService(UserManager.class);
|
||||||
if (userManager != null && userManager.isProfile()) {
|
if (userManager != null && userManager.isProfile()) {
|
||||||
return mContext.getString(R.string.security_settings_work_fingerprint_preference_title);
|
return mContext.getString(
|
||||||
|
Utils.isPrivateProfile(mUserId, mContext)
|
||||||
|
? R.string.private_space_fingerprint_unlock_title
|
||||||
|
: R.string.security_settings_work_fingerprint_preference_title);
|
||||||
} else {
|
} else {
|
||||||
return mContext.getString(R.string.security_settings_fingerprint_preference_title);
|
return mContext.getString(R.string.security_settings_fingerprint_preference_title);
|
||||||
}
|
}
|
||||||
|
@@ -50,6 +50,7 @@ public class ShadowUtils {
|
|||||||
private static ArraySet<String> sResultLinks = new ArraySet<>();
|
private static ArraySet<String> sResultLinks = new ArraySet<>();
|
||||||
private static boolean sIsBatteryPresent;
|
private static boolean sIsBatteryPresent;
|
||||||
private static boolean sIsMultipleBiometricsSupported;
|
private static boolean sIsMultipleBiometricsSupported;
|
||||||
|
private static boolean sIsPrivateProfile;
|
||||||
|
|
||||||
@Implementation
|
@Implementation
|
||||||
protected static int enforceSameOwner(Context context, int userId) {
|
protected static int enforceSameOwner(Context context, int userId) {
|
||||||
@@ -82,6 +83,7 @@ public class ShadowUtils {
|
|||||||
sResultLinks = new ArraySet<>();
|
sResultLinks = new ArraySet<>();
|
||||||
sIsBatteryPresent = true;
|
sIsBatteryPresent = true;
|
||||||
sIsMultipleBiometricsSupported = false;
|
sIsMultipleBiometricsSupported = false;
|
||||||
|
sIsPrivateProfile = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setIsDemoUser(boolean isDemoUser) {
|
public static void setIsDemoUser(boolean isDemoUser) {
|
||||||
@@ -188,4 +190,13 @@ public class ShadowUtils {
|
|||||||
public static void setIsMultipleBiometricsSupported(boolean isMultipleBiometricsSupported) {
|
public static void setIsMultipleBiometricsSupported(boolean isMultipleBiometricsSupported) {
|
||||||
sIsMultipleBiometricsSupported = isMultipleBiometricsSupported;
|
sIsMultipleBiometricsSupported = isMultipleBiometricsSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Implementation
|
||||||
|
protected static boolean isPrivateProfile(int userId, Context context) {
|
||||||
|
return sIsPrivateProfile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setIsPrivateProfile(boolean isPrivateProfile) {
|
||||||
|
sIsPrivateProfile = isPrivateProfile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user