Cherry pick android: fix base::Time::FromLocalExploded() crash.

Cherry pick of

Bug: 11313033

Original description:

android: fix base::Time::FromLocalExploded() crash.

This patch does the following:

- Provide a work-around for an Android platform bug that
happens on older Android releases (e.g. 4.1.2), but fixed
on later ones (e.g. 4.3), where mktime() / mktime64()
would return -1 even when passed proper time values.

- Improve the code to properly deal with the fact that
SysTime is actually int64 on Android, unlike other
platforms, allowing us to remove the CHECK() that
was triggered by the platform bug.

- Add a new unit test to verify that the new code
doesn't crash on Android 4.1.2 anymore, and returns
the correct values.



Change-Id: Icca4d67b827fbca14d6218493db776fb79db85b8
2 files changed