Skip to content

Commit 0c62812

Browse files
committed
Rename auto time APIs in TestDPC
Bug: 150958098 Test: manual testing Change-Id: Icfef3a01a86984a7638f1426ea092b01bc13e904
1 parent 3f33bd2 commit 0c62812

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2578,23 +2578,23 @@ private void reloadSetAutoTimeRequiredUi() {
25782578
private void reloadSetAutoTimeUi() {
25792579
try {
25802580
boolean isAutoTime = (Boolean) ReflectionUtil.invoke(mDevicePolicyManager,
2581-
"getAutoTime", new Class<?>[]{ComponentName.class},
2581+
"getAutoTimeEnabled", new Class<?>[]{ComponentName.class},
25822582
mAdminComponentName);
25832583
mSetAutoTimePreference.setChecked(isAutoTime);
25842584
} catch (ReflectionIsTemporaryException e) {
2585-
Log.e(TAG, "Error invoking getAutoTime", e);
2585+
Log.e(TAG, "Error invoking getAutoTimeEnabled", e);
25862586
}
25872587
}
25882588

25892589
@TargetApi(Util.R_VERSION_CODE)
25902590
private void reloadSetAutoTimeZoneUi() {
25912591
try {
25922592
boolean isAutoTimeZone = (Boolean) ReflectionUtil.invoke(mDevicePolicyManager,
2593-
"getAutoTimeZone", new Class<?>[]{ComponentName.class},
2593+
"getAutoTimeZoneEnabled", new Class<?>[]{ComponentName.class},
25942594
mAdminComponentName);
25952595
mSetAutoTimeZonePreference.setChecked(isAutoTimeZone);
25962596
} catch (ReflectionIsTemporaryException e) {
2597-
Log.e(TAG, "Error invoking getAutoTimeZone", e);
2597+
Log.e(TAG, "Error invoking getAutoTimeZoneEnabled", e);
25982598
}
25992599
}
26002600

@@ -4038,11 +4038,11 @@ abstract static class ManageLockTaskListCallback {
40384038

40394039
private void setAutoTimeEnabled(boolean enabled) {
40404040
try {
4041-
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTime",
4041+
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTimeEnabled",
40424042
new Class<?>[]{ComponentName.class, boolean.class},
40434043
mAdminComponentName, enabled);
40444044
} catch (ReflectionIsTemporaryException e) {
4045-
Log.e(TAG, "Error invoking setAutoTime", e);
4045+
Log.e(TAG, "Error invoking setAutoTimeEnabled", e);
40464046
// Prior to R, auto time is controlled by a global setting
40474047
mDevicePolicyManager.setGlobalSetting(mAdminComponentName,
40484048
Settings.Global.AUTO_TIME, enabled ? "1" : "0");
@@ -4051,11 +4051,11 @@ private void setAutoTimeEnabled(boolean enabled) {
40514051

40524052
private void setAutoTimeZoneEnabled(boolean enabled) {
40534053
try {
4054-
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTimeZone",
4054+
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTimeZoneEnabled",
40554055
new Class<?>[]{ComponentName.class, boolean.class},
40564056
mAdminComponentName, enabled);
40574057
} catch (ReflectionIsTemporaryException e) {
4058-
Log.e(TAG, "Error invoking setAutoTimeZone", e);
4058+
Log.e(TAG, "Error invoking setAutoTimeZoneEnabled", e);
40594059
// Prior to R, auto timezone is controlled by a global setting
40604060
mDevicePolicyManager.setGlobalSetting(mAdminComponentName,
40614061
Settings.Global.AUTO_TIME_ZONE, enabled ? "1" : "0");

0 commit comments

Comments
 (0)