Commit Graph

18699 Commits

Author SHA1 Message Date
Cole Faust
9b3a5fc03b Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I7052a1f7391ed6701fe0e1036c27368609032e35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 20:44:00 +00:00
Cole Faust
a1eb8cf128 Merge "Fix array-related errorprone warnings" 2022-08-30 18:03:01 +00:00
Treehugger Robot
e9712ca91b Merge "Exclude large tests from presubmit." am: 3d8681e31d am: 9dc9fd8930 am: 5860c207c9 am: da40df7c95
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2176682

Change-Id: I56d7b99eab9acc055a6935166f962d10e6df357c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 22:35:54 +00:00
Treehugger Robot
3d8681e31d Merge "Exclude large tests from presubmit." 2022-08-29 20:52:36 +00:00
Tiger Huang
81e8a4eb7f Merge "Enable LOCAL_LAYOUT" into tm-qpr-dev am: 2220c995a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18030522

Change-Id: I9848f788b2eff05772fd6c90421cc458f0a4c7b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:15:36 +00:00
Tiger Huang
2220c995a4 Merge "Enable LOCAL_LAYOUT" into tm-qpr-dev 2022-08-26 16:56:26 +00:00
Cole Faust
584140c83a Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.

Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ia6f216cc36ad0a5758f39fd9b34962cd4adf9d8e
2022-08-25 10:57:12 -07:00
Ming-Shin Lu
ebef237175 Merge "Fix IME jumpcut when playing user IME animation after IME restarted" into tm-qpr-dev am: 469cbe9037
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19600919

Change-Id: I6a80cf882660267d6a131ebb016a09e09c34297a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 16:32:23 +00:00
Ming-Shin Lu
469cbe9037 Merge "Fix IME jumpcut when playing user IME animation after IME restarted" into tm-qpr-dev 2022-08-25 16:13:08 +00:00
Yunfan Chen
75d85bac78 Merge "Refine the way of calculating insets for configuration (1/3)" into tm-qpr-dev am: cc9f87d9e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19333110

Change-Id: Id3f7effad6f179c9613b8d390e300426eba88c8f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 05:41:50 +00:00
Yunfan Chen
6640d839aa Refine the way of calculating insets for configuration (1/3)
The original patch reverted as commit
bc0d5539e6.

This patch only includes the part of refactors to make the calculation
of configuration around insets easier. The actual change of making extra
navigation bar treated as navigation bar and the fix of the UiDevice in
ui automator is in a separate patch to avoid being blocked and blocking
other changes for long.

Test: PlatformScenarioTests
Test: TaplTestsQuickstep, ThemeIconsTest, TaplTestsLauncher3
Bug: 238981445
Bug: 238985243
Bug: 238581838
Bug: 233945217
Change-Id: If966bcc8125300d47d5cd631f7db17ff027e5261
2022-08-24 09:01:03 +00:00
Treehugger Robot
d22d44dd2e Merge "View OWNERS: include PendingInsetsController.java in the WindowManager rules" am: ce2023b664 am: c20cde6ce5 am: 3edaa51344 am: 6cdbdf26c3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2190615

Change-Id: Iddd6f583f9c71d13a24a53d333fd5a97a7d9f26d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 13:15:58 +00:00
Hongwei Wang
e38914405d Merge "[Re-land] Remove getSfInstance usage from ViewRootImpl" into tm-qpr-dev am: 5238c74d09
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19600075

Change-Id: Ic93af6c2551e85c439765e3e47592a25d51fac5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 22:28:26 +00:00
Hongwei Wang
5238c74d09 Merge "[Re-land] Remove getSfInstance usage from ViewRootImpl" into tm-qpr-dev 2022-08-19 22:03:03 +00:00
Hyunyoung Song
89612ae180 Merge "Add passive callback for system-run insets animation" into tm-qpr-dev am: 7f9f126df7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19434248

Change-Id: I9544fd82036706c19031597c1fdf8e316c5f3f09
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 18:38:26 +00:00
Hyunyoung Song
7f9f126df7 Merge "Add passive callback for system-run insets animation" into tm-qpr-dev 2022-08-19 18:37:40 +00:00
Ming-Shin Lu
4141dae212 Merge "Fix toggleSoftInput can't hide IME when the app in multi-window mode" into tm-qpr-dev am: a9fa413a21
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19600536

Change-Id: Ied238b5980f4609b5a0a9b77301f691a6dd0637d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 16:14:11 +00:00
Fiona Campbell
477064e500 Merge changes I36ea0ffc,I1f3797c5,I01aeeedd into tm-qpr-dev am: a01ccaae13
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19638897

Change-Id: I32169097c0b807836bb989f60111cedcd49191b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 16:11:34 +00:00
Ming-Shin Lu
a9fa413a21 Merge "Fix toggleSoftInput can't hide IME when the app in multi-window mode" into tm-qpr-dev 2022-08-19 14:52:59 +00:00
Fiona Campbell
a01ccaae13 Merge changes I36ea0ffc,I1f3797c5,I01aeeedd into tm-qpr-dev
* changes:
  Add constraints to window duration scale
  Add constraints to animation duration scales
  Ensure animation scales are within bounds
2022-08-19 14:49:40 +00:00
Adrian Roos
b773c4dade View OWNERS: include PendingInsetsController.java in the WindowManager rules
Change-Id: I8b22a55ccfe3690e9879fcce221c4488f86a9a83
2022-08-19 07:11:47 +00:00
Hyunyoung Song
03110e20d9 Add passive callback for system-run insets animation
This passive window inset animation control listener
is used to for logging purpose when hide, show
method is called.

Test: atest InsetsControllerTest
Bug: 240192346

Change-Id: I399268ead9d04b356f10cc3e9ac1da9e31306e86
2022-08-19 05:15:29 +00:00
Joanne Chung
20dbe919b1 Merge "Fix system toolbar doesn't use correct theme." into tm-qpr-dev am: 9e263e643d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18800482

Change-Id: Ie4da503e5f569625c807bef1a194764cb5e133fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 13:08:55 +00:00
Joanne Chung
1551aae8d7 Merge "Fix translation session id collision bug." into tm-qpr-dev am: ebb357e1c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19423814

Change-Id: Iad538b9ee2aef1e58a9b292d8a36f27a7b79191b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 13:07:48 +00:00
Joanne Chung
9e263e643d Merge "Fix system toolbar doesn't use correct theme." into tm-qpr-dev 2022-08-16 10:00:57 +00:00
Joanne Chung
ebb357e1c9 Merge "Fix translation session id collision bug." into tm-qpr-dev 2022-08-16 09:52:18 +00:00
Tiger Huang
f114085baa Merge "Introduce IWindowSession#relayoutAsync" into tm-qpr-dev am: 81ae41092e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19194952

Change-Id: Iec4854d8c93a0e58a588d0483833b99a1ec38455
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 09:04:33 +00:00
Wilson Wu
908c368411 Merge "Refine {SHOW,HIDE}_MY_SOFT_INPUT constants" into tm-qpr-dev am: 08fc972311
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19569434

Change-Id: I4f26a508aa1e2081f4afcdf62ca00dc1d0a1949c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 09:01:38 +00:00
Tiger Huang
1721522709 Enable LOCAL_LAYOUT
Test: regular rotation, fixed rotation, and seamless rotation
Test: presubmit
Bug: 161810301
Bug: 175861564
Change-Id: If9488ffc84dc5e2af106acfae425a854fb7407a2
2022-08-16 08:45:02 +00:00
Tiger Huang
81ae41092e Merge "Introduce IWindowSession#relayoutAsync" into tm-qpr-dev 2022-08-16 08:44:11 +00:00
Wilson Wu
08fc972311 Merge "Refine {SHOW,HIDE}_MY_SOFT_INPUT constants" into tm-qpr-dev 2022-08-16 08:37:12 +00:00
Tiger Huang
3712433349 Introduce IWindowSession#relayoutAsync
IWindowSession#relayoutAsync is similar to IWindowSession#relayout, but
the former is an oneway method which just sends the layout attributes to
the server. Since the client can compute its own window frame, it just
needs to send attributes to the server without getting blocked for
receving the window frame.

In somes cases, the client still needs to obtain things from the server.
Such as:

- When view visibility is changed. The client maybe not be able to
  receive the latest insets state while it is INVISIBLE or GONE. In this
  case, the client needs to obtain the frame and the insets state. Also,
  the client need to obtain the surface control when it becomes VISIBLE.

- When the insets state is stale but the config is up-to-date. This can
  happen when WindowProcessController sends the new config to the client
  before WindowState does. In this case, the client needs to obtain the
  window frame from the server.

- When the position and the size of the frame are both changed. This
  will trigger a BLAST sync, and the client needs to obtain the sync seq
  ID.

For cases above, the client needs to call the original relayout method.

Bug: 161810301
Bug: 175861051
Test: Seamless rotation, fixed rotation, and regular rotation.
Merged-In: Ifb365789fa08103773fd3180e486ba1d92042fc5
Change-Id: Ifb365789fa08103773fd3180e486ba1d92042fc5
2022-08-16 12:49:31 +08:00
Vishnu Nair
f40b84db0a Merge "SurfaceView: Revert SurfaceLock locking changes" into tm-qpr-dev am: 5b518a2a69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19602637

Change-Id: I48929e3415143d5aa25178fd1b5870feee5b635b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 16:31:13 +00:00
Fiona Campbell
43ca1914b2 Ensure animation scales are within bounds
Ensure that all uses of TRANSITION_ANIMATION_SCALE setting are bounded
between 0 and 20.

Bug: 238178261
Test: adb shell dumpsys window windows | grep "Animation setting"

Change-Id: I01aeeeddcbcdce0824d61db6b8f4a8946595131d
2022-08-15 11:16:33 +00:00
Ming-Shin Lu
caeb909eac Fix IME jumpcut when playing user IME animation after IME restarted
There are 2 cases that will seeing IME jumpcut when IME insets animation
is controlled by the app during IME prcocess being killed & restarted:

1) When IME process been killed for some reasons
 (e.g. force-stop package ), during IME restarting,
 DC#computeImeTarget will select the remote insets target as the control
 target and deliver IME leash to WM shell. If the focused window is
 not in multi-windowing mode, it may have a timing that IME surface
 may unexpectedly shown when starting insets animation from the remote.

2) Previously CL[1] fixed an IME surface visiblity issue when enabling
 shell-transition that related to somehow IME insets source visibility
 out of sync with the actual IME surface visiblity. The CL fix is
 setting IME surface alpha value according to the requested visiblity in
 InsetsSourceConsumer#setControl as a workaround. However, this may
 cause a side-effect that after IME restarted and leash updated,
 when the app requests showing IME animation, system calls setControl to
 the client to set the same leash after IME onPostLayout, then
 applyRequestedVisibilityToControl will be called before the
 insets controller calls setInsetsAndAlpha for the animation, if the
 IME requested visibility has visible, IME jumpcut will happen.

To fix this issue:
For 1), returning null control target in DC#computeImeTarget for
the above special case.

For 2), with CL[2] can fully fixed IME visiblity issue by letting the
client know the initial visibility of an InsetsSourceControl and
correctly animate insets when delivering the new leash or the
visibility change of the InsetsSourceControl. for delivering same
leash to request animation case, adding a check to call
applyRequestedVisibilityToControl only when there is no running
animation.

[1]: Iaacdf5f57e68b928e2a19036cbd8a137cf320497
[2]: I2c02e97e191ebd83238c0c54908e861d200d4c8d

Fix: 239808087
Bug: 209064170

Test: atest DisplayContentTests InsetsSourceConsumerTest
Test: manual test steps in b/239808087#comment2
Test: manual test as steps in b/209064170
   0) Enabling shell-transition
   1) Launching camera app
   2) Swiping camera app to launcher
   3) Verify status bar appear animation works

Change-Id: I242517a9214b36049d94e89d1ee63ffe505b91ac
(cherry picked from commit 8945b5bcfc)
2022-08-15 01:23:40 +00:00
Vishnu Nair
e0b684f7d0 SurfaceView: Revert SurfaceLock locking changes
This reverts commit 9e3cd0533f
and commit 74c760394a.

Initially we made a change to address a performance issue
in SurfaceView caused by holding the mSurfaceLock whenever
we went though the updateSurfaces loop. This had a side
effects of causing an ANR since the locking order changed.

The followup fix removed the lock but broke some API
contracts around lock and unlock canvas.

Subsequent fixes, which never went into QPR, introduced
new issues. Changing the locking order is too risky
QPR so lets revert and try to rework the locking
mechanism in U.

Test: app in b/234006724 does not ANR
Test: app in b/235188096 does not crash
Test: app in b/239895124 does not ANR
Test: app in b/239142077 does not crash
Test: atest SurfaceViewTest

Bug: 235188096
Change-Id: I99c5bb707ecad7c8d3c1fbd8b4105a77d58c145d
2022-08-12 17:35:40 +00:00
Joanne Chung
9325f9b97e Fix system toolbar doesn't use correct theme.
The toolbar should set the theme to the app's theme. Because the
service cannot get the application context, we should pass this
information from application to service.

Bug: 218833400
Test: manual. Use light/dark theme for app, the toolbar shows with
the same theme
Test: atest TextViewIntegrationTest
Test: atest android.widget.TextViewActivityTest

Change-Id: I6d4e4e117c680ce57e760a87987059eded09b2bc
2022-08-12 16:54:34 +00:00
Ming-Shin Lu
bb40322347 Fix toggleSoftInput can't hide IME when the app in multi-window mode
CL[1] changed toggleSoftInput behavior with checking the last IME
requested visibility by using
ImeInsetsSourceConsumer#mRequestedVisible to toggle IME.

However, ImeInsetsSourceConsumer#mRequestedVisible will be updated only
when:
1) The IME insets is controllable for the app.
2) The caller uses WindowsInsetsController#{show, hide}

Since by design when the app is in multi-window mode, SystemUI will
take over the insets control for synchronizing task resizing / IME
animation concern, so it ends up making the app unable to receive IME
insets control then affects toggling IME visiblity.

Even though toggleSoftInput has been deprecated since Android S, we
still requires to support its functionality for old apps run in some
platforms by default in multi-window mode (e.g. ARC++ in freeform
windowing mode).

To fix the issue, replace the check logic with
getRootWindowInests().isVisible(ime()) to check the last IME visiblity
from the root window the served view.

[1]: I390dc029e7bcc30c200926a9bfbbbd0268a1f714

Bug: 240886131
Test: atest KeyboardVisibilityControlTest#testToggleSoftInput in ARC++
Change-Id: Iaf7ccc17a7c02711000983db0d65ad095fe9f8fa
2022-08-12 14:09:05 +00:00
Tony Huang
e3f070a172 [Re-land] Remove getSfInstance usage from ViewRootImpl
The getSfInstance usage on ViewRootImpl is target to reduce jank
when moving split divider, but legacy split is going to be depracated
and it didn't used on new split too so we can remove whole related
codes safely.

Bug: 222696368
Test: build pass
Change-Id: Id492c738942c2e01fce85c231350d16ef88242f5
2022-08-12 06:13:16 +00:00
Riddle Hsu
68bbbd9d9b Merge "Detect layout change of paramsForRotation precisely" into tm-qpr-dev am: 62b637a788
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19559829

Change-Id: I6c686bdd60cdb28d5d50bd6eece40dbbe4477202
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 12:08:33 +00:00
Riddle Hsu
62b637a788 Merge "Detect layout change of paramsForRotation precisely" into tm-qpr-dev 2022-08-11 11:43:13 +00:00
Mihir Patel
f333fa0c93 Merge "Reporting the Autofill IDs and Positions of active views in list view" into tm-qpr-dev am: 25192d7d0c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19054708

Change-Id: I6b8ffade431d057334147ae9cd5386afbad13cbc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 17:41:15 +00:00
Mihir Patel
25192d7d0c Merge "Reporting the Autofill IDs and Positions of active views in list view" into tm-qpr-dev 2022-08-10 16:35:13 +00:00
Winson Chung
805819c467 Merge "Add some client side logging for interrupted draws to the dump" into tm-qpr-dev am: 5f7ead346d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19533074

Change-Id: I59a509a87399d36612c518648a4288d8e3ad7882
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 16:12:16 +00:00
Winson Chung
5f7ead346d Merge "Add some client side logging for interrupted draws to the dump" into tm-qpr-dev 2022-08-10 15:56:12 +00:00
Wilson Wu
2ac25627d8 Refine {SHOW,HIDE}_MY_SOFT_INPUT constants
Naming of SoftInputShowHideReason#{SHOW,HIDE}_MY_SOFT_INPUT
constants may not clear enough to indicate its semantics.

Improve show/hide reasons of InputMethodService by:

-. Update constants naming to {SHOW,HIDE}_SOFT_INPUT_FROM_IME.
-. Introduce respective reasons to indicate different hide request
   cases within IME process.

Bug: 224565148
Bug: 241890033
Test: presubmit
Test: atest CtsInputMethodTestCases and observe logs
Change-Id: I8b148e9b5ab05ff7b827c6b8fe23008ca30a8c4b
Merged-In: I8b148e9b5ab05ff7b827c6b8fe23008ca30a8c4b
2022-08-10 11:51:59 +08:00
Mihir Patel
a6e0f74c90 Reporting the Autofill IDs and Positions of active views in list view
Test: atest CtsContentCaptureServiceTestCases, observed events reported only once on scroll and stop as well as on fling
Bug: 211899037
Change-Id: Id67fcc360bf63fcab1d9f345c31d2bf7b9a173d6
2022-08-09 15:37:50 -07:00
Winson Chung
32e2b596d2 Add some client side logging for interrupted draws to the dump
In particular, these are to try and narrow down why the app window isn't
drawing in b/235463625 where the draw state for launcher is stuck in
DRAW_PENDING.

- mLastReportNextDrawReason: the reason the last draw was requested,
  maybe useful in telling if wm is not requesting a draw if not set
- mLastPerformTraversalsSkipDrawReason: the reason perform traversals
  returned without drawing (includes wm/predraw cancel reasons)
- mLastPerformDrawSkippedReason: the reason perform draw returned
  without drawing
- mLocalSyncState: extra logging to confirm that the last sync actually
  completes

Bug: 235463625
Test: dumpsys -T 60000 activity -v all
Test: dumpsys activity activities
Change-Id: I10118470fe62075920e9ce29fe449b0cfc8570c9
Merged-In: I10118470fe62075920e9ce29fe449b0cfc8570c9
2022-08-09 21:08:32 +00:00
Ats Jenk
750da6f903 Update flag constant for caption on shell am: 4f279bac32
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19531018

Change-Id: I7b514f50299f625f04d9b798e61daeefd78fa264
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 02:02:32 +00:00
TreeHugger Robot
3c6d6b5232 Merge changes from topic "desktop-windowing-flags" into tm-qpr-dev
* changes:
  SysUI flags to support desktop windowing proto
  Update flag constant for caption on shell
2022-08-09 01:44:18 +00:00