Commit Graph

8270 Commits

Author SHA1 Message Date
Kevin Hufnagle
4581566521 Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev am: 1fe99017eb am: 1e8492c744 am: 85bd2c62cb
am: 4d53ea94c7

Change-Id: I734924789d8e8b6eac3270f857eadd0752904493
2019-09-17 12:44:44 -07:00
Kevin Hufnagle
4d53ea94c7 Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev am: 1fe99017eb am: 1e8492c744
am: 85bd2c62cb

Change-Id: Ic7beb1eabce4ce8b241a11163b637000c4df4270
2019-09-17 12:37:20 -07:00
Kevin Hufnagle
85bd2c62cb Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev am: 1fe99017eb
am: 1e8492c744

Change-Id: Idbc73307a0c3f4a937a2a964667f01b28aa274ce
2019-09-17 12:32:20 -07:00
Kevin Hufnagle
1fe99017eb Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev 2019-09-17 18:54:20 +00:00
TreeHugger Robot
c48da41993 Merge "Adds app enumeration support for all components" 2019-09-16 20:16:46 +00:00
Patrick Baumann
0c9257b73c Adds app enumeration support for all components
This change adds consideration for more than just activities when
computing matches between packages for app enumeration / filtering.

It also changes the failure logic when parsing a package to allow for a
queries intent tag that contains no action, but a scheme or one that
contains no data tag but one action (or both). Previously it would have
been impossible to enumerate an app purely based on the authority of one
of its providers.

Bug: 136675067
Test: adb shell device_config put package_manager_service package_query_filtering_enabled true && atest AppEnumerationTests
Test: atest AppsFilterTest
Change-Id: I07bb449e78fb79a2ed61f75b37e582e0f3467a2d
2019-09-13 14:05:17 -07:00
Ying Zheng
215116f8cb Not support flag primary in headless system user mode for now.
Test: build
Bug: 139950070
Change-Id: I5b06cb857fa1917f479c3018963970743b211087
2019-09-11 14:04:13 -07:00
Varun Shah
7fcf86ed49 Merge "Use language tags to store Configuration's locale list." into qt-dev am: 6dfa267f91 am: 6947f255e4
am: 667db1bea5

Change-Id: I0700617e4f639f3e03a793419b9e16590c328ad6
2019-09-10 23:42:08 -07:00
Varun Shah
667db1bea5 Merge "Use language tags to store Configuration's locale list." into qt-dev am: 6dfa267f91
am: 6947f255e4

Change-Id: Ic1954896252b758e8360c7fdf7cdeddb184bab03
2019-09-10 23:36:07 -07:00
Varun Shah
5e67462971 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
2019-09-10 19:53:57 +00:00
Varun Shah
bd0ce4d42f 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
Change-Id: I53946ed4e31de0ffe9c84875c391a7dec6f5375a
2019-09-10 15:51:37 -04:00
Colin Cross
ca4f16d099 Merge "Revert "Use language tags to store Configuration's locale list."" into qt-dev am: dd67a548b2 am: 18bf694f3c
am: c09f17d559

Change-Id: I6d503556ea8e7d02a4f2dfa127fe376880e21666
2019-09-10 12:43:01 -07:00
Colin Cross
c09f17d559 Merge "Revert "Use language tags to store Configuration's locale list."" into qt-dev am: dd67a548b2
am: 18bf694f3c

Change-Id: I9481fb2063b8a38a86dd52867c4c9ad52e9b8c7a
2019-09-10 12:36:03 -07:00
Colin Cross
dd67a548b2 Merge "Revert "Use language tags to store Configuration's locale list."" into qt-dev 2019-09-10 19:18:48 +00:00
Varun Shah
68cdb74d91 Revert "Use language tags to store Configuration's locale list."
This reverts commit ff43f4e6a6.

Reason for revert: b/140813780

Change-Id: Id5988b9ec959ca9b294f6bd5caa30c8156238d0a
2019-09-10 18:30:47 +00:00
Varun Shah
fe560ba5f2 Merge "Use language tags to store Configuration's locale list." into qt-dev am: bdfd7d6adb am: ec466c0a8e
am: 6540f10816

Change-Id: Icccf3e70bf24f629230ce5d5127cfff2cdbe22e4
2019-09-10 10:27:58 -07:00
Varun Shah
6540f10816 Merge "Use language tags to store Configuration's locale list." into qt-dev am: bdfd7d6adb
am: ec466c0a8e

Change-Id: If5fbf5869ebed425d2df0d5472d7bbe859fb6505
2019-09-10 10:17:23 -07:00
Varun Shah
bdfd7d6adb Merge "Use language tags to store Configuration's locale list." into qt-dev 2019-09-10 16:51:37 +00:00
Anthony Hugh
d4d88f2486 Merge "Refactor PermissionManager.SPLIT_PERMISSIONS" into qt-qpr1-dev
am: fcb2ce1503

