Commit Graph

8053 Commits

Author SHA1 Message Date
Varun Shah
b53b34487b Use language tags to store Configuration's locale list.
Instead of storing each Locale within a Configuration object's locale
list by its language, country, variant, and script to proto, store the
entire locale list by its language tags representation which accurately
describes each locale.

Bug: 140197723
Test: atest ConfigurationTest
Test: atest UsageStatsDatabaseTest
Test: manually with bad data
Merged-In: I53946ed4e31de0ffe9c84875c391a7dec6f5375a
Change-Id: Idaae690f79a5c680ad0059a52be62160d9dfb5e7
(cherry picked from commit 5e67462971)
2019-10-22 22:52:49 +00:00
Anna Trostanetski
4cfb3545d6 Merge "Add a native aidl API."
am: 577e3114da

Change-Id: I22c7963991747fe1e27dce432da3fc02c644bbef
2019-10-22 13:20:59 -07:00
atrost
ff948d8a2f Add a native aidl API.
Introduce a platform_compat_native service that just calls the
platform_compat service.
The new service is needed as it needs a slightly different (more
limited, no ApplicationInfo in cpp) aidl API, and a class can only
extend one stub.

Test: Call the service from dumpsys.cpp (http://aosp/1142055)
Bug: 138275545
Change-Id: Ic46cc34b4c1dd4ebc6bcc996fb3f8503607214ac
Merged-In: Ic46cc34b4c1dd4ebc6bcc996fb3f8503607214ac
2019-10-22 18:54:13 +00:00
Treehugger Robot
2f1d3ac4f4 Merge "[DO NOT MERGE] Update PermissionChecker usages to avoid unnecessary attribution." 2019-10-14 21:44:51 +00:00
Svet Ganov
484271bc7e [DO NOT MERGE] Update PermissionChecker usages to avoid unnecessary attribution.
We had accidental usages of the PermissionChecker for cases where no
private data was provided to the app but the checkPermission API on
the latter also did blame data access on the app. The PermissionChecker
was designed to handle IPC calls and not for generic API checks.

To avoid future accidental incorrect PermissionChecker usages this
change renames the existing APIs of the latter to clearly indicate
that they should be used for data delivery and also adds sibling
methods for doing the same permission checks for preflight purposes.
Also the documentation is improved to furhter assist developers.

In addition, this change fixes accidental permission checker usages
that blame when they should not by using the new preflight flavor
of the permission check APIs.

Test:
    atest com.android.settingslib.location.RecentLocationAppsTest
    atest CtsPermissionTestCases
    added: LocationAccessCheckTest#notificationOnlyForAccessesSinceFeatureWasEnabled
    added: LocationAccessCheckTest#noNotificationIfFeatureDisabled
    added: LocationAccessCheckTest#noNotificationIfBlamerNotSystemOrLocationProvider
    added: LocationAccessCheckTest#testOpeningLocationSettingsDoesNotTriggerAccess

Bug:141028068
Change-Id: I89f4add79a55c3c8d6fbe8d57decaa78fe12f0f9
Merged-In: I65c71569d0dd8a40bc6fecabb22c5373dd6e806e
2019-10-14 17:22:30 +00:00
Svet Ganov
534b728a1e [DO NOT MERGE] Update PermissionChecker usages to avoid unnecessary attribution.
We had accidental usages of the PermissionChecker for cases where no
private data was provided to the app but the checkPermission API on
the latter also did blame data access on the app. The PermissionChecker
was designed to handle IPC calls and not for generic API checks.

To avoid future accidental incorrect PermissionChecker usages this
change renames the existing APIs of the latter to clearly indicate
that they should be used for data delivery and also adds sibling
methods for doing the same permission checks for preflight purposes.
Also the documentation is improved to furhter assist developers.

In addition, this change fixes accidental permission checker usages
that blame when they should not by using the new preflight flavor
of the permission check APIs.

Test:
    atest com.android.settingslib.location.RecentLocationAppsTest
    atest CtsPermissionTestCases
    added: LocationAccessCheckTest#notificationOnlyForAccessesSinceFeatureWasEnabled
    added: LocationAccessCheckTest#noNotificationIfFeatureDisabled
    added: LocationAccessCheckTest#noNotificationIfBlamerNotSystemOrLocationProvider
    added: LocationAccessCheckTest#testOpeningLocationSettingsDoesNotTriggerAccess

Bug:141028068
Change-Id: I4a74d4906f92e323fbd30b9b25011129895afc9a
Merged-In: I89f4add79a55c3c8d6fbe8d57decaa78fe12f0f9
Merged-In: I65c71569d0dd8a40bc6fecabb22c5373dd6e806e
2019-10-14 17:15:38 +00:00
Xin Li
8efb8c35f1 DO NOT MERGE - Merge QP1A.191005.007 into master
Bug: 142297020
Merged-In: Ifc7254ab3a5272b056cbc75233aa2dfa8219ea84
Change-Id: Ib4566cec52912a8daa86c317fd99d6d60ef1524f
2019-10-10 00:28:04 +00:00
Jeongik Cha
f6629839d1 Support /system_ext partition
This commit is mainly from I7a6a30bf8e8db9f2738594d187bb9148f138b8da, so
test cases and features are mostly same.

We change product_services partition name to "system_ext" because this
partition's purpose changes.

 - installing a RRO package for framework from /system_ext/overlay
 - installing apps from /system_ext/app
 - installing priv-apps from /system_ext/priv-app
 - installing permissions from
   /system_ext/etc/[default-permissions|permissions|sysconfig]

Bug: 134359158
Test: `mma` under frameworks/base/tests/[libs|privapp]-permissions
      adb sync && adb reboot
      adb shell cmd package list libraries
        => confirmed com.android.test.libs.system_ext library
      adb shell cmd package dump \
        com.android.framework.permission.privapp.tests.system_ext
        => confirmed that the package is a priv-app

Change-Id: Ibbccbba64156a7bc464ffb3785fb8fe69ebb973c
Merged-In: Ibbccbba64156a7bc464ffb3785fb8fe69ebb973c
(cherry picked from commit 9ec059ac1d)
2019-09-23 22:00:50 +00:00
Varun Shah
57213b0ce5 Use language tags to store Configuration's locale list.
Instead of storing each Locale within a Configuration object's locale
list by its language, country, variant, and script to proto, store the
entire locale list by its language tags representation which accurately
describes each locale.

Bug: 140197723
Test: atest ConfigurationTest
Test: atest UsageStatsDatabaseTest
Test: manually with bad data
Merged-In: I53946ed4e31de0ffe9c84875c391a7dec6f5375a
Change-Id: Idaae690f79a5c680ad0059a52be62160d9dfb5e7
(cherry picked from commit 5e67462971)
2019-09-16 20:56:34 +00:00
Varun Shah
f1c7097834 Fix bootloop issue with UsageStatsService.
When the configurations are being read from the proto file, if a
duplicate locale is found in the list, an exception is thrown from
LocaleList which causes the UsageStatsService to crash. Instead, we'll
now log a WTF if duplicate locales are found when parsing the
configuration proto and not add the duplicate locale to the list.

Bug: 140197723
Test: atest UsageStatsDatabaseTest
Change-Id: Ie178b3cfdd45e6771a7c0e4bb42e47f79b5c30cc
(cherry picked from commit 5d9031dbee)
(cherry picked from commit 669d886cdc)
2019-09-16 20:56:27 +00:00
Aurimas Liutikas
00be951a08 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-30 00:14:44 +00:00
Lorenzo Colitti
ac913d725f Merge changes I69cdbb16,I6975e0b7
am: d889cb5098

Change-Id: I3c8ddf7809a0d443587c1c4c06ef56ac302fc80f
2019-08-27 03:31:02 -07:00
wangmingming1
71df3da8ae notify netd about uid internet permission changes when package replaced
1. If a previous version of an app doesn't declare internet permission;
2. The User upgraded it to a new version and the new one does declare the
internet permission;
3. The new app are not allowed to access the internet until next boot

Bug: 137864893
Test: Manual, just make sure the onPackageChanged would be executed on package changes
Change-Id: I69cdbb16a027a9c4e974b32371b1f64a23a51a23
Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
2019-08-26 09:30:59 +09:00
Lorenzo Colitti
7b0411782a Backport PackageListObserver#onPackageChanged.
Added internally in Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd,
of which this is a partial cherry-pick.

Bug: 137864893
Test: builds, boots
Change-Id: I6975e0b70ded6047e1ac8013a82bc35ff150f03b
Merged-In: Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd
2019-08-26 09:30:59 +09:00
Anna Trostanetski
81af0fc8bb Merge "Rename android.compat.IPlatformCompat"
am: ee716a23a2

Change-Id: I88fd93b46bcaa5ed782c407f2a9e9469fb0f5f0e
2019-08-23 02:26:15 -07:00
atrost
a6a4d60ae0 Rename android.compat.IPlatformCompat
To com.android.internal.compat.IPlatformCompat. This solves a java9
issue because libcore exported api has the same package android.compat.

Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make framework
Change-Id: I0918344f670669cecb04f1e9e54dbcb471b587d5
2019-08-21 17:07:11 +01:00
atrost
499d4bff66 Start platform compat service eariler.
It's needed by ActivityManager and PackageManager.
Also use a constant in Context for the name.

Test: flashed device with ag/9025572 and ag/9204795 and the platfrom
compat was accessible.
Bug: 137769727

Change-Id: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
Merged-In: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
2019-08-19 16:10:47 +00:00
atrost
8266ae32ba Start platform compat service eariler.
It's needed by ActivityManager and PackageManager.
Also use a constant in Context for the name.

Test: flashed device with ag/9025572 and ag/9204795 and the platfrom
compat was accessible.
Bug: 137769727
Change-Id: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
Merged-In: Ie1130a3f0bdd1769fe0755db0089702ea64d9db6
2019-08-19 16:10:31 +00:00
Xin Li
80860803a4 DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5713463) into stage-aosp-master
Bug: 134405016
Change-Id: I303c0268e8e454b0f0f460eb286812a50c9add88
2019-08-14 12:04:06 -07:00
Brad Ebinger
3856b9e7d4 Merge "Fix lint error getSystemService for EuiccManager"
am: 97245795e7

