Loading src/com/android/settings/DateTimeSettings.java +13 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings; import android.app.admin.DevicePolicyManager; import android.app.Activity; import android.app.AlarmManager; import android.app.DatePickerDialog; Loading Loading @@ -89,12 +90,23 @@ public class DateTimeSettings extends SettingsPreferenceFragment boolean autoTimeEnabled = getAutoState(Settings.Global.AUTO_TIME); boolean autoTimeZoneEnabled = getAutoState(Settings.Global.AUTO_TIME_ZONE); mAutoTimePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME); DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context .DEVICE_POLICY_SERVICE); if (dpm.getAutoTimeRequired()) { mAutoTimePref.setEnabled(false); // If Settings.Global.AUTO_TIME is false it will be set to true // by the device policy manager very soon. // Note that this app listens to that change. } Intent intent = getActivity().getIntent(); boolean isFirstRun = intent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false); mDummyDate = Calendar.getInstance(); mAutoTimePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME); mAutoTimePref.setChecked(autoTimeEnabled); mAutoTimeZonePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME_ZONE); // Override auto-timezone if it's a wifi-only device or if we're still in setup wizard. Loading Loading
src/com/android/settings/DateTimeSettings.java +13 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings; import android.app.admin.DevicePolicyManager; import android.app.Activity; import android.app.AlarmManager; import android.app.DatePickerDialog; Loading Loading @@ -89,12 +90,23 @@ public class DateTimeSettings extends SettingsPreferenceFragment boolean autoTimeEnabled = getAutoState(Settings.Global.AUTO_TIME); boolean autoTimeZoneEnabled = getAutoState(Settings.Global.AUTO_TIME_ZONE); mAutoTimePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME); DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context .DEVICE_POLICY_SERVICE); if (dpm.getAutoTimeRequired()) { mAutoTimePref.setEnabled(false); // If Settings.Global.AUTO_TIME is false it will be set to true // by the device policy manager very soon. // Note that this app listens to that change. } Intent intent = getActivity().getIntent(); boolean isFirstRun = intent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false); mDummyDate = Calendar.getInstance(); mAutoTimePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME); mAutoTimePref.setChecked(autoTimeEnabled); mAutoTimeZonePref = (CheckBoxPreference) findPreference(KEY_AUTO_TIME_ZONE); // Override auto-timezone if it's a wifi-only device or if we're still in setup wizard. Loading