Merge "Fix issue no action on clicking link in footer" into tm-dev
This commit is contained in:
@@ -1411,8 +1411,10 @@
|
|||||||
<!-- Message shown in screen lock picker while setting up the backup/fallback screen lock method for biometrics. Users can choose to use this method to unlock the screen instead of biometrics, or when biometrics are not accepted. [CHAR LIMIT=80] [BACKUP_MESSAGE_ID=2799884038398627882] -->
|
<!-- Message shown in screen lock picker while setting up the backup/fallback screen lock method for biometrics. Users can choose to use this method to unlock the screen instead of biometrics, or when biometrics are not accepted. [CHAR LIMIT=80] [BACKUP_MESSAGE_ID=2799884038398627882] -->
|
||||||
<string name="lock_settings_picker_biometric_message">Choose your backup screen lock method</string>
|
<string name="lock_settings_picker_biometric_message">Choose your backup screen lock method</string>
|
||||||
|
|
||||||
<!-- Text shown on the screen lock menu. This text is letting the user know that their IT admin can't reset their screen lock if they forget it, and they can choose to set another lock that would be specifically for their work apps. The place-holders "LINK_BEGIN" and "LINK_END" must NOT be translated. They mark a link to bring the user to enroll a work profile screen lock instead. [CHAR LIMIT=100] -->
|
<!-- Text shown on the screen lock menu. This text is letting the user know that their IT admin can't reset their screen lock if they forget it. [CHAR LIMIT=100] -->
|
||||||
<string name="lock_settings_picker_admin_restricted_personal_message">If you forget your screen lock, your IT admin can\u2019t reset it. <annotation id="link">Set a separate work lock</annotation></string>
|
<string name="lock_settings_picker_admin_restricted_personal_message">If you forget your screen lock, your IT admin can\u2019t reset it.</string>
|
||||||
|
<!-- Text shown on the screen lock menu. This text is letting the user know that they can choose to set another lock that would be specifically for their work apps. [CHAR LIMIT=100] -->
|
||||||
|
<string name="lock_settings_picker_admin_restricted_personal_message_action">Set a separate work lock</string>
|
||||||
|
|
||||||
<!-- Message shown in screen lock picker for setting up a work profile screen lock. [CHAR LIMIT=80] -->
|
<!-- Message shown in screen lock picker for setting up a work profile screen lock. [CHAR LIMIT=80] -->
|
||||||
<string name="lock_settings_picker_profile_message">If you forget this lock, ask your IT admin to reset it</string>
|
<string name="lock_settings_picker_profile_message">If you forget this lock, ask your IT admin to reset it</string>
|
||||||
|
@@ -25,6 +25,7 @@ import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_NONE;
|
|||||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE;
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE;
|
||||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.LOCK_SETTINGS_UPDATE_PROFILE_LOCK_TITLE;
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.LOCK_SETTINGS_UPDATE_PROFILE_LOCK_TITLE;
|
||||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK;
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK;
|
||||||
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK_ACTION;
|
||||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_SCREEN_LOCK_SETUP_MESSAGE;
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_SCREEN_LOCK_SETUP_MESSAGE;
|
||||||
|
|
||||||
import static com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment.RESULT_FINISHED;
|
import static com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment.RESULT_FINISHED;
|
||||||
@@ -78,7 +79,6 @@ import com.android.settings.core.SubSettingLauncher;
|
|||||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||||
import com.android.settings.safetycenter.LockScreenSafetySource;
|
import com.android.settings.safetycenter.LockScreenSafetySource;
|
||||||
import com.android.settings.search.SearchFeatureProvider;
|
import com.android.settings.search.SearchFeatureProvider;
|
||||||
import com.android.settings.utils.AnnotationSpan;
|
|
||||||
import com.android.settingslib.RestrictedPreference;
|
import com.android.settingslib.RestrictedPreference;
|
||||||
import com.android.settingslib.widget.FooterPreference;
|
import com.android.settingslib.widget.FooterPreference;
|
||||||
|
|
||||||
@@ -621,15 +621,20 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
} else if (!mForFace && !mForBiometrics && !mForFingerprint && !mIsManagedProfile
|
} else if (!mForFace && !mForBiometrics && !mForFingerprint && !mIsManagedProfile
|
||||||
&& mController.isScreenLockRestrictedByAdmin()
|
&& mController.isScreenLockRestrictedByAdmin()
|
||||||
&& profileUserId != UserHandle.USER_NULL) {
|
&& profileUserId != UserHandle.USER_NULL) {
|
||||||
CharSequence description =
|
final StringBuilder description = new StringBuilder(
|
||||||
mDpm.getResources().getString(WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK,
|
mDpm.getResources().getString(
|
||||||
() -> null);
|
WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK,
|
||||||
if (description == null) {
|
() -> getString(
|
||||||
description = getText(
|
R.string.lock_settings_picker_admin_restricted_personal_message)));
|
||||||
R.string.lock_settings_picker_admin_restricted_personal_message);
|
footer.setVisible(true);
|
||||||
}
|
footer.setTitle(description);
|
||||||
final AnnotationSpan.LinkInfo linkInfo = new AnnotationSpan.LinkInfo(
|
|
||||||
AnnotationSpan.LinkInfo.DEFAULT_ANNOTATION, (view) -> {
|
final StringBuilder setLockText = new StringBuilder(
|
||||||
|
mDpm.getResources().getString(
|
||||||
|
WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK_ACTION,
|
||||||
|
() -> getString(
|
||||||
|
R.string.lock_settings_picker_admin_restricted_personal_message_action)));
|
||||||
|
View.OnClickListener setLockClickListener = (v) -> {
|
||||||
final Bundle extras = new Bundle();
|
final Bundle extras = new Bundle();
|
||||||
extras.putInt(Intent.EXTRA_USER_ID, profileUserId);
|
extras.putInt(Intent.EXTRA_USER_ID, profileUserId);
|
||||||
if (mUserPassword != null) {
|
if (mUserPassword != null) {
|
||||||
@@ -642,10 +647,9 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
.setArguments(extras)
|
.setArguments(extras)
|
||||||
.launch();
|
.launch();
|
||||||
finish();
|
finish();
|
||||||
});
|
};
|
||||||
CharSequence footerText = AnnotationSpan.linkify(description, linkInfo);
|
footer.setLearnMoreText(setLockText);
|
||||||
footer.setVisible(true);
|
footer.setLearnMoreAction(setLockClickListener);
|
||||||
footer.setTitle(footerText);
|
|
||||||
} else {
|
} else {
|
||||||
footer.setVisible(false);
|
footer.setVisible(false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user