mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 19:15:58 +00:00
@@ -391,19 +391,13 @@ fun parseSecurityEventData(event: SecurityLog.SecurityEvent): JsonElement? {
|
||||
}
|
||||
|
||||
fun setDefaultAffiliationID() {
|
||||
if(VERSION.SDK_INT < 26) return
|
||||
val privilege = Privilege.status.value
|
||||
if (VERSION.SDK_INT < 26) return
|
||||
if(!SP.isDefaultAffiliationIdSet) {
|
||||
try {
|
||||
if(privilege.device || (!privilege.primary && privilege.profile)) {
|
||||
val affiliationIDs = Privilege.DPM.getAffiliationIds(Privilege.DAR)
|
||||
if(affiliationIDs.isEmpty()) {
|
||||
Privilege.DPM.setAffiliationIds(Privilege.DAR, setOf("OwnDroid_default_affiliation_id"))
|
||||
SP.isDefaultAffiliationIdSet = true
|
||||
Log.d("DPM", "Default affiliation id set")
|
||||
}
|
||||
}
|
||||
} catch(e: Exception) {
|
||||
Privilege.DPM.setAffiliationIds(Privilege.DAR, setOf("OwnDroid_default_affiliation_id"))
|
||||
SP.isDefaultAffiliationIdSet = true
|
||||
Log.d("DPM", "Default affiliation id set")
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user