Commit Graph

18650 Commits

Author SHA1 Message Date
Sunny Goyal
ff6a8b23df Merge "Adding missing rotationChange in RemoteAnimationTarget" into tm-qpr-dev 2022-10-18 16:32:28 +00:00
Tiger Huang
b3c6384df9 Merge "Re-land "Enable LOCAL_LAYOUT"" into tm-qpr-dev 2022-10-14 13:00:03 +00:00
Mark Punzalan
9c185693d4 Merge "Remove active translation on Activity destroyed" into tm-qpr-dev 2022-10-13 18:00:08 +00:00
TreeHugger Robot
3c282790e4 Merge "Update layout direction if ViewRoot is preserved" into tm-qpr-dev 2022-10-12 13:39:45 +00:00
Miranda Kephart
5caa83b5c6 Merge "Remove partial screenshot code" into tm-qpr-dev 2022-10-11 13:42:48 +00:00
Riddle Hsu
39ef5efaa5 Update layout direction if ViewRoot is preserved
Otherwise if the language of the configuration is changed between
RTL and LTR, the layout direction may still keep the previous
direction after calling recreate().

Bug: 250868428
Test: The layout direction will change with below sample:
  Configuration config = getResources().getConfiguration();
  configconfiguration.setLocales(LocaleList.forLanguageTags("ar"));
  getResources().updateConfiguration(configuconfigration, null);
  recreate();
Change-Id: Iad405bf02b2f19cb3aa8cbc21f9bca67d8a53c30
2022-10-11 15:12:51 +08:00
Mark Punzalan
f15a444d18 Remove active translation on Activity destroyed
When a translated Activity is destroyed or translation is finished
(e.g., finishTranslation() call), we also have to remove the entry in
the active translations we are keeping track in
TranslationManagerService. Prior to this change, we were not removing
the entry in the Activity destroyed case, and this caused problems when
a new callback is registered (e.g., Gboard) because it would incorrectly
get an onStarted() call for the now-inactive translation.

This can happen relatively frequently when the device has a work
profile, since switching to apps across profiles re-creates the IME, and
in the case of Gboard, it registers a callback every time.

Also added additional logging on Activity destroyed and when callbacks
are registered and triggered.

Bug: 245911471
Test: atest UiTranslationManagerTest
Change-Id: If1881fd4588725021d38e5b9336c3e69bca17039
Merged-In: If1881fd4588725021d38e5b9336c3e69bca17039
2022-10-06 18:23:30 +00:00
TreeHugger Robot
666111dfa7 Merge "Add InputDeviceBatteryListener to InputManager" into tm-qpr-dev 2022-10-05 20:52:59 +00:00
TreeHugger Robot
0854d61745 Merge "Fix input when hardware renderer drawing is disabled." into tm-qpr-dev 2022-10-05 20:22:11 +00:00
Louis Chang
0c3a5f856b Merge "Updating the cached resource configuration if ViewRoot is perserved" into tm-qpr-dev 2022-10-05 14:05:38 +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
Tiger
ab6b5064b9 Re-land "Enable LOCAL_LAYOUT"
Test: regular rotation, fixed rotation, and seamless rotation
Test: PowerMenuMicrobenchmark#testPower_verifySystemPowerMenuAppears
Bug: 161810301
Bug: 175861564
Change-Id: Ic0315aaef76fc9e6899fac278002c75fc1a2909d
2022-10-05 17:26:59 +08:00
Miranda Kephart
76140601a9 Remove partial screenshot code
It's broken currently, is extremely difficult to access, and will
need to be heavily rewritten/refactored anyway if we decide to
bring it back.

Fix: 249325548
Test: adb shell input keycombination -t 300 META_LEFT CTRL_LEFT
SHIFT_LEFT S
(now takes a regular screenshot)

Change-Id: I2cde564f6369b88bd4c6b20a9eecf8172fae7e7a
2022-09-27 15:13:28 -04:00
Maryam Dehaini
bf338c7633 Merge "Fixing input coordinates discrepancy" into tm-qpr-dev 2022-09-26 20:16:33 +00:00
TYM Tsai
5bca0e0058 Merge "Fix view does not show fill dialog" into tm-qpr-dev 2022-09-22 23:42:38 +00:00
Jorim Jaggi
52c3498acf Merge "Revert "Re-land "Enable LOCAL_LAYOUT""" into tm-qpr-dev 2022-09-22 21:48:43 +00:00
Prabir Pradhan
b6f775cea2 Add InputDeviceBatteryListener to InputManager
System apps can now register an InputDeviceBatteryListener on a
per-device basis to be notified of battery changes.

- InputManager manages registration of the binder callback with
  InputManagerService to ensure that there is only one battery
  listener per process.
- The battery listener is invoked immediately upon registration
  to provide the initial battery state for the device.
- The callbacks are removed automatically when the process dies.
- This CL does not yet identify changes in battery state for monitored
  devices.

DD: go/inputdevice-battery-notifications

Bug: 243005009
Test: atest FrameworkServicesTests
Test: atest FrameworkCoreTests
Change-Id: Idf2b06a099155a6f5cc13b55dcd40852f54aa56c
Merged-In: Idf2b06a099155a6f5cc13b55dcd40852f54aa56c
(cherry picked from commit e86f73ac50)
2022-09-22 16:59:53 +00:00
Tiger Huang
b557bc88b8 Revert "Re-land "Enable LOCAL_LAYOUT""
This reverts commit 975dd2c513.

Reason for revert: This is too risky for tm-qpr1
Bug: 161810301
Bug: 175861564

Change-Id: If906b4d538885fca407ce0bd7039c9d35b507032
2022-09-22 13:24:37 +00:00
Louis Chang
615928575a Updating the cached resource configuration if ViewRoot is perserved
When configuration changed, an Activity was relaunched because the
new layout size is smaller than old layout size. However, the
mLastConfigurationFromResources was not updated when relaunching
Activity while the window is preserved.

If the same Activity was resized to the previous bounds and the
configuration changes are not cross the size buckets, the Activity
won't be relaunched. Meanwhile, the View#onConfigurationChanged
was not reported because `mLastConfigurationFromResources` was not
update-to-date and was the same with the new configuration.

Bug: 247013643
Test: resizing the app in split-screen
Change-Id: I392417e1e6cc8bb5e8be0006b3b81385c3ef41aa
2022-09-21 08:48:40 +00:00
Tiger Huang
b47c6f2061 Merge "Re-land "Enable LOCAL_LAYOUT"" into tm-qpr-dev 2022-09-21 06:10:48 +00:00
TYM Tsai
fc5f2a60d3 Fix view does not show fill dialog
Sometimes, views may not be visible for the user immediately after
laid out, so add flag for do the evaluation once the view is visible.

Bug: 234429643
Test: Manual, check the fill dialog is appeared
Change-Id: I6b96b68ffc4a4b1ee5f5056848c5c4996d21ae73
2022-09-19 22:51:25 +00:00
Brett Chabot
4f58dc16bf Fix input when hardware renderer drawing is disabled.
When drawing is disabled the window's layer won't have a valid buffer. This
causes surfaceflinger to set the window's touchableRegion to zero.
This commit sets a window crop when drawing is disabled, so surfaceflinger
set touchableregion from crop instead of buffer.
And it modifies LetterboxUiController to not reset the crop.

Test: cts and perf tests as documented in go/android-slimulator-dev-env
Bug: 229870984
(cherry picked from commit 32dfc98382)
Merged-In: I4d6ca513c3daf5818ded03eae00e551fc319ad69
Change-Id: Ic8e1b17af825951505d448509530edf3ea81af5b
2022-09-19 10:29:06 -07:00
Tiger Huang
dea70726f6 Merge changes Ibc2f40dd,I37fb8ffc into tm-qpr-dev
* changes:
  Don't perform config change if relayoutAsync
  Apply synced relayout if we have FLAG_WINDOW_VISIBILITY_CHANGED
2022-09-16 14:23:42 +00:00
Maryam
e286a1de93 Fixing input coordinates discrepancy
Their was a input coordinate discrepancy for dialogs when we use the wm
caption in the shell.
Test: tested manually on multiple builds
Bug: 244190356
Bug: 243950192

Change-Id: I84cf95a933e90062f20978e4e1f83276c100c326
2022-09-15 17:56:05 +00:00
Tiger Huang
975dd2c513 Re-land "Enable LOCAL_LAYOUT"
Test: regular rotation, fixed rotation, and seamless rotation
Test: PowerMenuMicrobenchmark#testPower_verifySystemPowerMenuAppears
Bug: 161810301
Bug: 175861564
Change-Id: I7d70445a90ba234e2ba6482552886c1808d0d233
2022-09-15 15:37:35 +08:00
Tiger Huang
f3b99eee95 Don't perform config change if relayoutAsync
mPendingMergedConfiguration wouldn't be updated if we didn't call
IWindowSession#relayout.

Bug: 244003094
Test: atest ToggleDarkThemeMicrobenchmark#testToggle
Change-Id: Ibc2f40dd986136d9b54f3a7f491f7517489e05af
2022-09-15 15:02:40 +08:00
Sunny Goyal
b8761ced34 Adding missing rotationChange in RemoteAnimationTarget
Bug: 221961069
Test: Presubmit
Change-Id: Ibea2ba0694c5afe77dc809e8ad890f620bb92fda
2022-09-13 22:03:18 -07:00
Xiaowen Lei
f8e4efccda Merge "Add AppTransition type and remote animation for Dream in occluding Keyguard." into tm-qpr-dev 2022-09-09 23:12:19 +00:00
Mark Punzalan
1eaf0fadf2 Merge "Don't reset translation callback with other state" into tm-qpr-dev 2022-09-09 20:56:27 +00:00
Xiaowen Lei
7c458bea7d Add AppTransition type and remote animation for Dream in occluding Keyguard.
The existing Keyguard Occlude Animation Runner doesn't match the spec
for Dream in. It animates activity expanding from the center of the
screen. For Dream in, we have:
  - Dream fading in
  - DreamOverlay complications fading in slightly delayed, with each part
    starting at different times.

This CL adds dedicated AppTransitionType and remote animation runner,
which animates Dream fading in. It doesn't implement the separate
animation for DreamOverlay complications.

Bug: 222507937
Bug: 240477956
Bug: 242864189
Fix: 240477956
Test: on device, wait for Keyguard to time out to Dream.
Change-Id: I5517ded2eea77ea962ca1551ed51dd997ff09993
Merged-In: I5517ded2eea77ea962ca1551ed51dd997ff09993
2022-09-09 20:42:45 +00:00
Tiger Huang
40b4880d7a Apply synced relayout if we have FLAG_WINDOW_VISIBILITY_CHANGED
The client needs to call relayout to get the valid surface if
- mFirst,
- mViewVisibility != viewVisibility,
- mNewSurfaceNeeded, or
- mAppVisibilityChanged.

We didn't cover mNewSurfaceNeeded or mAppVisibilityChanged previously.
All of them are covered by FLAG_WINDOW_VISIBILITY_CHANGED.

Bug: 244521023
Bug: 161810301
Test: 1. Enable LOCAL_LAYOUT
      2. Open Camera and double press the power button.
      See if the preview screen of Camera become blank.
Change-Id: I37fb8ffc9063b72bf3abba5d29fc2f750e7fc64f
2022-09-08 15:40:49 +08:00
Tiger Huang
7cacd12b23 Merge "Revert "Enable LOCAL_LAYOUT"" into tm-qpr-dev 2022-09-06 14:26:43 +00:00
Riddle Hsu
3ef46b57b9 Optimize screen decor insets calculation
This stores the computed decor insets and frame excluding insets.
So it can save 99% time of recomputing the insets every time during
starting an activity. E.g. dozen times of "prepare display info/frame,
compute window layout of insets source windows, calculate insets"
becomes "get result from array".

The saved decor insets will be updated when:
- Display metrics is changed (DC#updateBaseDisplayMetrics).
- Insets provider is added/removed/changed.

Also
- Use DisplayCutout rather than WmDisplayCutout to simplify
  passing the cutout between methods.
- Optimize getSourceProvider to avoid unnecessary object allocation.

This also fixes an issue that the display doesn't compute the latest
configuration when navigation mode is changed. Now it is fixed by
checking if the insets provider has layout changes and then recompute
screen configuration.

Bug: 238399969
Bug: 159103089
Test: atest DisplayPolicyInsetsTests DisplayPolicyLayoutTests
      DisplayPolicyTests#testUpdateDisplayConfigurationByDecor
Test: Change navigation mode or display size (density) in Settings.
      And then swipe-up or press home key, there won't be a
      frozen effect (display configuration change).

Change-Id: If6c28a89939372e6362b92f469ef7d793e8ec215
2022-09-02 23:29:29 +08:00
Neha Jain
3e52eb1bc6 Revert "Enable LOCAL_LAYOUT"
This reverts commit 1721522709.

Reason for revert: b/244521023

Change-Id: I67df39f4d218ff65cb7a2010b544c3ef158f50cf
2022-09-02 02:50:46 +00:00
Tiger Huang
2220c995a4 Merge "Enable LOCAL_LAYOUT" into tm-qpr-dev 2022-08-26 16:56:26 +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
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
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
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
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
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
Mark Punzalan
ce2a5db2c8 Don't reset translation callback with other state
This fixes issues with Views that have their own custom
ViewTranslationCallback.

Bug: 236678324
Test: atest CtsTranslationTestCases
Test: manual - Verified on chat app that uses their own custom
ViewTranslationCallback; old and new messages are translated
Test: manual - Spot-checked translation on a few other chat apps

Change-Id: If4194bc8cde73a9cebb7b56594f6982855374410
2022-08-16 17:42:38 +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
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
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