Share
Embed
Transcript
31 slides
-
AccountManager - Authenticator https://developer.android.com/reference/android/accounts/AbstractAccountAuthenticator.html authenticator.xml <account-authenticator android:accountType=”com.sample” android:label=”SampleServiceName” android:icon=”@drawable/ic_account” android:smallIcon=”@drawable/ic_account”
/> public abstract class AbstractAccounAuthenticator { public abstract Bundle addAccount() public abstract Bundle getAuthToken() android.accounts.AbstractAccountAuthenticator -
AccountManager - Accessor https://developer.android.com/reference/android/accounts/AccountManager.html android.accounts.AccountManager public class AccountManager { public
AccountManagerFuture<Bundle> addAccount(String accountType, ...) public AccountManagerFuture<Bundle> getAuthToken(Account account, ...) -
AccountManager - Mechanism for managing accounts authenticator com.sample app app
1/3 Manage accounts at one app, Access accounts from one app. -
AccountManager - Mechanism for managing accounts authenticator com.sample app app
getAuthToken (com.sample) token getAuthToken (com.sample) token 2/3 Manage accounts at one app, Access accounts from multiple app. -
AccountManager - Mechanism for managing accounts authenticator com.sample app com.sample
app com.sample getAuthToken (com.sample) token getAuthToken (com.sample) token 3/3 Manage accounts at multiple app, Access accounts from multiple app. First installed app Second installed app Third installed app -
AccountManager - Mechanism for managing accounts authenticator com.sample app com.sample
app com.sample getAuthToken (com.sample) token getAuthToken (com.sample) token Uninstall... Second installed app Third installed app 3/3 Manage accounts at multiple app, Access accounts from multiple app. -
AccountManager - Mechanism for managing accounts authenticator com.sample app com.sample
getAuthToken (com.sample) token Second installed app Third installed app 3/3 Manage accounts at multiple app, Access accounts from multiple app. -
Diff API 22 to 23 - Permissions Removed. • android.Manifest.permission.AUTHENTICATE_ACCOUNTS
• android.Manifest.permission.MANAGE_ACCOUNTS • android.Manifest.permission.USE_CREDENTIALS Not removed. • android.Manifest.permission.GET_ACCOUNTS -
Diff API 22 to 23 - Permissions authenticator com.sample app
com.sample app com.sample First installed app Second installed app Third installed app Denied GET_ACCOUNTS Account[] accounts = accountManager.getAccountsByType(“com.sample”); // accounts.length == 3 Denied GET_ACCOUNTS -
Diff API 22 to 23 - Permissions authenticator com.sample app
com.sample app com.sample First installed app Second installed app Third installed app Account[] accounts = accountManager.getAccountsByType(“com.sample”); // accounts.length == 0 Denied GET_ACCOUNTS Denied GET_ACCOUNTS -
Diff API 22 to 23 - Permissions authenticator com.sample app
com.sample app com.sample First installed app Second installed app Third installed app Account[] accounts = accountManager.getAccountsByType(“com.sample”); // accounts.length == 3 Denied GET_ACCOUNTS Granted GET_ACCOUNTS -
Diff API 23 to 24 - Not inherit accounts On
API 23 and before authenticator com.sample app com.sample app com.sample First installed app Second installed app Third installed app account 1 account 2 -
app com.sample app com.sample Uninstall... Second installed app Third installed
app account 1 account 2 authenticator com.sample Diff API 23 to 24 - Not inherit accounts On API 23 and before -
authenticator com.sample app com.sample Second installed app Third installed app
account 1 account 2 Diff API 23 to 24 - Not inherit accounts On API 23 and before -
authenticator com.sample app com.sample Second installed app Third installed app
account 1 account 2 Diff API 23 to 24 - Not inherit accounts On API 23 and before -
authenticator com.sample app com.sample app com.sample First installed app Second
installed app Third installed app account 1 account 2 Diff API 23 to 24 - Not inherit accounts On API 24 and after -
On API 24 and after app com.sample app com.sample Uninstall...
Second installed app Third installed app account 1 account 2 authenticator com.sample Diff API 23 to 24 - Not inherit accounts -
authenticator com.sample app com.sample Second installed app Third installed app
Diff API 23 to 24 - Not inherit accounts On API 24 and after -
authenticator com.sample app com.sample Second installed app Third installed app
On API 24 and after Diff API 23 to 24 - Not inherit accounts empty...