Fix some crash on profile owner mode (#206)

This commit is contained in:
BinTianqi
2025-12-01 12:46:06 +08:00
parent 001d013b0c
commit c55cc2d3e1
5 changed files with 7 additions and 3 deletions

View File

@@ -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
)