New issue
Advanced search Search tips

Issue 656418 link

Starred by 6 users

Issue metadata

Status: Available
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: ----

Blocked on:
issue 660984



Sign in to add a comment

[Chrome Identity] Check for "Contacts" permissions at runtime on Android 6.0+

Reported by boswelj...@gmail.com, Oct 16 2016

Issue description

Device name: Any

From "Settings > About Chrome"
Application version: Any
Operating system: Android 6.0+ (Api23+)

URLs (if applicable):

Steps to reproduce:
(1) Install Chromium
(2) Realise you cannot sign into a google account

Expected result:
A screen listing available accounts to sign in with

Actual result:
A button that takes us to the new account page

Work-around:
If you grant Chromium contacts permissions manually before completing the setup process, it works (sorta)



 
I'm working on adding a permission dialog to the sign in screen, but theres still google firebase requests after signing in that we need to deal with :/

Comment 2 by bauerb@chromium.org, Oct 17 2016

Cc: gogerald@chromium.org ew...@chromium.org
Components: Services>SignIn UI>SignIn
Status: Untriaged (was: Unconfirmed)

Comment 3 by ew...@chromium.org, Oct 17 2016

Status: WontFix (was: Untriaged)
Chrome will have the necessary permissions by default to make sign in work. I'm not sure that non-official Chromium builds get the necessary permissions by default.

I think this is working as intended, though. gogerald@ - does that sound right to you?

Marking as WontFix for now.
Yeah, that sounds correct to me, non-official Chromium builds do not get the necessary permissions by default. Here might be a good start for how to get proper keys https://www.chromium.org/developers/how-tos/api-keys.
BUG=656418
Nonofficial builds? I've got all the api keys loaded and they work, its just missing permissions are a headache

Comment 6 Deleted

Comment 7 by ew...@chromium.org, Oct 19 2016

Owner: gogerald@chromium.org
Status: Assigned (was: ass)
Re-assigning to Ganggui so he can double check to make sure we have the XML file correctly set up so that non-official builds (i.e. non-Chrome builds, such as Chromium) correctly ask for permissions.
I did not see this problem with the latest ChromePublic.apk on Android 5.0. Account permissions look correct in the code https://cs.chromium.org/chromium/src/chrome/android/java/AndroidManifest.xml?rcl=0&l=41.

Not sure how you installed chromium. '-g' flag is needed to grant all permissions if 'adb install' is used. If it is installed by clicking ChromePublic.apk, a dialog should popup for permissions.
Try it on android 6.0+.. It thinks chromium will ask for them at runtime,
and thus none are granted

sign-in on api23+

5.0. Account permissions look correct in the code
https://cs.chromium.org/chromium/src/chrome/android/java/AndroidManifest.xml?rcl=0&l=41.

permissions if 'adb install' is used. If it is installed by clicking
ChromePublic.apk, a dialog should popup for permissions.
I did test -g flag (Grant all permissions listed in the app manifest) with adb install on Android 6.0+. It worked for me.
I'm not saying it doesn't work with permissions, but it doesn't ask for
contacts permissions on first run. Thus you cannot sign in until you
manually grant contact permissions

Comment 12 by ew...@chromium.org, Oct 31 2016

So just to make sure I understand:

- On Android 6.0+, apps have to ask for permissions at runtime
- If you don't install via adb (with the -g flag), Chromium doesn't have the necessary permissions
- And Chromium doesn't have the requisite code in place to ask for permissions on first run, if they haven't already been granted.

Ganggui, it sounds like we need to add some code that prompts the user to grant the permissions from the app manifest file at runtime for Android 6.0, if they haven't already been granted (by adb -g). Does that sound right?
Yes, I have made a temporary patch for that, but it needs a lot of work
Replay #12 and #13, sounds right to me for public build Chrome, Android changes it's way to grant permissions from 6.0. If the public build Chrome is just for debug purpose, '-g' flag it a good way to work around it for now.



Comment 15 by ew...@chromium.org, Oct 31 2016

Summary: Ask for permissions at runtime listed in app manifest on Android 6.0+ (was: Broken Google sign-in on api23+)
Right, but I guess we'd still want to do this for non-debug reasons as well.

I'm updating the title to accurately reflect this feature request. Ganggui - feel free to re-assign to someone on the Clank team if you don't have time to pick this up. This seems more like a Clank-specific feature request than a sign in specific one, since it's related to permissions on Android.
It might be sign in related, since user can revoke permissions after grant them at any moment, that means we should check permission when we need it (probably prompt to ask for permission again).

BTW, this is the case for non-Google-Official build Chrome, but not only public build chrome as mentioned in comment #14.

Assign to bzanotti@ since he is taking over this component.


Comment 17 by ew...@chromium.org, Oct 31 2016

Is sign in the only component that needs some permission from Android though? I can imagine that there might be other features in Clank that depend on permissions from Android.

If this is really a sign in-specific issue, then that's fine. But if the issue of requesting permissions at runtime when they're needed is more general to Android, it might make more sense for someone on the Clank team to own this.
Owner: bzanotti@chromium.org
Agree, it makes sense for someone on the Clank team to implement a general interface/mechanism for all permissions. But we still need to make some changes in sign in to check permission since the permission can be revoked by user at any moment (it's not one time setting).

Comment 19 by ew...@chromium.org, Oct 31 2016

OK, got it. I'll keep the focus of this bug on the sign-in specific piece then, since that's largely what we've been discussing here. I'll file another bug for creating the general framework for asking permissions at runtime if they're not available, and mark this bug as blocked on that bug.

Comment 20 by ew...@chromium.org, Oct 31 2016

Summary: [Chrome Identity] Check for "Contacts" permissions at runtime on Android 6.0+ (was: Ask for permissions at runtime listed in app manifest on Android 6.0+)
It seems we already have this general interfaces/mechanism, https://cs.chromium.org/chromium/src/ui/android/java/src/org/chromium/ui/base/AndroidPermissionDelegate.java?rcl=0&l=12. Might just use these interfaces in our sign in code. And we might need to design sign in specific explanation for the pop up dialogue for asking permission.

Comment 22 by ew...@chromium.org, Oct 31 2016

Blockedon: 660984

Comment 23 by ew...@chromium.org, Oct 31 2016

OK, so just followed up on Issue 660984, and it seems as though this really is an Identity-specific issue. I guess for signed builds, we don't even need to request permissions (we just use 1P APIs).

So I think the feature request can be summarized as: for non-signed (i.e. non-official) builds of Chrome, on any version of Android (because users may revoke permissions even on Android 5.0 and before), we should be dynamically checking to see whether we have the requisite permissions when the user tries to sign in, and pop up the contacts permission dialogue if necessary.

Ganggui, does that sound correct?
Quick update: we need the contacts permission whenever the user is already signed in as well to get access to the requisite tokens. So, we should basically prompt for contacts permission if we don't currently have it, the permission is requestable (i.e. the user hasn't checked "never ask again" at some point), and:

- The user is trying to sign in OR
- The user is already signed in

In the first case (user is currently trying to sign in), if the user grants contacts permission, we'll need to refresh the UI for the sign in screen to list the accounts.

Benoit - I'm keeping this filed on you as a low priority request. Only turn your attention to this when you have spare time.
comments on comment #23: users can only revoke permissions after installation on Android 6.0+, so we only need and can request permissions dynamically on Android 6.0+ device for non-official build. 
Ah interesting, okay. You can't revoke permissions on Android 5.0- after installation?

Alright, the feature request is still the same then, just scoped to Android 6.0+.
Project Member

Comment 27 by sheriffbot@chromium.org, Dec 19 2016

Status: Available (was: Assigned)
--Chrome Identity automated triaging--

This bug is Assigned and has gone one month without any activity, so it is being moved to Available to indicate that it is not actively being worked on. If you are working on this bug, please mark yourself as the owner and move back to Assigned. Please see https://goo.gl/78kbny for more details. Please remove the Services>SignIn or UI>Browser>Profiles components if this bug isn't related to Chrome Identity.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Owner: bsazonov@chromium.org
Cc: msarda@chromium.org jlebel@chromium.org bsazonov@chromium.org
 Issue 597550  has been merged into this issue.
Status: Assigned (was: Available)
Issue 689688 has been merged into this issue.
Project Member

Comment 32 by sheriffbot@chromium.org, Aug 7 2017

Status: Available (was: Assigned)
--Chrome Identity automated triaging--

This bug is Assigned and has gone one month without any activity, so it is being moved to Available to indicate that it is not actively being worked on. If you are working on this bug, please mark yourself as the owner and move back to Assigned. Please see https://goo.gl/78kbny for more details. Please remove the Services>SignIn or UI>Browser>Profiles components if this bug isn't related to Chrome Identity.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 33 by iuliah@google.com, Aug 11 2017

I would like this feature too!
Status: Assigned (was: Available)
Keeping this assigned.
Project Member

Comment 35 by sheriffbot@chromium.org, Sep 15 2017

Status: Available (was: Assigned)
--Chrome Identity automated triaging--

This bug is Assigned and has gone one month without any activity, so it is being moved to Available to indicate that it is not actively being worked on. If you are working on this bug, please mark yourself as the owner and move back to Assigned. Please see https://goo.gl/78kbny for more details. Please remove the Services>SignIn or UI>Browser>Profiles components if this bug isn't related to Chrome Identity.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -jlebel@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 38 by sheriffbot@chromium.org, Sep 3

Status: Available (was: Assigned)
--Chrome Identity automated triaging--

This bug is Assigned and has gone one month without any activity, so it is being moved to Available to indicate that it is not actively being worked on. If you are working on this bug, please mark yourself as the owner and move back to Assigned. Please see https://goo.gl/78kbny for more details. Please remove the Services>SignIn or UI>Browser>Profiles components if this bug isn't related to Chrome Identity.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment