Skip to content

Commit 6f02e24

Browse files
committed
Fix broken version check for autoTime.
Fixes: 109
1 parent 26b06fe commit 6f02e24

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/src/main/java/com/afwsamples/testdpc/policy/PolicyManagementFragment.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,10 @@ private void reloadSetAutoTimeRequiredUi() {
25332533

25342534
@TargetApi(Util.R_VERSION_CODE)
25352535
private void reloadSetAutoTimeUi() {
2536-
boolean isOrgOwned = Util.SDK_INT >= VERSION_CODES.R &&
2536+
if (Util.SDK_INT < VERSION_CODES.R) {
2537+
return;
2538+
}
2539+
boolean isOrgOwned =
25372540
mDevicePolicyManager.isOrganizationOwnedDeviceWithManagedProfile();
25382541

25392542
if (mDevicePolicyManager.isDeviceOwnerApp(mPackageName)
@@ -2546,7 +2549,10 @@ private void reloadSetAutoTimeUi() {
25462549

25472550
@TargetApi(Util.R_VERSION_CODE)
25482551
private void reloadSetAutoTimeZoneUi() {
2549-
boolean isOrgOwned = Util.SDK_INT >= VERSION_CODES.R &&
2552+
if (Util.SDK_INT < VERSION_CODES.R) {
2553+
return;
2554+
}
2555+
boolean isOrgOwned =
25502556
mDevicePolicyManager.isOrganizationOwnedDeviceWithManagedProfile();
25512557

25522558
if (mDevicePolicyManager.isDeviceOwnerApp(mPackageName)

0 commit comments

Comments
 (0)