Commit Graph

310 Commits

Author SHA1 Message Date
sunjian
bdabd40c63 Currently, when an account with USER_MANAGED_NOT_VISIBLE is chosen
in ChooseAccountActivity, its visibility doesn't get updated.
However, it is supposed to be updated to USER_MANAGED_VISIBLE.

Bug: 62067445
Test: manual
Change-Id: I2fb942a96d07dff06a53bc48a16ff337c50f3a26
2017-06-19 18:03:34 +00:00
Jian Sun
f1946baae7 Merge "Fix visibility issue in AccountManager.getAuthTokenByFeatures." into oc-dev 2017-06-06 18:30:12 +00:00
sunjian
f29d549c2d Fix visibility issue in AccountManager.getAuthTokenByFeatures.
Bug: 34679769
Test: manual, APCT
Change-Id: I7270a5a5dd681ad088fa28e48d849ba3541e45cd
2017-06-05 13:13:45 -07:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
Dmitry Dementyev
85d8a34ab1 Update AccountManager visibility JavaDoc.
Bug: 36983643
Test: None
Change-Id: I4512ed6d481256d65dabd7efa25acb220c31ae64
2017-05-03 09:56:09 -07:00
Dmitry Dementyev
cbe1bd1d42 Use invalid package names for special keys in AccountManager.
Bug: 37672088
Test: cts, manual.
Change-Id: I7fd40e0646a50f809b5c9b89dfe4242ceb00195d
2017-04-27 19:15:57 +00:00
Dmitry Dementyev
b6a7dc033c Update PACKAGE_REMOVED broadcast.
1) Include KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE.
2) Only send the broadcast to packages which were able to see the
account.

Test: manual, APCT.
Bug:37280078

(cherry picked from commit cbbc99f762)

Change-Id: I3c323e545628199903313096f93654687fa8f22b
2017-04-24 23:57:30 +00:00
TreeHugger Robot
7c8ab2651b Merge "Remove unnecessary casts on calls to findViewById" into oc-dev 2017-04-14 16:56:28 +00:00
Alan Viverette
51efddbd3b Remove unnecessary casts on calls to findViewById
Just frameworks/ this time. More paths to come.

Bug: 24137209
Test: make -j32
Change-Id: Iff27abd26fa43296ac2fff8f534fc6742d2ae80c
2017-04-14 11:15:50 -04:00
Dmitry Dementyev
a461e30053 Add ACTION_ACCOUNT_REMOVED to Account Manager.
AccountManagerService sends an intent with the action when account of any type is removed or renamed.

Test: manual, APCT.
Bug: 37280078

Change-Id: I53b1bb9d6cde1edba5c37ecf3e4e13d748b19005
2017-04-13 21:10:50 +00:00
Dmitry Dementyev
d6f0672e88 Make visible only accounts for which authenticator supports contacts operations
for callers with READ_CONTACTS permission.

Test: manual
Bug: 36983643
Change-Id: I1239a30a71cb13ce9ffff6f38b8506e9686abe4d
(cherry picked from commit d7e7a74179)
2017-04-07 17:50:00 +00:00
Dmitry Dementyev
06e232fbda Don't show empty account list in account chooser.
Use accounts order from getAccounts() method instead of
getAccountsAndVisibilityForPackage(), which is unpredicteble (not linked
HashMap)

Test: manual
Bug: 34684498
Change-Id: Idbd4dc1a4f7d5b5b8a1329b27f01a0793a64245d
(cherry picked from commit b2f1263b25)
2017-03-31 23:35:07 +00:00
Dmitry Dementyev
0f8bba0dc0 Update AccountManager JavaDoc.
Test: none.
Change-Id: Ib996d9c995c75adc4ec755a4fbd359eddbf43e70
2017-03-22 10:04:05 -07:00
Dmitry Dementyev
8882d881f9 Implement runtime account update notifications.
Test: manual, cts.
Change-Id: Iaf9fe4814c3d3c2ca2dca0a5bfa0f997e060bfeb
2017-03-21 15:54:00 -07:00
Jeff Sharkey
32ee8eefd7 Create new BroadcastBehavior annotation.
This will be used to help document the expected behavior of various
broadcast actions defined by the OS.

