Closed Bug 815098 Opened 12 years ago Closed 11 years ago

Maps app asks for geolocation upon startup - should ask only by user input

Categories

(Web Compatibility :: Site Reports, defect, P2)

x86
Gonk (Firefox OS)
defect

Tracking

(blocking-basecamp:-)

RESOLVED INVALID
blocking-basecamp -

People

(Reporter: daleharvey, Assigned: fzzzy)

Details

External manifest doesnt ask for geolocation premission so it prompts a dialog, it obviously should
Requesting blocking+ as its a pretty jarring ui and an easy fix
Assignee: nobody → dale
blocking-basecamp: --- → ?
Donovan - Can we ask the partner to update their app manifest to call out geolocation support as specified by this bug? Is the partner even okay with it?
Flags: needinfo?(dpreston)
Whiteboard: [3rd-party-preloaded-apps]
blocking-basecamp: ? → +
Priority: -- → P2
This seems like a platform issue. http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/PermissionsInstaller.jsm#46 tells it should be implicitely granted but the code seems to not honor the described matrix.

Moving component and assigning David Dahl (feel free to re-assign).
Assignee: dale → ddahl
Component: Gaia → General
(In reply to Vivien Nicolas (:vingtetun) from comment #4)
> This seems like a platform issue.
> http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/
> PermissionsInstaller.jsm#46 tells it should be implicitely granted but the
> code seems to not honor the described matrix.
> 
> Moving component and assigning David Dahl (feel free to re-assign).

I think the geolocation permission is not implicit as it is listed in the PermissionsTable.

Have you tested with a change to the manifest adding permissions like:

http://mxr.mozilla.org/mozilla-central/source/dom/tests/browser/test-webapp.webapp#5
Assignee: ddahl → nobody
yeh I have a patch to add the geolocation permission, however I cant test it as the current maps are broken, I figured there would already be a bug about that but doesnt appear so, will open one
(In reply to Dale Harvey (:daleharvey) from comment #6)
> yeh I have a patch to add the geolocation permission, however I cant test it
> as the current maps are broken, I figured there would already be a bug about
> that but doesnt appear so, will open one

There is a bug on that I believe and it just got fixed.
(In reply to Dale Harvey (:daleharvey) from comment #6)
> yeh I have a patch to add the geolocation permission, however I cant test it
> as the current maps are broken, I figured there would already be a bug about
> that but doesnt appear so, will open one

Btw - adding the geolocation permission to the manifest won't stop the prompt. Only certified apps can get implicit permissions to geolocation.

Arguing a wont fix on this one - I don't think there's anything we can do here.
Flags: needinfo?(dpreston)
Whiteboard: [3rd-party-preloaded-apps] → [3rd-party-preloaded-apps] [WONTFIX?]
blocking-basecamp: + → ?
Component: General → Gaia
(In reply to David Dahl :ddahl from comment #5)
> (In reply to Vivien Nicolas (:vingtetun) from comment #4)
> > This seems like a platform issue.
> > http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/
> > PermissionsInstaller.jsm#46 tells it should be implicitely granted but the
> > code seems to not honor the described matrix.
> > 
> > Moving component and assigning David Dahl (feel free to re-assign).
> 
> I think the geolocation permission is not implicit as it is listed in the
> PermissionsTable.
> 
> Have you tested with a change to the manifest adding permissions like:
> 
> http://mxr.mozilla.org/mozilla-central/source/dom/tests/browser/test-webapp.
> webapp#5

By matrix I mean https://docs.google.com/spreadsheet/ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0


Jason this is not a Gaia bug, so let's keep it in Gaia:General or move it to Core.
Component: Gaia → General
Summary: Maps application asks for Geolocation → PermissionsInstaller.jsm does not honor the permission matrix
Whiteboard: [3rd-party-preloaded-apps] [WONTFIX?] → [3rd-party-preloaded-apps]
I think this can be fixed by making all the entries for desktop-notification and geolocation be UNKNOWN_ACTION for web and privileged apps.
I'm going to guess this should be part of permissions finalization review Paul & I are doing then. Flagging as such.
(In reply to Vivien Nicolas (:vingtetun) from comment #9)
> (In reply to David Dahl :ddahl from comment #5)
> > (In reply to Vivien Nicolas (:vingtetun) from comment #4)
> > > This seems like a platform issue.
> > > http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/
> > > PermissionsInstaller.jsm#46 tells it should be implicitely granted but the
> > > code seems to not honor the described matrix.
> > > 
> > > Moving component and assigning David Dahl (feel free to re-assign).
> > 
> > I think the geolocation permission is not implicit as it is listed in the
> > PermissionsTable.
> > 
> > Have you tested with a change to the manifest adding permissions like:
> > 
> > http://mxr.mozilla.org/mozilla-central/source/dom/tests/browser/test-webapp.
> > webapp#5
> 
> By matrix I mean
> https://docs.google.com/spreadsheet/
> ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
> 

The maps app is not a certified app right? So it will always prompt for geolocation. Where do you see the bug in the PermissionsInstaller.jsm?
(In reply to Gregor Wagner [:gwagner] from comment #12)
> (In reply to Vivien Nicolas (:vingtetun) from comment #9)
> > (In reply to David Dahl :ddahl from comment #5)
> > > (In reply to Vivien Nicolas (:vingtetun) from comment #4)
> > > > This seems like a platform issue.
> > > > http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/
> > > > PermissionsInstaller.jsm#46 tells it should be implicitely granted but the
> > > > code seems to not honor the described matrix.
> > > > 
> > > > Moving component and assigning David Dahl (feel free to re-assign).
> > > 
> > > I think the geolocation permission is not implicit as it is listed in the
> > > PermissionsTable.
> > > 
> > > Have you tested with a change to the manifest adding permissions like:
> > > 
> > > http://mxr.mozilla.org/mozilla-central/source/dom/tests/browser/test-webapp.
> > > webapp#5
> > 
> > By matrix I mean
> > https://docs.google.com/spreadsheet/
> > ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
> > 
> 
> The maps app is not a certified app right? So it will always prompt for
> geolocation. Where do you see the bug in the PermissionsInstaller.jsm?

That's right. That's exactly the point I was making. Which is why I don't think this is a valid bug.
It was a valid bug when the title was still "Maps application asks for Geolocation"

Dale, can you please post your patch? The maps app url has been updated so you can test it again.
(In reply to Gregor Wagner [:gwagner] from comment #12)
> (In reply to Vivien Nicolas (:vingtetun) from comment #9)
> > (In reply to David Dahl :ddahl from comment #5)
> > > (In reply to Vivien Nicolas (:vingtetun) from comment #4)
> > > > This seems like a platform issue.
> > > > http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/
> > > > PermissionsInstaller.jsm#46 tells it should be implicitely granted but the
> > > > code seems to not honor the described matrix.
> > > > 
> > > > Moving component and assigning David Dahl (feel free to re-assign).
> > > 
> > > I think the geolocation permission is not implicit as it is listed in the
> > > PermissionsTable.
> > > 
> > > Have you tested with a change to the manifest adding permissions like:
> > > 
> > > http://mxr.mozilla.org/mozilla-central/source/dom/tests/browser/test-webapp.
> > > webapp#5
> > 
> > By matrix I mean
> > https://docs.google.com/spreadsheet/
> > ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
> > 
> 
> The maps app is not a certified app right? So it will always prompt for
> geolocation. Where do you see the bug in the PermissionsInstaller.jsm?

Ok, wait. So is the only fix for this to make the maps app certified and packaged?
(In reply to Donovan Preston from comment #15)
> (In reply to Gregor Wagner [:gwagner] from comment #12)
> > (In reply to Vivien Nicolas (:vingtetun) from comment #9)
> > > (In reply to David Dahl :ddahl from comment #5)
> > > > (In reply to Vivien Nicolas (:vingtetun) from comment #4)
> > > > > This seems like a platform issue.
> > > > > http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/
> > > > > PermissionsInstaller.jsm#46 tells it should be implicitely granted but the
> > > > > code seems to not honor the described matrix.
> > > > > 
> > > > > Moving component and assigning David Dahl (feel free to re-assign).
> > > > 
> > > > I think the geolocation permission is not implicit as it is listed in the
> > > > PermissionsTable.
> > > > 
> > > > Have you tested with a change to the manifest adding permissions like:
> > > > 
> > > > http://mxr.mozilla.org/mozilla-central/source/dom/tests/browser/test-webapp.
> > > > webapp#5
> > > 
> > > By matrix I mean
> > > https://docs.google.com/spreadsheet/
> > > ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
> > > 
> > 
> > The maps app is not a certified app right? So it will always prompt for
> > geolocation. Where do you see the bug in the PermissionsInstaller.jsm?
> 
> Ok, wait. So is the only fix for this to make the maps app certified and
> packaged?

Right, it would have to be certified and packaged with geolocation called out in the permissions property in order to get implicit permissions.

See the permissions matrix under "geolocation" - you'll see that:

- Web content - PROMPT_ACTION
- Installed web app - PROMPT_ACTION
- Privileged web app - PROMPT_ACTION
- Certified web app - ALLOW_ACTION
The maps app should not just 'have access' - fwiw, both android and IoS prompt for access to geolocation. 

The only exception we have is certified apps - for which mozilla has reviewed the code for security/privacy issues. Although to be honest, I kinda feel like geolocation should always be prompted for, but that is a different discussion I think. Note that this prompt should only appear the first time the API is accessed - so it should be in response to the user doing something like 'find my location' so they are expecting the prompt. 

The real issue here is m.here.net asks for location as soon as you open the app, rather than in response to some user access like pressing a 'find my location' button. I think the response here should be feedback to the third-party developer telling them not to grab location on startup.
Reworking title to the actual problem. This is a tech evangelism outreach problem. Not a bug in gecko or gaia.
Summary: PermissionsInstaller.jsm does not honor the permission matrix → Maps app asks for geolocation upon startup - should ask only by user input
No longer blocks: finalize-permissions
blocking-basecamp: ? → -
Component: General → Mobile
Product: Boot2Gecko → Tech Evangelism
Donovan, unless someone else has a suggestion for how to fix this issue in Mozilla code, I think the ball is back over to you to speak with Nokia.

I have moved this back to the B2G::General component as this is an issue with an app that ships on device.
Assignee: nobody → dpreston
Component: Mobile → General
Product: Tech Evangelism → Boot2Gecko
(In reply to Lawrence Mandel [:lmandel] from comment #19)
> Donovan, unless someone else has a suggestion for how to fix this issue in
> Mozilla code, I think the ball is back over to you to speak with Nokia.
> 
> I have moved this back to the B2G::General component as this is an issue
> with an app that ships on device.

No, this doesn't belong in b2g general. This is an evangelism problem. Whether that is tracked by our compatibility group or not is irrelevant to what goes into that component.
Component: General → Mobile
Product: Boot2Gecko → Tech Evangelism
Agreed. It seems to me that this bug falls in a different bucket than evangelism as it is an on device issue. However, I'm fine leaving the bug here as well.
(In reply to Lawrence Mandel [:lmandel] from comment #21)
> Agreed. It seems to me that this bug falls in a different bucket than
> evangelism as it is an on device issue. However, I'm fine leaving the bug
> here as well.

Not a device issue. There's no gecko or gaia changes required here. The maps app is hosted app - the problem here is on the hosted code. It's a mobile site issue.
(In reply to Lawrence Mandel [:lmandel] from comment #19)
> Donovan, unless someone else has a suggestion for how to fix this issue in
> Mozilla code, I think the ball is back over to you to speak with Nokia.

Yes. I will speak to them about it.
Whiteboard: [3rd-party-preloaded-apps]
Hi guys, here some comments from Nokia:
We expect the OS/browser to ask the user for permission that his/her location is used. Do we need to be a certified app? Which other advantages does that bring us? (performance?) 

If the answer is 'none', then just make the app a privileged app, and have it popup the user permission dialog. That is exactly how it is designed. (We cannot leave this functionality out, because it will impair the user experience incredibly on the first use case for a maps app, which is 'look around you on the map to see what is around you')

If the answer is not 'none', then we can make one adjustment on the app's side in our first-time start-up experience, where we show our disclaimer. We can include a message in the disclaimer that we will ask the user to use his/her location. The user can then press cancel in the disclaimer if he disagrees, but will not be able to use the app for other use cases - so I hope we don't have to go this way.

Let me know.
(In reply to Andy from comment #24)
> Hi guys, here some comments from Nokia:
> We expect the OS/browser to ask the user for permission that his/her
> location is used. Do we need to be a certified app? 

You don't have to change your app status for being able to prompt for geolocation usage.
Our security model allows all apps and web content to access geolocation after asking for permission. We ask for permission when an app uses navigator.geolocation. (Certified apps currently don't prompt but we might change this):

- Web content - PROMPT_ACTION
- Installed web app - PROMPT_ACTION
- Privileged web app - PROMPT_ACTION
- Certified web app - ALLOW_ACTION

I think the problem here is that the maps app checks for navigator.geolocation during app startup and this results in a prompt during startup and not when the user actually wants to get the current location.

Is it possible to use the geolocation object when the user wants to get the current location?

> Which other advantages
> does that bring us? (performance?)

There is no real advantage. You can access more APIs that you probably don't need.
Hi all - A few thoughts from a privacy perspective: 

The Maps app should prompt a user for geolocation upon first use - this would not be a surprising action
That isnt the problem, I filed this because I would not expect a maps application that has been installed to need to ask for my location, I do not remember having ever being asked on iOS or Android, Its possible I am wrong on that though.

But it is not a 'problem' that the maps application attempts to open in your surrounding area, thats very much a feature as Andy said.
Sorry by 'that' I was referring to the map opening at your current location, in reply to gwagners comment
So if we are happy with showing the prompt on startup, it works as expected and we can close this.
Let me start again as I was cut off...

Hi all - A few thoughts from a privacy perspective: 

The Maps app should prompt a user for geolocation upon first use - this is probably what most users expect. It would not be a surprising action as this behavior has reasonable parity with the other platforms. The privacy team agrees with Paul in comment #17 that "The maps app should not just 'have access'". Asking for location permission on first use is a good balance between just having access (which would violate some users' expectations) and forcing a user to hit the "locate me" button before giving them nearby info.

There would be a privacy concern if the app had automatic access to your location and attempts to open in your surrounding area without asking for permission first.
This confirms Dale's conclusion (comment 29). So if you show the prompt at startup, we will be happy. Thanks!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Product: Tech Evangelism → Web Compatibility
Component: Mobile → Site Reports
You need to log in before you can comment on or make changes to this bug.