Commit Graph

250 Commits

Author SHA1 Message Date
Carlos Valdivia
51b651aea1 introduce GET_PASSWORD_PRIVILEDGED permission.
That will be used to filter in passwords for Session based
AccountManager flows.

Bug: 27590532
Change-Id: I4a6d0540bcff186e416351a6f719600ce35d86a0
2016-04-01 10:55:34 -07:00
Ian Pedowitz
358e51f3d1 Revert "Permissions: Get rid of GET_ACCOUNTS"
This reverts commit d39600585b.

Bug: 27665091
Change-Id: I7d017ba7062ac594225229436d2877c7d21fb065
2016-03-15 17:08:27 +00:00
Carlos Valdivia
d39600585b Permissions: Get rid of GET_ACCOUNTS
Second attempt. Still need to add strict mode violation checks and
logging.

Bug: 21901286

This reverts commit bf33bd4d31.

Change-Id: I5d73343544c32ce4fc4c377ba44db8e677a1287d
2016-03-13 17:13:54 -07:00
Jeff Sharkey
f8880561e6 When system server goes down, crash apps more.
Similar to first patch, but now using new "rethrowFromSystemServer()"
method which internally translates DeadObjectException into
DeadSystemException.  New logic over in Log.printlns() now
suppresses the DeadSystemException stack traces, since they're
misleading and just added pressure to the precious log buffer space.

Add some extra RuntimeInit checks to suppress logging-about-logging
when the system server is dead.

Bug: 27364859
Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
2016-02-27 17:17:01 -07:00
Carlos Valdivia
bf33bd4d31 Revert "Permissions: Get rid of GET_ACCOUNTS"
This reverts commit 918c55a67c.

Change-Id: I995f134336bf61ac1f21052355900ae89d0d6694
2016-02-02 15:01:56 -08:00
Carlos Valdivia
3cdbc806ff Merge "Permissions: Get rid of GET_ACCOUNTS" 2016-01-27 00:12:06 +00:00
Sandra Kwan
0b84b456a7 AccountManager: add finishSessionAsUser api.
Change-Id: I9a08d957a9b25be4c6cf12e4ed35cdc0bfbb8605
2016-01-25 10:09:20 -08:00
Carlos Valdivia
918c55a67c Permissions: Get rid of GET_ACCOUNTS
Bug: 21901286

Change-Id: Id2c42f4d449a32c88078d80dcf952d15e67d536c
2016-01-24 14:57:03 -08:00
Sandra Kwan
390c9d2d91 AccountManager: add isCredentialsUpdateSuggested API.
Change-Id: I27e0db0345f3431b796a944740dab767b45f7871
2016-01-20 13:58:49 -08:00
Amith Yamasani
12747879b0 User creation with an intent
New API for an app to request creating a new user with
a given user name and seed account information for the
SetupWizard to use when that user is switched into.

Also adds system APIs to read the seed account data from
UserManager.

Bug: 22776757
Change-Id: I0bc3f11ee19c15e0ee2a908c88d98b13296cc30d
2016-01-15 17:06:35 -08:00
Sandra Kwan
a578d11470 AccountManager: make account session APIs SystemApi.
Make startAddAccountSession, startUpdateCredentialsSession and
finishSession Apis SystemApi.

Change-Id: Iaedfe546e9b87a2ee8dd2d19e8c28b7f1d59c111
2016-01-11 00:14:25 -08:00
Sandra Kwan
920f6ef983 AccountManager: add finishSession(...) API.
Adding finishSession API to AccountManager and
AbstractAccountAuthenticator.

Change-Id: I153dd2bb6fe01d2e4b10b41e8b553f59da26bd29
2015-12-04 15:32:47 -08:00
Sandra Kwan
e68c37eead AccountManager: add startUpdateCredentials API.
Adding startUpdateCredentials API to AccountManager and
AbstractAccountAuthenticator.

Change-Id: Id9a1ff86764f2fde01fd8482594e4ae34e1f3bd1
2015-11-20 16:44:31 -08:00
Sandra Kwan
7881228736 AccountManager: add startAddAccount API.
Adding startAddAccount API to AccountManager and
AbstractAccountAuthenticator.

Change-Id: I29e1defb2181ece1281534db0e36b28457085148
2015-11-18 18:25:08 -08:00
Fyodor Kupolov
02cb6e773b Added --restricted option for create-user command
Also moved restricted profile create/setup logic from Settings to
UMS.createRestrictedProfile.

Bug: 24212155
Bug: 24303609
Change-Id: I0346a3368de53f4bb4b6e054349f19adac959d7f
2015-09-28 10:01:54 -07:00
Bart Sears
9249a90977 Revert "Added --restricted option for create-user command"
This reverts commit 737b216b5c.

Change-Id: I4c43967933bb2e46cdb8ad6e643d7037d722cab2
2015-09-26 01:58:59 +00:00
Fyodor Kupolov
737b216b5c Added --restricted option for create-user command
Also moved restricted profile create/setup logic from Settings to
UMS.createRestrictedProfile.

Bug: 24212155
Bug: 24303609
Change-Id: I5f0d48bcbd3c0b51927926b874fd057c15ac5219
2015-09-25 11:22:13 -07:00
Svetoslav
f3f02ac931 Add get_accounts app op
For each runtime permission we have an app op to toggle the
permission for legacy apps as they cannot handle permission
revocations. We were lacking an app op for get_accounts
which prevented the user from controlling access to accounts
regardelss that they change the state of the permission
toggle in the UI. Even worse the permission UI is written
with the assumption that every runtime permission has an
app op and as a result revoking the contacts group (if the
app requests the get_accounts permission) is reset back to
allowed in the UI.

bug:23854618

Change-Id: I12b83dfd22974d130e5b8e7a195421120813e2db
2015-09-09 07:31:17 -07:00
Xiaohui Chen
75f68ce1bd Clean up USER_OWNER in AccountManager
Refactor copyAccountUser to take an explicit user handle instead of
hardcode to owner.  This requires refactoring one app that uses this
Api.

Bug: 19913735
Change-Id: Ib9b11d8155bea2a58974d09ec2d70bc756d46313
2015-08-18 18:00:50 +00:00
Ian Pedowitz
6cc066df7a Revert "Revert "Permissions: GET_ACCOUNTS permission cleanup""
This reverts commit 845d14db90.

Bug: 22942480
Bug: 22902898
Change-Id: If2d0e11594284414953c3dd45475fc7ba3366295
2015-08-05 14:25:15 +00:00
Ian Pedowitz
845d14db90 Revert "Permissions: GET_ACCOUNTS permission cleanup"
Temporarily revert ag/735253 until b/22902898 can be resolved with a
proper DMAgent prebuilt drop.

This reverts commit e7ed827a10.

Bug: 22902898
2015-08-04 07:47:37 -07:00
Carlos Valdivia
26ae600b5f Merge "Permissions: GET_ACCOUNTS permission cleanup" into mnc-dev 2015-07-30 21:58:16 +00:00
Carlos Valdivia
e7ed827a10 Permissions: GET_ACCOUNTS permission cleanup
First, getAccounts*() will now return all available accounts depending
on both GET_ACCOUNTS grants and signature matching. This is different
from before where a caller of getAccounts() would need GET_ACCOUNTS to
get any accounts, but if that same caller called getAccountsByType, they
might have gotten back accounts if they shared a signature with the same
developer.

Second, cleaned up some NPEs and javadoc.

This change was motivated by progress on the cts tests.

Change-Id: I2f36226780e074fdf58214b46de3b79d8319ace1
2015-07-30 09:18:53 -07:00
Simranjit Singh Kohli
210baceaa1 [Improve docs for AccountManager]
Currently, the docs for AccountManager are somewhat misleading and may
cause developer errors. To avoid them, we are properly documenting it.

Bug: 21924096
Change-Id: If775a54a09219b0f1623d2ff903085b9d12aa863
2015-07-29 19:43:16 -07:00
Craig Lafayette
3c9c71d36e Prevent null allowableAccounts from crashing
The javadoc for newChooseAccountIntent says that a null
value for the allowableAccounts parameter is valid and
an acceptable default. This CL makes sure that when this
parameter is null, a NullPointerException is not thrown.

Bug: 22475546
Change-Id: Ieb0d67dd02628e1ae5629499b3be3c6382efc9aa
2015-07-14 11:09:58 -04:00
Carlos Valdivia
a3db8acf3d Revert "Revert "Security: AccountChooser shouldn't auto reveal accounts.""
Fixes api stuff.

This reverts commit f2d248db80.

Change-Id: I75c05a17ebde4f245e1f3e0cc22e622d06534c4b
2015-07-10 14:47:07 -07:00
Baligh Uddin
f2d248db80 Revert "Security: AccountChooser shouldn't auto reveal accounts."
This reverts commit c3b3f46d5f.

Change-Id: I6d156e1ad82c052606f76644fe6085f14e82a734
2015-07-10 03:01:47 +00:00
Carlos Valdivia
c3b3f46d5f Security: AccountChooser shouldn't auto reveal accounts.
Bug: 9739125
Change-Id: Ib9032271def423aaafdab2505afaf6b1d3fcad06
2015-07-09 18:18:22 -07:00
Carlos Valdivia
c37ee22714 Tweak GET_ACCOUNTS behavior and improve memory.
Related to recent permissions and system health changes. This change
will make it so that calls to AccountManager#getAccountsByType will work
for the owning account authenticator even if they don't have
permissions. This is pretty fundamental to having a working
authenticator and it doesn't make sense to have it be disabled (or have
authenticators hack around the framework).

Also changed how TokenCache works so that memory usage is still
predictable (no more than 64kb) but token caching won't be at the mercy
of garbage collection. This is important for writing stable cts tests.

Change-Id: Ib31b550616b266ee5a04eb26b04ba0023ca0cb83
2015-06-30 19:30:36 -07:00
Simranjit Singh Kohli
0b8a7c00bd [Modify LastAuthenticatedTimestamp behaviour]:
We should not modify lastAuthenticated timestamp in authenticator
specific api's, as some of the calls maybe used by authenticators
for internal maintainance/upgrade. Only modify the timestamp when
calls effecting accounts is made to non-authenticator developer api's.

Bug: 21959561

Change-Id: I7b2d0c875957b263c4d9b203fe1f33042a65a58f
2015-06-19 17:12:38 -07:00
Carlos Valdivia
6eb73a5778 Revert "Revert "Permissions: Fix account related permissions.""
This reverts commit dcddc47665.

Change-Id: Ie2402167fc7cd3d5e57bf2fba704fdf00cfcb4fe
2015-06-11 14:10:04 -07:00
Carlos Valdivia
dcddc47665 Revert "Permissions: Fix account related permissions."
This reverts commit ffb46022b3.

Change-Id: I4c62b1b5a5bd4e2a5fac76244a16730526ed67fc
2015-06-11 20:04:04 +00:00
Carlos Valdivia
ffb46022b3 Permissions: Fix account related permissions.
Requires updating the docs in AccountManaager as well as the logic in
AccountManagerService.

MANAGE_ACCOUNTS, USE_CREDENTIALS, and AUTHENTCATE_ACCOUNTS are going
away. Where AUTHENTCATE_ACCOUNTS was required we now do signature
matching.

GET_ACCOUNTS is kept but has been grouped under contacts.

Bug: 20136477
Change-Id: Iabbb76dce8d1efc607c1f107911d7ddab598a481
2015-06-11 11:07:47 -07:00
Carlos Valdivia
91979be880 System Health: Support expiring tokens
In the past android:customTokens=true authenticators were required to handle
their own token caching. This is detrimental for battery when high traffic
authenticators are constantly spinning up processes to start services to do
file io to check their own caches.  This change allows authenticator
implementers to optionally let the framework do some of the work for them by
providing the framework with a expiration time.

The AccountManagerService will make a best effort to re-use the cached
token if possible.

Bug: 21530782

Change-Id: I16a7edba36a220e3891e55cf61c725c2be863323
2015-06-02 09:58:18 -07:00
Simranjit Singh Kohli
734f8fb69d [ChooseAccount/AccountManager.newChooseAccountIntent Bug Fixes]
Fixing lots of bugs related to the ChooseAccount Activities.
1. Fix jank which is seen when no accounts are present on the device.
2. After addition of the account, return to the user.
3. Don't crash when the user provides null to allowableAccountTypes.
4. Updated documentation of AccountManager#newChooseAccountIntent.
5. Fix NPE.

