Skip to content

Commit e47e297

Browse files
TreeHugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "Rename auto time APIs in TestDPC" into ub-testdpc-rvc
2 parents 3d2bce4 + 0c62812 commit e47e297

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
@@ -2612,23 +2612,23 @@ private void reloadSetAutoTimeRequiredUi() {
26122612
private void reloadSetAutoTimeUi() {
26132613
try {
26142614
boolean isAutoTime = (Boolean) ReflectionUtil.invoke(mDevicePolicyManager,
2615-
"getAutoTime", new Class<?>[]{ComponentName.class},
2615+
"getAutoTimeEnabled", new Class<?>[]{ComponentName.class},
26162616
mAdminComponentName);
26172617
mSetAutoTimePreference.setChecked(isAutoTime);
26182618
} catch (ReflectionIsTemporaryException e) {
2619-
Log.e(TAG, "Error invoking getAutoTime", e);
2619+
Log.e(TAG, "Error invoking getAutoTimeEnabled", e);
26202620
}
26212621
}
26222622

26232623
@TargetApi(Util.R_VERSION_CODE)
26242624
private void reloadSetAutoTimeZoneUi() {
26252625
try {
26262626
boolean isAutoTimeZone = (Boolean) ReflectionUtil.invoke(mDevicePolicyManager,
2627-
"getAutoTimeZone", new Class<?>[]{ComponentName.class},
2627+
"getAutoTimeZoneEnabled", new Class<?>[]{ComponentName.class},
26282628
mAdminComponentName);
26292629
mSetAutoTimeZonePreference.setChecked(isAutoTimeZone);
26302630
} catch (ReflectionIsTemporaryException e) {
2631-
Log.e(TAG, "Error invoking getAutoTimeZone", e);
2631+
Log.e(TAG, "Error invoking getAutoTimeZoneEnabled", e);
26322632
}
26332633
}
26342634

@@ -4072,11 +4072,11 @@ abstract static class ManageLockTaskListCallback {
40724072

40734073
private void setAutoTimeEnabled(boolean enabled) {
40744074
try {
4075-
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTime",
4075+
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTimeEnabled",
40764076
new Class<?>[]{ComponentName.class, boolean.class},
40774077
mAdminComponentName, enabled);
40784078
} catch (ReflectionIsTemporaryException e) {
4079-
Log.e(TAG, "Error invoking setAutoTime", e);
4079+
Log.e(TAG, "Error invoking setAutoTimeEnabled", e);
40804080
// Prior to R, auto time is controlled by a global setting
40814081
mDevicePolicyManager.setGlobalSetting(mAdminComponentName,
40824082
Settings.Global.AUTO_TIME, enabled ? "1" : "0");
@@ -4085,11 +4085,11 @@ private void setAutoTimeEnabled(boolean enabled) {
40854085

40864086
private void setAutoTimeZoneEnabled(boolean enabled) {
40874087
try {
4088-
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTimeZone",
4088+
ReflectionUtil.invoke(mDevicePolicyManager, "setAutoTimeZoneEnabled",
40894089
new Class<?>[]{ComponentName.class, boolean.class},
40904090
mAdminComponentName, enabled);
40914091
} catch (ReflectionIsTemporaryException e) {
4092-
Log.e(TAG, "Error invoking setAutoTimeZone", e);
4092+
Log.e(TAG, "Error invoking setAutoTimeZoneEnabled", e);
40934093
// Prior to R, auto timezone is controlled by a global setting
40944094
mDevicePolicyManager.setGlobalSetting(mAdminComponentName,
40954095
Settings.Global.AUTO_TIME_ZONE, enabled ? "1" : "0");

0 commit comments

Comments
 (0)