Commit Graph

7148 Commits

Author SHA1 Message Date
Chris Li
840218d5df Allow ActivityEmbedding to finish Activity through WCT
Before, we call Activity#finish() to finish activities when removing
TaskFragment. This may start a CLOSE transition before the organizer has
a chance to request the actual transition type.

Now, we allow the organizer to finish activities through WCT so that the
operation is atomic and the organizer can request the correct transition
type.

Bug: 240519866
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Test: atest CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerTest
Change-Id: I54671fb2dd34dca952468305429a90d89953de69
2022-09-23 21:23:03 +08:00
Kenneth Ford
7f8d5fd451 Introduces requestBaseStateOverride test API
Adds new requestBaseStateOverride on DeviceStateManager
to be used for testing, to provide a similar behavior
to changing the physical configuration of the device.

This is necessary now that the requestState API is being
used for features now, we need a test API that will
be a closer simulation to physical device changes.

Bug: 234336979
Test: DeviceStateManagerGlobalTest
Change-Id: I6ad9e799329f16521aa3c13b248eed762fe0b121
2022-09-21 23:47:04 +00:00
Darrell Shi
05dfa43c03 Merge "DO NOT MERGE: add interim startDream api." into tm-qpr-dev 2022-09-15 16:00:34 +00:00
Darrell Shi
93e654d66c DO NOT MERGE: add interim startDream api.
DreamManager#startDream has been updated on QPR and master which removes
the unnecessary component name parameter, but it breaks TM CTS tests.
The interim api added in this change will prevent breakage on TM, and
should not be merged downstream.

Test: atest DreamManagerServiceTests
Fix: 245223722
Fix: 245058392
Fix: 245070240
Change-Id: Id9e8cc67003da9fc3e03bffd6ec50643d10652b5
2022-09-14 20:42:20 +00:00
Chris Li
3550fa269a Cleanup unused TestApi in TaskFragmentOrganizer
The callback handling is moved to SplitController#onTransactionReady, no
longer need those TestApi.

This is different from the merged-in cl for CTS compatibility in the
current release.

Bug: 240519866
Test: pass existing
Change-Id: I66ddd51c94003254001436ff0505dde3b26d0437
Merged-In: I66ddd51c94003254001436ff0505dde3b26d0437
2022-09-13 09:38:26 +08:00
Lucas Silva
de117f20ff Merge "Fix vulnerability that allowed attackers to start arbitary activities" into tm-qpr-dev 2022-09-02 17:18:21 +00:00
Darrell Shi
68e81c211e Merge "Add hidden system dream API in DreamManagerService." into tm-qpr-dev 2022-09-01 16:41:32 +00:00
Maryam Dehaini
ef023c1411 Merge "Move Task Close to WindowContainerTransaction" into tm-qpr-dev 2022-08-31 20:39:37 +00:00
Lucas Silva
2ce1b7fd37 Fix vulnerability that allowed attackers to start arbitary
activities

Test: atest DreamServiceTest
Test: flashed device and verified dream settings works as expected
Fixes: 242845514
Change-Id: I6e90e3a0d513dceb7d7f5c59d6807ebe164c5716
2022-08-31 11:10:21 -04:00
Darrell Shi
3c94bacacd Add hidden system dream API in DreamManagerService.
This change
- adds a new private API in dream manager that allows a client with
  write dream permission to set a system dream component, which takes
  precedence over user configured dream
- fixes startDream() API in DreamManager which shouldn't take in a
  component name

Test: atest SystemDreamTest
Bug: 222529147
Change-Id: Iee9a0af1071e5ed57fa5bd4b0d06d8178118116e
2022-08-30 23:19:44 +00:00
Maryam
193d515420 Move Task Close to WindowContainerTransaction
Added removeTask HierarchyOp so that CaptionWIndowDecorModel now uses WindowContainerTransaction to remove task rather than IActivityTaskManager#removeTask(int)

Bug: 242094334
Test: Manual testing using acloud and unit testing (atest WmTests:WindowContainerTransactionTests)

Change-Id: I9e2f1946a517bdba6a75b7049f00943d729045f0
2022-08-30 22:17:21 +00:00
Chris Li
da64f9599f Make WCT#requestFocusOnTaskFragment a TestApi
So that we can verify the API in CTS.

Bug: 232476698
Test: CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerPolicyTest
Change-Id: I0e064f8cae48cc0281a0b462b8d072baceeeca9f
2022-08-26 10:19:37 +08:00
Chris Li
660101fdc7 Apply TaskFragmentOrganizer changes in one WCT (2/2)
Before, when receive TaskFragment transaction, we apply changes in
multiple WindowContainerTransactions. Now, update to apply all changes
in one WCT for the whole TaskFragment transaction.

Bug: 240519866
Test: pass existing
Change-Id: I943d6232ff226ed6f67367fa9b7f73e1f861de64
Merged-In: I943d6232ff226ed6f67367fa9b7f73e1f861de64
2022-08-20 20:19:57 +08:00
Louis Chang
61bfe6e0dc Sending TaskFragmentInfo and operation type in #onTaskFragmentError
So, the TaskFragmentOrganizer can know what exact operation was
failed and perform error handles if needed.

Removes the pending appeared activities when starting/reparenting
activity into a TaskFragment was failed.

Deprecating the #onTaskFragmentError method with another overloaded
version, but still making sure the deprecated one is called in order
to make it compatible with Android T CTS.

Bug: 236668365
Bug: 233989810
Test: atest TaskFragmentTest
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest
Test: atest TaskFragmentOrganizerPolicyTest
Change-Id: Id328d037536d32b3acb9c424d36052b6dca8628a
Merged-In: Id328d037536d32b3acb9c424d36052b6dca8628a
2022-07-28 01:36:38 +00:00
TreeHugger Robot
c326217c51 Merge "Correct the range of issueOfDataEphemeris as [0, 1023]" into tm-dev am: 58dc8eb63b am: 0f0fbcad8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19272069

Change-Id: I47c1c8a7404061b61b69a6e98049db90c3963aca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 23:14:24 +00:00
Yu-Han Yang
70f5d083ce Correct the range of issueOfDataEphemeris as [0, 1023]
Bug: 239083503

Test: atest SatellitePvtTest
Change-Id: I017b4e83a6af61c7827c9135176953809b139bb7
Merged-In: I017b4e83a6af61c7827c9135176953809b139bb7
2022-07-14 23:48:48 +00:00
Tony Huang
3b3c628f63 Merge "[DO NOT MERGE] Fix founction not found on tm cts tests" into tm-qpr-dev 2022-06-08 07:48:59 +00:00
Chet Haase
7e79d7c171 Allow system to disable behavior of pausing animators for bg apps am: 161732cf18 am: 339361ad29
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18527682

Change-Id: Ib075c2aeea02f640a0487aa6ee61974186e50270
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 20:28:11 +00:00
Chet Haase
f6541ab73e Pause animators when app is not visible am: b99cc5b4c8 am: f2e66fa4ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528824

Change-Id: I4a220654954199c26f29a93d8afc3ad8a448547e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 20:28:07 +00:00
Tony Huang
15578338b5 [DO NOT MERGE] Fix founction not found on tm cts tests
We refactor setAdjacentRoots function on tm-qpr but cts suite is
still using tm branch and it lead to it cannot found previous
function. Add a temp function params same as old one on tm-qpr only
for pass tests.

Fix: 235169332
Test: atest MultiWindowTests on tm-dev codebase
Change-Id: I3eaea698089cec78ef7fcef17817317c55a7bfe6
2022-06-07 16:03:37 +08:00
Tony Huang
4f8c3f0841 Merge "Remove the special logic of the divider bar z-ordering" into tm-qpr-dev 2022-05-25 02:01:26 +00:00
Chet Haase
161732cf18 Allow system to disable behavior of pausing animators for bg apps
This change adds a static method which can be called to disable the
default behavior of pausing infinite animators when an app's windows
are all in the background. This could potentially be used for
global behavior of a system property to disable this behavior system
wide.

Bug: 232937493
Bug: 233391022
Test: Added new cts test to AnimatorLeakTest to verify behavior
Change-Id: Idf4957e3968253228096671fde89f820311883e3
Merged-In: Idf4957e3968253228096671fde89f820311883e3
2022-05-23 20:31:19 +00:00
Chet Haase
b99cc5b4c8 Pause animators when app is not visible
Because animators are not tied to the lifecycle of any UI
elements, it is possible for an app to go into the background
and for the animators to continue running. Ideally, the app would
track the lifecycle of the activity/etc and pause or disable the
animators, but it is common for this to not happen, causing the
animators to continue spinning when the app does not need them.
The animators are not causing as much work as for a foreground
activity (since they do not cause any re-rendering), but they cause
work nonetheless by keeping Choreographer awake to continue pulsing
frames.

The ideal fix would be to introduce new API for animators that
tied them to lifecycle concepts (View, Activity, etc). But that kind
of fix would only be available for future versions of the platform,
and does not address existing app code. A workaround for the current
situation is to address the most egregious problems; infinite animators
running on backgrounded apps.

The fix here is exactly that: when an app's visible surface (either an
activity or, for Wallpapers, a WallpaperService) is backgrounded,
a request is sent to pause animators for that surface. When that surface
comes to the foreground, a request is sent to resume those animators.
Since all animators are handled on the same thread for the same process,
in AnimationHandler, we should only ever pause animators when *all*
surfaces for a process are not visible (and resume them when *any*
surface becomes visible). Also, to mitigate any issues with thrashing
animator state for apps which become only transiently backgrounded,
we delay pausing for some time.