Bug: 13104800
Bug: 17926560
Bug: 9626001

Change-Id: I0d1913e46560cfb458526a7c930a38049602d8f1
2015-05-22 17:19:21 -07:00
Tor Norbye
80b530afdb Add permission annotations on the AccountManager
Also add some @NonNull and @Nullable annotations.

Change-Id: Ia42b1af21ed14691b2268ea8b0f55d1b8b5ea2a3
2015-05-04 06:29:55 -07:00
Simranjit Singh Kohli
1663b44cfd [Update API]:
Rename accountAuthenticated to notifyAccountAuthenticated and other
changes.

Bug: 20642769
Change-Id: I7e69d6a9492691429af0d7c2f405e01e265fcedd
2015-04-28 12:57:28 -07:00
Simranjit Singh Kohli
6c7c4ada8b [Auth:Last Credentials Timing] : Introducing API
Storing last successful sign-in/authentication timings, and providing that
information as extra's in updateCredentials and confirmCredentials.
Also, adding a new api: AccountManager#accountAuthenticated(Account).

Change-Id: Icd0dac35b13d61bc28a2e045b96caefffeb353be
2015-03-30 11:08:18 -07:00
Esteban Talavera
22dc3b7ba1 New AccountManager method to copy accounts between users.
Adding the copyAccountToUser method which copies an account
along with its credentials to a different user.

Also an extra in the public api to identify the account to migrate
during provisioning.

Bug: 17716971
Change-Id: I2f29f1765ba0d360a3894b13ef86253b7c7d3284
2014-11-14 11:09:27 +00:00
Simranjit Singh Kohli
8778f993ae [RemoveAccount API]: Adding support for intent.
Adding support for intent handling provided by authenticators.

Bug: 18292092

Change-Id: I1e94422bc28e5fd54c454ee6542ff2d30f82849f
2014-11-07 18:37:30 -08:00
Alexandra Gherghina
f7f8fd64c8 Update string for account manager failures
Bug: 14642886
Change-Id: I200e38c7a93990787a3d6e01a583fe8ba193a987
2014-07-28 07:41:40 +00:00
Carlos Valdivia
f193b9a61d Allow authenticators to rename accounts.
Bug: 16390602

Change-Id: I4f7250726a2c7677e0ccaa6e5f995153893d8360
2014-07-21 13:56:45 -07:00
Alexandra Gherghina
999d394ade Ads per-user APIs to manage accounts through the AccountManager
Bug: 16056552
Bug: 14642886
Change-Id: I17ff6c2515285e63c84cecf2f861d10666c393c5
2014-07-17 17:08:49 +00:00
Alexandra Gherghina
c1cf161af0 Modifies APIs for retrieving managed profile accounts.
This is needed for Account Settings UI.

Bug: 13656853
Change-Id: I33129e4b7b33b428a7bf670259accacb60f62d9b
2014-06-12 18:39:33 +01:00
Alan Viverette
8eea3ea559 Add APIs for obtaining themed Drawable from Theme, Context
BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
2014-02-03 18:42:24 -08:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Joe Malin
64f2227bbc am 8811154e: am 423f8a8c: am 2618ac55: am a37bda7b: am 468d82bb: am 6bf45dc7: am b6a35268: B9257437: Typo in javadoc for AccountManager
* commit '8811154e9369ff936c35f355034ec1f6aafa984e':
  B9257437: Typo in javadoc for AccountManager
2013-06-03 14:34:00 -07:00
Joe Malin
423f8a8c21 am 2618ac55: am a37bda7b: am 468d82bb: am 6bf45dc7: am b6a35268: B9257437: Typo in javadoc for AccountManager
* commit '2618ac55a94a97e29abd9defa93dea30e067b4e4':
  B9257437: Typo in javadoc for AccountManager
2013-06-03 14:27:50 -07:00
Joe Malin
b6a35268cc B9257437: Typo in javadoc for AccountManager
Change-Id: I5349c2a0ba7e831d205f2801daecc24fa9a5b5a6
2013-06-03 12:20:08 -07:00
Amith Yamasani
5a3915b06b UX compliance for error messages
Bug: 9122154
Change-Id: I4a64750f11845a230321450bc6a2955cb73e3b6d
2013-05-30 10:37:38 -07:00