Change-Id: I5b42feafdfd0c88daeb502d0f2602d072028850d
2019-08-01 16:02:21 -07:00
Brad Ebinger
97245795e7 Merge "Fix lint error getSystemService for EuiccManager" 2019-08-01 22:06:44 +00:00
Jack Yu
3e2865f585 Merge "Create feature flags for OMAPI readers supportiveness"
am: 65e73f09fd

Change-Id: I72b65959dab75fcca8566d6eecd7a730ef044d94
2019-07-24 07:02:39 -07:00
Treehugger Robot
65e73f09fd Merge "Create feature flags for OMAPI readers supportiveness" 2019-07-24 13:33:45 +00:00
Jack Yu
18c7630c3d Create feature flags for OMAPI readers supportiveness
Bug: 131062577
Test: CTS OMAPI
Change-Id: I20c1159489ea0bd5cc9fb651914d6bfd2a6b25ca
2019-07-23 17:38:13 +08:00
Mathew Inwood
3020e050d0 resolve merge conflicts of 9acd72c60b to stage-aosp-master
Bug: None
Test: TH
Merged-In: I2fcf25264c62acc801f9e62967072cd04e4641e7
Change-Id: I5bc6b8c20bda03b3760f13f747b1e2069bfd9ac1
2019-07-22 09:29:24 +00:00
hyunhae.lee
75fdafaafb Fix lint error getSystemService for EuiccManager
EuiccManager was open to public API.
However @ServiceName does not have Context.EUICC_SERVICE.
It makes lint error when calling getSystemService.

