Merge "Improve libc time zone fallback behavior."
am: 1b42c54471 * commit '1b42c544711316281e09c5da25850fac531b27cb': Improve libc time zone fallback behavior.
This commit is contained in:
commit
69536213d6
@ -1316,9 +1316,10 @@ static void
|
|||||||
tzset_unlocked(void)
|
tzset_unlocked(void)
|
||||||
{
|
{
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
|
// The TZ environment variable is meant to override the system-wide setting.
|
||||||
const char * name = getenv("TZ");
|
const char * name = getenv("TZ");
|
||||||
|
|
||||||
// Try the "persist.sys.timezone" system property.
|
// If that's not set, look at the "persist.sys.timezone" system property.
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
static const prop_info *pi;
|
static const prop_info *pi;
|
||||||
|
|
||||||
@ -1340,6 +1341,10 @@ tzset_unlocked(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If that's not available (because you're running AOSP on a WiFi-only
|
||||||
|
// device, say), fall back to GMT.
|
||||||
|
if (name == NULL) name = gmt;
|
||||||
|
|
||||||
tzsetlcl(name);
|
tzsetlcl(name);
|
||||||
#else
|
#else
|
||||||
tzsetlcl(getenv("TZ"));
|
tzsetlcl(getenv("TZ"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user