Add support for querying timezone on Android#846
Conversation
|
OK the code does not work. The compiler complains: But I honestly don't know what's wrong with it. |
| let mut get_time_zone = Command::new("getprop"); | ||
| get_time_zone.arg("persist.sys.timezone"); | ||
| let output = get_time_zone.output().expect("fail to get time zone"); | ||
| return CompiledData::parse(output.stdout); |
There was a problem hiding this comment.
CompiledData is a trait, and TimeZone is implementing this trait:
| return CompiledData::parse(output.stdout); | |
| return TimeZone::parse(output.stdout); |
| }) | ||
| } else { | ||
| TimeZone::from_file("/etc/localtime") | ||
| if env::consts::OS == "android" { |
There was a problem hiding this comment.
I suppose it’s a good practice to include the “documentation” for this change.
| if env::consts::OS == "android" { | |
| // https://android.googlesource.com/platform/bionic/+/master/libc/tzcode/bionic.cpp | |
| if env::consts::OS == "android" { |
|
Well actually your approach is wrong. I’m really starting to think we should stop trying to replace the |
|
Closed in favor of #867 |
No description provided.