Return types possibly swapped through AndroidBridge (GetScreenOrientation <---> GetScreenAngle)

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
3 years ago
3 years ago

People

(Reporter: capella, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Comment 1

3 years ago
?ni to be sure we're noticed
Flags: needinfo?(nchen)
Looks like screen orientation [1] and screen angle [2] both have Java short type (C++ int16_t type). In GeckoAppShell, getScreenOrientation stays as short and getScreenAngle is expanded to int. Finally, in AndroidBridge, getScreenOrientation is expanded to int (uint32_t) and getScreenAngle is reduced back to short (uint16_t).

So the types are definitely not consistent, but because the values are both 16-bit values originally, the inconsistency should be harmless, and shouldn't cause crashes.

[1] https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/GeckoScreenOrientation.java?rev=be593a64d7c6#37
[2] https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/GeckoScreenOrientation.java?rev=be593a64d7c6#280
Flags: needinfo?(nchen)
(Reporter)

Comment 3

3 years ago
Thanks for the explanation. I'd meant to close this earlier :)
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.