Bug: 228598053
Bug: 233391022
Test: new AnimatorLeak CTS test, plus manual testing for activities
    and wallpapers

Change-Id: I8b9f841cc80babb972244c724968a5c085a06b69
Merged-In: I8b9f841cc80babb972244c724968a5c085a06b69
2022-05-23 20:31:19 +00:00
TreeHugger Robot
b3a0c13a88 Merge "Remove preferKeepClearAreaForFocusDelay, turn it into a flag" into tm-dev am: 12a7628e16 am: c3f7c80692
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18184947

Change-Id: I0b1f8272f51f60519011d3a98b1679fe83a3e6ce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 16:34:16 +00:00
Tony Huang
20e5039095 Remove the special logic of the divider bar z-ordering
Remove the divider bar z-ordering logic since the divider bar is
attached to a single-top root task for split screen now. Remove
split anchor too because it is for legacy split screen using.
Also removed corresponding tests which are no longer needed after
this patch.

Bug: 199236198
Test: pass existing tests
Change-Id: I3435a3c81de78804c8110eb38bbacd0a23b391ef
2022-05-20 14:58:55 +08:00
Robert Horvath
2a6ce367fe Remove preferKeepClearAreaForFocusDelay, turn it into a flag
TV PiP repositioning in response to keep clear area changes will be
debounced in SystemUI, so the client side delay in setting a keep clear
area with focus becomes obsolete.
Instead the config is turned into a flag for whether focused views
should automatically be marked as keep clear areas.

Bug: 231309309
Test: atest KeepClearRectsTests
Change-Id: I0ac61e671bb75e22a95b400c9bd8d84004379e43
Merged-In: I0ac61e671bb75e22a95b400c9bd8d84004379e43
2022-05-19 19:27:44 +00:00
Julia Reynolds
cb38803c23 Merge "Fix blockable system notifications" into tm-dev am: ddfeaa18f7 am: 0c63a032f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18292722

Change-Id: I444b147a291bb8cf9db30f3ecb20fa00d8e7535e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 12:50:06 +00:00
Julia Reynolds
756a475be5 Fix blockable system notifications
Notifications can be non-blockable if their app has the
permission fixed or if the app holds certain roles.

Calculate that on device boot and role change, and use the same
source of truth for all UIs. As a bonus, we can remove some
systemui binder calls.

Test: SystemUiTests & FrameworkUiServicesTests
TesT: verify that 'usb debugging connected' notifs are non blockable
but magnification ones are, in systemui and settings
Fixes: 231662091

Change-Id: I980718ab61196901d976f9ea8ee035eafc021fc8
2022-05-11 21:37:44 +00:00
Tony Huang
c3565a503d Merge "Clean up the legacy split screen (9/n)" into tm-qpr-dev 2022-05-10 04:03:06 +00:00
Julia Reynolds
729eee42e5 Merge "Remove notification permission feature flag" into tm-dev am: af7982277b am: 1c7aab6735
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18164160

Change-Id: Ie439e1d17ace323879e1c7fa2ceeb0be866954ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 21:21:09 +00:00
Julia Reynolds
af7982277b Merge "Remove notification permission feature flag" into tm-dev 2022-05-09 20:16:09 +00:00
Tony Huang
103f4a9673 Clean up the legacy split screen (9/n)
This should be final clean patch, remove legacy split screen
package and its windowing modes

Bug: 199236198
Test: build pass
Test: pass existing tests
Ignore-AOSP-First: remove whole package
Change-Id: Ib2af42834938032bf525b8c16b1046b4c898b8d5
2022-05-09 13:59:13 +08:00
Shan Huang
78c429f948 Merge "Migrate IME to handle back with OnBackInvokedDispatcher." into tm-dev am: e3a61826eb am: 4472170cb9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17952046

Change-Id: Icf52d1afb13bdab55270c3e6319b4d889d114db0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 20:19:10 +00:00
Shan Huang
e3a61826eb Merge "Migrate IME to handle back with OnBackInvokedDispatcher." into tm-dev 2022-05-06 19:35:42 +00:00
Julia Reynolds
0be19ec3c5 Remove notification permission feature flag
And the related obsolete code.

Test: SystemUITests, framework services tests, NotificationManagerTest
Fixes: 231344755
Change-Id: Id14941f82305b0216f2a12221d4195f8afcc65ab
2022-05-04 17:59:02 -04:00
Adam Bookatz
7a5725bfe6 Merge "Ensure getUserName cannot return null" into tm-dev am: 1503b56202 am: 10b45a2107
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18126297

