Commit Graph

23315 Commits

Author SHA1 Message Date
Chris Li
61ba70f1d1 Fix system crash when ActivityEmbedding process died with pending events
Before, when the organizer binder died, it will trigger TaskFragment
removal that can cause surface placement. Now, we make sure to cleanup
all pending events before removing organized TaskFragments.

Bug: 251583070
Bug: 254322068
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: Ifec6f763a7e7819c93cc28d71bd0314f3ac9ac0d
2022-10-25 04:03:04 +00:00
Chris Li
5dafb54f14 Move the ActivityEmbedding Task visibility filter to the client
Before, we only send TaskFragment info event to the client side when the
Task is visible, which may result some TaskFragments stuck in an
intermediate state. Now, we also send the info event to the client if
the app owns any visible Task, and let the client organizer to determine
if it wants to update the TaskFragments.

Bug: 251583070
Fix: 250943776
Fix: 251132298
Test: atest WMJetpackUnitTests:SplitControllerTest
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I47570639c4ed4bdfb4202f65ba4531adbd4a2d2d
2022-10-25 03:53:48 +00:00
Chaohui Wang
76695a5e54 Fix SuspendPackageHelperTest after Kotlin 1.7.20
Fix: 251257818
Test: lunch aosp_cf_x86_64_phone-userdebug
Test: acloud create
Test: atest  SuspendPackageHelperTest
Change-Id: I9a53541e98c0ba596b288ae92fe75f3279aac9cb
Merged-In: I9a53541e98c0ba596b288ae92fe75f3279aac9cb
Merged-In: Ie900be9e8f8a306f06e9856a25965c7a9e08b684
2022-10-18 05:39:26 +00:00
TreeHugger Robot
a45c7f7de3 Merge "Launch all activities into the same root task" into tm-qpr-dev 2022-10-18 02:53:28 +00:00
Lucas Silva
63402cf7d5 Merge "Update PowerManager to make ambient display suppression apply to dreams." into tm-qpr-dev 2022-10-18 00:51:59 +00:00
Colin Cross
b6b58d09b6 Merge "Fix more kotlin 1.7.0 errors" into tm-qpr-dev 2022-10-17 23:51:26 +00:00
Lucas Silva
6430c547b8 Update PowerManager to make ambient display suppression apply
to dreams.

Bug: 246472225
Test: manually by triggering ambient suppression/unsuppresion via adb
Test: atest PowerManagerServiceTest
Change-Id: Ib8cb68239be04e0481a1af14d974d9623f509eb9
2022-10-17 20:35:30 +00:00
Lucas Silva
a13bb16268 Merge "Add internal API to PowerManager which allows napping when device is asleep." into tm-qpr-dev 2022-10-17 18:34:46 +00:00
William Leshner
01f14d6873 Merge "Keep dreaming when undocked when configured to." into tm-qpr-dev 2022-10-17 15:35:41 +00:00
Jeff Chang
627b857191 Launch all activities into the same root task
When multiple activities are launched through a PendingIntent, all
activities need to be launched onto the same root task. To ensure
that, the launch root task information from the passed-in
SafeActivityOptions object are used to create a new
SafeActivityOptions object for bottom activities.

Bug: 243630981
Test: Drag and drop "new conversation" shortcut of Messages to split
      atest test_selectiveCloneLunchRootTask
Change-Id: I437db94f0019cf561464527147da08ccf4ac4cd3
2022-10-17 17:27:30 +08:00
Ruslan Tkhakokhov
c88bdf8a75 Offload teardown logic after BackupAgent crash to a worker thread
Teardown logic introduced in ag/16247901 is called on a foreground
thread in ActvitiyManager. The teardown itself might be time-consuming,
causing system_server to crash due to a blocked foreground thread (see
linked bug for more context).

This CL limits the scope of the fix to just the new logic that caused
the regression. Follow-up improvements should be made to ensure
time-consuming operations don't block foreground threads in the future
(b/242307900 will track).

Fixes: 213860448
Test: 1. atest UserBackupManagerServiceTest
      2. atest CtsBackupTestCases
      3. Kill app during full backup -> ensure agent is properly torn
	 down.
      4. Modify BackupTransport::cancelFullBackup() impl. to block; kill
	 app during full backup -> ensure foreground thread is not
	 blocked and agent is still properly torn down.
Change-Id: I6c1cb1ff71814564d5884a362135edfad3b258f2
2022-10-14 17:27:40 +00:00
Joe Bolinger
9541293118 Merge "Add a final lux method to ALSProbe." into tm-qpr-dev 2022-10-14 00:58:12 +00:00
Massimo Carli
d119d25429 Merge "Fix letterbox for SCREEN_ORIENTATION_BEHIND" into tm-qpr-dev 2022-10-13 21:27:10 +00:00
Joe Bolinger
4613aa9552 Add a final lux method to ALSProbe.
This address two remaining issues with with ALS logging since the pointer events were removed from the framework (starting at commit aa07cc3db3).

1) After the pointer events were removed the logging was updated to use wakefullness events as an alternative trigger. However, these events are often too slow when authenticating from the AoD and the sensor may not have a chance to be enabled or respond before the operation completes. The new method allows the sensor to be enabled after the operation has completed to fetch a value.
2) Fixes a bug where the initial wakefullness status was not checked at the start of an auth operation.

Fix: 253318983
Test: atest ALSProbeTest FingerprintAuthenticationClientTest BiometricLoggerTest
Test: statsd_testdrive 88 (verify lux field is always greater than 0 from AoD and with BP test app)
Change-Id: I2b1572579f52dc9dad7238d47e27b0068c7c74c6
2022-10-13 13:26:35 -07:00
Lucas Silva
16d6ddde58 Add internal API to PowerManager which allows napping when device is
asleep.

This allows us to enter the dream directly while the device is off, instead of needing to wake the device before entering dream.

Bug: 246472225
Test: adb shell cmd dreams start-dreaming (while device asleep)
Test: atest PowerGroupTest
Change-Id: Id4634f3d5f7c3ae324f85f11a6991f0cab068a7d
2022-10-13 10:52:06 -04:00
Massimo Carli
dd0f685060 Fix letterbox for SCREEN_ORIENTATION_BEHIND
At the moment, an activity with "behind" doesn’t go in
letterbox as expected when it’s at the top of a portrait-only
one which was letterboxed in landscape device orientation.

An activity with "behind" orientation will be letterboxed if it is
the activity that's immediately beneath it

Test: Launch an activity using SCREEN_ORIENTATION_BEHIND on top
of a fixed orientation activity and check it's letterboxed. Also run
`atest ActivityRecordTests`

Fix: 244309481

Change-Id: I221e4c2a778a4e2ea11795e82366bf5bb08a5507
2022-10-13 14:05:58 +00:00
Chris Li
9e3020b233 Merge "Polish ActivityEmbedding enter/exit PiP (1/n)" into tm-qpr-dev 2022-10-13 08:51:48 +00:00
Will Osborn
6d1c1b57b4 Merge "Allow rotation when display is half-folded" into tm-qpr-dev 2022-10-13 08:47:42 +00:00
Chris Li
84ec824a33 Polish ActivityEmbedding enter/exit PiP (1/n)
1. When moveActivityToPinnedRootTask with creating a new Task for PiP,
   make sure the Task's initial bounds is the same as the activity
   parent TaskFragment so the animation starts from the correct bounds.
2. When exit PiP to previous Task, make sure we are animating the
   correct window surface. For the previous implementation. there can
   also be TRANSIT_CHANGE change for entering ActivityEmbedding split
   (from PiP) in the same transition.

Bug: 207070762
Test: atest WmTests:RootWindowContainerTests
Test: atest WmTests:TransitionTests
Merged-In: Ifba090ad9ac9fb7033d343eab1c87c1a67bb9c11
Change-Id: Ifba090ad9ac9fb7033d343eab1c87c1a67bb9c11
2022-10-13 09:02:27 +08:00
Ats Jenk
a746afaa4e Merge "Create a launch params modifier for desktop mode" into tm-qpr-dev 2022-10-12 22:50:42 +00:00
Ats Jenk
6f0d613108 Create a launch params modifier for desktop mode
When desktop mode is supported, launch freeform tasks in a larger
default size.

Test: launch in task in desktop mode, observe new default size
Bug: 250097202
Change-Id: Ide757fa419323e4e7529d4480a095cd4a11e3d00
2022-10-12 11:43:53 -07:00
TreeHugger Robot
3865708949 Merge "Only consider to keep activity config if invisible requested" into tm-qpr-dev 2022-10-12 13:34:27 +00:00
Darrell Shi
4ccdca90b7 Merge changes Icea03eb6,Idad15d8e into tm-qpr-dev
* changes:
  Add more specific start/stop dream reasons.
  Dream manager improvements.
