mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 11:05:59 +00:00
@@ -689,16 +689,16 @@ class MyViewModel(application: Application): AndroidViewModel(application) {
|
||||
statusBarDisabled = if (VERSION.SDK_INT >= 34 &&
|
||||
privilege.run { device || (profile && affiliated) })
|
||||
DPM.isStatusBarDisabled else false,
|
||||
autoTimeEnabled = if (VERSION.SDK_INT >= 30 && privilege.run { device || org })
|
||||
autoTimeEnabled = if (VERSION.SDK_INT >= 30 && (privilege.device || privilege.org))
|
||||
DPM.getAutoTimeEnabled(DAR) else false,
|
||||
autoTimeZoneEnabled = if (VERSION.SDK_INT >= 30 && privilege.run { device || org })
|
||||
autoTimeZoneEnabled = if (VERSION.SDK_INT >= 30 && (privilege.device || privilege.org))
|
||||
DPM.getAutoTimeZoneEnabled(DAR) else false,
|
||||
autoTimeRequired = if (VERSION.SDK_INT < 30) DPM.autoTimeRequired else false,
|
||||
masterVolumeMuted = DPM.isMasterVolumeMuted(DAR),
|
||||
backupServiceEnabled = if (VERSION.SDK_INT >= 26) DPM.isBackupServiceEnabled(DAR) else false,
|
||||
btContactSharingDisabled = if (privilege.work)
|
||||
DPM.getBluetoothContactSharingDisabled(DAR) else false,
|
||||
commonCriteriaMode = if (VERSION.SDK_INT >= 30 && privilege.run { device || org })
|
||||
commonCriteriaMode = if (VERSION.SDK_INT >= 30 && (privilege.device || privilege.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
|
||||
@@ -1346,15 +1346,17 @@ class MyViewModel(application: Application): AndroidViewModel(application) {
|
||||
DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME,
|
||||
MyAdminComponent
|
||||
)
|
||||
intent.putExtra(
|
||||
DevicePolicyManager.EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE,
|
||||
Account(options.accountName, options.accountType)
|
||||
)
|
||||
if (VERSION.SDK_INT >= 26) {
|
||||
if (options.migrateAccount) {
|
||||
intent.putExtra(
|
||||
DevicePolicyManager.EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION,
|
||||
options.keepAccount
|
||||
DevicePolicyManager.EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE,
|
||||
Account(options.accountName, options.accountType)
|
||||
)
|
||||
if (VERSION.SDK_INT >= 26) {
|
||||
intent.putExtra(
|
||||
DevicePolicyManager.EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION,
|
||||
options.keepAccount
|
||||
)
|
||||
}
|
||||
}
|
||||
if (VERSION.SDK_INT >= 24) {
|
||||
intent.putExtra(
|
||||
@@ -1927,7 +1929,12 @@ class MyViewModel(application: Application): AndroidViewModel(application) {
|
||||
}
|
||||
@RequiresApi(26)
|
||||
fun setRpToken(token: String): Boolean {
|
||||
return DPM.setResetPasswordToken(DAR, token.encodeToByteArray())
|
||||
return try {
|
||||
DPM.setResetPasswordToken(DAR, token.encodeToByteArray())
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
false
|
||||
}
|
||||
}
|
||||
@RequiresApi(26)
|
||||
fun clearRpToken(): Boolean {
|
||||
|
||||
@@ -242,7 +242,7 @@ fun AppChooserScreen(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.combinedClickable(onLongClick = {
|
||||
if (params.multiSelect) {
|
||||
if (params.multiSelect && it !in selectedPackages) {
|
||||
selectedPackages += it
|
||||
hf.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
}
|
||||
|
||||
@@ -97,7 +97,9 @@ fun PasswordScreen(vm: MyViewModel,onNavigateUp: () -> Unit, onNavigate: (Any) -
|
||||
if(privilege.device) {
|
||||
FunctionItem(R.string.max_time_to_lock, icon = R.drawable.schedule_fill0) { dialog = 1 }
|
||||
FunctionItem(R.string.pwd_expiration_timeout, icon = R.drawable.lock_clock_fill0) { dialog = 3 }
|
||||
FunctionItem(R.string.max_pwd_fail, icon = R.drawable.no_encryption_fill0) { dialog = 4 }
|
||||
if (SP.displayDangerousFeatures) {
|
||||
FunctionItem(R.string.max_pwd_fail, icon = R.drawable.no_encryption_fill0) { dialog = 4 }
|
||||
}
|
||||
}
|
||||
if(VERSION.SDK_INT >= 26) {
|
||||
FunctionItem(R.string.required_strong_auth_timeout, icon = R.drawable.fingerprint_off_fill0) { dialog = 2 }
|
||||
|
||||
Reference in New Issue
Block a user