Commit Graph

16 Commits

Author SHA1 Message Date
Jeff Sharkey
2d2e07e2ff Tighten up Binder.clearCallingIdentity() usage.
The recently added AndroidFrameworkBinderIdentity Error Prone checker
examines code to ensure that any cleared identities are restored to
avoid obscure security vulnerabilities.

This change is a purely mechanical refactoring that adds the "final"
keyword to the cleared identity to ensure that it's not accidentally
modified before eventually being cleared.  Here's the exact command
used to generate this CL:

$ find . -name "*.java" -exec sed -Ei \
    's/    (long \w+ = .+?clearCallingIdentity)/    final \1/' \
    {} \;

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a
2020-10-06 11:18:09 -06:00
Tyler Gunn
c0e4e1581a Merge "Update language to comply with Android's inclusive language guidance" am: a005cb30ed am: 3772a5b3fd am: c5ef3b9cae am: 03921ada7b am: dc82235933
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1377136

Change-Id: I99fa531f570a13fd3a27abf522383e631f86ceed
2020-07-31 01:16:30 +00:00
Tyler Gunn
c5ef3b9cae Merge "Update language to comply with Android's inclusive language guidance" am: a005cb30ed am: 3772a5b3fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1377136

Change-Id: I2f838a951cec8f6e7af82a0cd08d99d6045f3952
2020-07-30 21:25:38 +00:00
Tyler Gunn
460360d6b8 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: Presubmit
Bug: 161896447
Change-Id: I4142f4819f5ed3e2ffddf471b90923985e72523a
2020-07-29 10:23:07 -07:00
Automerger Merge Worker
9b80f5fed1 Merge "Merge "Allow network stack UID caller to retrieve cell identity" into rvc-dev am: 855eb749ed am: 4f7fa277ab am: b8b8f1323b" into rvc-qpr-dev-plus-aosp am: f31ee636c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12226436

Change-Id: I6e8c3a67a6356ea179abd45e49b2725813cbdbdd
2020-07-24 22:49:16 +00:00
Jack Yu
56cfdd1e87 Allow network stack UID caller to retrieve cell identity
For backwards compatibility, we allow phone, system UID to
access cell identity through getServiceState. Cell broadcast
service, which is used to be part of telephony, now is running
under network stack UID. We should consider network stack UID as
trustable components like system/telephony.

Fix: 157618105
Test: Manual
Change-Id: I9b2dfc778752e130f5c7e44c4b2e45b63ac6f918
2020-07-24 19:54:25 +00:00
Hall Liu
d7c2351676 Make LocationAccessQuery's builder safer to use
Add new methods on LocationAccessQuery.Builder to make it harder to
screw up when using. Changes include:
* Mandatory specification of min sdk levels for enforcing both fine and
coarse permission
* Mandatory "are-you-sure" check when both fine and coarse are above the
base level (i.e. when there are api levels that are left unprotected)

Also adapt TelephonyRegistry's permission checks to follow these new
requirements on the builder.

Fixes: 157170257
Test: CTS, unit tests, manual
Change-Id: Ica8779dff4c671352b917a3ccc02cdd0e1c5856d
2020-06-04 17:21:54 -07:00
Hall Liu
d275561d87 resolve merge conflicts of 2994fd8537 to qt-qpr1-dev-plus-aosp
Change-Id: I1b47624f6d2f43fbb860b42483d08590d5e80ce8
2020-04-07 21:32:50 +00:00
Hall Liu
7e826f9531 Fix order of uid/pid in LocationAccessPolicy
Fix the order in which uid and pid are passed into the permission check.

Test: atest LocationAccessPolicyTest
Fixes: 151330809
Change-Id: I479c8fc123d5a994e8cbe6489aa00bea4abca1c7
(cherry picked from commit 0cd4dbc0b3)
2020-04-07 21:20:07 +00:00
Hall Liu
0cd4dbc0b3 Fix order of uid/pid in LocationAccessPolicy
Fix the order in which uid and pid are passed into the permission check.

Test: atest LocationAccessPolicyTest
Fixes: 151330809
Change-Id: I479c8fc123d5a994e8cbe6489aa00bea4abca1c7
2020-04-01 18:00:09 -07:00
Grace Jia
15b4c26024 Fix hidden API usages in LocationAccessPolicy and add API in ActivityManager
Bug: 146355892
Test: Cts test, atest TeleServiceTests
Change-Id: I91bf8a05383f29feaa26b03d6a03ed7de2d79061
2020-01-17 15:51:04 -08:00
Meng Wang
1b3e4e0604 telephony/common/* should use android.util.Log
Bug: 144374158
Test: make
Change-Id: Iec082f0c0256d4e8f9cdbb2ebaf7425227f2299c
2020-01-10 14:31:01 -08:00
Meng Wang
b8ffe81593 Use com.android.telephony.Rlog for mainline module.
Bug: 144374158
Test: make
Change-Id: I86a479affb8e0fa8e48734324a6a05c68230d910
2020-01-09 04:42:58 +00:00
Philip P. Moltmann
06b07e9e25 (Backport) Pipe through featureId from caller to permission checks in telephony
code

Test: atest FrameworksTelephonyTests CtsAppOpsTestCases
Bug: 136595429
Fixes: 146350559
Change-Id: Ie58007cf2a4e4a39cdfd72822150efce71dfbe84
Merged-In: I7ef41e8961e48d40e5685c4a521e83cb20953e48
2020-01-08 14:16:54 -08:00
Peter Wang
d10972957f [Telephony Mainline] Move CarrierAppUtils and LocationAccessPolicy to telephony common
Bug: 146904426
Test: Build
Change-Id: I6f6d24fd0adab803899b25a47199839bcbb09eb0
Merged-In: I6f6d24fd0adab803899b25a47199839bcbb09eb0
2020-01-07 02:44:34 -08:00
Peter Wang
c61b1edc97 [Telephony Mainline] Move CarrierAppUtils and LocationAccessPolicy to telephony common
Bug: 146904426
Test: Build
Change-Id: I6f6d24fd0adab803899b25a47199839bcbb09eb0
2020-01-06 20:14:24 -08:00