Closed Bug 760107 Opened 12 years ago Closed 12 years ago

SUTAgent should support getting rotation

Categories

(Testing :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla15

People

(Reporter: wlach, Assigned: wlach)

Details

Attachments

(2 files)

For my new Orangatun project (https://github.com/wlach/orangatun), we need to be able to get the device's current rotation to figure out the transformation for drag gestures (since the raw events will always assume portrait mode).
This adds an info subcommand for getting device rotation.
Attachment #628726 - Flags: review?(jmaher)
Comment on attachment 628726 [details] [diff] [review]
Patch to add support for getting device rotation to sutagent + devicemanager

Review of attachment 628726 [details] [diff] [review]:
-----------------------------------------------------------------

overall this is good, just one question below.

::: build/mobile/sutagent/android/DoCommand.java
@@ +2305,5 @@
> +    public String GetRotationInfo()
> +        {
> +            WindowManager wMgr = (WindowManager) contextWrapper.getSystemService(Context.WINDOW_SERVICE);
> +            int nRotationDegrees = 0; // default
> +            switch(wMgr.getDefaultDisplay().getRotation())

is this available on all platforms?  I am asking mostly about the tegra (android 2.2), but we have seen tablets act differently as well.
Attachment #628726 - Flags: review?(jmaher) → review+
Attachment #628731 - Flags: review?(jmaher) → review+
(In reply to Joel Maher (:jmaher) from comment #3)

> is this available on all platforms?  I am asking mostly about the tegra
> (android 2.2), but we have seen tablets act differently as well.

Just tested on my LG G2X running 2.2. Works fine. I'll bet this even works on older devices...
Target Milestone: --- → mozilla15
Inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/7d6bfa12744d

(didn't mean to set target milestone above, oh well!)
https://hg.mozilla.org/mozilla-central/rev/7d6bfa12744d
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: