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
Checking carrier privileges for UIDs with lots of shared apps can incur
a significant performance hit. For UIDs that are fixed and trusted
(system and phone), skip the permission check and always allow.
Also, double the cache size for getPackageInfo in order to reduce the
rate of cache misses.
Bug: 160971853
Test: manual verification -- observed lower rate of cache misses for
getPackageInfo from com.android.phone.
Change-Id: I1399cab579308479d7cf191b8795441cbcd3ff65
The SubscriptionManager APIs that return SubscriptionInfo objects are
often invoked by carrier privileged apps to obtain the details about
the subscription(s). Identifier and phone number access checks
currently verify requirements that typically cannot be satisfied by
carrier privileged apps first before verifying an app holds carrier
privileges. This commit invokes the carrier privileges check before
the generic PermissionManagerService check for identifier access
and moves the WRITE_SMS appop check after the READ_PHONE_STATE /
carrier privilege check for phone number access.
Bug: 157642567
Fixes: 73308711
Test: atest TelephonyPermissionsTest
Test: atest SubscriptionControllerTest
Change-Id: I0a446af5c2adaf1d6b06da221f9e236b1bdde146
If a carrier-associated app is added to the system image after the
device is initially launched (e.g. Q -> R OTA), the logic to disable
apps without a corresponding SIM will not run, leaving the app in an
enabled state in more cases than there should be.
To safely account for this, we only reevaluate on SDK change for apps
whose addedInSdk value falls within the range since the last time we
evaluated carrier apps' statuses. Apps that set lower (or higher)
SDK versions are ignored. We choose *not* to use minimum or target SDK
version here because it's more likely to change with each OTA /
prebuilt, which could cause unintended disable operations (or lack
thereof).
Bug: 154872019
Test: manual, QA, atest FrameworksTelephonyTests:CarrierAppUtilsTest
Change-Id: I97ddfa03f34e7d00e66ce7cd508d6d2a5e83fbc2
This reverts commit 1a3158b8e1.
Reason for revert: The carrier for which this was needed has been
updated to no longer require this change.
Change-Id: I5d07bd7ce4bde11a287f44ad2ff97370d4c30db6
Merged-In: I5d07bd7ce4bde11a287f44ad2ff97370d4c30db6
Bug: 138150105
Fixes: 157957579
Test: verify that app is no longer there
This is to support KR government requirement: CBR message should be available in
SMS.inbox. The solution is to insert CBR message once displayed to
users. this feature is disabled by default and OEM can turn it on for
specific mcc per country/carrier regulations.
Bug: 144749813
Test: Manual test on different messenger apps.
Change-Id: I5535cefb32e89694094299f3b89321f735983ef1
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)
This commit removes the log message from DevicePolicyManagerService
when a caller fails the access requirements as it can be confusing
if the caller subsequently passes a carrier privilege check and can
access identifiers, or in the case where the caller does not have
access a similar entry is logged by TelephonyPermissions. The subId
for which the carrier privilege check is performed is also logged
to facilitate debugging.
Bug: 152117976
Test: atest SubscriptionControllerTest
Change-Id: I6d88d739a0d9053e8eff32d74d90009699abe8fc
Based on feedback during the API review of the new SystemAPI for
telephony to check device identifier access the method was moved
from DevicePolicyManager to a more generic location to perform
the non-subscriber portions of the check.
Bug: 147761267
Test: atest TelephonyPermissionsTest
Test: atest PermissionManagerServiceTest
Test: atest DeviceIdentifierTest
Test: atest DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: atest TelephonyManagerTest
Test: atest DeviceOwnerTest#testDeviceOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: atest ManagedProfileTest#testProfileOwnerOnPersonalDeviceCannotGetDeviceIdentifiers
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testProfileOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testProfileOwnerCanGetDeviceIdentifiers
Change-Id: Ic1867dad0b2369f2dc1a7d31facb65f89131376f
This is done to get dangerous stuff off the READ_PHONE_STATE permission.
Also keeping READ_PHONE_STATE for apps targeting old SDK versions.
Refactored getPhoneNumber to allow READ_PHONE_STATE pre-R
Bug: 136160623
Test: atest SubInfoControllerTest, TelephonyPermissionsTest
Change-Id: I5c0adcbe432ffcbb22ac8959792ee60da7039f15
This reverts commit a63e69cf94.
Reason for revert: Remove mainline API for R
Test: build
Bug: 148174114
Change-Id: I712958984254ca6f16a9604d2aab532500dc1ca9
Use the new SystemConfigManager APIs in CarrierAppUtils instead of
accessing SystemConfig directly.
Fixes: 143112379
Test: manual
Change-Id: I04c61400f6f703e353ffdafb0f86df93ba3494dc
Use FLAG_UPDATED_SYSTEM_APP find if an app is updated system app
instead of MATCH_FACTORY_ONLY
Bug: 148308979
Test: Unit test for CarrierAppUtils and system test to
verify fi is not getting uninstalled
Change-Id: I1991e98bb1edb7d0628a7011df7488fbf5de3579
Add more character sets in CharacterSets.java to support more charsets.
These charsets are from http://www.iana.org/assignments/character-sets/
If MMS contains undefined charset value the corresponding field may not
be parsed correctly.
These charsets are from http://www.iana.org/assignments/character-sets/
Test: Receive MMS contains extended charsets texts, check if the text
could be parsed correctly.
Bug: 143253159
Change-Id: Id501dbaa9dfcc2cb28089430ed0b1bd3f2906bed
For statsd log DeviceIdentifierAccessDenied, field is_preinstalled is
provided by a hidden API. TelephonyPermissions cannot access hidden API
as a mainline module. So deprecate the field and always false.
Bug: 137202333
Test: make
Change-Id: Idb9b91015a867db9b9b0d2d8c1282e2afea65132
Do not use hidden withCleanCallingIdentity
Bug: 140908357
Test: Build
Merged-In: Ic6cbd587c009df973d4602ff21e5b8a9c27293ff
Change-Id: Ic6cbd587c009df973d4602ff21e5b8a9c27293ff
Remove usage of isPrivilegedApp as it is used only for logging.
Bug: 140908357
Test: Build
Merged-In: I510e10cd17546ebd4aa59f14a3b10738e37e912d
Change-Id: I510e10cd17546ebd4aa59f14a3b10738e37e912d
Replaced them with local constants as it is only for
internal use.
Test: basic sanity
Bug: 140908357
Change-Id: Icebabc4d16c2e6d5b6e2fb311fee697e8acfa285
Add TelephonyCommonStatsLog to framework-telephony-common-sources to
replace StatsLog call in TelephonyPermissions. This allows
TelephonyPermissions to be part of frameworks.jar after being jarjar'ed and also be included
statically in Mainline modules.
Bug: 145952197
Test: m frameworks-minus-apex
Test: fastboot flashall
Test: atest TelephonyCommonTests
Change-Id: I0b9e946e2b4a64a05acaf3132dffd8fc22f7d51d
The new annotation to be used is android.compat.annotation.UnsupportedAppUsage.
Test: m
Bug: 145132366
Change-Id: Ib2101605fb385b4f778893e5181a954dccbea037
Exempt-From-Owner-Approval: roll-forward previously approved change