Commit Graph

387 Commits

Author SHA1 Message Date
Dmitry Dementyev
7563c0bb5b Protect account chooser activities against overlay.
Bug: 172841550
Test: manual
Change-Id: I3cd5a94386f15cf60a7fe3095b00815e4a6485ae
2020-12-14 08:18:26 -08:00
Riddle Hsu
f90b2d4610 Move launched activity info getter to ActivityClientController
- Add getLaunchedFromUid and getLaunchedFromPackage into Activity
  because they are used in several places.
- Move getActivityClassForToken to ActivityTaskManagerInternal#
  getActivityName because it is only used in system server.
- Remove getPackageForToken because it is no longer used.

Bug: 174041144
Bug: 174040691
Test: CtsWindowManagerDeviceTestCases

Change-Id: Iac1581ac2271baf1ab1625ced6cc1f42bf05eaf5
2020-12-08 13:10:10 +08:00
Dmitry Dementyev
8eeeef38d2 Merge "Ignore GrantCredentials call with unexpected calling uid." into qt-dev am: a064b69f18 am: f0263a9369 am: 4290008125 am: de121ad5cb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13029782

Change-Id: I03d5431b03bd40ce5a72f385b382f1a62f4158b0
2020-11-11 23:17:03 +00:00
Dmitry Dementyev
4290008125 Merge "Ignore GrantCredentials call with unexpected calling uid." into qt-dev am: a064b69f18 am: f0263a9369
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13029782

Change-Id: If1903ef712d1d297cea648a6d78213127ddd3fd6
2020-11-11 22:01:38 +00:00
Dmitry Dementyev
f0263a9369 Merge "Ignore GrantCredentials call with unexpected calling uid." into qt-dev am: a064b69f18
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13029782

Change-Id: Ibf0233c8e736166a6357d622a5f5763cca64c07a
2020-11-11 21:41:34 +00:00
Dmitry Dementyev
a064b69f18 Merge "Ignore GrantCredentials call with unexpected calling uid." into qt-dev 2020-11-11 21:10:46 +00:00
Dmitry Dementyev
e174252a72 Protect GrantCredentialsPermissionActivity against overlay. am: f45dcfe1f5 am: 3f47c701f1 am: 765788de9a am: 364db883ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13029378

Change-Id: I0e002fdc58070bdb780bd33b7aea90f95d58436b
2020-11-11 06:57:57 +00:00
Dmitry Dementyev
765788de9a Protect GrantCredentialsPermissionActivity against overlay. am: f45dcfe1f5 am: 3f47c701f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13029378

Change-Id: I59ea6157c2646c0398111718cff4af51cd4245d8
2020-11-11 06:14:33 +00:00
Dmitry Dementyev
3f47c701f1 Protect GrantCredentialsPermissionActivity against overlay. am: f45dcfe1f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13029378

Change-Id: I5259ff89a5491f6cf3c5bb0eeb12fb66ef47d494
2020-11-11 06:00:59 +00:00
Dmitry Dementyev
10d8a114bb Ignore GrantCredentials call with unexpected calling uid.
Activity can be used only in two cases.
1) Calling uid matches uid grantee.
2) Calling uid is is system. This flow is used by getToken methods with
notifyAuthFailure=true.

Test: Existing CTS tests
Bug: 158480899
Change-Id: I1421c333b6cebb4f7cddcdd8766298f6872e933b
2020-11-10 16:05:58 -08:00
Dmitry Dementyev
e8e9404470 Revert "Ignore GrantCredentials call with unexpected calling uid."
This reverts commit bbdc83188e.

Reason for revert: Fix works fine on master, reverting the change and applying again will simplify automerger flow for proper fix.
Bug: 172932743

Change-Id: Id498e952a7e883e2d6b7fe0d4000fb3415486d85
2020-11-10 23:24:27 +00:00
Dmitry Dementyev
5c9473a962 Merge "Revert "Ignore GrantCredentials call with unexpected calling uid."" into pi-dev am: 888ba5ee1a am: 1d3492e181 am: 427ee435bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13028859

