fix creating managed profile problem

This commit is contained in:
BinTianqi
2024-02-08 15:54:32 +08:00
parent 62a4376851
commit 54023bee59
6 changed files with 59 additions and 34 deletions

View File

@@ -76,7 +76,7 @@ fun ApplicationManage(){
keyboardActions = KeyboardActions(onDone = {focusMgr.clearFocus()})
)
}
if(VERSION.SDK_INT>=24){
if(VERSION.SDK_INT>=24&&isDeviceOwner(myDpm)){
val isSuspended: Boolean = try{ myDpm.isPackageSuspended(myComponent,pkgName) }
catch(e:NameNotFoundException){ false }
catch(w:NameNotFoundException){ false }