SlideShare a Scribd company logo
Inside the Android
AccountManager
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
Zoe, Backup, …
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
HTC Account
Zoe, Backup, …
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
HTC Account
Zoe, Backup, …
system_server
Application Process
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
HTC Account
Zoe, Backup, …
system_server
Application Process
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
HTC Account
Zoe, Backup, …
Method
Invocation
system_server
Application Process
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
HTC Account
Zoe, Backup, …
Binder IPC
Method
Invocation
system_server
Application Process
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
HTC Account
Zoe, Backup, …
Binder IPC
Binder IPC
Method
Invocation
system_server
http://www.nds.rub.de/media/attachments/files/2012/03/binder.pdf
Binder
Native IPC mechanism
on Android.
Implemented as kernel
driver and the Binder
framework.
http://www.nds.rub.de/media/attachments/files/2012/03/binder.pdf
Binder
Binder client uses a proxy approach.
Native IPC mechanism
on Android.
Implemented as kernel
driver and the Binder
framework.
http://www.nds.rub.de/media/attachments/files/2012/03/binder.pdf
Binder
The transaction data is called Parcel.
Java objects implementing Paracelable interface can
be converted to Parcels.
Transaction data limit is around 1MB.
Native IPC mechanism
on Android.
Implemented as kernel
driver and the Binder
framework.
http://www.nds.rub.de/media/attachments/files/2012/03/binder.pdf
Binder
Binder server spawns binder threads to handle the
incoming requests automatically.
Native IPC mechanism
on Android.
Implemented as kernel
driver and the Binder
framework.
Android Interface Definition
Language (AIDL)
• To make customized Binder interface.
• Default supported data types include primitives,
String, CharSequence, List, Map.
• Non-primitive type parameters require in / out or inout
tag.
• Custom data types must implement Parcelable, and
declare a corresponding AIDL file.
http://developer.android.com/guide/components/aidl.html
frameworks/base/core/java/android/accounts/IAccountManager.aidl
frameworks/base/core/java/android/accounts/Account.aidl
Inside the Android AccountManager
predefined in
Binder framework
generated from
AIDL
frameworks/base/core/java/android/app/ContextImpl.java
AccountManager
(binder client side) initialization.
frameworks/base/core/java/android/app/ContextImpl.java
AccountManager
(binder client side) initialization.
frameworks/base/core/java/android/accounts/AccountManager.java
AccountManager
(binder client side) initialization.
AccountManagerService
(binder server side) initialization.
frameworks/base/core/java/android/accounts/
AccountManagerService.java
AccountManagerService
(binder server side) initialization.
frameworks/base/core/java/android/accounts/
AccountManagerService.java
Simplified addAccount()
Simplified addAccount()
Binder IPC
Simplified addAccount()
Binder IPC Binder IPC
AccountManagerFuture
Inside the Android AccountManager
main thread
main thread
bkg thread
Inside the Android AccountManager
main thread
main thread
bkg thread
main thread
bkg thread
main thread
Callback through IPC
frameworks/base/core/java/android/accounts/
IAccountManagerResponse.aidl
AccountManager.AmsTask.Response
Application Process
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
Asynchronized Binder IPC call
through interface IAccountManager;
Response returned through interface
IAccountManagerResponse
frameworks/base/core/java/android/accounts/IAccountAuthenticator.aidl
AccountManagerService.Session
AccountManagerService
(binder client side) initialization.
ServiceConnection
ServiceConnection
always on main thread
AbstractAccountAuthenticator
(binder server side) initialization.
frameworks/base/core/java/android/accounts/
AbstractAccountAuthenticator.java
Callback through IPC
frameworks/base/core/java/android/accounts/
IAccountAuthenticatorResponse.aidl
AccountManagerService.Session
Application Process
Account
Manager
Account
Manager
Service
Authenticator
Integrated App
Asynchronized Binder IPC call
through interface IAccountAuthenticator;
Response returned through interface
IAccountAuthenticatorResponse

More Related Content

PDF
Sync on Android
PDF
Android sync adapter
PPTX
Microsoft identity platform community call-May 2020
PPTX
Community call: Develop multi tenant apps with the Microsoft identity platform
PDF
AnDevCon - A Primer to Sync Adapters
PPTX
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
PPTX
Implement Authorization in your Apps with Microsoft identity platform-June 2020
PPTX
Microsoft Graph developer community call-March 2020
Sync on Android
Android sync adapter
Microsoft identity platform community call-May 2020
Community call: Develop multi tenant apps with the Microsoft identity platform
AnDevCon - A Primer to Sync Adapters
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Implement Authorization in your Apps with Microsoft identity platform-June 2020
Microsoft Graph developer community call-March 2020

What's hot (17)

PPTX
Get started azure- Azure Mobile Services
PPTX
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
PDF
Connecting Google API's With Mule ESB
PPTX
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
PPTX
Azure AD B2C Webinar Series: Custom Policies Part 1
PPTX
Developing Apps with Azure AD
PDF
FOSS STHLM Android Cloud to Device Messaging
PDF
Vaadin with Java EE 7
PPTX
Univeral App using O365 API
PPT
OAuth2 Protocol with Grails Spring Security
PDF
Using a Third Party Key Management System with WSO2 API Manager
PPTX
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
PDF
24032022 Zero Trust for Developers Pub.pdf
PDF
Azure AD B2C – integration in a bank
PDF
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...
PPTX
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
PDF
Foreman Single Sign-On Made Easy with Keycloak
Get started azure- Azure Mobile Services
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
Connecting Google API's With Mule ESB
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
Azure AD B2C Webinar Series: Custom Policies Part 1
Developing Apps with Azure AD
FOSS STHLM Android Cloud to Device Messaging
Vaadin with Java EE 7
Univeral App using O365 API
OAuth2 Protocol with Grails Spring Security
Using a Third Party Key Management System with WSO2 API Manager
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
24032022 Zero Trust for Developers Pub.pdf
Azure AD B2C – integration in a bank
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
Foreman Single Sign-On Made Easy with Keycloak
Ad

Similar to Inside the Android AccountManager (6)

PDF
Man in the Binder - Michael Shalyt & Idan Revivo, CheckPoint
PPTX
Man in the Binder
PPTX
Binder: Android IPC
PDF
Csw2016 chaykin having_funwithsecuremessengers_and_androidwear
PDF
Binding android piece by piece
PDF
Understanding binder in android
Man in the Binder - Michael Shalyt & Idan Revivo, CheckPoint
Man in the Binder
Binder: Android IPC
Csw2016 chaykin having_funwithsecuremessengers_and_androidwear
Binding android piece by piece
Understanding binder in android
Ad

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
sap open course for s4hana steps from ECC to s4
MYSQL Presentation for SQL database connectivity
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Inside the Android AccountManager