2022-10-11 16:15:11 +00:00
Riddle Hsu
f12c7b7aa6 Only consider to keep activity config if invisible requested
Otherwise unlike activity always has a valid initial config, wallpaper
may get an empty config (frame) if it is initializing when invisible.

Bug: 251371010
Test: atest WindowManagerServiceTests#testRelayoutExitingWindow

Change-Id: I41c1b350d56657b5e93456f8e57b788696747d92
2022-10-11 05:31:25 +00:00
Darrell Shi
312db22a14 Add more specific start/stop dream reasons.
As dreams get more complex, we would like more specific loggings for how
dreams are started/stopped for better debugging.

This CL adds "reason" as a required parameter in the start/stop dream
internal/private API. This allows callers to specify reasons.

Bug: 252796782
Fix: 252796782
Test: verified reasons are correctly logged on device
Change-Id: Icea03eb6e23ca113f50fa047f6d57e6e1d0b5604
2022-10-10 20:17:05 +00:00
William Osborn
9723cfbc38 Allow rotation when display is half-folded
When in 'tabletop' or 'book' mode, allow the display to rotate
even if it is frozen. Then return to the previously locked rotation when
the device is unfolded.

Bug: 240146362
Test: locally tested + ran atest on DisplayRotationTests
Change-Id: I9869f5b070fecd7df70e08323dfacef8b883f470
2022-10-10 20:47:26 +01:00
TreeHugger Robot
58b37f9a55 Merge "Fix TransitionTests#testFlagFillsTask_openActivityFillingTask" into tm-qpr-dev 2022-10-09 04:44:25 +00:00
Will Leshner
9f8583b06e Keep dreaming when undocked when configured to.
Bug: 251461510
Test: atest PowerManagerServiceTest

Change-Id: Ie760c3ec76a08f71aa1dcab956b165e8895d1c59
2022-10-07 13:51:56 -07:00
Colin Cross
2bab49dd2f Fix more kotlin 1.7.0 errors
Fix "'when' expression must be exhaustive" and UNEXPECTED_SAFE_CALL
errors.

Bug: 216136346
Test: m checkbuild
Change-Id: I2c1b1f7581426496f31198896c4ff3bd9abf2941
(cherry picked from commit 64acfee25d)
Merged-In: I2c1b1f7581426496f31198896c4ff3bd9abf2941
2022-10-07 20:14:01 +00:00
Chris Li
62b3f1aa39 Fix TransitionTests#testFlagFillsTask_openActivityFillingTask
Make sure the Task bounds is set correctly.

Fix: 250094641
Test: atest WmTests:TransitionTests
Change-Id: I7ef5c47625ab1c17dcab336057c93b243688022e
2022-10-07 22:00:41 +08:00
Charles Chen
c0ee7bde68 Merge "Fix SplitContainer not updated when folded." into tm-qpr-dev 2022-10-07 09:19:39 +00:00
Charles Chen
6e0b27a126 Fix SplitContainer not updated when folded.
The root cause is that TaskFragmentParentInfo wasn't be dispatched
when there's a display or visibility change because we didn't
implement getTaskFragment() in TaskFragment and it led to
the TskFragment can't return itself if the predicate function
returns true.

This CL fixes WC#getTaskFragment and changes to dispatch
Task#shouldBeVisible instead of Task#isVisibleRequested.
The reason is that the visibleRequested change is not early enough for
the scenario that device is folded from unfolded state, and lead to
Settings flickering.

Test: manual - open Settings and fold the device
Test: atest TaskTests#testGetTaskFragment
Test: atest TaskFragmentOrganizerControllerTest ActivityRecordTests
fixes: 249055633
Change-Id: Ie1c56758697d14b426c9ed713da84e49c9f880d8
2022-10-06 17:08:42 +08:00
Fiona Campbell
d639c8ee73 Merge "Add idle threshold levels to ddc" into tm-qpr-dev 2022-10-06 08:35:52 +00:00
Evan Rosky
559b8310f4 Merge "Consider "similar" change modes the same for promotion purposes" into tm-qpr-dev 2022-10-05 23:01:18 +00:00
TreeHugger Robot
666111dfa7 Merge "Add InputDeviceBatteryListener to InputManager" into tm-qpr-dev 2022-10-05 20:52:59 +00:00
Evan Rosky
aac5fb7387 Consider "similar" change modes the same for promotion purposes
If all the siblings of a change are changing in a similar way
(ie. all ending-up visible or non-visible) then they can be
considered the same mode for promotion (ie. if one child is hide
while the other is close, it is valid to promote).

