mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-24 03:16:00 +00:00
Fix some crash on profile owner mode (#206)
This commit is contained in:
@@ -681,7 +681,8 @@ class MyViewModel(application: Application): AndroidViewModel(application) {
|
||||
backupServiceEnabled = if (VERSION.SDK_INT >= 26) DPM.isBackupServiceEnabled(DAR) else false,
|
||||
btContactSharingDisabled = if (VERSION.SDK_INT >= 23 && privilege.work)
|
||||
DPM.getBluetoothContactSharingDisabled(DAR) else false,
|
||||
commonCriteriaMode = if (VERSION.SDK_INT >= 30) DPM.isCommonCriteriaModeEnabled(DAR) else false,
|
||||
commonCriteriaMode = if (VERSION.SDK_INT >= 30 && privilege.run { device || org })
|
||||
DPM.isCommonCriteriaModeEnabled(DAR) else false,
|
||||
usbSignalEnabled = if (VERSION.SDK_INT >= 31) DPM.isUsbDataSignalingEnabled else false,
|
||||
canDisableUsbSignal = if (VERSION.SDK_INT >= 31) DPM.canUsbDataSignalingBeDisabled() else false
|
||||
)
|
||||
|
||||
@@ -468,7 +468,8 @@ private fun ClearAppStorageDialog(
|
||||
AlertDialog(
|
||||
title = { Text(stringResource(R.string.clear_app_storage)) },
|
||||
text = {
|
||||
if(clearing) LinearProgressIndicator(Modifier.fillMaxWidth())
|
||||
if (clearing) LinearProgressIndicator(Modifier.fillMaxWidth())
|
||||
else Text(stringResource(R.string.clear_app_storage_confirmation))
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(
|
||||
|
||||
@@ -186,9 +186,9 @@ fun NetworkOptionsScreen(
|
||||
) {
|
||||
val privilege by Privilege.status.collectAsStateWithLifecycle()
|
||||
var dialog by rememberSaveable { mutableIntStateOf(0) }
|
||||
var lanEnabled by rememberSaveable { mutableStateOf(getLanEnabled()) }
|
||||
MyScaffold(R.string.options, onNavigateUp, 0.dp) {
|
||||
if(VERSION.SDK_INT >= 30 && (privilege.device || privilege.org)) {
|
||||
var lanEnabled by rememberSaveable { mutableStateOf(getLanEnabled()) }
|
||||
SwitchItem(R.string.lockdown_admin_configured_network, icon = R.drawable.wifi_password_fill0,
|
||||
state = lanEnabled,
|
||||
onCheckedChange = {
|
||||
|
||||
Reference in New Issue
Block a user