Test: Build
Change-Id: I2e28725b1ad4c07ada4e3181fa9a8a41789680f6
2019-07-19 22:42:18 +09:00
Mathew Inwood
a1b39023d8 Compatibility API implementation for app processes.
Pass the set of disabled changes from the system server into the app in the
bindApplication() call. Use this to instantiate an implementation of
Compatibility.Callbacks() to implement the API.

Test: Manual.
Bug: 135010838
Merged-In: I2fcf25264c62acc801f9e62967072cd04e4641e7
Change-Id: I2fcf25264c62acc801f9e62967072cd04e4641e7
2019-07-18 11:09:29 +01:00
Brad Ebinger
53f6c34039 Merge "Make RcsMessageStore a top level API"
am: bac258f22e

Change-Id: If235ead8a75dc080e1e129d83bf7f24c3c996d8c
2019-07-12 14:53:26 -07:00
Brad Ebinger
bac258f22e Merge "Make RcsMessageStore a top level API" 2019-07-12 21:40:40 +00:00
Brad Ebinger
0e93d73053 Add CAPABILITY_EMERGENCY_PREFERRED in PhoneAccount
Allow Telephony to mark a SIM PhoneAccount as
emergency preferred, meaning that Telecom will
override a user's PhoneAccount preference for
emergency calls if the PhoneAccount has the
CAPABILITY_EMERGENCY_PREFERRED capability.