Change-Id: Ib4bc41d74d8f486e79e43e7b332c93a2051c562b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 17:58:46 +00:00
Shan Huang
a6666f2221 Migrate IME to handle back with OnBackInvokedDispatcher.
We currently close the IME by having the target application forward KEYCODE_BACK to the IME process through InputMethodManager#dispatchInputEvent and having the IME handle the keycode in InputMethodService#onKeyDown. When apps opt in to OnBackInvokedDispatcher API, we will not dispatch KEYCODE_BACK to apps anymore. Thus we need to migrate IME to the new API for it to close on back invocation.

This implementation forwards OnBackInvokedCallbacks from the IME process
to the app process. This is necessary because all callbacks need to
exist in the app process for them to be considered by hardware back keys. While back gestures go through WM to resolve callbacks from the focused window, hw keys are directly sent to the focused window's ViewRootImpl, bypassing server side back nav logic.

Bug: 228358882
Test: atest CtsInputMethodTestCases:KeyboardVisibilityControlTest
Test: atest CtsInputMethodTestCases:InputMethodServiceTest
Test: atest CtsInputMethodTestCases
Change-Id: Ie207b63b11a56c9b2173f26b734a27b13ebccc60
2022-05-04 05:31:08 +00:00
Sudheer Shanka
c767408a54 Merge "Verify INTERACT_ACROSS_USERS_FULL perm for cross-user calls." into tm-dev am: 5047c1abb4 am: 73b8912e2d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17947145

Change-Id: I4742c422bc9305d0dc24039b84ce18b60dcf177a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 22:48:58 +00:00
Adam Bookatz
cd2466ee30 Ensure getUserName cannot return null
A user can be created with an explicitly null name, as happens in tests.
But getUserName claims to never return null. So we must do a null-check
here to prevent it.

Bug: 227624966
Test: atest UserManagerTest
Change-Id: Iea0e7b6292c6dd49df1bebc5467091a82ddaedb5
2022-05-02 20:18:54 +00:00
Sudheer Shanka
5047c1abb4 Merge "Verify INTERACT_ACROSS_USERS_FULL perm for cross-user calls." into tm-dev 2022-04-30 01:07:51 +00:00
Yurii Zubrytskyi
8ea36089c6 Merge "frameworks/base - Tiramisu is now 33 #4" into tm-dev am: 029b86ef00 am: 6b3b2ebcce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17778829

Change-Id: I7e0c35149c6cf8d26cee0ff91f75fd377a30f4b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 19:09:10 +00:00
Yurii Zubrytskyi
5b3038ea7e frameworks/base - Tiramisu is now 33 #4
update the lint baselines for the new SDK

Bug: 225745567
Test: Build
Change-Id: Ifcc86b065ce770561a391a84d8bb81c2b72307cd
Merged-In: Ifcc86b065ce770561a391a84d8bb81c2b72307cd
2022-04-27 16:37:19 +00:00
Sudheer Shanka
85a9add6bd Verify INTERACT_ACROSS_USERS_FULL perm for cross-user calls.
Bug: 218338453
Bug: 217935264
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I3ef13204834e04228280a73e8a095720d5e854a3
2022-04-26 17:19:52 -07:00
Charles Chen
a4c2e9162b Merge "Promote isFloating to TestApi" into tm-dev am: 6ed3a87798 am: 98ff6c839b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17887364

Change-Id: Ic5e30c76c23e88986473559b7d2ca496afee9f93
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-26 07:27:16 +00:00
Charles Chen
6ed3a87798 Merge "Promote isFloating to TestApi" into tm-dev 2022-04-26 06:20:14 +00:00
Issei Suzuki
3a0ce75489 Merge "Add timestamp to ActivityOptions.OnAnimation*Listener" into tm-dev am: 408b90ffad am: 69ca04c6e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17860344

Change-Id: I2eee80f5c11f997b8071ac62bcb1afa939365251
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-23 05:10:02 +00:00
Issei Suzuki
8fbc23c5c9 Add timestamp to ActivityOptions.OnAnimation*Listener
Bug: 229948029
Test: atest ActivityTransitionTests
Change-Id: I1e6d21c8b603f4e81bde6c649868baad625c2b38
2022-04-22 21:47:24 +02:00
Charles Chen
6010845a4a Promote isFloating to TestApi
fixes: 229824513
Test: presubmit
Change-Id: I0023ee49bb4bcc4a49563a26107484915dc7713b
2022-04-21 17:17:17 +08:00
Lucas Silva
b075a1d669 Merge "Cleanup dream preview complication." into tm-dev am: b6918681db am: 7a2fba6d8d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17731951

Change-Id: I327d1f2fd7955ad41fcbfc8995ea81338e44b306
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 16:48:56 +00:00
Lucas Silva
b6918681db Merge "Cleanup dream preview complication." into tm-dev 2022-04-20 16:17:50 +00:00