1

Ive been following the tutorial from Google Smart Lock , i can successfully save, start the account list Dialog:

enter image description here

enter image description here

However i dont want to use the popups from google to choose the accounts. I wonder if i can customise the Dialog in the second picture or : Is there a way i can retrieve all the credentials at once?

in the sample code i can see:

else if( status.getStatusCode() == CommonStatusCodes.RESOLUTION_REQUIRED ){
                            resolveResult(status, RC_CREDENTIALS_READ);
                        }



 private void resolveResult(Status status, int requestCode) {
            try {
                status.startResolutionForResult(MainActivity.this, requestCode);
            } catch (IntentSender.SendIntentException e) {
                Log.e(TAG, "Failed to send Credentials intent.", e);
            }
    }

then in the source code of this status class:

enter image description here

I assume that its sending a pendingintent to another application?

Anyway, there's no way i can just retrieve the credentials at once if there are more than 1 credentials i saved.

Is it possible to do this?

Qing
  • 1,401
  • 2
  • 21
  • 41
  • Unfortunately, it's not possible to customize the dialog or retrieve all the credentials without user interaction. Let me know what your concerns with the dialog are or what you would like to customize and I'll see what might be possible! – Steven Feb 24 '16 at 23:46

1 Answers1

3

I'm the product manager for Smart Lock at Google:

No, unfortunately, when multiple credentials are stored for the Google Account(s) on the device, a system dialog needs to be shown to allow the user to pick and this cannot be customized by the calling app. Only the credential selected by the user will be returned to the calling app for privacy and security reasons.

In practice, we find that most users use a single account for most apps, so auto sign-in is the most common scenario and the dialog is a much less common user flow.

Please leave a comment with any feedback on your concerns about the dialog or what you feel could be improved. Thanks!

Steven
  • 3,812
  • 23
  • 38
  • The popup dialog just has two buttons, one is "never", and other is "save password". if a user accidentally click "never", the SmartLock will be disabled until he use a chrome app to delete the "never saved password" item, which is way too many steps for a "lazy user" , and it is very likely that this user may not use the SmartLock like forever. – Qing Feb 25 '16 at 02:48
  • In our opinion , if a user doesnt want to save his password to SmartLock just once, its very likely that he will click "never" since the Dialog just has two buttons.... Few of them know if they click anywhere else in the screen they can just dismiss the Dialog.... and once they click never, they lose the chance to enjoy SmartLock ;( So we suggest if google can offer 3 buttons for the Dialog, "never", "no"," save password ", which will be easier for user to understand what they are doing ;) Wonder if you consider this as a good suggestion and forward it to the SmartLock team – Qing Feb 25 '16 at 02:48
  • And also, if a user just has one credential saved in smartlock, whenever you call Auth.CredentialsApi.request() , you will see a popup on the left bottom of your screen indicating the id of the credential... is there a way not show it? thank you so much Steven – Qing Feb 25 '16 at 03:04
  • These are good questions. Could you post the one about save dialog Never behaviour as a separate question and I will write a full answer explaining why we built it this way? For the blue bar, there is a similar existing question, let me see if I can answer there. http://stackoverflow.com/questions/34800713/how-do-i-control-the-smartlocks-blue-banner – Steven Feb 28 '16 at 03:07
  • hey Steven Ive posted my question here, thanks for answering http://stackoverflow.com/questions/35679294/why-google-smart-lock-dialog-just-has-two-options-never-and-save-without-an – Qing Feb 28 '16 at 05:59
  • Hey Steven: When dismissing the multiple credentials dialog by touching outside your dialog has enabled the click event to propagate down to the underlying UI hence introducing issues with clicking items unintentionally. I don't think this is default behaviour for dialogs so I am curious why this has been implemented for the smart lock dialog. – Joakim Jul 31 '17 at 08:40
  • 1
    Ya, the click outside going through to the UI below is known bug on the backlog to fix :/ – Steven Jul 31 '17 at 21:19