← Back to team overview

ubuntu-phone team mailing list archive

Re: Find out if running on a phone

 


On 11.01.2016 04:58, Michi Henning wrote:
>>
>> Right... forgot that it's a gerrit MR, not Launchpad:
>>
>> https://codereview.qt-project.org/#/c/101049/
> 
> Thanks for that!
> 
> I just had a look
> at https://codereview.qt-project.org/#/c/101049/15/src/systeminfo/qinputinfo.h
> 
> But this requires an input to then find out what the source was (mouse,
> touch screen, etc.).

Not really, no. It is enough plugging some input hardware to make it
appear in that API. No actual events required. Anyways, this won't help
you further because in our team we already 20% of people working with
touch screens on their laptop. Your assumption would cause bad things to
happen on their notebooks.

> 
> I need to know whether I’m running on touch or on the desktop, without
> any input events.


Yes, as I said in the other mail, this approach sounds definitely wrong
to me. What you really want is to find out whether the android
hardware/drivers are around or not.

> 
> Any other ideas? Is there some place in the filesystem I could look at,
> or test some env var or whatever?
> It has to work under confinement though.

Jamie, can you think of something that works confined?

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References