private fun showPinDialogWarning(syncEngine: SyncEngine, newValue: Boolean) { context?.let { AlertDialog.Builder(it).apply { setTitle(getString(R.string.logins_warning_dialog_title)) setMessage( getString(R.string.logins_warning_dialog_message), ) setNegativeButton(getString(R.string.logins_warning_dialog_later)) { _: DialogInterface, _ -> updateSyncEngineState(syncEngine, newValue) } setPositiveButton(getString(R.string.logins_warning_dialog_set_up_now)) { it: DialogInterface, _ -> it.dismiss() val intent = Intent( Settings.ACTION_SECURITY_SETTINGS, ) startActivity(intent) } create() }.show().secure(activity) it.settings().incrementShowLoginsSecureWarningSyncCount() } }
Creates and shows a warning dialog that prompts the user to create a pin/password to secure their device when none is detected. The user has the option to continue with updating their sync preferences (updates the [SyncEngine] state) or navigating to device security settings to create a pin/password.