Commit Graph

65401 Commits

Author SHA1 Message Date
Alex Buynytskyy
4e5ff2eb7d Merge "Lifecycle: detecting blocked and unhealthy." into rvc-dev 2020-05-27 04:15:54 +00:00
TreeHugger Robot
d7d14eb420 Merge "Dump UidRecord's capability and list of ProcessRecord." into rvc-dev 2020-05-27 01:28:45 +00:00
Mady Mellor
82e64ff476 Merge changes from topic "canBubble_isBubble_nuances" into rvc-dev
* changes:
  Always open bubble for bubble notifs + fix issue
  canBubble only true when it can actually bubble
2020-05-27 00:06:58 +00:00
TreeHugger Robot
c6d6c0b466 Merge "Avoid setting a barrier on layers that will not render frames" into rvc-dev 2020-05-26 23:55:19 +00:00
TreeHugger Robot
dbc5e64b68 Merge "ShellRoot: Hold lock during binder death." into rvc-dev 2020-05-26 23:42:46 +00:00
Hui Yu
39e99108d1 Dump UidRecord's capability and list of ProcessRecord.
For example:
    UID u0a148: UidRecord{4b1bf83 u0a148 BTOP procs:3 seq(0,0,0)}
      curProcState=3 curCapability=LCM
      proc=ProcessRecord{eaf5d6f 3854:com.google.android.googlequicksearchbox:interactor/u0a148}
      proc=ProcessRecord{9b68072 4143:com.google.android.googlequicksearchbox:search/u0a148}
      proc=ProcessRecord{3eaef29 5665:com.google.android.googlequicksearchbox:assistant/u0a148}

UID u0a148's capability is "LCM", it has 3 processes.

Bug: 157269041
Test: "adb shell dumpsys activity -a", looking for "UidRecord"
Change-Id: I564193f47292b8ebf0e239e8da50536931fc3d75
2020-05-26 16:32:21 -07:00
Chavi Weingarten
d91929d91f Merge "Force reportResized when useBlastSync enabled" into rvc-dev 2020-05-26 21:45:03 +00:00
TreeHugger Robot
851415b693 Merge "Disabled DEBUG_USER constant on SystemService." into rvc-dev 2020-05-26 21:37:46 +00:00
Vishnu Nair
1a7075f235 Avoid setting a barrier on layers that will not render frames
Fixes an issue where a barrier is set on a layer that will not
submit a buffer and transactions will get queued up causing
the system to eventually watchdog.

Fixes: 150578848
Test: Run manual repro steps in bug
Test: go/wm-smoke

Change-Id: Icba60e60fa9e62cca2fb3ff06d73f1975485a91d
2020-05-26 21:09:35 +00:00
Mady Mellor
db0a602465 canBubble only true when it can actually bubble
If the notif is unable to present as a bubble:
  - set the record#canBubble value to false
  - null out bubble metadata if present (we show bubble
    button if there is metadata, so shouldn't show it
    if it can't present for some reason)

Because bubble metadata is now null'd out we don't have
the shortcutId to check / update the tracked shortcut
list, so instead if it's null check for that entry in
the list and remove it. Also fixes one spot where we
weren't unregistering the listener before and adds a
test for it.

Test: atest ShortcutHelperTest BubbleExtractorTest NotificationManagerServiceTest
Bug: 152883583
Change-Id: I29e993c01a8fb9fcdf2386b18a94adc712fe101f
2020-05-26 14:02:36 -07:00
TreeHugger Robot
58c7846f6a Merge "WindowlessWindowManager: Set size when creating surface" into rvc-dev 2020-05-26 20:41:22 +00:00
Todd Kennedy
edd9383a90 Merge "Add check for cross user permission" into rvc-dev 2020-05-26 20:16:41 +00:00
Todd Kennedy
dcf6bafbaa Add check for cross user permission
Bug: 153995991
Bug: 153996872
Bug: 153996866
Bug: 155466646
Test: atest ManagedProfileCrossProfileTest
Change-Id: I9d5f8b506f796c4890352ea9d77ec80d3a9ef1da
2020-05-26 20:15:45 +00:00
Alex Buynytskyy
8ef61aebee Lifecycle: detecting blocked and unhealthy.
Part 1: interfaces and PM implementation.

Bug: 153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I312dd919d2bb552bea3d72fb49fd1579882da14b
2020-05-26 19:34:39 +00:00
TreeHugger Robot
00b717d6f4 Merge "updateAppUidRecLocked() needs to run for all ProcessRecord of a UidRecord." into rvc-dev 2020-05-26 18:43:51 +00:00
Robert Carr
5d9d2ddca2 WindowlessWindowManager: Set size when creating surface
When we set the buffer size from relayout window, there is a race
condition where the client may then submit its first buffer but the
transaction hasnt applied yet on the SF side and so the buffer is
rejected. Setting a defualt size when creating fixes this. Luckily
SurfaceControlViewHost size is known at add time, since we force the
window size based on the values passed in to the SurfaceControlViewHost API.

Bug: 157153874
Test: Existing tests pass
Change-Id: I2566844aea81df92f1694f43254a480fc3b3c019
2020-05-26 11:29:39 -07:00
Robert Carr
1dc572934c ShellRoot: Hold lock during binder death.
We need to acquire the lock in removeShellRoot because we may
end up calling it from a binder thread.

Bug: 154486882
Test: Existing tests pass
Change-Id: I59bfd521a04f81590c403025c729729438d0d841
2020-05-26 11:19:37 -07:00
Ryan Mitchell
4515014469 Merge "Add overlayable configurator resources" into rvc-dev 2020-05-26 17:53:47 +00:00
Hui Yu
ca10d44c13 updateAppUidRecLocked() needs to run for all ProcessRecord of a
UidRecord.

for example,
adb shell dumpsys  activity -a | grep *APP*  | grep quicksearchbox
*APP* UID 10148 ProcessRecord{a86bfc8 19343:com.google.android.googlequicksearchbox:search/u0a148}
*APP* UID 10148 ProcessRecord{8932590 20318:com.google.android.googlequicksearchbox:assistant/u0a148}
*APP* UID 10148 ProcessRecord{7458b77 19013:com.google.android.googlequicksearchbox:interactor/u0a148}

UID 10148 has three ProcessRecord.

After uidRec.reset(), for uidRec that has multiple processes(ProcessRecord),
We need apply all ProcessRecord into UidRecord, otherwise, the
UidRecord's proc state and capability are wrong.

Bug: 157269041, 152709842
Test: Use the reproduce step in b/152709842, squeeze phone and talk to
Assistant.

Change-Id: Id46dbd4f428968fb2029255fbcf61bba328b582c
2020-05-26 09:49:03 -07:00
felipeal
edec484d1a Disabled DEBUG_USER constant on SystemService.
Test: none
Fixes: 133242016

Change-Id: I0e34ffc37a0701b5a5ab2843402ce504ce97c4a5
2020-05-26 09:47:39 -07:00
chaviw
73abde9d93 Force reportResized when useBlastSync enabled
We need to always reportResized if using blastSync since the window
waiting on a finishDrawing from the client. Therefore, always add the
window to the resizing list even if bounds have not changed.

Test: WindowStateTests#testRequestResizeForBlastSync
Bug: 153579514
Change-Id: I87b459d95fac315b9a25f2d8e989fe3aaf0c0c85
2020-05-26 09:41:53 -07: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
TreeHugger Robot
7b3b0611d3 Merge "Fixes NPE on null pkg" into rvc-dev 2020-05-26 15:59:58 +00:00
TreeHugger Robot
1961a740b4 Merge "Fix size compat bounds in close-to-square display" into rvc-dev 2020-05-26 15:14:10 +00:00
Patrick Baumann
0bc18b37ac Fixes NPE on null pkg
This change moves unprotected access of a setting's pkg field to take
place after an existing null check.

Test: atest AppEnumerationTests
Fixes: 157298411
Change-Id: I49c0cb0d08dd09cabd271cf195a8eff71a98083c
2020-05-26 06:28:33 -07:00
Lorenzo Colitti
7f7171c6a1 Inform the DNS resolver when it needs to do DNS64 synthesis.
This is only necessary when learning the NAT64 prefix from the
RA, because if the NAT64 prefix is learned from DNS, the DNS
resolver already knows the prefix and automatically enables
DNS64 synthesis.

The DNS resolver needs to be informed of the prefix any time
clat is running on a prefix learned from an RA. This is simple to
implement: just set the prefix when starting clat if prefix
discovery is not running, and clear the prefix when stopping clat
if prefix discovery was not running. This ensures that the prefix
is cleared iff it was set.

Bug: 156914456
Test: new unit test coverage
Original-Change: https://android-review.googlesource.com/1315578
Merged-In: If8ad2d30712a6df3e207c8d3e8a129705242191e
Change-Id: If8ad2d30712a6df3e207c8d3e8a129705242191e
2020-05-26 11:52:35 +00:00
Andrei-Valentin Onea
259d98b1dd Merge "Fix boundary condition for targetSDK gated changes" into rvc-dev 2020-05-26 10:07:47 +00:00
Robin Lee
59b3f7c7f0 Merge "Fix volume key handling for key press repeat" into rvc-dev 2020-05-25 19:44:03 +00:00
TreeHugger Robot
b3898ee44e Merge "Only send <Standby> to TV on sleep when active source" into rvc-dev 2020-05-25 19:37:36 +00:00
Stanislav Zholnin
c1846a1a65 Merge "Remove UidAtomTests from presubmit due to failures." into rvc-dev 2020-05-25 19:31:54 +00:00
Stanislav Zholnin
86b0b984cf Remove UidAtomTests from presubmit due to failures.
Test: manual

Bug: 155714228
Change-Id: I661c6503c387a00803bb949e3e8ca431045dd266
2020-05-25 19:01:34 +00:00
Martijn Coenen
91d3f2a4fc Merge "Don't kill apps for OP_REQUEST_INSTALL_PACKAGES on targetSdk < 26." into rvc-dev 2020-05-25 18:56:58 +00:00
TreeHugger Robot
c82ee307b1 Merge "Fix black screen during Quick switch" into rvc-dev 2020-05-25 18:07:29 +00:00
Riddle Hsu
f9fb7e7b2f Fix size compat bounds in close-to-square display
DisplayContent#ignoreRotationForApps does not mean the display
cannot rotate. It means that the display can rotate without
considering the orientation requested by application. Currently
the case is that the aspect ratio of display is close to square.

Originally if the close-to-square display is rotated, an activity
with fixed aspect ratio will still use non-rotated bounds that
causes unexpected scaling. This change makes the case calculate
the bounds by current rotation.

Fixes: 156543028
Test: SizeCompatTests#testFixedAspectRatioBoundsWithDecorInSquareDisplay

Change-Id: Id22522f9a142806a922f643f4802971df302dadb
2020-05-25 23:29:51 +08:00
Nathalie Le Clair
fd434cbcd8 Only send <Standby> to TV on sleep when active source
Test: make, flash, let device go to sleep due to keycode_power and
energy saver mode, verify that <Standby> is only sent when mIsActiveSource is true.

Bug: 155228844
Change-Id: Ie62d60e8c4fa573aac6c08a4c1093d5f1a52d7f3
2020-05-25 15:25:14 +00:00
Ming-Shin Lu
aa9376bc4f Fix black screen during Quick switch
When quick switch a delayed task, before onTaskAppeared called,
if the user holds gesture on nav bar, TRANSIT_WALLPAPER_OPEN from closing
app happens will cancel recents animation when
WC#applyAnimationUnchecked, and that will cause the black screen if the
delayed task not yet drawn and there is no recents task snapshot on top.

Since cancelling recents animation during quick switching doesn't make
sense, to fix that, we should check the animation task target if is
still controlled by recents animation, if so, we should not cancel it.

Also, make sure if the appeared task has already been in task target list,
(i.e. task A appreared, quick switch to task B, before task B appeared,
quick switch back to task A) if so, we don't need to callback task
appeared again.

Fix: 156670249
Test: manual as issue test steps.
Change-Id: I303403d63c91c08fabcb8c5b1b1aac42c4ec65db
2020-05-25 21:20:33 +08:00
Charles Chen
770597c761 Fix recursive calls on DC#ensureActivitiesVisible
Previously CL[1] used display#ensureActivitiesVisible instead of
stack#ensureActivitiesVisible, and it caused recursive calls on
ensureActivitiesVisible in a very hidden way. A possible scenario
is when an activity paused and AM tried to resume another activity
which did not support multi-resume.

[1]: Id8253eb97581a9dd52ab748117d9cd4cc63a206d

fixes: 156189923
Test: atest DisplayContentTests#testEnsureActivitiesVisibleNotRecursive
Change-Id: Iba2a052e4a1d91edfc6fa80954a730ad5ca3ff0d
2020-05-25 17:39:59 +08:00
Jean-Michel Trivi
7c7016071a Fix volume key handling for key press repeat
The original code for translating volume key presses into CEC
commands was sending the equivalent of a key up / key down for
each call to adjustSuggestedStreamVolume. This behavior caused
CEC commands to pile up in HdmiControlService, and a repeated
key press (user keeping finger on volume button on remote) would
cause volume to still change on the CEC device handling volume
even after the key was released.
  The fix consists in changing how PhoneWindowManager communicates
with AudioService, by passing the key event directly, so AudioService
can communicate the key up / key down information to the CEC
library, which already deals with repeated commands on the CEC bus.

Bug: 137311120
Test: connect DUT to CEC TV or receiver capable of handling vol cmds,
  keep pressing on vol key, verify releasing key stops volume
  changes on TV/receiver.

Change-Id: I7a75af651b6b424129515a8991b5afb15c62dba3
Merged-In: I7a75af651b6b424129515a8991b5afb15c62dba3
(cherry picked from commit 12ba113894ec8ad7c24913a0a09ea70047d25353)
(cherry picked from commit 7e58c9145d71ba92053ad6629f910456566cfea9)
2020-05-25 10:22:38 +02:00
Louis Chang
3799331c9f Merge "Fix returning activity that not in the task" into rvc-dev 2020-05-25 04:53:39 +00:00
Louis Chang
523e3e8cd6 Fix returning activity that not in the task
Illegal state warning logs were able to observe on normal
activity starts flow.

Also should only returning the activity if it is the descendant
of this task.

Bug: 156882835
Test: atest TaskTests
Change-Id: Ia44bbbd8254e3f05b440153c180a3317e4d79209
2020-05-25 10:14:57 +08:00
easoncylee
3e213cffec Fix mis-configuration of TEST_MAPPING file.
UidAtomTests:testAppOps is a test class and test method of
CtsStatsdHostTestCases. To run this in Test Mapping, it should
specify CtsStatsdHostTestCases. as the name in TEST_MAPPING file,
and android.cts.statsd.atom.UidAtomTests as the options.

Bug: 155714228
Test: presubmit test.
Change-Id: I7df08ae811425020ebbeae6a8e9f1317065c00c9
2020-05-24 21:32:51 +00:00
Martijn Coenen
f488724013 Don't kill apps for OP_REQUEST_INSTALL_PACKAGES on targetSdk < 26.
The app-op wasn't required back then, and granting it shouldn't change
the filesystem view.

Bug: 150819885
Test: atest CtsNoPermissiontestCases25 (still fails, but for a different
reason now).

Change-Id: Id505013233c44ad624d3a4b929bbd3c36ecfd8ce
2020-05-24 21:39:27 +02: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
Tiger Huang
2bbb08bc42 Merge "Let top-fullscreen-app window keep controlling status bar" into rvc-dev 2020-05-22 20:35:28 +00:00
Tiger Huang
8949be4a6c Let top-fullscreen-app window keep controlling status bar
If a top-fullscreen-app window is hiding status bar but the focus is
changed to a non-fullscreen window, we let the top-fullscreen-app window
keep controlling status bar. This CL makes the logic compatible with the
legacy insets mode.

Fix: 156322689
Test: WindowInsetsControllerTests
Change-Id: I74387c2c794c8a5a7056eea3ba4ec7257c66652a
2020-05-22 21:55:57 +08:00
Robin Lee
1d22ea4eca Merge "Take interactive bugreports on Android TV" into rvc-dev 2020-05-22 09:58:53 +00:00
Wei Wang
1a8ed6d95c Merge "ThermalManagerService: initialize to THROTTLING_NONE explicitly" into rvc-dev 2020-05-22 02:05:13 +00:00
Claudio Martella
674562840b Merge "Revert "Fix AppOps collection bug."" into rvc-dev 2020-05-21 21:58:27 +00:00
TreeHugger Robot
0a90c7b97e Merge "Move StatsPullAtomService pullers to binder thread" into rvc-dev 2020-05-21 21:44:38 +00:00
Ryan Mitchell
71765aa97c Merge "Invalidate PackageInfo cache when overlays change" into rvc-dev 2020-05-21 20:22:07 +00:00