Export to GitHub

ytd-android - issue #14

GlsAuthorizer class does not check account type


Posted on Jul 9, 2012 by Happy Panda

What steps will reproduce the problem? 1. Create a Dropbox account on your Android device using the same email address as one of your Google accounts. 2. Run the YTD sample app 3. Select the "duplicate" Google/Dropbox account 4. The getAccount method in GlsAuthorizer does not check to determine which account is being returned.

What is the expected output? What do you see instead? getAccount should include an additional check:

private Account getAccount(String name) { Account[] accounts = accountManager.getAccounts(); for (Account account : accounts) { if (account.name.equals(name) && account.type.equals("com.google")) { return account; } } return null; }

What version of the product are you using? On what operating system? * r15 of the ytd-android project

Please provide any additional information below.

As mentioned above, I have two accounts on my device that have the same account name, essentially my Gmail address. One @gmail.com address is tied to my Google account and that same email address is the account name for my Dropbox account. So, I have a com.google account type and a com.android.dropbox account type. When the Dropbox account is returned by getAccount, it does not have the proper authToken for the callback in fetchAuthToken.

A simple fix of checking the account type should resolve this issue.

Status: New

Labels:
Type-Defect Priority-Medium