Change-Id: I830c2580f3d141a3641e023c189c148a0a1737d0
2019-09-09 19:24:39 -07:00
Anthony Hugh
6f5eadc0d3 Refactor PermissionManager.SPLIT_PERMISSIONS
Creating a SystemConfig from a non-system process is taking 500+ ms.
This CL instead exposes the needed split permissions from system_server
to optimize performance.

Tested locally and creating PermissionManager / retrieving SystemConfig
is now less than 1 ms.

Bug: 139828734
Bug: 139485700
Fixes: 139828734
Test: Added systrace / logs to PermissionController app and traced
runtime of onGrantDefaultRoles().

Merged-In: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
Change-Id: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
(cherry picked from commit f69c71e25889d8a9d66da05ee0f386d7fb626c6c)
2019-09-09 15:49:04 -07:00
Varun Shah
ff43f4e6a6 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
Change-Id: Id0e63ae4a7be578d1e93838b371320f86a787e0e
2019-09-09 22:41:54 +00:00
Varun Shah
669d886cdc 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)
2019-09-09 22:41:22 +00:00
Varun Shah
ea424deee9 Merge "Fix bootloop issue with UsageStatsService." into qt-qpr1-dev am: eff156093c
am: a5c53a01ae

Change-Id: I9e172385ca47ee1a37986f27694b904acb22769b
2019-09-06 11:25:35 -07:00
TreeHugger Robot
2257e8b62d Merge "int userHandle -> int userId" 2019-09-06 18:08:08 +00:00
Varun Shah
a5c53a01ae Merge "Fix bootloop issue with UsageStatsService." into qt-qpr1-dev
am: eff156093c

Change-Id: Iece7adc8dd9a3cb5c704e917b22337cf8339f460
2019-09-06 10:59:13 -07:00
Bookatz
f56f258495 int userHandle -> int userId
Throughout the codebase, sometimes an integer user ID is called
userId, and sometimes it is called userHandle. Here, we rename the
occurences of "int userHandle" to "int userId" in select files.
Additionally, we add the @UserIdInt annotation in many more places.

This certainly does not cover all uses of userHandle, which is used
widely throughout Android; doing so would be more dangerous and cause
merge conflicts. But at least the core User code can have a consistent
nomenclature.

Bug: 138384792
Test: compiles. presubmit passes.

Change-Id: I9a2684e9bfac637e0476c4b68027008ebb8a160b
2019-09-06 09:26:35 -07:00
Anthony Hugh
dcd137410c Merge "Refactor PermissionManager.SPLIT_PERMISSIONS" 2019-09-05 00:53:17 +00:00
Chen Xu
c1f208cd69 Merge "remove symbols from greylist" 2019-09-04 23:31:25 +00:00
Anthony Hugh
de787d4a83 Refactor PermissionManager.SPLIT_PERMISSIONS
Creating a SystemConfig from a non-system process is taking 500+ ms.
This CL instead exposes the needed split permissions from system_server
to optimize performance.

Tested locally and creating PermissionManager / retrieving SystemConfig
is now less than 1 ms.

Bug: 139828734
Bug: 139485700
Fixes: 139828734
Test: Added systrace / logs to PermissionController app and traced
runtime of onGrantDefaultRoles().

Change-Id: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
2019-09-04 15:00:24 -07:00
Varun Shah
5d9031dbee 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
2019-09-04 19:12:08 +00:00
Chen Xu
27c4e658b3 remove symbols from greylist
telephony-common is not intended to used by any apps and
being in boot class is not updatability friendly.
We are removing telephony-common from bootclass and apply
<uses-library> in manifest instead.
for apps targeting < R will auto load telephony-common lib
for app compatibility. For apos >=R, only allow usage for
phone UID.

Bug: 135955937
Test: Build
Change-Id: Ia318661546df6d8516328886e5cc0c54d5cfafe6
2019-09-04 11:42:14 -07:00
TreeHugger Robot
fcc598d1e7 Merge "Remove isAutofillDisabledLocked from test api." 2019-09-04 12:52:54 +00:00
Kevin Hufnagle
fbfe223a44 docs: Fixed contradictory info in IntentFilter
The docs now (correctly) state that, if an intent filter specifies no
actions, then it only matches intents that don't specify/contain an
action.

Test: make ds-docs -j32

Bug: 140435265
Change-Id: I8931c6540cb22edd15e8caa1be984ca70efcdc96
2019-09-03 21:54:31 +00:00
TreeHugger Robot
8e6a69c3a2 Merge "Allow apps to collect which appops were noted" 2019-08-30 18:53:22 +00:00
Aurimas Liutikas
488d37b2d0 Merge "Add missing nullability annotations." into stage-aosp-master am: 85c0a5a2be am: ed5beec21b
am: de0ebb082e

Change-Id: I60c55b6706e8d43121e8b2c7a35efff38668f66b
2019-08-30 08:54:38 -07:00
Aurimas Liutikas
ed5beec21b Merge "Add missing nullability annotations." into stage-aosp-master
am: 85c0a5a2be

Change-Id: Ic9ea2b9840fbb678bbb6ab77038415581feba918
2019-08-30 08:35:52 -07:00
Philip P. Moltmann
2b08aafc14 Allow apps to collect which appops were noted
If private user data is send to an app the data provider should note an
app-op. This change adds a new API AppOpsManager#setNotedAppOpsCollector
that allows an app to get notified every time such an private data access
happens.

This will allow apps to monitor their own private data usage. Esp. with
big, old apps, distributed teams or 3rd party libraries it might not always
be clear what subsystems access private data.

There are three different situations how private data can be accessed and
an app op is noted:

1. Private data access inside a two-way binder call.
E.g. LocationManager#getLastKnownLocation. When we start a two way
binder transaction, we remember the calling uid via
AppOpsManager#collectNotedAppOps. Then when the data providing code
calls AppOpsManager#noteOp->AppOpsManager#markAppOpNoted the noted
app-op is remembered in
AppOpsManager#sAppOpsNotedInThisBinderTransaction. Then when returning
from the binder call, we add the list of noted app-ops to the
reply-parcel via AppOpsManager#prefixParcelWithAppOpsIfNeeded. On the
calling side we check if there were any app-ops noted in
AppOpsManager#readAndLogNotedAppops and then call the collector while
still in the binder code. This allows the collector e.g. collect a stack
trace which can be used to figure out what app code caused the
private data access.

2. Very complex apps might do permissions checks internal to themself.
I.e. an app notes an op for itself. We detect this case in
AppOpsManager#markAppOpNoted and immediately call the collector similar
to case (1).

3. Sometimes private data is accessed outside of a two-way binder call.
E.g. if an app registers a LocationListener an app-op is noted each time
a new location is send to the app. In this case it is not clear to the
framework which app-action triggered this app-op-note. Hence the data
provider has to describe in a AsyncNotedAppOp object when an why the
access happened. These objects are then send to the system server via
IAppOpsService#noteAsyncOp and then the collector in the app. There are
rare cases where a private data access happens before the app is running
(e.g. when a geo-fence is triggered). In this case we cache a small
amount of AsyncNotedAppOps (in AppOpsService#mUnforwardedAsyncNotedOps)
and deliver them when the app is ready for these events (in
AppOpsManager#setNotedAppOpsCollector).

Test: atest CtsAppOpsTestCases (includes new tests covering this
                                functionality)
Bug: 136505050
Change-Id: I96ded4a8d8d9bcb37a4555d9b1281cb57945ffa9
2019-08-30 08:18:50 -07:00
Aurimas Liutikas
34c56bcf4a Merge "Add missing nullability annotations." 2019-08-30 15:14:37 +00:00
TreeHugger Robot
7ce605ebe9 Merge "Updated onSharedPreferenceChanged listener behavior." 2019-08-30 03:10:08 +00:00
Aurimas Liutikas
4d1699da48 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
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07: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
Jeff Sharkey
ce766b3ac7 Merge changes from topic "mappingz"
* changes:
  Sprinkle in some TEST_MAPPING.
  Fix subtle bug when using empty withValues().
2019-08-29 02:58:51 +00:00
Kevin Hufnagle
3c7aa609cc Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev am: b14d2dede2 am: 13e2b970ec am: 5e1a48a660
am: eba15ec2b4

Change-Id: I3a599fb3e781067b76b8868d7cf3013c0e4a4fb3
2019-08-28 18:23:59 -07:00
Kevin Hufnagle
eba15ec2b4 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev am: b14d2dede2 am: 13e2b970ec
am: 5e1a48a660

Change-Id: Ic65f9e1e2a51d91a08b482b3ee2e66f9f0ef29ea
2019-08-28 17:56:05 -07:00
Kevin Hufnagle
5e1a48a660 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev am: b14d2dede2
am: 13e2b970ec

Change-Id: I393ec53ecf097e5ebe4ce2878e149fbf653df622
2019-08-28 17:39:34 -07:00
Kevin Hufnagle
123f51ff28 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev
am: b14d2dede2

Change-Id: Ibd55727fe3387ef7b6c6cde2e1c5ba7c2f42f34b
2019-08-28 17:21:39 -07:00
Kevin Hufnagle
b14d2dede2 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev 2019-08-28 22:08:47 +00:00
Andrew Solovay
8d4be69f1c Merge "Docs: clarify getSharedPreferences behavior" into qt-dev am: 3791f9b071 am: 73a66dc100 am: c149d6ff19
am: 9f226a0085

Change-Id: Ia766df0c95dafd61e68303d49a1b5558cc4fc9d8
2019-08-28 14:28:16 -07:00
Andrew Solovay
9f226a0085 Merge "Docs: clarify getSharedPreferences behavior" into qt-dev am: 3791f9b071 am: 73a66dc100
am: c149d6ff19

Change-Id: Ieae488ea773c6f21b4f3517a682be60c99eaa628
2019-08-28 14:13:35 -07:00
Andrew Solovay
c149d6ff19 Merge "Docs: clarify getSharedPreferences behavior" into qt-dev am: 3791f9b071
am: 73a66dc100

Change-Id: Ia14424c38de4a55096bad5e1e91d29681b26f4f5
2019-08-28 13:52:14 -07:00