Robocop: Improve the solution for identifying the device type and OS

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: AdrianT, Unassigned)

Tracking

Trunk
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
This is a follow-up bug to bug 747835 to find a better solution to determine if the device the test is running on is a phone or a tablet and what OS it is running. The scope of this is to be able to run tests depending on the UI layout which may be different depending on OS and device type.

Here is Joel's proposition in bug 747835:

> I also see abstracting this out:
> 
> DeviceClass myDevice = detectDevice()
> # myDevice.type = tablet
> # myDevice.version = ics
> # myDevice.width = 400
> # myDevice.height = 600
> # myDevice.rotate() rotate the display
> 
> Then for the navigation stuff, it could be more like this:
> MenuNavigation nav = newMenuNavigation(myDevice)
> nav.back()
> nav.more()
> nav.forward()
(Reporter)

Updated

7 years ago
Blocks: 747835
For version-specific needs, Fennec code often uses Build.VERSION.SDK_INT. eg:

if (Build.VERSION.SDK_INT >= 16)

or

boolean honeycomb = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB &&
                     Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB_MR2);


context.getResources().getDisplayMetrics() may be appropriate for width/height.
(Reporter)

Comment 2

7 years ago
(In reply to Geoff Brown [:gbrown] from comment #1)
> For version-specific needs, Fennec code often uses Build.VERSION.SDK_INT. eg:
> 
> if (Build.VERSION.SDK_INT >= 16)
> 
> or
> 
> boolean honeycomb = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
> &&
>                      Build.VERSION.SDK_INT <=
> Build.VERSION_CODES.HONEYCOMB_MR2);
> 
> 
> context.getResources().getDisplayMetrics() may be appropriate for
> width/height.
Hi Geoff,

Actually I have found the same solution yesterday and implemented it I just need some more time to test it.

Thank you for your input here.
(Reporter)

Comment 3

7 years ago
Setting the status for this issue as fixed since bug 747835 contains the code for this also and the patch has been integrated
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.