private fun updateSyncEngineStateWithPinWarning( syncEngine: SyncEngine, newValue: Boolean, ) { val manager = activity?.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager if (manager.isKeyguardSecure || !newValue || !requireContext().settings().shouldShowSecurityPinWarningSync ) { updateSyncEngineState(syncEngine, newValue) } else { showPinDialogWarning(syncEngine, newValue) } }
Prompts the user if they do not have a password/pin set up to secure their device, and updates the state of the sync engine with the new checkbox value.