Also add logic to PackageParser that will then yell at developers
whose manifests are making bad assumptions about which broadcasts
they'll receive.

Test: builds, boots
Bug: 35925551
Change-Id: I059c2bf8aa3ce53d9ff18dcc263db7620cd14bd6
2017-03-08 20:19:31 -07:00
Dmitry Dementyev
06f32e0abd Update AccountManager getAccountVisibility method to better handle default cases.
Test: cts, manual
Change-Id: Ic0f8fef9f928fefa6cc32a91c471969f7d5a4e45
2017-02-16 20:31:05 -08:00
Sudheer Shanka
f88ebeb250 Use correct packageName for checking if it belongs to callingUid.
In AccountManagerService.getAccountsAsUser, we check if opPackageName
belongs to calling uid by calling AppOpsManager.checkPackage. But when
AccountManagerService.getAccountsAsUser is called from
AccountManagerService.addSharedAccountsFromParentUser, we're using the
opPackageName from system context instead of calling context.

Bug: 35258008
Test: cts-tradefed run singleCommand cts-dev --module CtsMultiUserHostTestCases \
      -t android.host.multiuser.CreateUsersPermissionTest#testCanCreateRestrictedUser
Change-Id: I5c425d9314beb86f7c64a5b5c64b7d879711879a
2017-02-14 18:35:05 -08:00
Dmitry Dementyev
e366f82cef Update Account Discovery API.
Use package name instead of uid.
Check calling package name in getAccounts methods.

Bug: 34841115, 34841115
Test: cts tests, manual tests.
Change-Id: I8a9e6aea5e2b6677be4bc414836b842239c5b6ac
2017-02-02 12:41:40 -08:00
Dmitry Dementyev
7b5bbb5509 Merge "Implement Account Discovery API." 2017-01-26 07:53:59 +00:00
Elliot Waite
0ce4b0e4c3 Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9
am: 9b21265b2c

Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
2017-01-26 04:49:33 +00:00
Elliot Waite
28ba4722a9 Fix @links in reference docs. am: 54de77470d
am: ab978c035e

Change-Id: If0d0613362e0ea95cf48eaf9a16d3eea48b589ea
2017-01-26 04:39:57 +00:00
Dmitry Dementyev
01985ff6d2 Implement Account Discovery API.
Inludes temporary flow for notifications filtered by accountType
Bug: 33046496
Test: cts tests, manual tests.
Change-Id: I2d767030e851579a0666efd7e243a1239af740c7
2017-01-25 17:59:47 -08:00
Elliot Waite
54de77470d Fix @links in reference docs.
Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
2017-01-25 17:00:55 -08:00
Dmitry Dementyev
2ae64092c1 Update Account Manager to use latest version of account discovery API.
Bug: 33046496
Test: cts tests, manual tests.
Change-Id: I2791f4f7bab2665a928264da5ccf6a3ab975cea6
2017-01-13 16:25:06 -08:00
Dmitry Dementyev
2e22cfbefb Revert "Implement Account Discovery API."
This reverts commit 58fa836210.

Change-Id: Iffc9c5eb63db382b720b45ff5e8f1948db908a03
2017-01-09 18:42:14 +00:00
Dmitry Dementyev
58fa836210 Implement Account Discovery API.
Bug: https://b.corp.google.com/issues/33046496
Test: cts tests, manual tests.

Change-Id: I03d1ae5dfa1577f191817aa7d508f6b4d0e625ed
2017-01-06 16:44:27 -08:00
Dmitry Dementyev
527454795f Update account visibility API.
Remove no longer used functions and in-memory visibility table.
Add stubs for new methods.
Actual implementation will be added in follow up CLs.
Bug: https://b.corp.google.com/issues/33046496
Test: manual tests, cts tests.

