Commit Graph

345 Commits

Author SHA1 Message Date
Valentin Iftime
18972946ce AccountManager APIs use context.getUserId for "asUser" operations
Bug: 139914710
Test: atest AccountManagerXUserTest

Change-Id: Id730da38cd5dd03a4d781948bd76e9a69b795b37
2019-12-19 14:36:35 +01:00
Artur Satayev
c895b1b450 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
2019-12-18 16:37:37 +00:00
Dmitry Dementyev
b6907622f7 Remove hidden shared account methods from AccountManager.java
Bug: 145207098,145206763,145206842
Test: CTS
Change-Id: I0d07e0e6c4377eff5756ee938c5b43ad632249df
2019-12-17 00:17:38 +00:00
Charles Munger
5c76aaae1b Merge "Deprecate account-specific activity subclass" am: b7c5d354fb am: 310697d68d
am: 3dd92afd74

Change-Id: Ia3cf674a7bca083fbdcc76e3d274cb5c2275cc8a
2019-11-19 19:45:09 -08:00
Charles Munger
3dd92afd74 Merge "Deprecate account-specific activity subclass" am: b7c5d354fb
am: 310697d68d

Change-Id: I1e6622b5d481938c1f5df8f4964284ef56c34cc3
2019-11-19 15:42:53 -08:00
Charles Munger
67127ff179 Deprecate account-specific activity subclass
Bug: 144042891
Test: No behavior changes
Change-Id: I22cc3f2d19280adeb627c5d9797621fac8b2da1d
2019-11-18 12:53:43 -08:00
Artur Satayev
756d3b447a Merge "Add @UnsupportedAppUsage annotations for greylist." am: 423c3a32d6
am: 7a565c45b1

Change-Id: I48075ef4296e0b55c0055f7364c5129bbd60e9ed
2019-11-11 09:33:13 -08:00
Artur Satayev
fc46be7dbd Add @UnsupportedAppUsage annotations for greylist.
go/cleanup-greylist-txt

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

Bug: 137350495
Test: m

Change-Id: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
Merged-In: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
2019-11-08 16:17:13 +00:00
Kevin Hufnagle
c665fedfe1 docs: Added consent notice re. getAccounts()
Test: make ds-docs -j32

Bug: 32704758
Change-Id: Id5e5c00840f2bde6c31a4f95f365b8bc8857884d
2019-10-21 14:04:55 +00:00
Dmitry Dementyev
32e8579638 Check that Account Parcel has name and type.
Bug: 129287265
Test: manual
Change-Id: I8431eb27cc4c6dfd3048b28ff635474f14433308
2019-04-08 17:30:05 -07:00
Andrei-Valentin Onea
94aeae08c0 Merge "Add @UnsupportedAppUsage annotations" 2019-03-06 15:06:05 +00:00
Andrei Onea
4b2116ca79 Add @UnsupportedAppUsage annotations
For packages:
  android.accounts
  android.app

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I65c961e3f59b9868156b3ee6a3b1cab81b0e9d25
2019-03-04 16:29:55 +00:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Mathew Inwood
31755f94e1 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 11:50:04 +00:00
Dmitry Dementyev
16d697576b Document AccountManager method failures for locked user.
Bug: 118700914
Test: N/A
Change-Id: I5f4f25c7c791f8ac0bf0037f0b370e021ee5a652
2018-10-30 14:56:53 -07:00
kopriva
c997fc62e0 Merge "docs: fixing errors found with lint check" into pi-dev am: 8c7d2142f6
am: 4d12f4c42b

Change-Id: I96a6dab05b6d4ea40950fe2ddc0948adf1b4e48f
2018-10-09 13:29:04 -07:00
kopriva
4d12f4c42b Merge "docs: fixing errors found with lint check" into pi-dev
am: 8c7d2142f6

Change-Id: Ief137b64e798b4b5bb6be5e6d25a35e08037abe5
2018-10-09 13:18:06 -07:00
kopriva
a1a7848f83 docs: fixing errors found with lint check
This covers directories through /app.

removed unused import in KeyguardManager.java

Test: make ds-docs

Bug: 117494359

Change-Id: Ie2536676ae8d3ab9349aa43dc3e3248b618dd143
Exempt-From-Owner-Approval: Docs-only change
2018-10-09 10:27:35 -07:00
Dmitry Dementyev
427675a0e6 Merge "Expand isCredentialsUpdateSuggested docs." 2018-10-03 23:49:59 +00:00
kopriva
dd5e73e5bf Merge "docs: fixing typo, bug 37006473" into pi-dev am: 323a915bb3
am: 1862847340

