Commit Graph

2874 Commits

Author SHA1 Message Date
Issei Suzuki
0dfb582d5a Merge "Exclude launcher from app transition animation while recents is running." into tm-dev 2022-05-31 15:48:01 +00:00
Rubin Xu
07df5c4d16 Update security_log_writer group name
group name was changed during review but not updated
in the permission mapping.

Bug: 232283779
Test: manual
Change-Id: Ib7df61fa4fd49c8419f0543fd6c54186a33ebeb6
(cherry picked from commit 4486314be6)
Merged-In: Ib7df61fa4fd49c8419f0543fd6c54186a33ebeb6
2022-05-26 17:45:49 +00:00
Rubin Xu
bcb0741c91 Map WRITE_SECURITY_LOG permission to gid
Map WRITE_SECURITY_LOG to AID_SECURITY_LOG_WRITE which is how logd
controls access to security log buffer.

Bug: 232283779
Test: manual
Change-Id: Ifde2e5192326f0811807dcb05563b1b5b63077ce
(cherry picked from commit e806776e54)
Merged-In: Ifde2e5192326f0811807dcb05563b1b5b63077ce
2022-05-25 20:54:27 +00:00
Issei Suzuki
05cd2b6104 Exclude launcher from app transition animation while recents is running.
Changed approach to handle conflict between app transition and recents.

In order to fix flicker which happens when recents and app transition
start in a short time, we delayed app transition while recents was
running. However this approach brought side effects such as b/232984498.

When recents starts, we just want to wait that the launcher activitiy
finishes rendering and commit its visibility without animation. Added a
flag DisplayContent#mExcludeLauncherFromAnimation flag, so that we can
now explicity declare whether we want to apply animation on the launcher
or not.

Bug: 223499269
Bug: 231711212
Bug: 232984498
Test: atest com.android.server.wm.AppTransitionTests
Test: atest AppTransitionTest + manual tests
  Test 1
   1. Launch Gmail app
   2. Click icon on the bottom tab (e.g. Chat)
   3. Swipe up from the bottom (immediately after step 2)
   4. Verify closing animation only plays once
  Test 2
   1. Launch "Google TV"
   2. Play a trailer
   3. Full screen and PIP mode switch twice
   4. Verify PIP window is shown
  Test 3
   1. Change phone to portlait mode
   2. Launch Photo app
   3. Swipe up from the bottom
   4. Verify no rotation animation on the launcher
  Test 4
   1. Install 3P launcher and set it default.
   2. Launch Gmail app
   3. Swipe up to go back home
   4. Launch Chrome app
   5. Swipe up and hold to go to overview.
   6. Scroll to Gmail app and click.
   7. Verify Gmail app is launched without delay.
Change-Id: I0ccb99479684d17453ce57e8797024c0cd233ac3
2022-05-25 13:44:47 +00:00
Winson Chung
35640f948e Merge changes I1978ce3a,I79160004 into tm-dev
* changes:
  Add workaround for new back flow with legacy recents animation
  Ensure recents input consumer can be focused in Overview
2022-05-18 17:23:38 +00:00
TreeHugger Robot
5ea9ade689 Merge "Remove duplicate allowlist entries for Bluetooth" into tm-dev 2022-05-16 20:59:24 +00:00
Winson Chung
03df66775f Add workaround for new back flow with legacy recents animation
- Override the callback to inject back as we do today while in Overview.
  We can't rely on the client side compat callback because the Launcher
  window is not focused in this current state.

Bug: 223750399
Test: Open overview, swipe back
Change-Id: I1978ce3a91cba3e57c0f8bab366691b48a9d5921
2022-05-14 00:09:13 +00:00
Galia Peycheva
7a662cfbf9 Merge "Set TvBottomSheetActivity as unrestricted keep-clear area" into tm-dev 2022-05-11 07:43:24 +00:00
Issei Suzuki
d49b5d442d Suppress app transition while recents is running
This fixes conflict between app transition and recents animation in the
following scenario.

1) App transition animation finishes after app closing animation, which
is controlled by recents, finishes.

During the app closing animation, recents makes the closing app surface
invisible, but app transition animation overrides it to visible again.
This causes a flicker.

2) App transition starts during recents animation.

This can happen when a user launches an activity, and immediately after
that, swipes up the screen to close the app.

While recents is running, we assume animation on tasks is controlled by
recents, and visibility is commited without animation after recents
animation finishes. However starting app transition during recents
breaks this assumption, which ends up with playing one more unexpected
closing animation (so users see closing animation twice).

Bug: 223499269
Bug: 231669960
Test: atest AppTransitionTest + manual tests
  Test 1
   1. Launch Gmail app
   2. Click icon on the bottom tab (e.g. Chat)
   3. Swipe up from the bottom (immediately after step 2)
   4. Verify closing animation only plays once
  Test 2
   1. Launch "Google TV"
   2. Play a trailer
   3. Full screen and PIP mode switch twice
   4. Verify PIP window is shown
  Test 3
   1. Change phone to portlait mode
   2. Launch Photo app
   3. Swipe up from the bottom
   4. Verify no rotation animation on the launcher
Change-Id: Ic18d00812308903db08d3564136f33f1eccf408c
2022-05-09 14:10:14 +00:00
Issei Suzuki
d2303d97a4 Merge "Revert "Suppress app transition while recents is running"" into tm-dev 2022-05-09 10:00:41 +00:00
Neha Jain
a2e0455cd9 Revert "Suppress app transition while recents is running"
This reverts commit c34693dcac.

Reason for revert: Causing PiP to fail b/231669960
Bug: 231669960
Change-Id: Ib16cf999071fd06bd9a574859f8fb18d6fede3fa
2022-05-06 20:40:28 +00:00
Chavi Weingarten
823b164edd Merge "Set focus to WMS computed focus when embedded window drops focus" into tm-dev 2022-05-06 18:07:46 +00:00
TreeHugger Robot
db2310a284 Merge "Complete Reference RCU keylayout with all buttions" into tm-dev 2022-05-06 11:44:05 +00:00
Galia Peycheva
557fc354c1 Set TvBottomSheetActivity as unrestricted keep-clear area
This makes the Tv Pip move away from the dialog in order to not cover
its content

Bug: 227596282
Test: manual: start activity in Pip; start Duo and send:
      adb shell cmd sensor_privacy enable 0 microphone && \
      adb shell appops start com.google.android.apps.tachyon 27
Change-Id: Ifb0a11cc6c09b2b088d8a28c6016b831f5c57ac9
2022-05-05 18:11:09 +02:00
chaviw
02f564f331 Set focus to WMS computed focus when embedded window drops focus
If an internal system window wants to drop focus from an embedded
window, requestFocusTransfer doesn't need to be called and instead we
can directly call setFocusedWindow. This fixes the case where transfer
focus fails if the old focused window loses visibility by the time the
transfer request arrives. The transfer won't be allowed because the old
window isn't focused anymore so we can't honor the transfer request.

This fix is fine for internal system windows because there's no security
issue with transferring focus from embedded to something WMS computes.
However, there's still a race condition for cases where apps want to
transfer focus from embedded back to host when they are setting
visibility on the embedded window since the embedded window can become
invisible before the transfer goes through.

Test: Pip Menu focus lost
Fixes: 230851770
Change-Id: I09db0bbdf4db6eeaffa30275233811b13ea31132
Merged-In: I09db0bbdf4db6eeaffa30275233811b13ea31132
2022-05-05 15:42:46 +00:00
Issei Suzuki
c34693dcac Suppress app transition while recents is running
This fixes conflict between app transition and recents animation in the
following scenario.

1) App transition animation finishes after app closing animation, which
is controlled by recents, finishes.

During the app closing animation, recents makes the closing app surface
invisible, but app transition animation overrides it to visible again.
This causes a flicker.

2) App transition starts during recents animation.

This can happen when a user launches an activity, and immediately after
that, swipes up the screen to close the app.

While recents is running, we assume animation on tasks is controlled by
recents, and visibility is commited without animation after recents
animation finishes. However starting app transition during recents
breaks this assumption, which ends up with playing one more unexpected
closing animation (so users see closing animation twice).

Bug: 223499269
Test: atest AppTransitionTest + manual
  1. Launch Gmail app
  2. Click icon on the bottom tab (e.g. Chat)
  3. Swipe up from the bottom (immediately after step 2)
  4. Verify closing animation only plays once
Change-Id: Id0a8b472b9a3d7cf5b55852de83cbd50b985b834
2022-05-03 14:23:18 +00:00
Andrei Onea
7a8010b205 Remove duplicate allowlist entries for Bluetooth
These allowlist entries are already bundled in the Bluetooth apex.

Test: boots
Bug: 230449777
Change-Id: Ife22ecbfd36882720e9059d8144cdaf6c410268c
2022-04-29 12:10:14 +00:00
Max Zhang
df6c116b9a Complete Reference RCU keylayout with all buttions
Reference RCU has 2 models with different numbers of keys.
And some keys have multiple HID key IDs used by different
partners.
This change lists all possible HID key values of reference RCU.

Change-Id: I9c3c93c17701f39b415989ccf066744fb314d29c
bug: 229692045
test: manually tested on tm-dev build
2022-04-27 09:24:53 +00:00
Chris Li
9e08260cce Add TaskFragmentOrganizer#onActivityReparentToTask
When the activity exits PiP and is reparented to the original Task, the
organizer should handle it as a new launch.

Bug: 225371112
Test: atest WmTests:TaskFragmentTest
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: Ia7e32e995a35e167b0d76e701c972b269ae068cc
2022-04-22 17:36:02 +08:00
TreeHugger Robot
9e9a9d36ac Merge "Apply transaction when starting back nav" into tm-dev 2022-04-13 05:04:39 +00:00
Treehugger Robot
43f42ced37 Merge "Add keylayout mapping for Xbox360 compatible controllers." am: e9e88881a2 am: cbd6b9bbab am: 9db4acd342
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2026303

Change-Id: Id90b29c3072080c8cbc08ce26be1c92b77a80ab5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 00:51:33 +00:00
Treehugger Robot
cbd6b9bbab Merge "Add keylayout mapping for Xbox360 compatible controllers." am: e9e88881a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2026303

Change-Id: I46558bef859c120a55658afa2512494d7081677d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-12 23:12:30 +00:00
Treehugger Robot
e9e88881a2 Merge "Add keylayout mapping for Xbox360 compatible controllers." 2022-04-12 22:52:03 +00:00
Tyler Lacey
11000cfd99 Merge "When adding overlay to a task, emit an immediate inset update" into tm-dev 2022-04-12 16:08:44 +00:00
Vadim Caen
fe1f5828f9 Apply transaction when starting back nav
The transaction was not applied anymore after the refactor and the
end of animation callback was not correctly set.

Bug: 228202811
Test: com.android.server.wm.BackNavigationControllerTests#backNavInfo_HomeWhenBackToLauncher

Change-Id: Id4635f2988a23ad7e214fb37739ba8dc2c394ee4
2022-04-12 13:49:02 +02:00
Jerry Chang
efb263d1a4 Merge "Include all not occluded leaf tasks while wrapping animation target" into tm-dev 2022-04-11 05:37:04 +00:00
Kriti Dang
012dcb8b1a Merge "Changing the name densityMap->densityMapping due to framework changes" into tm-dev 2022-04-08 12:31:26 +00:00
Shan Huang
be460cbac4 Merge "Create OnBackInvokedCallbackInfo to wrap callback and its priority." into tm-dev 2022-04-08 04:07:53 +00:00
Kriti Dang
226a5e3b66 Changing the name densityMap->densityMapping due to framework changes
Bug: 228268712
Test: Tested manually
Change-Id: I15bdf7a1bb5c1dbd4596d85d15f964bb81ceae4a
2022-04-07 16:25:49 +02:00
Shan Huang
b353af0387 Create OnBackInvokedCallbackInfo to wrap callback and its priority.
Main motivation is to store a back callback's exact priority value in WM. This is required by the IME migration (ag/17076160) to compare the priority levels of IME window callback and focused window callback in BackNavigationController.

This also consolidates the WindowState#mSystemOnBackInvokedCallback and WindowState#mApplicationOnBackInvokedCallback fields into one field, as tracking two fields for one callback was error prone. We had to remember to clear the application / system field when the other field is set, and failing to do so has resulted in bugs such as b/222675481.


Bug: 224856664
Test: atest BackNavigationControllerTest
Test: atest WindowOnBackInvokedDispatcherTest
Test: m -j and test back behavior throughout the system on apps that
opted in and out.

Change-Id: Ic57113610d934f33d2c9ca4cef59f39a9b87e832
2022-04-07 05:11:42 +00:00
Zach Johnson
3ed0308046 Merge changes from topic "bluetooth-certificate-change" into tm-dev
* changes:
  Make permissions Bluetooth needs role-available
  Adding bt permissions to the priv app allowlist
2022-04-07 00:45:21 +00:00
Tyler Lacey
4eaf39219b When adding overlay to a task, emit an immediate inset update
Test: Manual testing no longer reproduce b/227202029
Bug: 227202029
Change-Id: I73dd21e027c5fff66185f03d3ffd4e2f4b3f61fb
2022-04-06 13:41:11 +00:00
Peiyong Lin
a2df99e5eb Merge "Allow Shell to have permission for CTS." into tm-dev 2022-04-05 02:23:55 +00:00
Roopa Sattiraju
0928332272 Adding bt permissions to the priv app allowlist
BUG: 226403247
Test: build and boot
Change-Id: I5dbe5c4a17675ee8ac6c8f24ba53b05c26c17898
2022-04-04 16:19:54 -07:00
Hui Wu
b061e2e60e Merge "Adds more roles to the protectionlevel" into tm-dev 2022-04-01 21:50:00 +00:00
Hui Wu
b20414b8bd Adds more roles to the protectionlevel
MANAGE_CLOUDSEARCH is and will be wanted by many applications. privileged/role should be able to cover most use cases.

Bug: 227041245
Test: atest
Change-Id: Idfb85f9e181968df935c4f27490bae2babadd0d9
2022-04-01 14:25:26 -07:00
TreeHugger Robot
97dabec966 Merge "Move out PermissionController allowlist entries" into tm-dev 2022-04-01 19:39:20 +00:00
Vadim Caen
a28e989921 Merge "Some cleanup logging and test for back navigation" into tm-dev 2022-04-01 15:57:59 +00:00
Vadim Caen
71297c8aab Some cleanup logging and test for back navigation
- Better logging
 - Remove method form OnBackInvokedDispatcher interface (but not the
   implementation)
 - Add test for ag/17211289

Bug: 222675481
Test: BackNavigationControllerTests#testUnregisterCallbacksWithSystemCallback
Change-Id: I6a3ae30da7e29dddda116acd8fa0c9af4b9faa6e
2022-04-01 15:57:49 +00:00
Jerry Chang
b9438a8dce Include all not occluded leaf tasks while wrapping animation target
There might be other leaf tasks beside the top leaf task are not
occluded. Like the case when split screen is activated, both top leaf
tasks in each side are not occluded. This makes sure to include them
into remote animation target.

Fix: 227307495
Test: pass existing tests
Test: enter split, quick switch back and forth won't crash

Change-Id: Ic8af56b1a9e029dc4f1c2c57ab59071aab2924b4
2022-04-01 07:42:20 +00:00
Jay Sullivan
5c375eacdd Merge "Add perm split W_E_S to A_M_L and sort" into tm-dev 2022-03-31 22:59:24 +00:00
Peiyong Lin
7479cbc372 Allow Shell to have permission for CTS.
Add ACCESS_FPS_COUNTER to Shell in order to run CTS properly.

Ignore-AOSP-First: permission doesn't exist in AOSP yet.
Bug: b/220029298
Test: atest TaskFpsCallbackCtsTest
Test: atest TaskFpsCallbackCtsTest --instant
Change-Id: Ica37bafff368f4a0027f9549de6a31ce3254c986
2022-03-30 17:17:50 +00:00
Jay Thomas Sullivan
5b9f6a592c Add perm split W_E_S to A_M_L and sort
Add a permission split:

    WRITE_EXTERNAL_STORAGE to ACCESS_MEDIA_LOCATION

...and sort split permissions.

The reason adding this is that the split-permission handling code
doesn't handle recursive split-permission mappings, but only direct
mappings.

The reason for sorting is that, given a tree of permission splits,
the entries in platform.xml must be sorted topologically, due to
current permission split code.

Bug: 227240947
Test: atest CtsPermissionTestCases CtsPermission3TestCases SplitPermissionsSystemTest
Change-Id: I62c2ab8687af2e8325fcc370a74af0f589d8e9f2
2022-03-29 17:46:18 -07:00
Sharon Su
acf4d5a89d Merge "Change android.permission.MANAGE_WALLPAPER_EFFECTS_GENERATION to signature| privileged Test: cts test Bug: 213238425 Change-Id: Iacaec0904a1d1c14ba8b0ec8f3871376ff33f01c" into tm-dev 2022-03-29 16:41:57 +00:00
Alex Johnston
4879dca57a Remove unused lost mode permission
Bug: 226945080
Test: NA
Change-Id: I339b6894b3a9e32a3d644a06e4ebc3a0f7f98a05
2022-03-29 15:36:49 +00:00
Jay Thomas Sullivan
9b78af4292 Add split perms from W_E_S to media
Add split permissions from WRITE_EXTERNAL_STORAGE to media permissions.

The reason for doing this is that the split-permission handling code
doesn't handle recursive split-permission mappings, but only direct
mappings.

This resulted in a problem with WRITE_EXTERNAL_STORAGE because:

1) WRITE_EXTERNAL_STORAGE splits into READ_EXTERNAL_STORAGE, and
2) Recently, we added split permissions from READ_EXTERNAL_STORAGE
to READ_MEDIA_AUDIO, READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, and
ACCESS_MEDIA_LOCATION

The effect is that apps which request WRITE_EXTERNAL_STORAGE are not
being granted media storage permissions properly.

(Note that, for now, we've not yet added the split to
ACCESS_MEDIA_LOCATION, because this scenario has not yet been
thoroughly tested.)

Bug: 222238273
Test: atest CtsPermissionTestCases CtsPermission3TestCases SplitPermissionsSystemTest
Change-Id: I94694b37189ea8ad89edc4f478391ccfe1ccd5b8
2022-03-28 19:51:38 +00:00
Vadim Caen
09f7f6f69b Merge changes from topic "presubmit-am-b87ddd3bbf2947f1aa639cddcee6ecb8" into tm-dev
* changes:
  Remove callback before WindowState removal
  Improve startBackNavigation stability
2022-03-28 18:53:26 +00:00
Ganesh Olekar
3795120659 Merge "Add broadcast receiver to listen for safety center flag changes" into tm-dev 2022-03-28 18:32:53 +00:00
Sharon Su
c5d3f167f7 Change android.permission.MANAGE_WALLPAPER_EFFECTS_GENERATION to signature| privileged
Test: cts test
Bug: 213238425
Change-Id: Iacaec0904a1d1c14ba8b0ec8f3871376ff33f01c
2022-03-25 23:57:32 +00:00
Ganesh Olekar
ff11a6e291 Add broadcast receiver to listen for safety center flag changes
Change-Id: I0a22edd85d10bdd1ccb6f26a48615e88a30e7cb3
Bug: 225294614
Test: atest com.android.systemui.qs.HeaderPrivacyIconsControllerTest -c
2022-03-25 17:36:10 +00:00