Change-Id: I990759b20c57df70bc944e27b84e59b9f77b9bd4
2016-12-20 15:44:55 -08:00
Sudheer Shanka
dc589ac82b Update usage of ActivityManagerNative.
- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
      adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
          -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
2016-11-14 11:27:12 -08:00
Salvador Martinez
3b41285a0c Changed themes for core activities am: 7e2657c303 am: f3209d6c87
am: 32a87ca7a9

Change-Id: I9db830b77e0d6ef224f7fe12e2596e3a6d9bd0e2
2016-09-28 00:22:59 +00:00
Salvador Martinez
32a87ca7a9 Changed themes for core activities am: 7e2657c303
am: f3209d6c87

Change-Id: I1595ffd9a91137666e45792f8f980355ea622f50
2016-09-28 00:16:50 +00:00
Salvador Martinez
f3209d6c87 Changed themes for core activities
am: 7e2657c303

Change-Id: If4019d7f37ea13bbbcbaeaaccde40a112173683c
2016-09-28 00:08:55 +00:00
TreeHugger Robot
c43f05e669 Merge "Changed themes for core activities" into nyc-mr1-dev 2016-09-28 00:04:00 +00:00
Svet Ganov
9d56963630 [DO NOT MERGE] Use tokens instead of account access trackers am: 32bfb594af
am: 18b725ac0a

Change-Id: I8f90fb4c4d4baa29727d84a28db68f277d305a74
2016-09-27 20:59:00 +00:00
Salvador Martinez
7e2657c303 Changed themes for core activities
Many activities in core were using the
material theme which would result in teal
colors on all devices. These themes have
all been changed to DeviceDefault so that
the color will be more suited to whatever
device the user has.

Test: Manual Inspection
Bug: 31623421
Change-Id: I6847023c4fb57a1c3384a1f8e483cd740229458f
2016-09-26 12:49:31 -07:00
Svet Ganov
d4696126b5 Update strings
Change-Id: I2f3a73a15d305d3e3a28001d2daa343cbfdec3b5
2016-09-24 13:57:45 -07:00
Svet Ganov
32bfb594af [DO NOT MERGE] Use tokens instead of account access trackers
We keep track which process saw and account to whitelist
the app for future access as an optimization to avoid
prompting the user for account access approval. Some apps
use SefeParcelable where the parcels are marshalled
which does not allow the parcel to contain IBinders.
To avoid this we are switching from account tracker remote
objects to unforgeable tokens.

bug:31162498

Change-Id: I3b52bff720655f695ad0c58d420eb35ef93161b9
2016-09-24 06:00:14 +00:00
Svet Ganov
c1c0d1cc53 Use tokens instead of account access trackers
We keep track which process saw and account to whitelist
the app for future access as an optimization to avoid
prompting the user for account access approval. Some apps
use SefeParcelable where the parcels are marshalled
which does not allow the parcel to contain IBinders.
To avoid this we are switching from account tracker remote
objects to unforgeable tokens.

bug:31162498

Change-Id: I19916b54afd0b47e57c517145aa6b1ff17154144
2016-09-23 21:47:38 -07:00
Svet Ganov
5d09c998a0 Backup account access grants
Sync adapters without an account access cannot run until the
user approves the account access (for the case the account
access is not allowed by other policy such as being singed
with the same cert as the authenticator). If the sync adapter
does not have permission to access the account we ask the
user to grant access and take a note. This CL adds backup
for the explicit user grants.

bug:31162498

Change-Id: I31e3f3d010475352c7c54255ac2d3a2fed4d0c72
2016-09-21 14:01:02 +00:00
Svet Ganov
f6d424f133 While-list apps to access account if already saw it
Sync adapters without an account access cannot run until the
user approves the account access (for the case the account
access is not allowed by other policy such as being singed
with the same cert as the authenticator). However, if the
sync adapter package already got the account from another
app which means it already saw the account we white-list
the sync adapter app to access the account as it already
saw it - the bird is out of the cage.

bug:31162498

