summaryrefslogtreecommitdiff
path: root/core/java/android/accounts/AccountManagerService.java
Commit message (Collapse)AuthorAgeFilesLines
* Move lingering services to services.jar.Jeff Sharkey2012-12-111-2548/+0
| | | | | | | | This helps reduce the pressure on framework.jar, and makes it clear that it should only be used by the system_server. Bug: 7333397 Change-Id: I0858904239535380fbf30562b793e277d8c3f054
* Authenticate correct user's account when pattern fails multiple times.Amith Yamasani2012-11-051-5/+27
| | | | | | | | | | | | | | Bug: 7473142 Provide hidden methods in AccountManager for querying accounts and authenticating for a specific user. Lockscreen is running in the system process. Allow only system process to access accounts across users. Also make sure to launch the lock settings screen on the just reset user using startActivityAsUser() Change-Id: Ifefc0039ba2b51396b8bd0268f36d5271a3d8676
* Defer more Account actions until user starting.Jeff Sharkey2012-10-171-1/+0
| | | | | | | | Instead of explicitly scanning OWNER accounts, move to using the "user starting" call path for consistency. Bug: 7358086 Change-Id: Ied3289a074aafa48259d828db1d68804912589b3
* Include all accounts in dumpsys.Jeff Sharkey2012-10-101-17/+53
| | | | | | | | | Allow accounts to be loaded when a user is stopped, but always validate accounts against a freshly queried PMS cache when the user actually starts. Bug: 7276595 Change-Id: I0382064c73123c243bc6f6e5da8fc3d0a8b73442
* Fix build, only invalidate when creating user.Jeff Sharkey2012-10-101-2/+1
| | | | | Bug: 7276595 Change-Id: I322f9d76a682b2d45fc556e35381442458168fe5
* Make RegisteredServicesCache multi-user aware.Jeff Sharkey2012-10-091-70/+64
| | | | | | | | | | | | | | | | | | RegisteredServicesCache is used to track account authenticators and sync adapters, which can vary based on user. This change requires that callers now provide a userId when making cache requests. It continues persisting into a single file for now, which is keyed based on UID. It now watches for package broadcasts from all users, and scans packages on-demand. It changes cache callers to provide a relevant userId, and evicts cache entries when users are stopped. Changes SyncManager to only work with accounts from running users, only kicking off pending syncs once a user is started. Bug: 7276595, 7316150 Change-Id: I79466a84aa69aa37e4bd9691c5d6221d3662ff29
* Fix issue #7214090: Need to be able to post notifications to all usersDianne Hackborn2012-09-241-15/+23
| | | | | | | | | | | | | | | Also fix a bunch of system services that should be doing this. And while doing that, found I needed to fix PendingIntent to evaluate USER_CURRENT at the point of sending, not creation. Note that this may end up with us having some notification shown to non-primary users that lead to settings UI that should only be for the primary user (such as the vpn notification). I'm not sure what to do about this, maybe we need a different UI to come up there or something, but showing the actual notification for those users at least seems less broken than not telling them at all. Change-Id: Iffc51e2d7c847e3d05064d292ab93937646a1ab7
* Merge "Remove Binder.getOrigCallingUid()." into jb-mr1-devDianne Hackborn2012-08-311-10/+13
|\
| * Remove Binder.getOrigCallingUid().Dianne Hackborn2012-08-311-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced all remaining places that used it with explicit user specification. While doing this, I ran into stuff that was creating PendingIntent objects (that now need to specify the explicit user they are for), which are also posting notifications... but have no way to specify the user for the notification. So the notification manager in the system process now also gets a formal concept of a user associated with the notification, which is passed in to all the necessary aidl calls. I also removed the old deprecated aidl interface for posting/cancelling notifications, since we now always need a user supplied. There is more work that needs to be done here, though. For example I think we need to be able to specify USER_ALL for a notification that should be shown to all users (such as low storage or low battery). Along with that, the PendingIntent creation needs to be tweaked to be able to handle USER_CURRENT by evaluating the user at the point the pending intent is sent. That's for another change, however. Change-Id: I468e14dce8def0e13e0870571e7c31ed32b6310c
* | Centralize the creation of the user system directoryAmith Yamasani2012-08-311-2/+2
|/ | | | | | | | | | Environment.getUserSystemDirectory(int userId) Use it all relevant places that was hardcoding it. Also, wipe out the user's system directory when user is removed, otherwise old state might be transferred to a new user. Change-Id: I788ce9c4cf9624229e65efa7047bc0c019ccef0a
* Switch public APIs to use new UserHandle class for identifying users.Dianne Hackborn2012-08-171-1/+1
| | | | | | Gets rid of "yet another integer" confusion. Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
* UserHandle to UserSerialNo mappingAmith Yamasani2012-08-171-1/+1
| | | | | | | | | Use AtomicFile for usermanager files. Added a MANAGE_USERS permission that apps (signature permission) can use to create/query/modify/remove users. Change-Id: I5cf232232d0539e7508df8ec9b216e29c2351cd9
* Rename UserId to UserHandle.Dianne Hackborn2012-08-161-6/+6
| | | | | | This is the start of turning this into a formal public API. Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
* User Manager service to manage users and query user detailsAmith Yamasani2012-08-111-6/+10
| | | | | | | | | | Moved a bunch of methods from PackageManager to UserManager. Fix launching of activities from recents to correct user. Guest creation APIs Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
* Add APIs for interacting across users.Dianne Hackborn2012-08-021-1/+1
| | | | | | | | | | | | | | | | - Expose the existing Context.sendBroadcast() as Context.sendBroadcastAsUser(). - Add new android:singleUser attribute for services. - Add new INTERACT_ACROSS_USERS_FULL permission for full system-level access to cross-user interface (allows sendBroadcastAsUser() to send to any receiver). - Add new INTERACT_ACROSS_USERS_FULL permission for more restricted cross-user interaction: this is required for android:singleUser, and allows you to use sendBroadcastAsUser() but only to send to your own receivers. Change-Id: I0de88f6718e9505f4de72e3f45d29c0f503b76e9
* Delay AccountManagerService initializationKenny Root2012-07-301-2/+5
| | | | | | | | | | Since applications can have Account providers, they need to be delayed until after PackageManagerService says everything is mounted. Otherwise the accounts associated with that provider will be removed immediately when startup happens. Bug: 6820670 Change-Id: Iba81765260421649f706624d0605a40ebc1347b1
* Merge "Preserve account list in order of creation in the database." into jb-devAmith Yamasani2012-05-301-2/+3
|\
| * Preserve account list in order of creation in the database.Amith Yamasani2012-05-301-2/+3
| | | | | | | | | | | | | | | | | | This makes it possible to retrieve the account list in the order of creation, if we want to display them in the account settings screen in that order. Bug: 6579937 Change-Id: I2025aaa8b770fbb78be978dfde64ef95823fd5aa
* | Add an updateAppPermission() API call to the AccountManagerService AIDLFred Quintana2012-05-241-10/+29
|/ | | | | | | | | | and have the GrantCredentialsPermissionActivity call that instead of a static so that it can be made to run in a different process than the AccountManagerService. Protect this call by checking that the caller has the same UID as the system process. Bug: 6545417 Change-Id: I295e65cad68883349a47e7927c171af45c89b229
* Merge "Don't migrate accounts.db if already migrated."Amith Yamasani2012-04-111-2/+5
|\
| * Don't migrate accounts.db if already migrated.Amith Yamasani2012-04-111-2/+5
| | | | | | | | | | | | | | | | | | Some developers accidentally create a blank accounts.db and this was causing accounts to vanish. This safeguards the case where both old and new files exist. Bug: 6168813 Change-Id: I79cf211acc5422ff1c17fe0c9af80c49227b60ac
* | Fix a race condition in SyncManager.onAccountsUpdated()Amith Yamasani2012-04-111-0/+25
|/ | | | | | | | | Get the full list of accounts from AccountManagerService in one shot instead of getting them per user. Bug: 6263091 Change-Id: I488f24749a96281ef1e2a620820399c97f471024
* User management and switchingAmith Yamasani2012-03-271-0/+30
| | | | | | | | | | | | | | | | | | | Broadcast intents that get sent out when users are added/removed/switched. More work on generating user-specific information in package manager queries. APIs to update user name and query a user by id. Removed Package.mSetStopped and mSetEnabled, since they're not user specific. User removal: - Cleanup ActivityManager, PackageManager, WallpaperManager, AppWidgetService and AccountManager. - Shutdown processes belonging to the user. Don't show vibrate option in long-press power if there's no vibrator. Lock the screen when switching users, to force unlocking. Change-Id: Ib23a721cb75285eef5fd6ba8c7272462764038fa
* Merge "Fix an initialization ordering bug due to the userprofile changes."Fred Quintana2012-03-201-2/+2
|\
| * Fix an initialization ordering bug due to the userprofile changes.Fred Quintana2012-03-201-2/+2
| | | | | | | | | | Bug: 6194599 Change-Id: I6ebedec3b5f045374f216aa1419bfdb57141a80e
* | Merge "Bind to the correct instance of the authenticator service."Amith Yamasani2012-03-191-1/+1
|\ \
| * | Bind to the correct instance of the authenticator service.Amith Yamasani2012-03-191-1/+1
| |/ | | | | | | | | | | Otherwise you will see authentication failures on secondary users' accounts. Change-Id: Ia3f8427f68df6048cdca65710bf673ac12a2cddb
* / Use renameTo safely when creating the user 0 account databaseMarc Blank2012-03-181-1/+10
|/ | | | | | | | * Because the user directory probably won't exist, the renameTo in previous code fails silently Bug: 6188815 Change-Id: I6afd1bad9bbd1a36de7e93d9e02ed7172b1ed370
* Make SyncManager and AccountManagerService multi-user aware.Amith Yamasani2012-03-081-184/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | AccountManagerService - Maintain multiple account lists, one per user - Keep multiple databases of accounts - Account db moved to /data/system/users/<userid>/ SyncManager - SyncStorageEngine keeps track of multiple users' accounts. - SyncQueue maintained as a single instance, queueing requests from multiple users. - Changed some methods to take userId arguments - Removed some deadc0de - Store the userId in the SyncOperation, so we know which provider instance to bind to when queued operations are processed. ContentService - Pass along the userid to sync manager calls. ActivityManagerService: - Fixed a bug in cancelIntentSender - Don't bring other user's task forward when resetting tasks. Updated tests Change-Id: If317340ef68e902787aa3f5ceb4cf96f14aea695
* Use Map.Entry, not HashMap.EntryAndy McFadden2012-01-201-1/+2
| | | | | | | Map.Entry is the defined return value from entrySet(). HashMap.Entry shouldn't be used directly. Change-Id: Ia21598c6a73fe7eb22179ce114095f779c903084
* Fixed a bug that causes AccountManager calls to hang forever, eventuallyFred Quintana2011-10-241-5/+19
| | | | | | | | exhausting the binder threads in the gapps process, making it unusable. Bug: 5486091 Change-Id: I82bd197e27c2be1bf82e4e5cc1468e1c6a3e4919
* Merge "b/5399355 StringIndexOutOfBoundsException from AccountManagerService"Costin Manolache2011-10-071-2/+6
|\
| * b/5399355 StringIndexOutOfBoundsException from AccountManagerServiceCostin Manolache2011-10-071-2/+6
| | | | | | | | Change-Id: I13426a8b57d6fcbc7a43ffd61922439b0fae332c
* | Add DUMP permission checks to servicesKenny Root2011-09-291-0/+8
|/ | | | | | | | Some services have info that is not readily available any other way. Add a permission check to those services. Bug: 5389201 Change-Id: I5a9724ec89e1c11ef7813eeb52a6a05b3ea92af5
* For consistency with getAuthToken, pass UID/PID for add account. Needed for ↵Costin Manolache2011-09-121-18/+17
| | | | | | | | | | customizing the add account flow b/5278759 API changes to pass package, options b/5249018 consistent/customized add account UI b/5270079 tag who adds the account Change-Id: I1ee211d751b565c725c89aa1a429ef2f5bebe34a
* Tolerate missing AccountManager resource, not just missing resource nameBrian Carlstrom2011-04-071-4/+8
| | | | | | In addition to the primary change in the subject, also some minor cleanup of javadoc, typos, CloseGuard warning, etc found while working on a new AbstractAccountAuthenticator. Change-Id: I73f3408773a43a0021a15f8d051fd3dbbdf898a5
* resolved conflicts for merge of 17f95e92 to honeycomb-plus-aosprepo sync2011-03-221-16/+0
|\ | | | | | | Change-Id: Ic82ab20e216d810f6372c833ac49c3856449c09c
| * remove the code that clears the passwords when the simFred Quintana2011-03-071-91/+0
| | | | | | | | | | | | | | | | | | | | is replaced with a different one. DO NOT MERGE patched from honeycomb-mr1 Bug: 3404577 Change-Id: If11fc6be817ca1fa3dd5c085ff9696a1c5ea3a03
| * DO NOT MERGECostin Manolache2011-03-011-12/+63
| | | | | | | | | | | | | | | | | | Backport (with modifications ) some changes from Honeycomb, that would allow authenticators to control caching and permissions. This is backward compatible - both new and old authenticators will work with old and new framework, but the functionality will only be present if both sides support it. Change-Id: Ib2838cc2159f45264b38c844cd4c1d6f315d8064
| * Fix bug in permission grant system.Costin Manolache2010-12-091-13/+51
| | | | | | | | Change-Id: Ic7d712e5a672c3eded16fee83235db01ab3c74fa
* | Fix a deadlock in AccountManagerService cause by differentFred Quintana2011-03-011-318/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | paths of code getting the mCacheLock and DB locks in different orders. The philosophy I followed for this was to ensure that the DatabaseHelper is only ever accessed from within a synchronized(mCacheLock) block. I also renamed a bunch of methods to make it easier to know if a given method should be called from within this synchronized block. Bug: 3404506 Change-Id: Ia48f95e77b77647d0717f70f1d8364da3719cc13
* | Merge "Make the AccountManagerService clear old grants when the package that ↵Fred Quintana2011-02-281-0/+35
|\ \ | | | | | | | | | the grants refer to is no longer installed."
| * | Make the AccountManagerService clear old grants when the packageFred Quintana2011-02-281-0/+35
| | | | | | | | | | | | | | | | | | | | | that the grants refer to is no longer installed. Bug: 3425856 Change-Id: I6ec057415c8f35be91c8434ff10e6cf5c1fc47bb
* | | remove the code that clears the passwords when the simFred Quintana2011-02-251-96/+0
|/ / | | | | | | | | | | | | is replaced with a different one. Bug: 3404577 Change-Id: I3149df7040dfc56e91544010ac56b5912964d925
* | Add TelephonyManager.getCurrentPhoneTypeWink Saville2011-02-011-1/+1
| | | | | | | | | | | | | | | | | | The new method getCurrentPhoneType has the old behavior of getPhoneType and does not check for voice capable. This allows code to assume the old behavior. bug: 3198435 Change-Id: I0542838ceca2f757cceb6cd7f795e95fe886523e
* | If 'customTokens', let authenticator handle notification.Costin Manolache2011-01-251-1/+4
| | | | | | | | | | Bug: 3377952 Change-Id: Iffb0ed01c39b42838cf88fd1b332c4b41c3194ec
* | Token cache was not reset on password changeCostin Manolache2011-01-191-0/+8
| | | | | | | | | | Bug: 3365443 Change-Id: I3e85c56810c0d71ddc82d3c6a1dcbba640444564
* | Add back NEW_TASK flag.Costin Manolache2011-01-171-0/+4
| | | | | | | | | | | | b/2510486 suggests we remove it, but this breaks services who can't call the intent without the flag. A different solution is needed to notify when the activity is done. Change-Id: I0b32ead69cf816e105899fdd74e99cc1e8bf5ce3
* | Fix previous quick fix, LoginOptions is final.Costin Manolache2011-01-141-4/+3
| | | | | | | | Change-Id: I5f262458239378697a67cbd8e83175bf3ffc7f5b
* | Fix NPE, caller may not pass loginOptions.Costin Manolache2011-01-141-0/+3
| | | | | | | | Change-Id: Ifb6a8bf876d30a9726f535a90ba8c0719a9a04aa