Commit Graph

17776 Commits

Author SHA1 Message Date
Leon Scroggins
a8693ecd42 Merge "DisplayManager: Add an API to query for DISPLAY_DECORATON" 2022-01-07 17:11:47 +00:00
TreeHugger Robot
413e92ac19 Merge "Fix flaky test WindowInputTestsi#testTrustedOverlapWindow" into sc-v2-dev am: 651343388f am: cfa5c420e3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16544958

Change-Id: I59a4af69db4c0b9bf0e906cb56f5304dc2af37ea
2022-01-07 15:15:13 +00:00
TreeHugger Robot
cfa5c420e3 Merge "Fix flaky test WindowInputTestsi#testTrustedOverlapWindow" into sc-v2-dev am: 651343388f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16544958

Change-Id: I4001fabda75da2bfc2da66eb7692cc021078e549
2022-01-07 15:02:02 +00:00
Leon Scroggins III
c66a2ac732 DisplayManager: Add an API to query for DISPLAY_DECORATON
Tunnel through SurfaceControl to determine whether the HWC has this
capability. This allows clients (i.e. SystemUI) to know whether they can
use Composition.DISPLAY_DECORATON. If so, they may want to render
differently (i.e. in A8). See Ib948c38ee189877eda675a6342cb70099f66122b
for an example.

Bug: 193170859
Test: manual
Test: TODO
Change-Id: I9904452b6408199bb1f86de9e21132e4d4444e1a
2022-01-07 09:41:01 -05:00
Daniel Hsieh
53d247ace8 Merge "Support following typing foucs in window mode [2/n]." 2022-01-07 02:27:49 +00:00
Arthur Hung
7ed2d03fdb Fix flaky test WindowInputTestsi#testTrustedOverlapWindow
When disabling batching input, we should post the action to consume
batched events to prevent it would be handled before current event.

Bug: 189241600
Test: atest WindowInputTests --rerun-until-failure
Change-Id: I87aaa2574a27368f88df1aba3f2eb769a8e8f36b
(cherry picked from commit a0ef47223c)
2022-01-07 02:22:28 +00:00
Vishnu Nair
dfea9ff5d0 Merge "SurfaceView: Synchronize visibility changes with VRI frame" 2022-01-06 19:00:13 +00:00
Joanne Chung
93cbc8aa8e Merge "Refine FloatingToolbarPopup to allow multiple implementations" 2022-01-06 11:55:30 +00:00
TYM Tsai
ba6aaaeff0 Merge "Migrate compat mode allowed list to DeviceConfig" 2022-01-06 11:46:39 +00:00
Prabir Pradhan
d30e268474 Merge "Revert "Use SOURCE_CLASS_POINTER as the default source for MotionEvent"" 2022-01-06 10:41:30 +00:00
Prabir Pradhan
3ccd2488c5 Revert "Use SOURCE_CLASS_POINTER as the default source for MotionEvent"
This reverts commit b1d3e076af.

Reason for revert: Breaking CarUiRecyclerViewTest#testThumbDragToCenter tests

Bug: 211051185
Bug: 211051850
Bug: 213425347

Change-Id: Ia8e5c2301ab389a4e9b436165157f8918d285649
2022-01-06 10:23:41 +00:00
Vishnu Nair
230677e7b3 SurfaceView: Synchronize visibility changes with VRI frame
There is a flicker in wallpaper picker due to a recent change where
SurfaceView creation changes were synchronized with VRI frame. This
breaks wallpaper picker because wallpaper picker doesn't actually
draw into the SV surface, instead they attach a surface package.

The current implementation meant the SurfacePackage would be visible
before it was scaled correctly.

This fix applies the visibility changes along with the scaling changes.

Test: steps in b/211945947
Fixes: 211945947
Change-Id: I4e5107ac2caf634429e1bec3201fdcaa8f5f92bc
2022-01-05 16:26:36 -08:00
Haoyu Zhang
a58ffd37ff Merge "Scribe in View: Introduce HandwritingInitiator" 2022-01-05 23:14:09 +00:00
Haoyu Zhang
934fa21273 Scribe in View: Introduce HandwritingInitiator
This CL only implement the handwriting initiation for milestone 1:
a) handwriting is only initiated for a focused editor.
b) user must start handwriting within the editor's boundary.

Bug: 209854913
Test: atest FrameworksCoreTests:HandwritingInitiatorTest
Change-Id: Iab6d83f58aa74f0af8091731c80bbdb2eb29c024
2022-01-05 12:37:30 -08:00
Sally Yuen
f685942962 Merge "Add and implement cache API" 2022-01-05 20:11:36 +00:00
Daniel Hsieh
8cdb9fedb9 Support following typing foucs in window mode [2/n].
There are 3 milestones in this feature.
1. Refactor the callbacks for Accessibility in WindowManagerInternal.
2. Implement this feature in such new architecture.
3. Implement the setting choice in preference page.

This CL is for the 2nd milestone.

We move the window magnification to the typing focus' center position
based on the condition of whether a user takes control or not. We only
make a movement when the control is not taken by a user or we don't
preform the movement for the window magnification.

There are 2 methods for a user to take the control.
1. A user use 1 finger to drag the window magnification.
2. A user use 2 finger to drag the window magnification.

There is 1 method for a user to release the control.
1. When IME is shown, the control would be released.

So, we can decide whether we should make a movement to typing focus
given the condition of who take the control.

Bug: 194668976
Test: atest MagnificationControllerTest
	atest WindowMagnificationTest
	atest WindowMagnificationControllerTest
	atest WindowMagnificationManagerTest
Change-Id: I145f893d412b74c20afe1685449370d1dba99961
2022-01-05 09:08:20 +00:00
Arthur Hung
1273a2bdf3 Merge "Consuming common key combinations in app priority" 2022-01-05 01:29:14 +00:00
Riley Jones
71cafe807e Merge "Deprecate obtain and recycle for AccessibilityNodeInfo Test: Feature removal, should not interfere with existing unit tests Fixes: 208469173" 2022-01-04 17:49:58 +00:00
Arthur Hung
292152573a Consuming common key combinations in app priority
Some apps or games could use the combo keys such as holding Ctrl or Alt
to trigger its own shortcut or behavior. To prevent the system shortcut
might be handled before dispatching to the app, we move these keys
handling to 'dispatchUnhandledKey' when the app didn't handle.

This will also fix the corresponding state when the modifier key is
released.

Bug: 156619364
Bug: 213096704
Test: atest AppKeyCombinationsTest
Change-Id: I42770045c61ad6396b27132b8a61d34fc121d77e
2022-01-04 07:08:55 +00:00
shawnlin
fb137147e2 Update the java doc of DisplayCutout.getBoundingRect API.
Since we now support long edge cutout, the description of this API is
out of date.

Bug: 211939507
Test: make
Change-Id: I04c4c34e56c4e8b8d466e05cf60e89da31d6cc9b
2022-01-04 04:40:43 +00:00
Adrian Roos
9a1aee4d2b WindowManager: Fix javadoc for soft input states
Change-Id: I23e10b92356113ec61d1f2ee50a2f6d72ab17abf
2022-01-03 22:21:46 +01:00
TreeHugger Robot
806e4df853 Merge "BBQ: Recreate BBQ when SurfaceControl changes 2/2" 2021-12-30 00:16:14 +00:00
TreeHugger Robot
e5607a2fc8 Merge "Only updateDisplayDecoration if not the default" 2021-12-29 20:55:35 +00:00
Riley Jones
c20406e720 Deprecate obtain and recycle for AccessibilityNodeInfo
Test: Feature removal, should not interfere with existing unit tests
Fixes: 208469173

Change-Id: I894d94ff75dd3dbf39528d11726b99135dd957c8
2021-12-29 18:52:36 +00:00
Leon Scroggins
3fccaab880 Merge "Reland "Add/plumb SurfaceControl.DISPLAY_DECORATION"" 2021-12-29 13:01:54 +00:00
Prabir Pradhan
4250ea4c35 Merge changes from topics "inputfeature-flag-aidl", "remove-dpg-inputfeature"
* changes:
  Remove unused InputFeature flag DISABLE_POINTER_GESTURES
  Move InputFeature flag definitions to AIDL (2/2)
2021-12-29 12:56:30 +00:00
TreeHugger Robot
4c7bf29fe3 Merge "Add an input feature for a stylus interceptor" 2021-12-29 11:52:49 +00:00
Wilson Wu
bc6a601f58 Merge "Add getInputMethodList API for locked user state" 2021-12-29 02:00:02 +00:00
Vishnu Nair
daa281da18 BBQ: Recreate BBQ when SurfaceControl changes 2/2
Alternative approach to fab15e55446080bdcfc05ba315e8ef914b0a6f65 which
was racy because the disconnect callback is called without the
BQ lock and the client can continue to modify the BQ state after
disconnecting from the queue.

This approach resets the BQ and BBQ states when the SurfaceControl is
updated. This solves one concrete problem of not relying on the old
SurfaceControl to be destroyed in order to release the currently presented
buffer back to BQ.

In addition this change resets the sync state in BBQ with the rationale
the system does not want to sync on buffers presented on an older
SurfaceControl.