Bug: 131203278
Test: Manual testing, Telecom/Telephony unit testing
Merged-In: If70d917cfb3d825f375d282012b8788d69a2f144
Change-Id: I88b8bbfa444f5445b2f0d6a1542c6406a19b240f
2019-07-11 17:55:37 -07:00
Mathew Inwood
53507c3423 Merge "Add trackingBug to API used by chromium vebview."
am: c25ad64386

Change-Id: I45a07ef1d02e4c18dc63bc3333bb0fcf40aa9da5
2019-07-10 06:27:13 -07:00
Treehugger Robot
c25ad64386 Merge "Add trackingBug to API used by chromium vebview." 2019-07-10 12:59:59 +00:00
Nikita Ioffe
0ad641f9f6 Merge "Rename ApexInfo.package{Name,Path} to module{Name,Path}" into stage-aosp-master
am: 6a36ad8b7e

Change-Id: Idabee06e646addd278b0f47224da9a6401a81036
2019-07-04 08:48:49 -07:00
Nikita Ioffe
f585ed0459 Use ApexInfo.moduleName
See another CL in the topic

Bug: 132428457
Test: builds
Change-Id: I87ba3fb539d0761c515adc8e2d2acc8dfc5e6a9a
Merged-In: If0bd3d368c7373ab0028211a8a4246a9821893af
2019-07-04 15:46:08 +00:00
Mathew Inwood
7bcc174a0e Add trackingBug to API used by chromium vebview.
Bug: 136728678
Test: m
Change-Id: Ia7ff4b258ac24d6ebd165be3f294fc1500cc7fb6
2019-07-04 11:42:48 +01:00
Nikita Ioffe
b4eee2a17d Rename ApexInfo.package{Name,Path} to module{Name,Path}
This should resolve the confusion between internal name of APEXes that
comes from apex_manifest.json and packageName that comes from
AndroidManifest.xml.

Follow-up CLs:
* Rename package to module for all apexservice binder APIs.
* Rename package to module in apexd codebase.

Test: atest apexservice_test
Test: atest CtsStagedInstallHostTestCases
Bug: 132428457
Change-Id: If0bd3d368c7373ab0028211a8a4246a9821893af
Merged-In: If0bd3d368c7373ab0028211a8a4246a9821893af
(cherry picked from commit ec67395d7d)
2019-07-03 14:27:01 +01:00
Dmitry Dementyev
45e4f2e836 Merge "Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"" into qt-dev
am: 660c234e9a

Change-Id: I466b3e4a3631614064be6aed38f1e74fde48544a
2019-07-02 12:29:39 -07:00
Dmitry Dementyev
40431ae1bc Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"
This reverts commit 8094880025.

