← Back to team overview

ubuntu-phone team mailing list archive

Re: Find out if running on a phone

 

Ah, i thought you were working on a system service, didn't realize it would
be confined.

I wouldn't make the assumption that confined processes are necessarily
running in the phone as i believe the convergence plan is to have confined
apps on the desktop.

Aside from that, i would just try to do whatever it is you're trying to do
and then catch the failure as gracefully as possible when it fails on the
phone, if you can. Better to ask forgiveness than permission ;-)
On Jan 10, 2016 8:16 PM, "Michi Henning" <michi.henning@xxxxxxxxxxxxx>
wrote:

>
> On 11 Jan 2016, at 14:12 , Robert Park <robert.park@xxxxxxxxxxxxx> wrote:
>
> Pardon my ignorance, buy can you not just check which codecs are
> installed/in use and then make the right decisions based on that? It is a
> really bad practice to write code that says "desktops be like this while
> phones be like that" because you never know when one day a new device might
> come along that shatters your expectations.
>
> Feature detection > device detection
>
> I agree with the sentiment. But how would I, from a confined process, work
> out what’s installed? I won’t even be allowed to look there.
>
> I guess I can conclude that, if I’m not allowed to look, I’m confined.
> And, if I’m allowed to look, use what I can see. But it also seems a very
> round-about way of figuring this out.
>
> The real question actually is “If I thumbnail from an audio or video file,
> will I be using the android/hybris hardware codecs or a software codec?”
>
> But there is no API for that either, as far as I know.
>
> Michi.
>

Follow ups

References