Change-Id: I2b72f3b0d6307561ed68db2f2e9c900b15e8d098
2016-09-20 22:21:07 -07:00
Hongming Jin
adc906206a Only return password for account session flow if the caller is signed with system key and have get_password permission. am: 9342e137c6
am: 8b75ebf0bb

Change-Id: I95794bb5269c849fe740576a344e43da4306ac56
2016-09-14 23:32:29 +00:00
Hongming Jin
914e549bce Only return password for account session flow if the caller is signed with system key and have get_password permission. am: 9342e137c6
am: 57e38003e8

Change-Id: Iaa63cf3bc288803e92a81386f03d1151d78e6b02
2016-09-14 23:32:11 +00:00
Hongming Jin
57e38003e8 Only return password for account session flow if the caller is signed with system key and have get_password permission.
am: 9342e137c6

Change-Id: I10134040a7596000e768433943979c9af790e582
2016-09-14 23:23:05 +00:00
Hongming Jin
9342e137c6 Only return password for account session flow if the caller is signed
with system key and have get_password permission.

Bug: 30455516
Change-Id: I78484c59e4de1dff685ab91a0a8e7a756fffd9bf
2016-09-14 14:15:56 -07:00
Svet Ganov
171b77b91e [DO NOT MERGE] Backup account access grants am: 72ed12c55f
am: 0dc4ff0753

Change-Id: Ic6ad395f958b2e09d66467f41bd40e84c34851b9
2016-09-10 00:28:50 +00:00
Svet Ganov
72ed12c55f [DO NOT MERGE] Backup account access grants
Sync adapters without an account access cannot run until the
user approves the account access (for the case the account
access is not allowed by other policy such as being singed
with the same cert as the authenticator). If the sync adapter
does not have permission to access the account we ask the
user to grant access and take a note. This CL adds backup
for the explicit user grants.

bug:31162498

Change-Id: I31e3f3d010475352c7c54255ac2d3a2fed4d0c72
2016-09-09 10:16:57 -07:00
Svet Ganov
7580351e9e [DO NOT MERGE] While-list apps to access account if already saw it am: 91d37f43c7
am: f56f70365d

Change-Id: I3a553a7efe34feb9fbfa5d5c504874a2780bf132
2016-09-09 02:42:23 +00:00
Svet Ganov
91d37f43c7 [DO NOT MERGE] While-list apps to access account if already saw it
Sync adapters without an account access cannot run until the
user approves the account access (for the case the account
access is not allowed by other policy such as being singed
with the same cert as the authenticator). However, if the
sync adapter package already got the account from another
app which means it already saw the account we white-list
the sync adapter app to access the account as it already
saw it - the bird is out of the cage.

bug:31162498

Change-Id: I2b72f3b0d6307561ed68db2f2e9c900b15e8d098
2016-09-08 16:46:46 -07:00
Svet Ganov
890a210e41 resolve merge conflicts of eeeebd3 to master
Change-Id: I3aa0d1b9228be408837f7dd93a9b8268e564fc65
2016-08-24 00:13:36 -07:00
Svetoslav Ganov
eeeebd346a Only sync adapters with access can see an account - framework am: 5cb2973495
am: 721402e75a

Change-Id: I361b009afa6c6e658157e6e04bf88096e8331fd0
2016-08-24 02:08:19 +00:00
Svetoslav Ganov
5cb2973495 Only sync adapters with access can see an account - framework
It was possible for a sync adapter without accounts access to
see the account which it is supposed to sync which can be used to
identify the user. This change ensures that only sync adapters
with account access can run (which results in seeing the account),
otherwise we involve the user to approve access only to this account.

A sync adapter can access an account if one of these is true:
 - it is signed as the authenticator for this account
 - has the GET_ACCOUNTS permission
 - has an auth token for the account
 - it is a preinstalled app (system or privileged)

The main thing we need to figure out is if the extra prompts
for giving access to a sync adapter to the account create too
much friction.

bug:28163381

Change-Id: Ie083bb681b5a2aed81ca5f6a062193a175fad77e
2016-08-23 21:43:27 +00:00