Skip to content

Commit c6ccd00

Browse files
author
Rubin Xu
committed
Fix COPE admin constraint bug
TestDPC is only a COPE PO if the device is in COPE mode plus TestDPC itself is PO. Bug: 150121247 Test: manual Change-Id: I7c6469a7b4eb2be53be4f0928412374a0422104a
1 parent 93ab9aa commit c6ccd00

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceHelper.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,12 @@ private int getCurrentAdmin() {
264264
} catch (ReflectionIsTemporaryException e) {
265265
orgOwned = false;
266266
}
267-
if (orgOwned) {
268-
return ADMIN_ORG_OWNED_PROFILE_OWNER;
269-
}
270267
if (dpm.isProfileOwnerApp(packageName)) {
271-
return ADMIN_PROFILE_OWNER;
268+
if (orgOwned) {
269+
return ADMIN_ORG_OWNED_PROFILE_OWNER;
270+
} else {
271+
return ADMIN_PROFILE_OWNER;
272+
}
272273
}
273274
return ADMIN_NONE;
274275
}

0 commit comments

Comments
 (0)