Closed Bug 1176913 Opened 9 years ago Closed 9 years ago

Camera App does not respond to physical camera button or volume buttons when launched from lock screen with a passcode.

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.5?, b2g-master verified)

VERIFIED FIXED
blocking-b2g 2.5?
Tracking Status
b2g-master --- verified

People

(Reporter: callahad, Assigned: djf)

Details

(Keywords: DevAdvocacy, foxfood, Whiteboard: [spark])

Attachments

(6 files)

STR:

1. Lock phone
2. Turn on screen, swipe left to open Camera
3. Press physical camera button

What should happen:

- The camera takes a picture

What actually happens:

- Nothing

The button does work as expected when the phone is unlocked and the Camera app is launched from the homescreen.
This seems to work for me; are you on rc4?  if so, can you try to reproduce this again please?
Flags: needinfo?(dan.callahan)
Seems to be tied to PIN lock.

If the phone has been recently unlocked, it works. If you'd have to enter a PIN to unlock the phone, it doesn't.

Can you repro with a PIN?
Flags: needinfo?(dan.callahan)
QA Whiteboard: [foxfood-triage]
I just encountered this on both the latest Aries build. I am not able to use either the hardware camera button or the volume buttons to take a picture when launching the camera from the lockscreen with a passcode enabled. Using the volume buttons will actually adjust the volume, whereas the camera button is not functional at all.

This issue also occurs on the Flame device, specifically using the volume buttons.

An added layer of behavior, if I take a picture using the software touch-screen button first, the hardware camera button and volume buttons will then properly take pictures.

Environmental Variables:
Device: Aries 2.5
BuildID: 20151014133333
Gaia: df7683e4f7329c567deb487d11317578c6930246
Gecko: c3c027f6070db795bc59ba57795b8e36fde2471b
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 44.0a1 (2.5) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0

Environmental Variables:
Device: Flame 2.5
BuildID: 20151014030205
Gaia: d400cda6bf0f8b30dcf7d7d71bfa61f29a3f1588
Gecko: 2387ada864282880d3a498d643abe3d8b887ee59
Gonk: c4779d6da0f85894b1f78f0351b43f2949e8decd
Version: 44.0a1 (2.5) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0
Summary: [spark][aries] App does not respond to physical camera button on Aries when launched from lock screen → Camera App does not respond to physical camera button or volume buttons when launched from lock screen with a passcode.
[Blocking Requested - why for this release]:
I think since this scenario is not too uncommon, it's worth nominating to block to start a discussion.
blocking-b2g: --- → 2.5?
I did a quick debug and it seems the Camera app is not receiving 'keydown' events when in secure mode. This suggests it could be a System app issue.
Gregor: Need your help with investigating this one. 

Thanks
Hema
Component: Gaia::Camera → Gaia::System
Flags: needinfo?(anygregor)
David, is this related to bug 1200351?
Flags: needinfo?(anygregor) → needinfo?(dflanagan)
I can't reproduce this. Is this still an issue? maybe fixed by bug 1200351?
Keywords: qawanted
In order to reproduce this, you first have to set a lockscreen PIN.

When I do this and launch camera from the lockscreen, the volume keys just control volume and do not take a picture.

But if I then take a picture with the on-screen shutter button, then the volume keys start working correctly.

That makes me think that we've got initialization issues in secure mode where the camera is not registering its event handlers properly until the first photo is taken...

Gregor: because the secure camera app can sometimes receive keyevents and sometimes not, I don't think it is related to bug 1200351.  (Though it is probably easy to back it out and check).

Wilson: does the fact that the keys start working after one photo give you any clues what could be going on?
Flags: needinfo?(dflanagan) → needinfo?(wilsonpage)
Clearing the needinfo for Wilson. This is another focus issue, just like the one in 1200351. The app isn't getting the key events becuase it doesn't have focus.  But once you touch the screen (anywhere, not just on the shutter button) the app gets focus, and then the keys work.