Reason for revert: changed services order
Test: manual
Bug: 136261465

Change-Id: I2f78f0dbbace212309b87f779efad020cf255196
2019-07-02 03:59:17 +00:00
Andrew Sapperstein
f08f33b97b Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev
am: 9dd0c5628b

Change-Id: Ia58094614151af83aadd36bb04e0389050dd05be
2019-06-28 10:28:00 -07:00
Andrew Sapperstein
9dd0c5628b Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev 2019-06-28 16:56:04 +00:00
Mathew Inwood
13ffa87a6d Merge "Restore some greylist entries." into qt-dev
am: f76bdce6e0

Change-Id: I320e33be57b8124ff7c132a67c8981d53802f8f5
2019-06-28 07:43:43 -07:00
Mathew Inwood
3a75f264a8 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I5ac8b8b9b23c3789d80239cf456072cc7dfa1203
2019-06-28 10:15:37 +01:00
Andrew Sapperstein
93f5ed6c18 Allow granting URI permissions to com.android.settings.module_licenses.
Exempts this new ContentProvider for providing mainline module licenses.

Also sets ApplicationInfo.publicSourceDir for APEXes.

Bug: 135183006
Test: open module licenses, click app, verify file opens
Change-Id: Iec4f1de198525f7cd176a52d8448a2c71b6aabc0
2019-06-24 18:24:52 -07:00
Brad Ebinger
d1cb346d4f Make RcsMessageStore a top level API
RcsManager was handling both DB APIs and RcsFeature logic, which
made it confusing. Instead, make RcsMessageStore->RcsMessageManager,
which is a top level API.

Test: Manual
Change-Id: I9b9f96154d0705797cedade3d6cee27719897164
2019-06-20 23:28:43 +00:00
Amith Yamasani
29c3068cb4 Merge "Expose BIND_NOT_PERCEPTIBLE service flag" into qt-dev
am: 41d0b1abc8

Change-Id: I209930a67dfc89cf4c5178ad21452e624122df7f
2019-06-19 22:53:06 -07:00
Amith Yamasani
5016a7891a Expose BIND_NOT_PERCEPTIBLE service flag
Using this flag when binding to a service will
allow the bound process to be held at a low
oom_adj of 250, so that it can be expunged to
reclaim memory if a more user-visible app needs
it.

Use for bindings such as job services and other
connections that the caller can easily recover
from and restart if necessary.

Adjust the lmk thresholds to use this oom_adj
as one of the levels, so they're killed before
perceptible apps (such as foreground services).

Bug: 135219821
Test: CtsAppTestCases
      Manually check notification listener oom_adj
      and dumpsys activity services output

Change-Id: I9f6d0891d842e4d12f7995b9b1a8f57b0903a16d
2019-06-19 14:40:57 -07:00
Narayan Kamath
21ab5c0e34 Merge "Move legacy obb data migration to a handler thread." into qt-dev
am: 6d371e092e

Change-Id: I4505e845d2d85a5b8fd9f4c13c29f1ba5adcc690
2019-06-13 02:34:07 -07:00
Narayan Kamath
157dd1dc40 Move legacy obb data migration to a handler thread.
The operation can potentially take a long time to complete
depending on the volume of data to be copied, so move it off
the ActivityManager handler thread that needs to be available
for other operations.

Bug: 134570017
Test: manual; set a 1 minute sleep in migrate_legacy_obb_data.sh

Change-Id: I3d2c52e8b012ed71c53810e6919d11be9a97cc6c
2019-06-12 13:40:15 +01:00
Winson
5d53d4b564 Merge "Expose PermissionManager as TestApi and fix SplitPermissionInfo equality" into qt-dev
am: d703395fcb

Change-Id: I10e09a0bc15d9f4782ac9d91878becb9046581c3
2019-06-10 13:22:46 -07:00
TreeHugger Robot
d703395fcb Merge "Expose PermissionManager as TestApi and fix SplitPermissionInfo equality" into qt-dev 2019-06-10 20:12:57 +00:00