File tree Expand file tree Collapse file tree
app/src/main/java/com/owncloud/android/ui/dialog Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ class AppPassCodeDialog :
4848 val positiveButton = alertDialog.getButton(AlertDialog .BUTTON_POSITIVE ) as ? MaterialButton
4949 positiveButton?.let {
5050 viewThemeUtils.material.colorMaterialButtonPrimaryTonal(it)
51+ val enforceProtection = MDMConfig .enforceProtection(requireContext())
52+ if (enforceProtection) {
53+ it.isEnabled = (binding.lockPasscode.isChecked || binding.lockDeviceCredentials.isChecked)
54+ }
5155 }
5256
5357 val dismissable = arguments?.getBoolean(ARG_DISMISSABLE , true ) ? : true
@@ -122,6 +126,13 @@ class AppPassCodeDialog :
122126 }
123127
124128 currentSelection = selectedLock
129+
130+ val positiveButton = (dialog as ? AlertDialog )
131+ ?.getButton(AlertDialog .BUTTON_POSITIVE ) as ? MaterialButton
132+ val enforceProtection = MDMConfig .enforceProtection(requireContext())
133+ if (enforceProtection) {
134+ positiveButton?.isEnabled = (binding.lockPasscode.isChecked || binding.lockDeviceCredentials.isChecked)
135+ }
125136 }
126137 }
127138
You can’t perform that action at this time.
0 commit comments