Change-Id: I183fcc7ec5e1813088cad831129305db80657a5e
2018-10-02 18:24:55 -07:00
kopriva
1862847340 Merge "docs: fixing typo, bug 37006473" into pi-dev
am: 323a915bb3

Change-Id: I3544307a34da9fc358ed63316fb3212507bd8ef7
2018-10-02 17:18:00 -07:00
Dmitry Dementyev
f6dc7c9dea Expand isCredentialsUpdateSuggested docs.
Follow-up to API Review.

Bug: 37672138
Test: N/A
Change-Id: I7dc509717305d48de5ad8a81a48e33828df74b7c
2018-10-02 17:06:46 -07:00
kopriva
b0cbd1637b docs: fixing typo, bug 37006473
also fixing an import statement that was blocking upload at repo hooks:
removed unused SystemApi import

Test: make ds-docs

Bug: 37006473

Change-Id: I2dec10fad213c4822631ad0f9c518a89d6c0c384
Exempt-From-Owner-Approval: Docs-only change
2018-10-02 12:51:17 -07:00
Hui Yu
139c2488d1 Obfuscate account name in account manager logs and dumpsys.
The account name could be PII or email address that should not be
printed in android logs or dumpsys. In account manager output, call
Account.toSafeString() to replace letters/digits in account name with
character 'x'.

Change-Id: Ic1abd1ecda99a309e8973f13bd3650286bbd59e6
Fix: 111937873
Test: atest AccountTest.java
2018-09-10 17:28:04 -07:00
Treehugger Robot
78f8ffbffd Merge "Add @UnsupportedAppUsage annotations" 2018-08-09 13:58:15 +00:00
Mathew Inwood
ad576cc8b9 Add @UnsupportedAppUsage annotations
For packages:
  android.accounts

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ic59c7e006b893a24f0a532a96db5192e91596b04
Merged-In: I9f59cf8e0d0d36da7e6e24f811902de7c070b90d
2018-08-06 16:51:18 +01:00
Mathew Inwood
1fde99af3c Add @UnsupportedAppUsage annotations
For packages:
  android.accounts

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I9f59cf8e0d0d36da7e6e24f811902de7c070b90d
2018-08-06 16:43:30 +01:00
Wale Ogunwale
04d9cb5f40 Moved some activities implementation to ActivityTaskManagerService (2/n)
Second step in unifying the window hierarchy that is currently split
within AM and WM packages. We move some of the API implementation for
activities from ActivityManagerService.java to
ActivityTaskManagerService.java.

Test: Existing tests pass
Test: go/wm-smoke-auto
Bug: 80414790

Change-Id: I23dcd924493d8ad1e0b6e3a55386fd72b0146605
2018-06-12 13:38:39 -07:00
Sandra Kwan
e1395b42ef Add OWNERS for AccountManager.
Test: no code change.

Change-Id: I6dabe8ff503a68d0ac2082a9149c23e0d4fd46ea
2018-02-16 15:40:27 -08:00
Jeff Sharkey
ad357d1839 Pass in the user defined by Context.
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.

This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.

Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
2018-02-03 02:11:45 +00:00
Jeff Sharkey
ce8db99114 Add more IntDef prefixes for auto-documenting.
Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
2017-12-13 20:05:36 -07:00
Fyodor Kupolov
c9117ddbfa Merge "Fix AddAccountSettings memory leak" am: 104501fa29 am: c17b4e5a14
am: 80e87f97c3

Change-Id: Iff2f6a0dff9774d155961aafade36eeb5db5bc81
2017-09-19 18:56:45 +00:00
tiansiming
f58793c5a1 Fix AddAccountSettings memory leak
The memory leak will always occur in AddAccoutSettings
when a null Bundle is returned in the addAccount we implement.

Bug: https://issuetracker.google.com/issues/65322371
Test: Install the app through the github i have offered in above link,
then press the "Test" item in ChooseAccountActivity (adb shell am start -n
'com.android.settings/.accounts.ChooseAccountActivity') serveal times.
Check the activity number by "adb shell dumpsys meminfo com.android.settings".

Change-Id: I3f139fe059e6094e9e5bf1660946ebc8bab6d090
Signed-off-by: tiansiming <tiansiming@xiaomi.com>
2017-09-11 10:19:11 +08:00
Jeff Sharkey
67f9d5070a Fix broken javadocs.
Bug: 64337634
Test: make -j32 doc-comment-check-docs
Change-Id: I20fdd3dcddef09111d35946c41c596c7689effa6
2017-08-06 07:37:08 -06:00
sunjian
87d0c3c987 Improve documentation for custome token.
Bug: 37963830
Test: none
Change-Id: I1ca14d0b5e0779ae96c867806ddcc6792621876f
2017-07-14 18:58:30 +00:00
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