Merge "Fix More details not work on fingerprint" into tm-dev am: cb38753530
am: baba62294b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18197508 Change-Id: If4e36f14157ffab5a5b77c3f428998c15b19bb55 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1293,11 +1293,9 @@
|
||||
<!-- Text shown in fingerprint settings explaining what the fingerprint can be used for. [CHAR LIMIT=NONE] -->
|
||||
<string name="security_settings_fingerprint_enroll_disclaimer">In addition to unlocking your phone, you can also use your fingerprint to authorize purchases and app access. <annotation id="url">Learn more</annotation></string>
|
||||
<!-- Text shown in fingerprint settings explaining what the fingerprint can be used for in the case unlocking is disabled [CHAR LIMIT=NONE] -->
|
||||
<string name="security_settings_fingerprint_enroll_disclaimer_lockscreen_disabled">
|
||||
The screen lock option is disabled. To learn more, contact your organization\'s admin.
|
||||
<annotation id="admin_details">More details</annotation>\n\nYou can still use your
|
||||
fingerprint to authorize purchases and app access.
|
||||
<annotation id="url">Learn more</annotation></string>
|
||||
<string name="security_fingerprint_disclaimer_lockscreen_disabled_1">The screen lock option is disabled. To learn more, contact your organization\u2019s admin.</string>
|
||||
<!-- Text shown in fingerprint settings explaining what the fingerprint can be used for in the case unlocking is disabled [CHAR LIMIT=NONE] -->
|
||||
<string name="security_fingerprint_disclaimer_lockscreen_disabled_2">You can still use your fingerprint to authorize purchases and app access.</string>
|
||||
<!-- Text shown in fingerprint enroll when we didn't observe progress for a few seconds. [CHAR LIMIT=100] -->
|
||||
<string name="security_settings_fingerprint_enroll_lift_touch_again">Lift finger, then touch sensor again</string>
|
||||
<!-- Text shown during fingerprint enrollment to indicate bad sensor calibration. [CHAR LIMIT=100] -->
|
||||
|
@@ -65,7 +65,6 @@ import com.android.settings.biometrics.BiometricUtils;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settings.password.ChooseLockGeneric;
|
||||
import com.android.settings.password.ChooseLockSettingsHelper;
|
||||
import com.android.settings.utils.AnnotationSpan;
|
||||
import com.android.settingslib.HelpUtils;
|
||||
import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||
@@ -73,6 +72,7 @@ import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.widget.FooterPreference;
|
||||
import com.android.settingslib.widget.TwoTargetPreference;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -114,6 +114,13 @@ public class FingerprintSettings extends SubSettings {
|
||||
|
||||
public static class FingerprintSettingsFragment extends SettingsPreferenceFragment
|
||||
implements OnPreferenceChangeListener, FingerprintPreference.OnDeleteClickListener {
|
||||
|
||||
private static class FooterColumn {
|
||||
CharSequence mTitle = null;
|
||||
CharSequence mLearnMoreOverrideText = null;
|
||||
View.OnClickListener mLearnMoreClickListener = null;
|
||||
}
|
||||
|
||||
private static final int RESET_HIGHLIGHT_DELAY_MS = 500;
|
||||
|
||||
private static final String TAG = "FingerprintSettings";
|
||||
@@ -144,8 +151,7 @@ public class FingerprintSettings extends SubSettings {
|
||||
private boolean mLaunchedConfirm;
|
||||
private Drawable mHighlightDrawable;
|
||||
private int mUserId;
|
||||
private CharSequence mFooterTitle;
|
||||
private View.OnClickListener mLearnMoreListener = null;
|
||||
private final List<FooterColumn> mFooterColumns = new ArrayList<>();
|
||||
private boolean mEnrollClicked;
|
||||
|
||||
private long mChallenge;
|
||||
@@ -352,32 +358,45 @@ public class FingerprintSettings extends SubSettings {
|
||||
mLaunchedConfirm = true;
|
||||
launchChooseOrConfirmLock();
|
||||
}
|
||||
updateFooterColumns(activity);
|
||||
}
|
||||
|
||||
private void updateFooterColumns(@NonNull Activity activity) {
|
||||
final EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfKeyguardFeaturesDisabled(
|
||||
activity, DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT, mUserId);
|
||||
final AnnotationSpan.LinkInfo adminLinkInfo = new AnnotationSpan.LinkInfo(
|
||||
ANNOTATION_ADMIN_DETAILS, (view) -> {
|
||||
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(activity, admin);
|
||||
});
|
||||
final Intent helpIntent = HelpUtils.getHelpIntent(
|
||||
activity, getString(getHelpResource()), activity.getClass().getName());
|
||||
final AnnotationSpan.LinkInfo linkInfo = new AnnotationSpan.LinkInfo(
|
||||
activity, ANNOTATION_URL, helpIntent);
|
||||
final View.OnClickListener learnMoreClickListener = (v) ->
|
||||
activity.startActivityForResult(helpIntent, 0);
|
||||
|
||||
mFooterColumns.clear();
|
||||
if (admin != null) {
|
||||
DevicePolicyManager devicePolicyManager =
|
||||
final DevicePolicyManager devicePolicyManager =
|
||||
getSystemService(DevicePolicyManager.class);
|
||||
String footerText = devicePolicyManager.getResources().getString(
|
||||
final FooterColumn column1 = new FooterColumn();
|
||||
column1.mTitle = devicePolicyManager.getResources().getString(
|
||||
FINGERPRINT_UNLOCK_DISABLED_EXPLANATION,
|
||||
() -> getString(R.string.security_settings_fingerprint_enroll_disclaimer_lockscreen_disabled));
|
||||
() -> getString(
|
||||
R.string.security_fingerprint_disclaimer_lockscreen_disabled_1
|
||||
)
|
||||
);
|
||||
column1.mLearnMoreClickListener = (v) -> RestrictedLockUtils
|
||||
.sendShowAdminSupportDetailsIntent(activity, admin);
|
||||
column1.mLearnMoreOverrideText = getText(R.string.admin_support_more_info);
|
||||
mFooterColumns.add(column1);
|
||||
|
||||
mFooterTitle = AnnotationSpan.linkify(footerText, linkInfo, adminLinkInfo);
|
||||
final FooterColumn column2 = new FooterColumn();
|
||||
column2.mTitle = getText(
|
||||
R.string.security_fingerprint_disclaimer_lockscreen_disabled_2
|
||||
);
|
||||
column2.mLearnMoreClickListener = learnMoreClickListener;
|
||||
mFooterColumns.add(column2);
|
||||
} else {
|
||||
mFooterTitle = getText(R.string.security_settings_fingerprint_v2_home_screen_text);
|
||||
mLearnMoreListener = (v) -> activity.startActivityForResult(helpIntent, 0);
|
||||
final FooterColumn column = new FooterColumn();
|
||||
column.mTitle = getText(R.string.security_settings_fingerprint_v2_home_screen_text);
|
||||
column.mLearnMoreClickListener = learnMoreClickListener;
|
||||
mFooterColumns.add(column);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private boolean isUdfps() {
|
||||
@@ -474,12 +493,21 @@ public class FingerprintSettings extends SubSettings {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
final FooterPreference footer = new FooterPreference.Builder(context)
|
||||
.setTitle(mFooterTitle).build();
|
||||
if (mLearnMoreListener != null) {
|
||||
footer.setLearnMoreAction(mLearnMoreListener);
|
||||
for (int i = 0; i < mFooterColumns.size(); ++i) {
|
||||
final FooterColumn column = mFooterColumns.get(i);
|
||||
final FooterPreference footer = new FooterPreference.Builder(context)
|
||||
.setTitle(column.mTitle).build();
|
||||
if (i > 0) {
|
||||
footer.setIconVisibility(View.GONE);
|
||||
}
|
||||
if (column.mLearnMoreClickListener != null) {
|
||||
footer.setLearnMoreAction(column.mLearnMoreClickListener);
|
||||
if (!TextUtils.isEmpty(column.mLearnMoreOverrideText)) {
|
||||
footer.setLearnMoreText(column.mLearnMoreOverrideText);
|
||||
}
|
||||
}
|
||||
root.addPreference(footer);
|
||||
}
|
||||
root.addPreference(footer);
|
||||
}
|
||||
|
||||
private static String genKey(int id) {
|
||||
|
Reference in New Issue
Block a user