Change-Id: I7a2396510c5333088d5c8e16dbb277c3b895e3ce
2020-11-10 23:15:07 +00:00
Dmitry Dementyev
f45dcfe1f5 Protect GrantCredentialsPermissionActivity against overlay.
Bug: 169763814
Test: manual
Change-Id: I15dd22791fcc61ef02b06ad51d9e4409d11c0181
2020-11-10 22:43:31 +00:00
Dmitry Dementyev
427ee435bd Merge "Revert "Ignore GrantCredentials call with unexpected calling uid."" into pi-dev am: 888ba5ee1a am: 1d3492e181
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13028859

Change-Id: I472f2b6180738e11cc0747db1b0fd4789b0ae721
2020-11-10 22:41:05 +00:00
Dmitry Dementyev
1d3492e181 Merge "Revert "Ignore GrantCredentials call with unexpected calling uid."" into pi-dev am: 888ba5ee1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13028859

Change-Id: I25446d7e0cb9eec2b98cf630bd85db30a007f6a0
2020-11-10 22:23:04 +00:00
Dmitry Dementyev
888ba5ee1a Merge "Revert "Ignore GrantCredentials call with unexpected calling uid."" into pi-dev 2020-11-10 21:44:51 +00:00
Dmitry Dementyev
c1097a8488 Revert "Ignore GrantCredentials call with unexpected calling uid."
This reverts commit 4f0084580d.

Reason for revert: Build breakage - b/172932743

Bug: 172932743
Change-Id: Iee0a5e2b84e5d89a206b099f75a15e714a332ff4
2020-11-10 21:44:34 +00:00
TreeHugger Robot
b2f3dc0083 Merge "Check that Account Parcel has name and type." into oc-dev am: 3349eaa9e8 am: 01f2d401c9 am: e0efbc5fbb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12999920

Change-Id: I72a0a54f22b8ebd457db1c7fa8b3757bc1f0f327
2020-11-10 20:25:01 +00:00
TreeHugger Robot
e0efbc5fbb Merge "Check that Account Parcel has name and type." into oc-dev am: 3349eaa9e8 am: 01f2d401c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12999920

Change-Id: I0e4803e7aafd730b9e21e49dc350ee51eedf42d8
2020-11-10 19:56:49 +00:00
TreeHugger Robot
3349eaa9e8 Merge "Check that Account Parcel has name and type." into oc-dev 2020-11-10 19:22:49 +00:00
Dmitry Dementyev
2d868147e4 Ignore GrantCredentials call with unexpected calling uid. am: 88787b77a0 am: 2e5fe473e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940344

Change-Id: Id30e803ed372bff60a3242a1667c5bd52cb12728
2020-11-06 22:52:46 +00:00
Dmitry Dementyev
bbdc83188e Ignore GrantCredentials call with unexpected calling uid.
Activity can be used only in two cases.
1) Calling uid matches uid grantee.
2) Calling uid is is system. This flow is used by getToken methods with
notifyAuthFailure=true.

Test: Existing CTS tests
Bug: 158480899
Change-Id: I983fac0ae742bbd426cbc02e854564083702a89f
2020-11-06 22:23:08 +00:00
TreeHugger Robot
4b9ee68510 Merge "Ignore GrantCredentials call with unexpected calling uid." into pi-dev am: 5409071886 am: 9bca2e2c06 am: 36fabac3e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12933114

Change-Id: Id9ffbcc9a437f5ce9be0c639e16a1a577ecfb28e
2020-11-06 19:53:55 +00:00
TreeHugger Robot
36fabac3e9 Merge "Ignore GrantCredentials call with unexpected calling uid." into pi-dev am: 5409071886 am: 9bca2e2c06
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12933114

Change-Id: I33234d76668076b68bb88991e17ffef395f29d6e
2020-11-06 19:39:21 +00:00
Dmitry Dementyev
88787b77a0 Ignore GrantCredentials call with unexpected calling uid.
Activity can be used only in two cases.
1) Calling uid matches uid grantee.
2) Calling uid is is system. This flow is used by getToken methods with
notifyAuthFailure=true.

Test: Existing CTS tests
Bug: 158480899
Merged-In: I983fa
Change-Id: I8da362df269decd7c3930a2387f42e09796e732f
2020-11-06 19:34:05 +00:00
TreeHugger Robot
9bca2e2c06 Merge "Ignore GrantCredentials call with unexpected calling uid." into pi-dev am: 5409071886
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12933114

Change-Id: If00e93aa992441865a0d27ee2971b43a221fd2dc
2020-11-06 19:28:14 +00:00
Dmitry Dementyev
0992000ace Check that Account Parcel has name and type.
Bug: 129287265
Test: manual
Change-Id: I8431eb27cc4c6dfd3048b28ff635474f14433308
(cherry picked from commit 32e8579638)
2020-11-06 00:37:40 +00:00
Dmitry Dementyev
4f0084580d Ignore GrantCredentials call with unexpected calling uid.
Activity can be used only in two cases.
1) Calling uid matches uid grantee.
2) Calling uid is is system. This flow is used by getToken methods with
notifyAuthFailure=true.

Test: Existing CTS tests
Bug: 158480899
Change-Id: I983fac0ae742bbd426cbc02e854564083702a89f
2020-11-05 21:56:36 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Jeff Sharkey
705f6bec2d Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e
2020-09-14 09:59:01 -06:00
Dmitry Dementyev
0a52ac5f64 Fix typo in AccountManager.java
Test: none
Bug: 69843581
Change-Id: I424e29f27fa518947862b5b4700f2c85ef899805
2020-04-22 12:03:02 -07:00
Dmitry Dementyev
092d2a715d Merge "Fix typo in AccountManager JavaDoc." 2020-04-22 17:45:37 +00:00
Dmitry Dementyev
8f72ab2c85 Fix imports in AccountManager.
Test: none
Bug: none
Change-Id: Id3881d1430fb99ab4f3cb7832cbfcc91f556e15e
2020-04-22 08:06:40 -07:00
Dmitry Dementyev
f7dc3e24a6 Fix typo in AccountManager JavaDoc.
Test: none
Bug: 117978867
Change-Id: Ie63071070f7032701d274f4df176a381917bbb9d
2020-04-22 07:53:26 -07:00
Lee Shombert
1d254f2e75 Correct debugging of accountsForUser binder cache
Bug: 140788621

Replaced the default result comparison so that two results can be compared
for value equality.  This code is only exercised with VERIFY is set true
in PropertyInvalidatedCache (this is a compile-time flag).

Test: Created a special build that sets VERIFY to true; verified that the
binder cache does not detect any inconsistent results.  Further modified
the build to generate inconsistencies; verified that the new code does,
in fact, detect true inconsistencies.

Change-Id: I48080cd3109b96159f711bd2d84a69530450c2c8
2020-04-06 17:02:18 +00:00
Edgar Arriaga García
dddb1bd3f1 Adding binder cache for AccountManagerService:getAccountsAsUser
Test: atest AccountManagerTest

b/140788621

Change-Id: I5c244cacaffb175f92c3185138bf1277e51aae0a
2020-03-05 17:22:42 -08:00
Edgar Arriaga García
07dae6a4b1 add binder-cache for getUserData
Test: atest AccountManagerTest

b/140788621

Change-Id: Idd168f1121adada4c8c9d7e0648b12d49d9c9af4
2020-03-05 12:01:00 -08:00
Dmitry Dementyev
a5fb0829d5 Remove hidden shared account methods from AccountManager.java
Bug: 145207098,145206763,145206842
Test: CTS
Change-Id: I0d07e0e6c4377eff5756ee938c5b43ad632249df
(cherry picked from commit b6907622f7)
2020-02-06 22:18:47 +00:00
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