-
Notifications
You must be signed in to change notification settings - Fork 521
[Android] Fix the issue that Environment.TickCount returns wrong value… #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e due to /proc/uptime is unaccessible on Android 8 and above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Looks good to me. Should we have similar changes in IL2CPP @joshpeterson ? |
Yes, we probably do. @vincent-unity do you know if this has been tried with IL2CPP and Android 8? |
@joshpeterson I tried with il2cpp on android 8, it returned a negative value on a rebooted device, I didn't check il2cpp code, but seems we have problem with il2cpp as well. |
@vincent-unity: Is there is reproducible test case for this issue on Mono, please drop us a bug report and we can try to fix it. Also, what devices can use Android 8? We do have a Pixel 3 available here, is that sufficient? |
@joshpeterson Bug https://fogbugz.unity3d.com/f/cases/1108927/, and Pixel 3 is fine as it's definitely above android 8. |
Is this PR ready to merge? |
@joncham I talked to Yury, we would like to test the fix on multiple devices before landing it to trunk. I'm preparing a branch with mono built for qa. I don't know how this would align with your process. Should we wait for the green light from qa before merging this pr? |
Yes please. I'll run ABV and normal trunk queue will cover things, but please test this yourself/QA before merging. |
QA has tested the PR https://ono.unity3d.com/unity/unity/pull-request/81368/_/platform/android/vincent/case-1108927#comment-662004 |
[Android] Fix the issue that Environment.TickCount returns wrong value due to /proc/uptime is unaccessible on Android 8 and above.
The root cause is we can't open 'proc/uptime' to get the boot time on Android 8 and above due to Android 8 'proc' permissions change. So we use clock_gettime() on android instead.