frameworks/base/services/core/java/com/android/server/timezonedetector/TimeZoneDetectorCallbackImpl.java
public boolean isDeviceTimeZoneInitialized() {
// timezone.equals("GMT") will be true and only true if the time zone was
// set to a default value by the system server (when starting, system server
// sets the persist.sys.timezone to "GMT" if it's not set). "GMT" is not used by
// any code that sets it explicitly (in case where something sets GMT explicitly,
// "Etc/GMT" Olson ID would be used).
String timeZoneId = getDeviceTimeZone();
return timeZoneId != null && timeZoneId.length() > 0 && !timeZoneId.equals("GMT");
}
@Override
@Nullable
public String getDeviceTimeZone() {
return SystemProperties.get(TIMEZONE_PROPERTY);
}
private static final String TIMEZONE_PROPERTY = "persist.sys.timezone";
private static final String TIMEZONE_PROPERTY = "persist.sys.timezone";
这个是设置时区的属性 persist.sys.timezone
在android源码目录 build/make/core/main.mk
添加默认 persist.sys.timezone默认属性
文章评论