Bug: 250012839
Test: atest TransitionTests
Change-Id: Iedd12ee0ca6c026848c6c4d3259fef541609f724
2022-10-05 17:10:04 +00:00
John Wu
576b93c7fe Merge "Do not resolve ActivityInfo in navigateUpTo" into tm-qpr-dev 2022-10-05 16:36:10 +00:00
Louis Chang
19be85eef8 Merge "Trim the activity info of another uid if no privilege" into tm-qpr-dev 2022-10-05 14:06:29 +00:00
Lucas Silva
9b428b25c9 Merge "Fix PowerManager#dream API by partially rolling back ag/19763724" into tm-qpr-dev 2022-10-05 14:03:42 +00:00
TreeHugger Robot
96eae2359b Merge "Make startTransition one-way" into tm-qpr-dev 2022-10-05 12:52:45 +00:00
Fiona Campbell
281b849e1e Add idle threshold levels to ddc
- Add idle screen brightness mode threshold tuning to ddc
- Migrate existing threshold tuning to ddc.
- Add tests for all thresholds in the ddc.

Bug: 242267499
Test: adb shell dumpsys display | grep -A4 HysteresisLevels
Test: atest com.android.server.display

Change-Id: I9e67aa60609c4202321477a001504d29028d7f6b
Merged-In: I9e67aa60609c4202321477a001504d29028d7f6b
2022-10-05 11:15:46 +00:00
TreeHugger Robot
1cd69247c2 Merge "Fix condition to dispatch config for visible window" into tm-qpr-dev 2022-10-05 10:17:58 +00:00
Riddle Hsu
935b474bec Fix condition to dispatch config for visible window
The condition in [1] was accidentally inverted. Then the activity
might get an intermediate config from view root but ActivityRecord
isn't aware of that.

[1]: I19af6cf7f9a4a27fbc987d920630e2de95ced602

Bug: 245225302
Test: atest WindowManagerServiceTests#testRelayoutExitingWindow
Change-Id: I4cbbd52f32019fbc7347365156b1e95399d1ecc7
2022-10-05 10:07:25 +00:00
Riddle Hsu
b2327bcfa6 Merge "Do not set orientation changing to invisible window" into tm-qpr-dev 2022-10-05 08:39:48 +00:00
Riddle Hsu
fb95d523ed Merge "Skip deferring draw for non seamless rotation window" into tm-qpr-dev 2022-10-05 05:46:05 +00:00
John Wu
d75844cf9a Do not resolve ActivityInfo in navigateUpTo
During navigateUpTo, it will first resolve the activity before creating
the ActivityStarter. This bypasses the explicit intent filter
enforcement introduced in T, exposing a security flaw that allows
non-matching intents to be delivered to components.

Bug: 238602879
Test: atest CtsWindowManagerDeviceTestCases
Change-Id: I9aa3e27f753f2f809e74a8f421f8b68e4d610702
Merged-In: I9aa3e27f753f2f809e74a8f421f8b68e4d610702
2022-10-04 08:23:17 +00:00
Riddle Hsu
724c1c3c05 Skip deferring draw for non seamless rotation window
Otherwise even if keepAppearanceInPreviousRotation is not called,
the draw transaction requested by InsetsSourceProvider#onPostLayout
may still be deferred with start transaction of transition even if
blast group sync is off.

Bug: 247856453
Test: TransitionTests#testDisplayRotationChange

Change-Id: I8360ab65d886e86351c3fa3ffcbff5ec88accedb
Merged-In: I8360ab65d886e86351c3fa3ffcbff5ec88accedb
2022-10-04 06:44:29 +00:00
Lucas Silva
7cf2634f91 Fix PowerManager#dream API by partially rolling back ag/19763724
ag/19763724 modified Sandman.java to use LocalServices, but it turns out
that Sandman.java is exposed to clients via PowerManager - where
LocalServices isn't available. This caused PowerManager#dream to break

Fixes: 249916607
Test: atest UiModeManagerServiceTest
Test: "OKG go to ambient" voice command
Change-Id: I3e031593568fdb7b92a1209823463832feeb1601
2022-10-03 14:54:31 -04:00
TreeHugger Robot
bc62749f01 Merge "Revert "Adding the missing display mode strings to persistentDataStore"" into tm-qpr-dev 2022-09-30 19:48:31 +00:00
TreeHugger Robot
bcc9dddda3 Merge "DO NOT MERGE: Revert "Removing the initialising the mode with system pref mode."" into tm-qpr-dev 2022-09-30 18:28:29 +00:00