So this is correctly categorized as a System app issue. We just have to figure out how this app gets launched from the lockscreen and make sure to give it focus.  In app_window_manager.js, the way to set focus appears to be this._activeApp.broadcast('focus');
Flags: needinfo?(wilsonpage)
Assignee: nobody → dflanagan
Comment on attachment 8680824 [details] [review]
[gaia] davidflanagan:bug1176913 > mozilla-b2g:master

Gregor: since you've already looked at this bug, I thought you might be a good reviewer, or could nominate someone on your team to review.

It is a trivial patch, and I don't think there are any security concerns with it. But I don't know the system app window manager architecture well enough to know if this is the right way to fix the bug.
Attachment #8680824 - Flags: review?(anygregor)
I don't think this should be a blocker, but it is a serious usability papercut for anyone who uses pin codes and wants to quickly pull out their phone and snap a photo.  We've got a trivial fix for it, so let's be sure to get this landed for the 2.5 release.
Based upon the steps in Comment 9, I am also able to reproduce this issue using Aries Master and Flame 2.5
Result: From Lockscreen after enabling passcode and sliding left to access Camera pressing the hardware volume buttons will not take a photo. Instead the volume is adjusted. However, Pressing the camera button itself will then enable the volume buttons to take a picture.

Environmental Variables:
Device: Aries 2.5
BuildID: 20151029161147
Gaia: 91cac94948094cfdcd00cba5c6483e27e80cb3b0
Gecko: ac68828c5e3e2ac4fabcfde859440a749e0f5fbf
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 45.0a1 (2.5) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:45.0) Gecko/45.0 Firefox/45.0

Environmental Variables:
Device: Flame 2.5 Kk Fullflash (512mb)
BuildID: 20151029045227
Gaia: 91cac94948094cfdcd00cba5c6483e27e80cb3b0
Gecko: acb3f4ac5424181d3d4d73283668162137918cf1
Gonk: 205ac4204bbbb2098a8046444acba551ba5dc75a
Version: 45.0a1 (2.5) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:45.0) Gecko/45.0 Firefox/45.0
QA Whiteboard: [foxfood-triage] → [QAnalyst-Triage?][foxfood-triage]
Flags: needinfo?(jmercado)
Keywords: qawanted
QA Whiteboard: [QAnalyst-Triage?][foxfood-triage] → [QAnalyst-Triage+][foxfood-triage]
Flags: needinfo?(jmercado)
Comment on attachment 8680824 [details] [review]
[gaia] davidflanagan:bug1176913 > mozilla-b2g:master

I guess Greg is a much better reviewer for this.
Attachment #8680824 - Flags: review?(anygregor) → review?(gweng)
Comment on attachment 8680824 [details] [review]
[gaia] davidflanagan:bug1176913 > mozilla-b2g:master

I feel the code looks good but with one nit. I will be grateful if you can fix that before landing the code.
Attachment #8680824 - Flags: review?(gweng) → review+
review comments addressed, and landed to master: https://github.com/mozilla-b2g/gaia/commit/11df0c1cc7d6e5dee40fb5e3ce7987525f2d08ac
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Attached file logcat_1633.txt
QA Whiteboard: [QAnalyst-Triage+][foxfood-triage] → [QAnalyst-Triage+][foxfood-triage], [MGSEI-Triage+]
Jessica,

I don't understand. You said that verification has failed. But you say that the actual result is that the volume keys and camera button take a picture. That's what we want. The bug was that the camera button and volume keys were not taking a picture. I fixed that, and now they do take a picture. I've just checked this with a nightly 2.6 Aries build and it looks to me like this bug is actually fixed.

(In reply to Jessica from comment #18)
> Created attachment 8682980 [details]
> verified_Aries KK v2.6.3gp
> 
> According to the STR of Comment 0 and Comment 9, this bug has been verified
> fail on latest Aries KK v2.6.
> 
> See attachments: verified_Aries KK v2.6.3gp and logcat_1633.txt
> Reproduce rate: 5/5
> 
> Actual result: The camera takes a picture via volume buttons or physical
> camera button when launched from lock screen with a passcode.
>
Flags: needinfo?(dflanagan) → needinfo?(yelanying)
I sincerely apologize for writting an incorrect 'Actual result'. Please ignore it.
 
The actual result on master is that: It's the first time to use camera app from lockscreen after flashing the DUT. The camera can't take pictures via volume buttons or physical camera button. If we lock screen and enter camera again, the volume keys and physical camera button start working normally. So this issue just exists when user uses camera for the first time.
Could you please help to check it again? Thanks a lot.

See attachments: verified_Aries KK v2.6.3gp and logcat_1410.txt
Reproduce rate: 5/5

Device: Aries KK v2.6 (master) (Fail)
Build ID               20151105105137
Gaia Revision          6a8cab20288c28a8555eeb61ba7f22a4306a2d0d
Gaia Date              2015-11-04 11:33:05
Gecko Revision         n/a
Gecko Version          45.0a1
Device Name            aries
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.rose.20151103.153542
Firmware Date          Tue Nov 15:36:03 CST 2015
Bootloader             s1

Device: Flame KK v2.6 512mb (master)  (Fail)
Build ID               20151104150239
Gaia Revision          47da49f8206788d70d834c3a63d9245d50c89103
Gaia Date              2015-11-03 21:48:23
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/6077f51254c69a1e14e1b61acba4af451bf1783e
Gecko Version          45.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20151104.182640
Firmware Date          Wed Nov  4 18:26:52 EST 2015
Firmware Version       v18D v4
Bootloader             L1TC000118D0
Flags: needinfo?(yelanying)
Attached file logcat_1410.txt
Hi David,

Could you please help to check it again?  Thanks.
Flags: needinfo?(dflanagan)
I can reproduce this if the there is a lockscreen pin and if the camera app brings up the geolocation permission dialog. Reflashing the device makes the camera prompt for geolocation permissions on the first run, but you can also do that by going to Settings -> App Permissions -> Camera and setting hte permission to "Ask".

So this is a focus issue in the secure window manager, where it is not giving focus back to the app after a permission dialog is dismissed.  Thank you for finding that, Jessica. I've filed bug 1224281 for that issue.

Let's verify this patch because it does fix the issue for all cases except the first run where there is the geolocation prompt.
Flags: needinfo?(dflanagan) → needinfo?(yelanying)
Hi all,

This bug has been verified as pass on latest build of Flame KK v2.6 512mb and Aries KK v2.6.

Actual results: The camera can take pictures via physical camera button and volume buttons, when there isn't the geolocation prompt the first run.
See attachment: verified_Aries KK v2.6.3gp
Reproduce rate: 0/6


Device: Flame KK v2.6 512mb (master) (Pass)
Build ID               20151112150206
Gaia Revision          27bc9412ca607648bc398b25bb1ae25653b2b278
Gaia Date              2015-11-12 02:27:47
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/3cc3b1968524248450c465c4ea2ee5596ffa65f2
Gecko Version          45.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20151112.183236
Firmware Date          Thu Nov 12 18:32:49 EST 2015
Firmware Version       v18D v4
Bootloader             L1TC000118D0

Device: Aries KK v2.6 (master) (Pass)
Build ID               20151112120735
Gaia Revision          27bc9412ca607648bc398b25bb1ae25653b2b278
Gaia Date              2015-11-12 02:27:47
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/3cc3b1968524248450c465c4ea2ee5596ffa65f2
Gecko Version          45.0a1
Device Name            aries
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.worker.20151112.112635
Firmware Date          Thu Nov 12 11:26:43 UTC 2015
Bootloader             s1
Flags: needinfo?(yelanying)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: