Commit Graph

6750 Commits

Author SHA1 Message Date
Nick Chalko
1ce1702e90 Merge "CEC: Add listener for HDMI CEC volume control feature" into rvc-dev am: 75ef06daa5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11246196

Change-Id: Ibf2ba76de1e0b162230af06c134179154cdd1c7f
2020-06-04 19:11:30 +00:00
Nick Chalko
75ef06daa5 Merge "CEC: Add listener for HDMI CEC volume control feature" into rvc-dev 2020-06-04 19:03:05 +00:00
Zak Cohen
12c90e42d4 Merge "Fix build - tests for screenshot helper not updated." into rvc-dev am: 80c031b151
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11731435

Change-Id: I5210598ea5607d1e1fe6b146b432b994a3f6c3a1
2020-06-04 08:14:55 +00:00
Zak Cohen
7b9edacc8c Fix build - tests for screenshot helper not updated.
Bug: 158145739
Test: atest ScreenshotHelperTests
Change-Id: I4d0f84c00a21e17fbd1d5ac589891a34201d315b
2020-06-03 22:39:11 -07:00
TreeHugger Robot
0310dbe4fc Merge "Add PackageInstaller SessionParams restrictions" into rvc-dev am: a817a0515e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11621266

Change-Id: I7aecc94ad108866aa4aebcf178592dc2ed1f2ea9
2020-06-03 16:51:54 +00:00
TreeHugger Robot
a817a0515e Merge "Add PackageInstaller SessionParams restrictions" into rvc-dev 2020-06-03 16:37:24 +00:00
TreeHugger Robot
b1fe173f1f Merge "Fix AugmentedAutofillService onFillRequest() wrong focused AutofillId for WebView" into rvc-dev am: cc4f13e0ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11700779

Change-Id: If21669fc2a76cfee6bbf7c875ad23a913328801e
2020-06-02 21:11:06 +00:00
Winson
10d51880e2 Add PackageInstaller SessionParams restrictions
To mitigate a boot loop with reading a massive
install_sessions.xml file, this restricts the amount of
data that can be written by limiting the size of
unbounded parameters like package name and app label.

This introduces a lowered max session count. 50 for general
applications without the INSTALL_PACKAGES permission, and
the same 1024 for those with the permission.

Also truncates labels read from PackageItemInfo to 1000
characters, which is probably enough.

These changes restrict a malicious third party app to ~0.15 MB
written to disk, and a valid installer to ~3.6 MB, as opposed to
the >1000 MB previously allowed.

These numbers assume no install granted runtime permissions.
Those were not restricted since there's no good way to do so,
but it's assumed that any installer with that permission is
highly privleged and doesn't need to be limited.

Along the same lines, DataLoaderParams are also not restricted.
This will have to be added if that API is ever made public.

However, installer package was restricted, even though the API is
hidden. It was an easy add and may have some effect since the value
is derived from other data and passed through by other system
components.

It's still possible to inflate the file size if a lot of
different apps attempt to install a large number of packages,
but that would require thousands of malicious apps to be installed.

Bug: 157224146

Test: atest android.content.pm.PackageSessionTests

Change-Id: Iec42bee08d19d4ac53b361a92be6bc1401d9efc8
2020-06-02 12:58:53 -07:00
Joanne Chung
fbc89efee3 Fix AugmentedAutofillService onFillRequest() wrong focused AutofillId for WebView
When AutofillManagerService try to trigger AugmentedAutofill, it uses
AutofillId.withoutSession() to get the AutollId without session. It
will return invalid "parentId:NO_ID" if the virtual AutofillId is
created with FLAG_IS_VIRTUAL_INT. The virtual AutofillId flag should
be FLAG_IS_VIRTUAL_INT or FLAG_IS_VIRTUAL_LONG, we should get
mVirtualIntId for FLAG_IS_VIRTUAL_INT or mVirtualLongId for
FLAG_IS_VIRTUAL_LONG.

Bug: 156408900
Test: atest android.autofillservice.cts.augmented
Test: atest android.view.autofill.AutofillIdTest#\
testVirtual_Long_withoutSession
Test: atest android.view.autofill.AutofillIdTest#\
testVirtual_Int_withoutSession
Test: Manual. Write a simple cts test for webview and check the
focused AutofillId is correct while switching between the field.

Change-Id: I7ebb4d7cfb6d6f383724b798dae69269ae3a27be
2020-06-03 01:06:24 +08:00
Marvin Ramin
7ddbb62ccd CEC: Add listener for HDMI CEC volume control feature
Adds a listener to receive updates to the state of the HDMI CEC volume
control features.

Interested parties can register and unregister to get notified about
state updates which are sent on every change to the value.

Test: atest HdmiControlServiceTest
Bug: 152018314
Change-Id: I342d748114bae99b3c3f236502d73bfeac9e9ac5
Merged-In: I342d748114bae99b3c3f236502d73bfeac9e9ac5
2020-06-01 20:13:54 +00:00
Charles Chen
c1ee356ca6 Merge "Fix get display from display context derived context not working" into rvc-dev am: 13e3568567
Change-Id: Ibdb1cea64d43db5b54b5905ee544b6e374fe60ff
2020-05-30 06:51:42 +00:00
Charles Chen
13e3568567 Merge "Fix get display from display context derived context not working" into rvc-dev 2020-05-30 06:35:35 +00:00
Charles Chen
e22c4cb3c6 Fix get display from display context derived context not working
In ContextImpl, we checked the flag "mIsAssociatedWithDisplay" to
identify if a context can access a display or not. The flag wasn't
passed from outer context, and it leads to an issue that context
which created from #createConfigurationContext from display context
failed to obtain display instance.

This CL passes mIsAssociatedWithDisplay from outer context and
also add test to verify the behavior.

fixes: 157719118
Test: atest ContextTest ContextAccessTest

Change-Id: Ibeb2a08c75f90304e12dcf99293c84409c5eea34
2020-05-30 12:46:59 +08:00
Narayan Kamath
cc9f819283 Merge "Revert ResolverActivity changes associated with browseables." into rvc-dev am: 101fcc5746
Change-Id: I3cd05030567145ae5528db56a3b4d73faa4fb814
2020-05-28 11:30:32 +00:00
Narayan Kamath
101fcc5746 Merge "Revert ResolverActivity changes associated with browseables." into rvc-dev 2020-05-28 10:35:09 +00:00
TreeHugger Robot
38a9ac0ff4 Merge "Remove InstantAppResolverTests for migration to CTS" into rvc-dev am: f37b09335f
Change-Id: I3c746107c6e0941ab6b60ccddd384f75818e9828
2020-05-28 00:25:41 +00:00
TreeHugger Robot
f37b09335f Merge "Remove InstantAppResolverTests for migration to CTS" into rvc-dev 2020-05-28 00:23:16 +00:00
Heemin Seog
164713ecfe Merge "Add climate bar insets" into rvc-dev am: 58169786a6
Change-Id: Iea5d4299f49aa5d886c5482a5916d80ef8596eba
2020-05-27 15:49:24 +00:00
Heemin Seog
58169786a6 Merge "Add climate bar insets" into rvc-dev 2020-05-27 15:38:32 +00:00
Narayan Kamath
754186806d Revert ResolverActivity changes associated with browseables.
Reverts changes 69df963, 0c7c5d59, 6cbef19 and others. These changes
don't revert cleanly because of several refactorings layered on top
of the original changes.

The main objective of these change is to get rid of mUseLayoutForBrowseable
and associated codepaths as we treat choosing between browseables the
same as other choices.

Bug: 157460946
Test: manual
Test: atest ResolverActivityTest
Test: atest ChooserActivityTest

Change-Id: Ibe9f2289289f7f5da3986e6892a2ee4ff65765a0
2020-05-27 12:48:15 +01:00
Heemin Seog
d79e4f49d2 Add climate bar insets
This can be used to support a 3rd kind of system bar to inset the
applicaiton space.

Bug: 152763889
Test: manual
Change-Id: I3ba75886e94a9fe80a0d1a920749d152dda64031
2020-05-26 14:26:25 -07:00
Michael Groover
3cdc8fbdb2 Merge "Address edge cases for signing certificate lineages in sharedUids" into rvc-dev am: 2046776127
Change-Id: If65b24c62ca4ae868d15bbf30aff5f5bbc4b235f
2020-05-26 16:11:10 +00:00
Michael Groover
2046776127 Merge "Address edge cases for signing certificate lineages in sharedUids" into rvc-dev 2020-05-26 16:07:57 +00:00
Michael Groover
f1744af7ed Address edge cases for signing certificate lineages in sharedUids
Currently when a package is installed / updated in a sharedUid the
signatures for the sharedUid are not updated unless the new package
adds a new signer to the lineage; in this case the new lineage is
assigned to the sharedUid without consideration for the existing
lineage. This leads to the following problems:

1. If the current sharedUid lineage is A -> B and the new package has
lineage B -> C then this is used for the sharedUid and A is lost from
the lineage.
2. If the new lineage revokes one or more capabilities from a previous
signer in the lineage these updated capabilities are ignored unless the
lineage added a new signer as well.
3. If the new lineage revokes the sharedUid capability from a previous
signing key in the lineage and another app is installed as part of the
sharedUid and signed with that key the new app's installation is allowed
to proceed.
4. If only a single app is installed as part of a sharedUid, and that
app is updated with a rotated key and a lineage that revokes the
previous signing key's sharedUid capability the update is blocked.
5. If an app is installed as part of the sharedUid and has a diverged
signer in the lineage (ie sharedUid lineage is Y -> A -> B and new app
lineage is Z -> A -> B -> C) the installation is allowed and Y is lost
from the lineage.

Problems 1 and 2 are addressed with the new SigningDetails
mergeLineageWith method that merges common signers between two lineages
and also updates their capabilities to the most restrictive between
the two lineages (capabilities are anded together). Problems 3 is
addressed by checking the signatures of each of the packages in the
sharedUid for any signed with an ancestor for which the sharedUid
capability may have been revoked. Problem 4 is addressed by checking
if the package being updated is the only one in the sharedUid; if so
the update to the new lineage is allowed to proceed. Problem 5 is
addressed by verifying the new app's lineage is the same, a subset, or
a superset of the other.

Bug: 152046935
Test: atest PkgInstallSignatureVerificationTest
Test: atest SigningDetailsTest
Test: atest PackageManagerTests
Test: atest PackageManagerTest
Change-Id: I420c309f522bb47b65ca40ee848024c85cd5804d
2020-05-22 23:50:52 +00:00
Ryan Mitchell
8151421cbe Merge "Invalidate PackageInfo cache when overlays change" into rvc-dev am: 71765aa97c
Change-Id: I650896cfbd0700e6efbb31e816379bfcd59c9238
2020-05-21 20:26:29 +00:00
Ryan Mitchell
71765aa97c Merge "Invalidate PackageInfo cache when overlays change" into rvc-dev 2020-05-21 20:22:07 +00:00
Winson
badad7b62f Remove InstantAppResolverTests for migration to CTS
See change I79b7c42e8a495c0f4ba4cd42a076ac3b43ee2919

Bug: 155114274
Bug: 155115137
Bug: 155115845
Bug: 155116506
Bug: 155116748
Bug: 155117421

Test: atest CtsInstantAppTests

Change-Id: I09023d098c93758c049169a909c27c230bb3dd9b
2020-05-21 11:50:43 -07:00
TreeHugger Robot
9746c711c1 Merge "Add tests for AtomicFile compatibility behaviors." into rvc-dev am: 6b98402100
Change-Id: I24157ed89c99093d91a1e3a7e3d5412e14dd6011
2020-05-21 01:43:55 +00:00
Hai Zhang
c45618242b Add tests for AtomicFile compatibility behaviors.
Bug: 151959443
Bug: 157092639
Test: atest android.util.AtomicFileTest
Change-Id: I84e4f7d482e516ee091170a31d6c2e61c65d8812
2020-05-20 16:33:39 -07:00
Ryan Mitchell
5aa617a3da Invalidate PackageInfo cache when overlays change
When overlays for a target package change, invalidate PackageInfo
caches across all processes. Overlay paths are not persisted in PMS's
settings, so no need to commit to package settings.

Bug: 156743293
Test: presubmit
Change-Id: I193544abe29cff07dda76a75376961d0d51d9c95
2020-05-19 12:13:43 -07:00
TreeHugger Robot
37f0ad1b43 Merge "Change AtomicFile to use rename-into-place." into rvc-dev am: 0d23267a9c
Change-Id: I1235f345fc1709526eedda154696f7cd0b14fc56
2020-05-19 06:57:17 +00:00
TreeHugger Robot
0d23267a9c Merge "Change AtomicFile to use rename-into-place." into rvc-dev 2020-05-19 06:52:52 +00:00
Hai Zhang
b1a7706716 Change AtomicFile to use rename-into-place.
The previous implementation of backing up beforehand doesn't handle
the case where the file is created for the first time, and might leave
a corrupted file in case of failure.

This new implementation creates a new file for writing data into, and
renames it into the place of the original file after writing
finished.

Fixes: 151959443
Test: atest android.util.AtomicFileTest
Change-Id: I5c4c438526a2aecdd2af18f71e16b41a05817c61
Merged-In: I5c4c438526a2aecdd2af18f71e16b41a05817c61
2020-05-19 00:27:32 +00:00
Collin Fijalkovich
aa1c667e4f Merge changes from topic "dump-cacheinfo" into rvc-dev am: acb2bba925
Change-Id: Iec363450741936bc3d8ec0f99c597fb5373b5b9c
2020-05-18 23:56:28 +00:00
Darryl Johnson
f7f71df05c Merge "Make sure config change items are executed in the order dispatched." into rvc-dev am: 0d8822c94a
Change-Id: I2317fc9f603255b092f56253f7aaa3e277b69b14
2020-05-18 23:39:03 +00:00
Collin Fijalkovich
acb2bba925 Merge changes from topic "dump-cacheinfo" into rvc-dev
* changes:
  Add cache debugging information to bugreports.
  Maintain global list of caches; purge on low memory
2020-05-18 20:52:43 +00:00
Darryl Johnson
0d8822c94a Merge "Make sure config change items are executed in the order dispatched." into rvc-dev 2020-05-18 17:26:14 +00:00
TreeHugger Robot
37334ce7d4 Merge "De-duplicate with callerTargets(added by using Intent.EXTRA_INITIAL_INTENTS) when adding DisplayResolveInfo." into rvc-dev am: e79c1056b2
Change-Id: I65562306c089dfedc3d06ae147f4f619fdd69ab5
2020-05-15 23:26:16 +00:00
TreeHugger Robot
e79c1056b2 Merge "De-duplicate with callerTargets(added by using Intent.EXTRA_INITIAL_INTENTS) when adding DisplayResolveInfo." into rvc-dev 2020-05-15 23:10:41 +00:00
Joshua Duong
c28d70db77 Merge "Don't attach PendingIntent if settings app is hidden." into rvc-dev am: 8ba3431761
Change-Id: Ib618a2537340cd1e9683387ff6377c282b5ace7a
2020-05-15 21:15:21 +00:00
Joshua Duong
8ba3431761 Merge "Don't attach PendingIntent if settings app is hidden." into rvc-dev 2020-05-15 21:14:39 +00:00
TreeHugger Robot
b06daeb545 Merge "Sharesheet - Fix app stacking" into rvc-dev am: 8714e7d195
Change-Id: I459d1a499ed6301f727623addfc41eb6e9dc6d81
2020-05-15 20:15:23 +00:00
TreeHugger Robot
8714e7d195 Merge "Sharesheet - Fix app stacking" into rvc-dev 2020-05-15 20:13:47 +00:00
Joshua Duong
b381dfaf18 Don't attach PendingIntent if settings app is hidden.
The settings app may not be available. In that case, just show the adb
notification without a PendingIntent.

Bug: 156453114

Test: atest AdbNotificationsTest
Test: With USB debugging enabled, install TestDPC, and use it to hide settings app.
Unplug and replug USB. USB debugging notification shows up and clicking
it does nothing.
Change-Id: Ie29d2c425c05bce9371600d76e4eb2eaba692fd7

Change-Id: Ie5f746cbc7b8a32fc280177bf281a9e973c8df12
2020-05-15 18:58:33 +00:00
Song Hu
276e384e4c De-duplicate with callerTargets(added by using Intent.EXTRA_INITIAL_INTENTS) when adding DisplayResolveInfo.
Bug: 154611479
Test: atest CtsSharesheetTestCases:android.sharesheet.cts.CtsSharesheetDeviceTest
Change-Id: I812c8275fc6f12ad52f56419eedd0c580530704a
2020-05-15 10:01:52 -07:00
Darryl L Johnson
2b9720c694 Make sure config change items are executed in the order dispatched.
In the previous implementation a batch of process/activity config
changes would effectively be executed out of order. When the server
would dispatch changes in config in quick succession the config change
items would update the pending configs first through the preexecute()
calls and then apply the activity config before the process config
is applied even though the process config was dispatched before the activity
config change item. See b/148639784 for more detail.

Fixes: 148639784

Test: ActivityThreadTest#testHandleActivityConfigurationChanged_EnsureUpdatesProcessedInOrder
Test: ActivityThreadTest#testHandleActivityConfigurationChanged_SkipWhenNewerConfigurationPending

Change-Id: I3c926076ac8dba73eb0471c7bc91313df519cf92
2020-05-15 09:40:30 -07:00
Tiger Huang
4f6a9e78cc Merge "Do not dispatch system UI visibility during traversal" into rvc-dev am: 8fd8a538b8
Change-Id: Ief24436d5c61577546d2b99341945d4bdd39ceb9
2020-05-14 17:27:13 +00:00
Tiger Huang
8fd8a538b8 Merge "Do not dispatch system UI visibility during traversal" into rvc-dev 2020-05-14 17:25:56 +00:00
Matt Pietal
c9544a7e92 Sharesheet - Fix app stacking
When there was greater than 2 candidates for app stacking, the prior
targets would get dropped.

Bug: 156220800
Test: atest ChooserActivityTest
Change-Id: Ia8494bb81e95c5415d080148a0c4f98bd243c142
2020-05-13 21:19:40 -04:00
Collin Fijalkovich
ceefcec397 Add cache debugging information to bugreports.
Following the model for dumpsys gfxinfo, this patchset adds a
CacheBinder service that dumps cache state information from each
process.

Bug: 153661880
Test: adb shell dumpsys cacheinfo
Test: adb bugreport

Change-Id: Ie7cce70e56777a200e3e3e92ab895126b6f29032
2020-05-13 11:15:22 -07:00