Skip to content

[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

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

vincent-unity
Copy link

@vincent-unity vincent-unity commented Jan 10, 2019

[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.

…e due to /proc/uptime is unaccessible on Android 8 and above.
Copy link

@Over17 Over17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Over17 Over17 requested a review from hkr January 10, 2019 13:53
@joncham
Copy link
Member

joncham commented Jan 11, 2019

Looks good to me. Should we have similar changes in IL2CPP @joshpeterson ?

@joshpeterson
Copy link

Yes, we probably do. @vincent-unity do you know if this has been tried with IL2CPP and Android 8?

@vincent-unity
Copy link
Author

@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.

@joshpeterson
Copy link

@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?

@vincent-unity vincent-unity requested review from joncham and removed request for adrianoc-unity3d January 14, 2019 15:49
@vincent-unity
Copy link
Author

@joshpeterson Bug https://fogbugz.unity3d.com/f/cases/1108927/, and Pixel 3 is fine as it's definitely above android 8.

@joncham
Copy link
Member

joncham commented Jan 16, 2019

Is this PR ready to merge?

@vincent-unity
Copy link
Author

@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?

@joncham
Copy link
Member

joncham commented Jan 17, 2019

Yes please. I'll run ABV and normal trunk queue will cover things, but please test this yourself/QA before merging.

@Over17
Copy link

Over17 commented Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants