Commit Graph

17126 Commits

Author SHA1 Message Date
Mariia Sandrikova
02a17e7b1f Merge changes from topic "camera-compat" into sc-v2-dev am: 3486eacda3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468379

Change-Id: I1e56abcef9715a3dd6a00d70cb815c4d9260175a
2021-12-18 21:59:31 +00:00
Mariia Sandrikova
3486eacda3 Merge changes from topic "camera-compat" into sc-v2-dev
* changes:
  [3/n] Camera Compat UI: Add a camera compat control.
  [2/n] Camera Compat UI: Add interfaces for client-server communication.
2021-12-18 21:39:13 +00:00
Mariia Sandrikova
24f4d8a952 [2/n] Camera Compat UI: Add interfaces for client-server communication.
Changes:
- Listens to changes from the client coming through IActivityClientController#requestCompatCameraControl to ActivityRecord#updateCameraCompatState
- ActivityRecord#updateCameraCompatState sends updated state via TaskInfo to WM Shell
- ITaskOrganizerController#updateCameraCompatControlState to dispatch the user interactions with the control from WM Shell triggers callback to ActivityRecord#updateCameraCompatStateFromUser
- ActivityRecord#updateCameraCompatStateFromUser remembers the user's choice and asks client to apply treatment through ICompatCameraControlCallback

Feature is guarded with config_isCameraCompatControlForStretchedIssuesEnabled

Test: atest WMShellUnitTests:ShellTaskOrganizerTests, atest WmTests:ActivityRecordTests
Bug: 206602997
Change-Id: I083aa6718bd67456bedd9444e9b78740c041f870
2021-12-17 00:18:57 +00:00
TreeHugger Robot
52347713d1 Merge "SurfaceView: Synchronize initial destframe change from BBQ" into sc-v2-dev am: 852000568a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468818

Change-Id: I133fc76f951540f36f7c6d116d0334638734d1a4
2021-12-16 20:44:33 +00:00
TreeHugger Robot
852000568a Merge "SurfaceView: Synchronize initial destframe change from BBQ" into sc-v2-dev 2021-12-16 20:31:12 +00:00
Prabir Pradhan
0e229b7f33 Merge "Use SOURCE_CLASS_POINTER as the default source for MotionEvent" into sc-v2-dev am: 72e278d976
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16432384

Change-Id: I7916149c7abb1e940558383155e2b4cca3a88f2e
2021-12-16 19:40:16 +00:00
Prabir Pradhan
b1d3e076af Use SOURCE_CLASS_POINTER as the default source for MotionEvent
This CL also adds a test to ensure that a pointer source is used by
default when obtaining a MotionEvent, and that offsets are only applied
to pointer sources.

Bug: 207251886
Test: atest MotionEventTests
Change-Id: Id40accc6d1238c940f139a18b26fa277dd6e11f9
2021-12-16 09:19:29 +00:00
Treehugger Robot
9e9eb416f7 Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" am: e908851af5 am: 0c024d11ed am: d9c2da8152
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1923058

Change-Id: I3ed9484befd715965561bd80d0de6498a5b2735e
2021-12-15 18:19:34 +00:00
Treehugger Robot
d9c2da8152 Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" am: e908851af5 am: 0c024d11ed
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1923058

Change-Id: Icaa621b17c72031f0a767aaece8c96a92221fc82
2021-12-15 17:54:19 +00:00
Jon Eckenrode
b085975620 Merge "Revised the OnDragListener and onDragEvent API documentation." am: 629810015f am: b38f3d7744 am: 8ad9969307
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1907031

Change-Id: I10d1576b26e8c4eebfc78eb292e07ab2ccf5d813
2021-12-15 17:36:23 +00:00
Treehugger Robot
e908851af5 Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" 2021-12-15 17:00:15 +00:00
Jon Eckenrode
8ad9969307 Merge "Revised the OnDragListener and onDragEvent API documentation." am: 629810015f am: b38f3d7744
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1907031

Change-Id: Ic1790e4270db0e0da99c33cc0911a33bbf4727c9
2021-12-15 16:59:14 +00:00
Jon Eckenrode
629810015f Merge "Revised the OnDragListener and onDragEvent API documentation." 2021-12-15 15:22:55 +00:00
Yohei Yukawa
1fdc14b8a9 Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value
This is a follow up CL to our previous CL [1], which had an off-by-one
bug when determining the return value of

   EditableInputConnection#endBatchEdit().

According to the API document of InputConnection#endBatchEdit(), the
following test should pass.

   EditText editText = new EditText(context);
   EditorInfo editorInfo = new EditorInfo();
   InputConnection editableInputConnection =
           editText.onCreateInputConnection(editorInfo);
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isFalse(); // (*)
   assertThat(editableInputConnection.endBatchEdit()).isFalse();

However, the last assertion marked with (*) actually fails due to an
off-by-one bug.  This CL finally fixes it.

The risk of app compat breakages because of fixing this long standing
bug is supposed to be low, mainly because:

 * the system has not relied on this return value yet.
 * Widgets like WebView have correctly implemented this API.
 * IME has always received true no matter what the app returned, which
   is the same behavior as other async InputConnection APIs.

This CL adds several notes to InputConnection#endBatchEdit() document
to help developers correctly implement and use this API.

 [1]: I1ec5518fdc16fb0551fbce9d13f5d92eb4bc78c0
      c478c171e9

Fix: 209958658
Fix: 210165648
Test: atest -c CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: Ibc40072fa11a4d6e3c24b8d7860c914ccdbcbc8a
Merged-In: Ibc40072fa11a4d6e3c24b8d7860c914ccdbcbc8a
(cherry picked from commit beda2b7f76)
2021-12-14 15:15:54 -08:00
Vishnu Nair
fce5b2bece SurfaceView: Synchronize initial destframe change from BBQ
Fixes a case where the SurfaceView is stuck with a wrong
scale.

Destination frame scales the buffer to the SurfaceView
fixed size. Currently the initial destination frame is
applied when the first buffer is acquired by BBQ. The
transaction is sent via the BBQ apply token.

Meanwhile if the client updates the SurfaceView fixed
size, the SurfaceView will apply the transaction via
the SCC apply token.

This can cause destframe changes to be applied out of
order causing the app to be stuck with the wrong
scale.

Bug: 195443440
Test: atest BLASTBufferQueueTest
Test: repro steps from bug

Change-Id: Ibf53a0efdebb87291d081e48633c373a98d347b1
Merged-In: Ibf53a0efdebb87291d081e48633c373a98d347b1
2021-12-14 19:34:02 +00:00
joneckenrode
74390f89b2 Revised the OnDragListener and onDragEvent API documentation.
Test: Javadoc build
Signed-off-by: joneckenrode <joneckenrode@google.com>
Change-Id: I807143412b249787526c6e3f7e8a27cc7f77bf89
2021-12-14 19:00:22 +00:00
Joanne Chung
5c32e894cb Merge "Fix translation animation flash for the same translation" into sc-v2-dev am: 1ff5a29afd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16432382

Change-Id: I6cb7a365fb9bfb6e719227d2292aa08a5609396b
2021-12-13 02:54:00 +00:00
Joanne Chung
a5d4f094e8 Fix translation animation flash for the same translation
The system received the same multiple translation responses in a very
short time. We use a isShowingTranslation flag to determine if the
duplicated responses to call onShowTranslation. However the
isShowingTransation flag is set in a post runnable, this may cause the
system  allow the duplicate responses can call onShowTranslation
because the isShowingTransaltion isn't set true yet.

Use multiple flags isShowingTranslation and a new isRunningAnimation
to check if the same translation response should skip to call
onShowTranslation.

Bug: 207457172
Test: manual
Test: atest CtsTranslationTestCases
Change-Id: I7003b7f49fc0a8ce2e909228bcb89acedee6d3d0
2021-12-10 05:00:00 +00:00
Chris Li
2f7bdbc104 Merge "Do not use prefixOrderIndex for animation layer" into sc-v2-dev am: af715328d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16379907

Change-Id: I0d219b0d1eda1a258d08c60fe603eaccba0470cc
2021-12-04 05:20:18 +00:00
Treehugger Robot
0b897fd62f Merge "ANDROID: Fix EventLog string class problem in ViewRootImpl#enqueueInputEvent()" am: 808e0a5e7a am: d3b9a7f1b2 am: bb269bc6e4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909899

Change-Id: I718e10a27a823cd46c6c6751acca5bbe7b701290
2021-12-03 22:42:10 +00:00
Treehugger Robot
bb269bc6e4 Merge "ANDROID: Fix EventLog string class problem in ViewRootImpl#enqueueInputEvent()" am: 808e0a5e7a am: d3b9a7f1b2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909899

Change-Id: I112425b087412ffd10ba7ab8bd38a0477c5d1388
2021-12-03 22:27:51 +00:00
Treehugger Robot
d3b9a7f1b2 Merge "ANDROID: Fix EventLog string class problem in ViewRootImpl#enqueueInputEvent()" am: 808e0a5e7a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909899

Change-Id: I1bc36b94f27ec90d484df3a468c1984d1ece8277
2021-12-03 22:21:12 +00:00
Chris Li
91010a79de Do not use prefixOrderIndex for animation layer
We may set a z-order different from the prefix order, for example
TaskDisplayArea#adjustRootTaskLayer. As a result, we should no longer
set animation leash layer based on the prefix order.

Fix: 208793409
Test: manually test launching activity over another
Change-Id: If8d545ca7a9ac42162262ad3a8f95b4ac9f65585
2021-12-03 20:50:00 +08:00
chenchaoli
beb8f3f4b3 ANDROID: Fix EventLog string class problem in ViewRootImpl#enqueueInputEvent()
EventLog function can handle string,integer class and long class. (in android_util_EventLog.cpp)
    If menu title string are used bold tag(like <b>test</b>), it'll be android.text.SpannedString.
    therefore any android activity using tag menu string(like <b></b>) can be crashed by IllegalArgumentException.

    Bug: 208862322

Change-Id: I2432b0cd28c8f5fcb07cdf3e29560bf6b6c0f7b6
Signed-off-by: chenchaoli <chenchaoli@xiaomi.com>
2021-12-03 05:52:33 +00:00
Adrian Roos
712c609507 Merge "ViewRootImpl: peek IME source instead of creating it" into sc-v2-dev am: 3f7eca5695
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16358839

Change-Id: Ib6990fc82d4d68b1d6a650249a9735ce79970515
2021-12-01 15:25:12 +00:00
Adrian Roos
3f7eca5695 Merge "ViewRootImpl: peek IME source instead of creating it" into sc-v2-dev 2021-12-01 15:09:27 +00:00
Naomi Musgrave
4987d076b0 [DO NOT MERGE] Revert "Temporary flag for Launcher to debug their usage of sandboxed display APIs" am: 608a679783
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16273554

Change-Id: I44d5d6796ebefb4f6920a8f98296f2d52f865869
2021-12-01 14:15:40 +00:00
Naomi Musgrave
a9a8c94b5f [DO NOT MERGE] Revert "[1/n] Introduce API for all available max WindowMetrics" am: 49381ee746
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16273544

Change-Id: Ide372fdcfdfd7f2d25e74e18c4ab5f182a61373d
2021-12-01 10:06:21 +00:00
Naomi Musgrave
608a679783 [DO NOT MERGE] Revert "Temporary flag for Launcher to debug their usage of sandboxed display APIs"
This reverts commit 253696fea3.

Reason for revert: remove from sc-v2
Bug: 206649452