Bug: 197269223
Test: atest BLASTBufferQueueTest
Test: labtest ag/16407859 cf-foldable * 3 (b/197269223#comment40)
Change-Id: I137d3284c4e9216963f9c672f192afd334501ee5
2021-12-29 00:47:40 +00:00
Chavi Weingarten
6489e997ac Merge "Send syncStatus and return FrameCommitCallback in FrameCallback" 2021-12-28 21:17:00 +00:00
Vishnu Nair
05f920bbf8 Merge "SurfaceView: Fix unsafe transaction accesses" 2021-12-28 17:45:55 +00:00
chaviw
b680371f77 Send syncStatus and return FrameCommitCallback in FrameCallback
FrameCallback sends back the syncStatus and allows the caller to return
a FrameCommitCallback. This is so the caller can evaluate the results of
the sync and determine if it wants to continue waiting for a commit
callback. In cases, where the sync has failed, there will never be a
commit callback so the caller can avoid waiting.

This is partically helpful for VRI because it wants to sync with a frame
that will draw, but also doesn't want to get stuck indefinitely waiting
on the callback. VRI can check the syncStatus and only handle blast sync
and/or reportDraw when its determined that a draw will happen.

This allows VRI to remove frameCompleteCallback since it can now wait
until a buffer has drawn instead of when the vsync has completed. This makes
sure it waits on FrameDropped since that result indicates HWUI will draw on
the next vsync

Test: BlastSync
Bug: 200284684
Change-Id: Ic6e2f08ea21ac8a1634a3389c927fcb68ede3f7b
2021-12-28 11:27:23 -06:00
Leon Scroggins III
f02c47d86f Only updateDisplayDecoration if not the default
The default value for DISPLAY_DECORATION is false. If there's a new
SurfaceControl, we only need to set the flag if it's true. This avoids
applying an unnecesary transaction.

It also prevents a boot failure which is independently fixed by
Ib11d46439db57b90486bad07dd90f2cf0822182a.

Bug: 211797674
Bug: 211835607
Bug: 212402133
Test: boots
Change-Id: Iccb662f9a6312b547b3d28fa1f5c1e9ff5dce9eb
2021-12-28 10:12:12 -05:00
Leon Scroggins
906fe67bb4 Reland "Add/plumb SurfaceControl.DISPLAY_DECORATION"
The first time this topic landed, it resulted in b/212402133. We avoid
running into this bug with Ib11d46439db57b90486bad07dd90f2cf0822182a.

Original commit message:

When passed to native, this flag will tell a Layer that it should use
Composition.DISPLAY_DECORATION.

Bug: 193170859
Test: manual

Change-Id: I7f1685eb7dc57271f532065dcd1d4dcc449c5cb0
2021-12-28 10:09:39 -05:00
Joanne Chung
f0f831e546 Refine FloatingToolbarPopup to allow multiple implementations
This change refined the FloatingToolbarPopup to allow the local and
system implementation. Use the flag to control which implementation
will be used. Use the local implementation as default, we will switch
the system version when it is done and stable.

Bug: 190030331
Bug: 205822301
Test: manual. The toolbar still work after refinement
Test: atest TextViewActivityTest
Test: atest TextViewIntegrationTest
Ignore-AOSP-First: new feature for T.

Change-Id: I191cb02fc4857855f5b63bdab21c014fa0879a0c
2021-12-28 16:59:28 +08:00
Wilson Wu
04a226334d Add getInputMethodList API for locked user state
When work profile disable by quick settings, the
user would be locked then we cannot query installed
input method lists for work user by existings API
InputMethodManager#getInputMethodListAsUser().

Adding a new API to query input method services
regardless of the user state. This API currently
only used by Settings, it shouldn't affect the
original behavior for other usages.

Bug: 210083408
Test: verify we can get input methods list after
      disable work apps by quick settings
Test: atest CtsInputMethodTestCases
Change-Id: I54d5dbec7e76d6a68935007ed3af0641f717a7c5
2021-12-28 15:40:36 +08:00
Prabir Pradhan
68dcaf6eba Remove unused InputFeature flag DISABLE_POINTER_GESTURES
Bug: None
Test: build
Change-Id: Ic521e47ddbfffcc84d663274281fe8868c01e045
2021-12-24 05:30:45 -08:00
Prabir Pradhan
6288496385 Move InputFeature flag definitions to AIDL (2/2)
We convert the InputFeatures flags into AIDL enums that will have values
generated in both native and java code so that the value only has to be
defined once.

Bug: 162194035
Test: build, presubmit
Change-Id: I8176265079292ee969c409ddd52676a52f208601
2021-12-24 05:30:45 -08:00
Taran Singh
d4e6b2aad7 Add an input feature for a stylus interceptor
A stylus interceptor is a window that receives all stylus events within
its touchable bounds, while letting all other events be dispatched to
windows behind it. This makes it possible for the framework to create a
stylus interceptor on top of another app to implement handwriting
recognition.

The feature has no effect when the window flag FLAG_NOT_TOUCHABLE is
not set.

The feature has no effect when the window is not a trusted overlay.

Test: manual
Change-Id: Ia481ee8d831643bc99445b47659a7f5e9875c388
2021-12-24 05:30:44 -08:00
Tiger Huang
96278acd8e Merge "Move tests from DisplayPolicyLayoutTests to WindowLayoutTests" 2021-12-24 10:14:06 +00:00
Vishnu Nair
894fa8809a SurfaceView: Fix unsafe transaction accesses
PositionUpdateListener callbacks maybe replaced before they
are applied. We need to merge with the existing transaction
so we don't drop any destination frame updates. But accessing
the previous callback transaction is unsafe since we might fight
with render thread.

Fix this by locking access to the transaction object.

This also fixes a potential SurfaceControl access issue where
we may release the SurfaceControl that is used by render thread
in the UI thread.

Fixes: 211090247
Test: atest SurfaceViewSyncTest
Change-Id: I28ed344754601169c6cefd919668e76ef5a467c3
2021-12-23 23:42:04 +00:00
Leon Scroggins
5812b5ed7f Merge "Revert "Add/plumb SurfaceControl.DISPLAY_DECORATION"" 2021-12-23 21:55:09 +00:00
TreeHugger Robot
f1cd18c1f6 Merge "Add an input feature for a spy window" 2021-12-23 16:15:11 +00:00
Leon Scroggins
96fc474abc Revert "Add/plumb SurfaceControl.DISPLAY_DECORATION"
Revert "Add eLayerIsDisplayDecoration flag"

Revert submission 16511727-wm_DISPLAY_DECORATION

Reason for revert: b/211835607
Reverted Changes:
I1da3199ba:Allow changing composition from DISPLAY_DECORATION...
I1fae74b36:Update documentation for DISPLAY_DECORATION
I1da03a88f:Add eLayerIsDisplayDecoration flag
I7f22dfd03:Add/plumb SurfaceControl.DISPLAY_DECORATION

Change-Id: Ieef6e12206aaab6d3bcd2819a139ae1f201b2f8d
2021-12-23 15:28:46 +00:00
Calvin Pan
55f8b4d30c Merge "Rename TextAttributeBuilder" 2021-12-23 02:03:54 +00:00
Leon Scroggins
cf8a6227cc Merge "Add/plumb SurfaceControl.DISPLAY_DECORATION" 2021-12-22 18:53:25 +00:00
TreeHugger Robot
0314f0285e Merge "Ensure Insets surface visiblity and alpha value are aligned" 2021-12-21 17:42:09 +00:00
TreeHugger Robot
66eca70ab0 Merge "Change close guard logged messages" 2021-12-21 15:55:19 +00:00
TYM Tsai
9f8d8c0171 Migrate compat mode allowed list to DeviceConfig
To test, manually played with 'adb shell device_config'. Examples:

$ adb shell device_config list autofill
$ adb shell device_config delete autofill compat_mode_allowed_packages
$ adb shell device_config list autofill
compat_mode_allowed_packages: not found

$ adb shell device_config put autofill compat_mode_allowed_packages com.android.chrome[url_bar]:com.brave.browser[url_bar]
$ adb shell device_config list autofill
compat_mode_allowed_packages: found, value is com.android.chrome[url_bar]:com.brave.browser[url_bar]
$ adb shell dumpsys autofill
see:
Autofill Compat State:
  User: 0
    com.android.chrome: maxVersionCode=10000000000, urlBarResourceIds=[url_bar]
from device config: com.android.chrome[url_bar]:com.brave.browser[url_bar]

Bug: 194967348
Test: atest CtsAutoFillServiceTestCases
Test: atest com.android.server.autofill.AutofillManagerServiceTest
Change-Id: I775782622adecb42b86de508f502f03039cc34ca
2021-12-21 22:23:27 +08:00
Ioannis Ilkos
0bde67ab00 Change close guard logged messages
Unless we are looking at stack traces (e.g. from strict mode) it's not
possible to identify which type of object is not being closed (most
methods are 'close' or 'release). Change the logged text to clarify.

Change-Id: Ib90eac716f43c2c2caf8d8c6fb64a7bd90562da9
Test: manual
2021-12-21 11:46:10 +00:00