
Firefox Android: Camera remains active even when the phone is locked - kkm
https://bugzilla.mozilla.org/show_bug.cgi?id=1564451
======
kbrosnan
For a user to be affected by this they woul need to:

* They would need to visit a website using webrtc

* Grant Firefox the Android camera/microphone permissions

* They would then be prompted to allow the website access to the camera and microphone

* For this to be a persistent problem the user would need to check a box that says "Remember my decision for this site" this is unchecked by default in the above dialog

As comments here and in the bug there are cases where leaving the camera
active is useful so this is not as cut and dry as the title leads you to
believe.

~~~
_bxg1
I think the bigger story is that this is possible for an app to do at all on
Android, in a way such that the user might not realize it can happen/is
happening.

~~~
kbenson
I agree. What does iOS do about this? Does it just not allow locked phones
access to the camera, or provide a prompt at lock, or something else?

~~~
_bxg1
I'm curious too. I assume it's better, but I don't know firsthand. I tried
googling it and every result was about manually opening the Camera app from
your lockscreen.

~~~
kbenson
Some other comments here seem to indicate (at least in recent models?) that
it's a visual indicator light on the phone that the camera/mic is being
accessed. That might be sufficient, although I might also like a small audio
cue on lock (or camera engage/disengage while locked).

Unfortunately, I doubt Android will ever be able to rely on a separate visual
indicator of recording, since that's another hardware component and probably
hard (if not impossible) for Android to enforce.

~~~
dogma1138
I remember in the old Nokia days and early android days when the camera
shutter sound couldn’t be disabled (peeping Tom rules) adding an indicator
similar to what webcams have could be possible heck you could potentially use
the flash LED on its lowest setting.

~~~
pedrocx486
Some phones don't have such fine grained control over the flash, in my case
(Galaxy Note 10+) it still is like a flashbang.

------
dvno42
Only somewhat related but I have a phone where the front camera mechanically
pops up when it's used. I've noticed that by default, when I visit many
websites, without notification the camera pops up and down quickly. After
every Firefox update, I have to go into android settings and deny camera
permissions. I've just assumed a page attempts to access the camera via JS but
I'm not sure, it could also just be a bug in FF.

~~~
kbrosnan
That is a separate issue which is fixed in Firefox Beta as part of bug
1578073.

~~~
cpeterso
Links to the fixed bug reports:

[https://bugzilla.mozilla.org/show_bug.cgi?id=1578073](https://bugzilla.mozilla.org/show_bug.cgi?id=1578073)

[https://github.com/mozilla-
mobile/fenix/issues/4833](https://github.com/mozilla-mobile/fenix/issues/4833)

------
teekert
Since Covid19 I've been using Jitsi a lot. I gave the same "chatroom" to my
parents and parents in law, as a way to speak to the kids. Then at some point
I'm getting a message from my father saying they can hear my parents in law
speak from their living room in our Jitsi room. It turns out the app does not
hang up when moving to another app. So they probably spend a couple of days
streaming... No idea if others visited the room, it has a rather unique but
not very long name and no password... I know one should hang up, but, keeping
a video+audio stream alive in the background should also lead to some warning
imho. Btw, this was the iPad Jitsi app keeping the connection alive, not the
website.

~~~
tikkabhuna
Pretty sure all video apps on iOS do this? Normally the status bar changes to
put a coloured pill around the time.

WhatsApp, FaceTime, and Zoom do this but they will pause video while in the
background.

Personally I would be annoyed if calls were killed while swapping to other
apps.

~~~
teekert
True, it's nice that it can continue. A warning after some time would be nice
though.

------
mcbits
This _could_ be desirable behavior in some circumstances, e.g. recording video
where someone might seize the device and try to stop the recording, or snoop
through the device while it's unlocked.

~~~
akerro
This! I once was in a car accident and wanted to record the conversation, I
started recording, locked phone and put it into my pocket. camera app stopped
recording when screen was locked, edge case but really unexpected one for me.

Web browser shouldn't be doing it tho.

~~~
ggreer
Wow, I didn't know this. I just tried with iOS 14 beta and was surprised to
see video/audio recording stop as soon as I hit the button to lock the screen.

By the way: You might want to try recording something while walking around
with your phone in your pocket. My guess is that your clothing will muffle
sound. Any movement will cause fabric to rub against the phone, drowning out
the sound you actually want to record. Even if your tactic did work, I'm not
sure it would have captured much of the conversation.

~~~
akerro
>By the way: You might want to try recording something while walking around
with your phone in your pocket. My guess is that your clothing will muffle
sound.

Many android phones detect being in pocket and lock screen automatically to
prevent accidental touches.

~~~
abdusco
I think it works the other way: display won't turn on if something is blocking
the proximity sensor, so you won't accidentally dial someone, but if I place
the phone in pocket while the display is on, it stays on.

------
devit
Seems not a bug: you may want this behavior, and the proper way to stop
recording is to close the website or the app, not locking your phone.

~~~
noja
Sure _some_ may want this behavior, but I think most will not: it's
unexpected.

~~~
kbenson
I think it's probably more complex than that. It's either unexpected or
_expected_ depending on what you're trying to do, as shown by the cases
mentioned here in the comments. You want to record something but you want your
phone in your pocket (and locked, so you don't accidentally touch something).
You want to use it as a baby monitor for a room. Your in a conference meeting
call but in your car without a charger, so would prefer to not waste battery
on the screen. Those are all cases where if you were were actively using the
camera and locked the phone, you might reasonably expect the camera to
continue working as it seems a use case people would have.

At the same time, there's the desire to know that when your phone is not in
active use (i.e. locked) it's not recording you.

I think this is a textbook case of where our expectations are contextual, and
conflicting. A naive adherence to one expectation or the other will leave
people unhappy. Perhaps then, a less naive behavior (prompting on lock, a
visual indicator of any recording, etc) is sufficient.

~~~
kbrosnan
There is a visual indicator Firefox provides an Android notification that
appears when the camera and/or the mic is in use.

~~~
kbenson
By visual indicator, I specifically mean a visual indicator that showed when
your phone is locked, and the screen may be off (like an LED, as iOS is
apparently enabling). To be clear, that's not only not an app's
responsibility, and in fact it should not be something an app can change at
all, so I don't really think Firefox should worry about changing how it
indicates this.

Because part of this has to do with security/privacy and at the device level,
this is really something Android needs to tackle. None of the solutions I
proposed are really appropriate for an application, since that would imply an
application has control over them, and they are useful only if an application
can't change them so you can have assurance they work as expected.

This is less an issue of trusting Firefox, which I do (for the most part, but
it does have a large security surface to be aware of since it runs remote
code), and more an issue of trusting something like Zoom or Tik Tok, which I
don't really.

------
duxup
I wish there was a hardwired led indicator, one for mic and one for camera.

When not in use neither the mic nor the camera would get power and the leds
tied to the same power connection. If they're on, you know they're on.

Yeah for "ok google" or whatever service it would be on all the time, but
you'd know.

A physical switch to cut power would be nice too.

I know there are likely some software complications such as checking 'hey does
the camera work / is it there' but maybe that's more of a symptom of a
problem.

~~~
GekkePrutser
Apple is doing this now in iOS 14 - not quite hardwired but their OS is so
controlled it's nearly the same thing. I doubt an app can bypass it.
[https://9to5mac.com/2020/07/07/ios-14-what-do-the-orange-
and...](https://9to5mac.com/2020/07/07/ios-14-what-do-the-orange-and-green-
dots-in-the-status-bar-mean/)

On Android you have the pop-up phones of course! Sadly they are super heavy...
I was checking the Poco F2 last weekend and it's > 200 grams which is really a
lot. Great for privacy though (and I really don't care about the front cam
much anyway).

~~~
katbyte
Wow that’s awesome, I have an app installed on my MacBook that pops up
something when the mic is in use and it’s a great addition.

~~~
GekkePrutser
Edit: Oops you were talking about the mic, not the cam.. So the green light I
spoke of doesn't apply.

I wouldn't be surprised if this feature came to Big Sur too though! But the
current beta doesn't have it.

------
pmlnr
Please keep this as an _option_. The current lack of having background video
streaming prevents me from using my old androids as dashboard AND a network
camera, even though they have the capacity to be both.

~~~
sakis
Relevant/obligatory xkcd: [https://xkcd.com/1172/](https://xkcd.com/1172/)

On the subject, I would really prefer this to be an option as well, even with
the default being not the current default, however I see that there is a
general trend of removing a lot of fine tuning knobs in apps (android or
otherwise) in the sake of reducing complexity for the end-user.

------
blendergeek
This is the behavior I expect and desire from my phone. Locking the screen
should not suddenly end my video call. To end my video call, I should press
the 'end call' button. I can think of scenarios where I would want my phone to
record without showing any notice at all (some people have mentioned law
enforcement interactions, I think this is a good example of such a situation).

------
LockAndLol
This could (maybe even should) be handled by Android permissions itself e.g
allow app to be access camera when screen is off or locked. But this has been
inactive mostly inactive for a year, which shows where priorities lie.

------
httpsterio
Doesn't Android require the camera permissions in order to use the microphone?
I mean, it makes sense to keep a webrtc connection alive even if you lock the
screen (if you're on a voip ball for example)

~~~
asveikau
I don't see why microphone should require camera access. I can think of a few
scenarios that need the former and not the latter.

What about a voice calling app that doesn't have video calling support?

What about a sound recorder, voice recorder, music capture or PTT/walkie-
talkie app?

What about something like Shazam?

------
jbaber
This is why I still use [bouncer] despite the fact that it's roughly been
replaced by Android's new only-while-app-is-running style permission.

I have great* confidence the camera is off when, after hitting the home key, I
actually see the permissions for the app switch off.

[bouncer]:
[https://play.google.com/store/apps/details?id=com.samruston....](https://play.google.com/store/apps/details?id=com.samruston.permission&hl=en_US)

------
cookiengineer
Also, Firefox for Android has Google AdMob integration and uses firebase as a
hosting service for some scripts.

I lately started to use Appwarden [1] to check some apps, and I'm amazed how
messed up the App ecosystem is in terms of advertising trackers and abusive
CDNs - even if you use only AOSP builds, no gapps, and only f-droid, you can
get compromised very easily.

[1]
[https://gitlab.com/AuroraOSS/AppWarden](https://gitlab.com/AuroraOSS/AppWarden)

------
srg0
/Offtopic

I remember that at some point it was possible to open a Youtube video in
Firefox for Android, lock the screen, and it kept on playing. It was great for
some podcast-like / talking channels.

Then either Firefox changed or Youtube cracked down on this.

~~~
jeroenhd
As far as I know, Firefox still allows you to play video in the background
from the lock screen. It's probably YouTube that changed (because they want
you to pay them for the feature, because people use YouTube for background
music).

You can keep it from pausing by requesting the desktop site in Firefox. The
mobile site pauses, the desktop site just keeps playing.

~~~
srg0
Interesting. I tried it in Firefox for Android, and the desktop site plays for
a couple of seconds after screen lock and then stops. It might depend on the
video.

~~~
jeroenhd
It probably also depends on the power saving settings your phone enforces.
From what I've seen from DontKillMyApp[0] the optimalizations vary widely per
manufacturer and probably per device and ROM as well.

I don't think the websites cares much, at least it didn't for me and I tested
it with a music video (something Youtube usually doesn't like you playing in
the background without a subscription). Your phone's settings and
optimizations are a more likely culprit, in my opinion.

[0]: [https://dontkillmyapp.com/](https://dontkillmyapp.com/)

------
badrabbit
Ok, but why is this up to the browser? If it was any other app, how can users
be protected? Shouldn't this be enforced by the hardware ideally?

------
kerng
Interesting, but why is this possible in the first place on Android?

~~~
ars
Because I might still want to record things with my screen off?

Imagine you are recording a video, and you turn of the screen to save power -
why would you expect it to stop recording?

------
dec0dedab0de
Meh.. If I was in a video chat and my phone locked i wouldnt want it to get
discconected

------
coronadisaster
wow that is really bad, I am increasingly loosing fate in Firefox and I have
been using it since v1.0

~~~
GekkePrutser
I'm sure this wasn't intentional though. It doesn't even benefit them in any
way. It's not as if they were doing it to steal information. It's just a bug,
at least it's known now and they'll fix it.

~~~
coronadisaster
assuming the NSA isn't behind it and cutting them a check

~~~
jacquesm
That's well into tinfoil hat territory unless you have some proof of this.

~~~
swebs
Not Mozilla, but there's plenty of proof for other big tech companies,
including Google.

[https://en.wikipedia.org/wiki/PRISM_(surveillance_program)](https://en.wikipedia.org/wiki/PRISM_\(surveillance_program\))

~~~
jacquesm
But this _is_ about Mozilla, which is not all like the other big tech
companies. They've definitely made some mistakes but I'd pause for a long time
before accusing them of malice at that level.

~~~
speedgoose
How are they different?

~~~
neurostimulant
Many contributors are volunteer, not under mozilla payroll. I doubt they would
stay quiet if they notice something like this happen.

------
techntoke
It is only a year old. I mean how high of a priority can it be to not send
your camera when your phone is locked or when you send the app to the
background?

~~~
ed25519FUUU
Furthermore, how does the OS even make this possible?

~~~
techntoke
Well for music, people may want to continue listening to music when their
phones are off or the app is in the background.

For video I agree it doesn't make much sense, but in a web app world if you're
recording video you may want to turn off the screen or do other things just
like a computer. It should at least show you in the notification area.

~~~
disiplus
i can think a scenario where the phone is acting as a sort of security camera.
or you are using it as a replacement for web cam when you stream from your pc.
etc. but i agree most of those are edge cases.

~~~
TeMPOraL
It's not as much of an edge case; spare (particularly, old) phones and tablets
are used as DIY home security systems, baby monitors, etc.

~~~
AnthonyMouse
And even edge cases should be supported. Maybe the default in Firefox should
be to disable the camera when you lock your phone, but then it should have a
setting to do otherwise, and it certainly shouldn't be rendered impossible by
the OS (rather than, say, having a separate permission).