Change-Id: I013f08dfba89eb89e7713dddc1f4f894e335df62
2021-12-01 09:57:48 +00:00
Naomi Musgrave
c5bdc9bcb7 Merge "[DO NOT MERGE] Revert "[1/n] Introduce API for all available max WindowMetrics"" into sc-v2-dev 2021-12-01 09:57:24 +00:00
TreeHugger Robot
b46414f27b Merge "Update Contenet Capture API discription" into sc-v2-dev am: 8528d07450
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16345097

Change-Id: I80a03e94f49cb7c3b8c86081929e9f99ac275a70
2021-12-01 03:14:15 +00:00
TYM Tsai
7d888cbc2f Update Contenet Capture API discription
There are missing API description at getServiceComponentName in
ContentCaptureManager. Some errors may occur and an exception may be
thrown. So update the javadoc to remind user to handle.

Fixes: 203368373
Test: make
Change-Id: I979c81c74cda4e50627dc0c83ae7c33b333b9255
2021-12-01 09:12:14 +08:00
Naomi Musgrave
49381ee746 [DO NOT MERGE] Revert "[1/n] Introduce API for all available max WindowMetrics"
This reverts commit f70f8ecefc.

Reason for revert: remove from sc-v2
Test: manual
Bug: 206649452

Change-Id: If5f38307dd9ce38316c3b918d692f8b921f40832
2021-11-30 17:19:46 +00:00
Naomi Musgrave
98f8b55975 [DO NOT MERGE] Revert "[2/n] Display stack provides DisplayInfos" am: 4dfa01a86e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16273545

Change-Id: Ide06de4f8466790e47fd7e99b29cb55ce70b2add
2021-11-30 16:54:01 +00:00
Adrian Roos
bf551fe111 ViewRootImpl: peek IME source instead of creating it
Fixes an issue where getting the IME source to check its
visibility unintentionally lazily created it.

Fixes: 208200189
Test: manual
Change-Id: Ib36082b393215fc59e299dea30d3315f3748ca02
2021-11-30 15:06:06 +01:00
Naomi Musgrave
4dfa01a86e [DO NOT MERGE] Revert "[2/n] Display stack provides DisplayInfos"
This reverts commit aca03a172c.

Reason for revert: remove from sc-v2
Test: manual
Bug: 206649452

Change-Id: I1ce3c567eb1203edc7f22c568eeb15e85c643134
2021-11-30 13:32:08 +00:00
Naomi Musgrave
4d4c7bfafa [DO NOT MERGE] Revert "PossibleMaximumWindowMetrics reports physical display insets for each" am: f1012018bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16273546

Change-Id: I37f3161473af8dcbc0ef98ae2c8c160a36a30f45
2021-11-29 21:45:42 +00:00
Naomi Musgrave
dce6b41a0f Merge "[DO NOT MERGE] Revert "PossibleMaximumWindowMetrics reports physical display insets for each"" into sc-v2-dev 2021-11-29 21:15:46 +00:00
Rob Carr
a3b02ba67e Merge "Rework blast sync callback model" into sc-v2-dev am: f7fc07271f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15685699

Change-Id: I61c6fb2a966a334b9c3dfa1b0e151b7667d8ea4d
2021-11-29 18:55:56 +00:00
Rob Carr
f7fc07271f Merge "Rework blast sync callback model" into sc-v2-dev 2021-11-29 18:43:00 +00:00
Tiger Huang
44a025aa73 Merge "Prevent resize animation from changing the requested visibilities" into sc-v2-dev am: 2aba350b3f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16303384

Change-Id: Ie4ebc27b9cfbaa9b9c887b09ec6be1b62ff9e791
2021-11-29 15:32:30 +00:00
Tiger Huang
2aba350b3f Merge "Prevent resize animation from changing the requested visibilities" into sc-v2-dev 2021-11-29 15:17:38 +00:00
Naomi Musgrave
f1012018bf [DO NOT MERGE] Revert "PossibleMaximumWindowMetrics reports physical display insets for each"
This reverts commit a77d7425a4.

Reason for revert: remove from sc-v2
Test: manual
Bug: 206649452

Change-Id: I461e6cec8ff2a14a57cf019861da2babd82d0a2a
2021-11-29 14:10:05 +00:00
Ming-Shin Lu
b0404606ed Merge "Revert hide logic in ImeInsetsSourceConsumer#setControl" into sc-v2-dev am: cf9560a43b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16334306

Change-Id: I9b0dd9d77181794e93e3d5eb4d8e9c606b27d7ca
2021-11-25 02:36:07 +00:00
chaviw
e97e296c81 Rework blast sync callback model
The previous code waited for a frame complete callback from hwui before
notifying WMS that a draw had occurred. However, frame complete callback
was not guaranteed to get called since it only invokes a callback if a
draw actually occured. VRI really needs a signal that RT has completed,
since it just needs to know that a draw was possible so it can notify
WMS that the RT completed its pass.

Instead, rename frameCompleteCallback to frameCommitCallback since that
API is exposed to a public API when a frame was actually drawn.
Create a new callback, frameCompleteCallback, that is invoked when the
draw has completed, regardless if a frame was actually drawn.

When the frameCompleteCallback is invoked, VRI can check to see if a new
frame actually drew. VRI can call into BBQ to see if the frame acquired
matches the frame that was attempted to draw. If so, VRI can wait on a
transaction callback. If not, it can allow VRI to continue. In either case,
it will notify WMS that the draw has finished.

Test: Split over and over
Bug: 195262673
Bug: 193634619
Change-Id: I24dd19ab2746be3fc33e597761abf8c5249f8b5b
Merged-In: I24dd19ab2746be3fc33e597761abf8c5249f8b5b
2021-11-24 23:38:34 +00:00
Ming-Shin Lu
6ba7432173 Revert hide logic in ImeInsetsSourceConsumer#setControl
CL[1] using isRequestedVisibleAwaitingControl() in
ImeInsetsSourceconsumer#setControl to hide IME surface when it returned
false without waiting control or requesting visible to deal with the
unexpecting hide IME cases during the testing.

However, when calling IMM#toggleSoftInput to reqest showing keyboard
on the dialog implicitly that will set requrested visible on both the
caller window and the dialog window, since toggleSoftInput didn't
explicit set the target window but just using the caller window as
requester implicitly.

It causes a regression that can't hide the IME surface when dismissing
the dialog to back to the caller window that the IME insets source
control is null but isRequestedVisibleAwaitingControl still returned
true because isRequestedVisible has been set true for the
toggerSoftInput caller window.

Revert logic in setControl to use mIsRequestedVisibleAwaitingControl
in case the IME surface won't be removed when backing to the implicit
caller window of toggleSoftInput.

[1]: I3071af14bf78e23f9526d6a9c138ab6ae2e0e339

Bug: 207092186
Bug: 204524304

Test: manual
Test: atest CtsInputMethodTestCases
Test: atest WindowInsetsAnimationControllerTests
Change-Id: Ic5265a6c3f2eba77d43832d23309998bf3cb1671
2021-11-24 12:12:13 +00:00
Tony Huang
acb5bc569f Merge "Fix pip surface under divider" into sc-v2-dev am: c06aeea5fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16284008

Change-Id: I2986beba24124675a57cce3c8205b0af1c51f350
2021-11-24 03:34:51 +00:00
Tony Huang
c06aeea5fd Merge "Fix pip surface under divider" into sc-v2-dev 2021-11-24 03:09:59 +00:00
Vishnu Nair
be8227dbe2 Merge "WM: Use task bounds for modal window touchable region" into sc-v2-dev am: d57f990567
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16080856

Change-Id: I3feeb9fc9bb3d96a5ef402e4bbfc37c009a5191a
2021-11-23 22:43:53 +00:00
Vishnu Nair
d57f990567 Merge "WM: Use task bounds for modal window touchable region" into sc-v2-dev 2021-11-23 22:27:10 +00:00