Commit Graph

15616 Commits

Author SHA1 Message Date
TreeHugger Robot
5cbef17292 Merge "SyncPointerCapture (4/n): Receive capture events in InputEventReceiver" 2020-11-20 04:35:02 +00:00
TreeHugger Robot
7bb2a03b2d Merge "API Review: InputConnection error handling is inconsistent" 2020-11-19 15:35:56 +00:00
Bernardo Rufino
f48a5e3d13 Merge "Optionally wait animations on syncInputTransactions/injectInputEvent" 2020-11-19 14:07:13 +00:00
Bernardo Rufino
ab008846a8 Optionally wait animations on syncInputTransactions/injectInputEvent
I need to perform a touch while animating in CTS to test ag/13067140,
but current methods all wait for animations to complete, which defeats
the purpose.

Creating new methods that optionally wait for animations to complete.

Test: atest WindowUntrustedTouchTest on child CL
Bug: 172787052
Change-Id: I4832ea2c62531a73098d2817930638ccb5f40765
2020-11-19 08:30:08 +00:00
Nikita Dubrovsky
d8b6ec5f39 Merge "Add View.performReceiveContent in addition to View.onReceiveContent" 2020-11-18 21:25:16 +00:00
Issei Suzuki
30ce5da1bc Merge changes Ia2f99fa3,I4320b04d
* changes:
  Replace old app transition type to new transition type (3/N)
  Replace old app transition type to new transition type (2/N)
2020-11-18 17:07:39 +00:00
Issei Suzuki
656bfb5389 Replace old app transition type to new transition type (2/N)
AppTransitionController#getTransitionCompatType scans app transition
requests being set in the setup stage, and decides the app transition
animation.

Bug: 166736358
Test: Changes are behind a flag. No logic change yet.
Change-Id: I4320b04da2569d555369e6698f084d9514e36590
2020-11-18 15:05:29 +01:00
TreeHugger Robot
5bc9594c6b Merge "Add divider view support for app-pairs" 2020-11-18 12:12:18 +00:00
Tiger Huang
33ffcac4d4 Merge "Remove legacy frames from WindowFrames and DisplayFrames" 2020-11-18 09:26:46 +00:00
Tiger Huang
b73471b4ec Remove legacy frames from WindowFrames and DisplayFrames
These frames are used for computing the legacy insets which won't be
used anymore. We should only maintain the new insets system now.

This CL also unhides Rect#inset APIs.

Bug: 149813814
Test: atest WindowFrameTests DisplayPolicyLayoutTests InsetsPolicyTest
            SplashscreenTests ManifestLayoutTests WindowMetricsTests
            WindowInsetsAnimationImeTests WindowInsetsControllerTests
            WindowUntrustedTouchTest DisplayContentTests
Change-Id: I06e40be6342b2ae35f7cc3e6f4ebdbe68edf0499
2020-11-18 10:59:15 +08:00
Nikita Dubrovsky
53bf38e9ff Add View.performReceiveContent in addition to View.onReceiveContent
Bug: 170191676
Bug: 152068298
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentTest
Test: atest FrameworksCoreTests:TextViewOnReceiveContentTest
Change-Id: I3a3a3ec3b386c5af9c7e997fb32201fefa564545
2020-11-17 15:26:58 -08:00
Prabir Pradhan
7c48ce83bc SyncPointerCapture (4/n): Receive capture events in InputEventReceiver
Since a capture event was added to the InputChannel, this CL lets
InputEventReceiver receive the capture events sent by the publisher.

Bug: 141749603
Test: build, crosshatch boots
Change-Id: I608f3cf86d96e4d2b00b28f88fa2b7aa6e83b6dc
2020-11-17 14:58:46 -08:00
Ioana Stefan
06f759835a Merge changes from topics "ime-tracing-interface", "optimized-ime-tracing-clients", "optimized-ime-tracing-imms", "optimized-ime-tracing-ims"
* changes:
  Log only current client data in IME tracing
  Optimized workflow for IME tracing on InputMethodManagerService side
  Optimized workflow for IME tracing on InputMethodService side
  Optimized workflow for IME tracing on clients side
2020-11-17 15:18:30 +00:00
TreeHugger Robot
781e61d2c9 Merge "Add shouldBeSeamless param to Surface.setFrameRate" 2020-11-17 14:57:11 +00:00
Jeff DeCew
5185c6bf66 Merge changes from topic "template_redesign"
* changes:
  Update variable names to reduce confusion.
  Fix/hack MessagingStyle notifications
  Reduce notification minimized height
  Fix the placement of the work profile and feedback badges.
  Fix HUNs
  Remove the unneeded icon spacing in the InboxStyle.
  Hide app name from minimized notifications
  Notification Title is 16pt in Big state
  Ensure headerless notification with large icon is big enough.
  Round corners of BigPicture
  Increase the expand button touchable area.
  Remove the reply action entirely.
  Notification template redesign; part 1.
  Remove night-mode override of notification_divider_height
2020-11-17 13:21:53 +00:00
Marin Shalamanov
41ffa8dd06 Add shouldBeSeamless param to Surface.setFrameRate
This CL adds a new parameter shouldBeSeamless to the existing
setFrameRate APIs. This parameter indicates whether the desired
refresh rate should be achieved only seamlessly or also switches
with visual interruptions for the user are allowed. The default
value of the new parameter is "true".

Test: atest SetFrameRateTest
Test: atest RefreshRateConfigsTest
Test: atest libsurfaceflinger_unittest
Bug: 161776961
Change-Id: Ic2446d278e4f57fe507d30a0a18ef7b85909da4b
2020-11-17 11:53:14 +01:00
Jerry Chang
0545edfa3d Add divider view support for app-pairs
Add divider bar for app-pairs. AppPairLayout and divide policy records
and handles the layout in pair.

Bug: 172704238
Bug: 172704672
Test: manul check the behavior of the splits and divider bar.
Test: AppPairTests, AppPairsPoolTests, AppPairsControllerTests

Change-Id: I688c7001d056fe8dd9a192885e1f9fd5f004dc11
2020-11-17 11:22:19 +08:00
Charles Chen
e9cf1f9847 Merge "Introduce getWindowContextToken" 2020-11-16 08:47:01 +00:00
Charles Chen
468a11afdd Introduce getWindowContextToken
Also consolidate UI context related flags to ContextType.

Bug: 171280916
Test: atest ContextTest ContextAccessTest
Test: atest WindowContextTest WindowContextTests \
            WindowMetricsTest WindowMetricsTests
Test atest InputMethodServiceStrictModeTest \
           InputMethodMenuControllerTest
Test atest InputMethodServiceTest#testGetDisplay
           StrictModeTest#testIncorrectContextuse_*

Change-Id: I7f3a7f951c664d4c329059942e688ee3a625b992
2020-11-16 14:19:36 +08:00
Jeff DeCew
87257cbb6e Fix the placement of the work profile and feedback badges.
* Removed some dead code from NotificationTopLineView
* Icons appear left-aligned, as they do with conversations
* Fixed the order (also with conversations) to ensure that
  the 'alerted' icon disappearing doesn't cause movement
  (at least when the header text fits; otherwise some
  amount of movement is unavoidable).

Bug: 163626038
Test: manual
Change-Id: I8e19dd504f8c861f752cd2705048f015ab0e3106
2020-11-13 13:16:02 -05:00
Jeff DeCew
1842262813 Notification template redesign; part 1.
Known issues:
* Sub-par dyson animation
* Sub-par animation of text in the title
* Notification height limits not yet adjusted
* Decorated custom view height limits not yet updated
* HUNs may need to get their own headerless template
* Messaging style notifications are not yet headerless
* Possible [de]colorization bug for grouped icons
* Some notifications still not always expandable

Bug: 163626038
Test: Manual, visual testing
Change-Id: I9e7e2fd689938a13e042c8f6319bd7d0d2252781
2020-11-13 13:16:00 -05:00
Nikita Dubrovsky
00813be0ed Merge "Update onReceiveContent() logic for app vs platform processing" 2020-11-13 15:54:02 +00:00
Ioana Stefan
45296595a3 Log only current client data in IME tracing
This change moves from dumping information of all Input Method client
instances to dumping only the current client, which is the one in which
the triggering event happened.

Bug: 154348613
Test: flash a device
      start IME tracing by calling "adb shell ime tracing start"
      end IME tracing by calling "adb shell ime tracing stop"
      pull generated trace files and visualize in Winscope
      or start tracing directly through ADB Connect and visualize traces
Change-Id: I46460d3d08947c7d37a8969a2fed6539f35aaf91
2020-11-13 14:30:13 +00:00
Ioana Stefan
ab1008480b Optimized workflow for IME tracing on clients side
Optimized the tracing logic for the IME clients information. The
clients trigger a tracing dump through the new method triggerClientDump
exposed by the ImeTracing interface. This change was done
to be able to support custom dump for clients information and
custom dump from IMS.

This change only covers the clients information. The IMS and IMMS
information will be dumped in next changes.

Bug: 154348613
Test: start IME tracing by calling "adb shell ime tracing start"
      end IME tracing by calling "adb shell ime tracing stop"
      pull trace using "adb pull /data/misc/wmtrace/ime_trace_clients.pb ime_trace_clients.pb"
Change-Id: I499cb5f45a3e78912b09b9c6cedf1ce5443e797a
2020-11-13 10:18:47 +00:00
Aurimas Liutikas
8f8eaec801 Merge "Suppress all hidden abstract methods in constructable classes." 2020-11-12 23:37:21 +00:00
Nikita Dubrovsky
a25346bf0c Update onReceiveContent() logic for app vs platform processing
Previously onReceiveContent() would only invoke the app-configured
callback if the MIME type of the content matched one of the declared
MIME types for the callback. This change updates onReceiveContent()
to always invoke the listener if one is set (regardless of the MIME
type of the content). To delegate processing to the platform, the
app's listener can return some or all of the passed-in content. To
make this easy for apps to implement, the Payload class and its
Builder now provide some convenience methods to conditionally
partition the content.

Reasons for this change:
* Checking the MIME types could be an expensive operation. On SDKs prior
to S, ClipData does not keep track of the MIME types of individual
items, so for a ClipData that contains multiple items, checking the MIME
types requires making at least one RPC call per item.
* Allowing the listener to delegate processing to the platform via its
return value enables us to limit the API surface (we don't need to
expose TextViewOnReceiveContentListener as a public API, nor equivalent
classes for other types of views such as WebView).
* An app that wants to customize the platform behavior for coercing
content to text would previously need to declare "*/*" as the MIME type
for the callback (in order to be invoked for all content). But this
would make it impossible for features to know whether the app would
actually accept a particular type of content or just coerce it to text
(e.g. should the soft keyboard show GIF suggestions when the declared
MIME type is "*/*"). With the new logic the app's listener is always
invoked and can decide which content to process vs delegate to the
platform vs reject completely.

Bug: 170191676
Bug: 152068298
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentTest
Test: atest FrameworksCoreTests:TextViewOnReceiveContentTest
Change-Id: Ie48b6fe0b2ae4b014c371b5dc40248221947c6bf
2020-11-12 14:19:57 -08:00
Aurimas Liutikas
796760c56e Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-11 23:16:32 +00:00
Tiger Huang
149218bc50 Merge "Fix missing private flags in LayoutParams#tostring" 2020-11-11 07:33:08 +00:00
Yohei Yukawa
c599432222 Merge "Show logs when an app tries to show the IME" 2020-11-11 03:11:55 +00:00
Yohei Yukawa
c211f5677a Show logs when an app tries to show the IME
In order for us to be able to easily narrow down bugs that say
  "IMEs stopped being shown up"
this CL temporarily enables good-old debug messages to logcat whenever
an app is trying to show the IME with the following two APIs:

  * InputMethodManager#showSoftInput()
  * InsetsController#show(ime())

With these logs, we can easily see if the app was actually trying to
show the IME or something went wrong before the app calls these APIs.

Hopefully one day we can remove these Log.d() as part of our on-going
effort to improve IME debugging (Bug 154348613).

Bug: 171597353
Bug: 171637033
Bug: 171792138
Bug: 172731591
Test: adb logcat -s InputMethodManager:D InsetsController:D
Change-Id: I67a790f9d98d6131aaf04e4bb98d2a28873d3424
2020-11-10 13:23:29 -08:00
Tiger Huang
38c45bdfc2 Merge "Make insets source window stable while resizing" 2020-11-10 05:02:33 +00:00
Chavi Weingarten
7df723dd69 Merge "Fixed a few issues with blast sync with SurfaceView" 2020-11-09 16:54:23 +00:00
Marin Shalamanov
e5b273412d Merge "Add Display.Mode.getAlternativeRefreshRates()" 2020-11-09 15:05:20 +00:00
Kyunglyul Hyun
a0e5a733c8 Merge "Make ViewConfiguration#getMultiPressTimeout public" 2020-11-09 02:47:34 +00:00
Tiger Huang
eefe559c72 Make insets source window stable while resizing
When the size and the position of the insets source window are changed
at the same time, setPosition will be applied first, and the client will
draw on the new-size surface later, which makes the screen flicker.

This CL defers the setPosition transaction until the new frame is drawn,
which can make the window stable if the content is drawn at the same
location on the display.

This CL also fixes WindowState#mGivenInsetsPending. If the given insets
will be sent to window manager, the provided insets won't be changed
during relayoutWindow until the given insets are sent.

Bug: 171965103
Test: steps in the bug
Change-Id: I4684c03e8def6fa33980e6c10e444f7377c306f8
2020-11-08 02:08:57 +08:00
chaviw
ad81608488 Fixed a few issues with blast sync with SurfaceView
If SurfaceView changed and needs to update its SurfaceControl, it will
append its changes to the main window's blast sync transaction. This is
to ensure it can synchronize with the main window.

However, if SV changes, but the main window doesn't need to submit a new
frame, the logic to synchronize doesn't work. This changes fixes a few
issues

1. Make sure to force a full redraw when
mNextDrawUseBLASTSyncTransaction. This is to ensure we get the proper
callbacks even if there's no new content to draw

2. Clear nextTransaction in BBQ when a frameCompleteCallback is invoked.
In most cases the transaction in BBQ is already cleared since the
frameCompleteCallback is called after a frame is latched and BBQ will
clear the nextTransaction that was set. This is needed when hwui won't
draw a new frame since there's nothing new to draw. In that case, we
will get an immediate frameCompleteCallback without invoking the
processNextBuffer. If VRI doesn't clear the transaction, BBQ will try to
use the stale transaction when a new frame does come in

Test: blast sync in SV enabled doesn't freeze YT
Bug: 172579592
Change-Id: Idca7accdf094dbb4585897e4e884c1147b1a2cd0
2020-11-06 16:44:16 -08:00
Marin Shalamanov
1df8bde25d Add Display.Mode.getAlternativeRefreshRates()
Add a method to Display.Mode to return all refresh rates
to which a seamless display mode switch can be done. Note
that this is not a hard guarantee for seamless switches,
but rather a guarantee that switching to any other mode
will be non seamless.

This is implemented using the config groups which we get
from SurfaceFlinger.

Bug: 161776429
Test: atest LocalDisplayAdapterTest
Change-Id: Id0e721f6c278ce9dcc04d59422b2f881a1154102
2020-11-06 16:32:26 +01:00
TreeHugger Robot
85b41414ab Merge "API review: Update javadoc for InputConnection#getSurroudingText" 2020-11-06 10:43:10 +00:00
Rob Carr
12874c660b Merge "SurfaceView: Disable BLASTSync" 2020-11-05 23:28:38 +00:00
Robert Carr
02e5a33bbc SurfaceView: Disable BLASTSync
We didn't intend to flip this behavior in the initial BLAST flip
revert back to using deferTransaction for now.

Bug: 172579592
Test: Existing tests pass
Change-Id: I07887d59d16ff3676cf20fac11e1ef3fc5e17106
2020-11-05 11:22:51 -08:00
Minche Li
19188bcc25 Merge "Handles magnification scale change when requesting Accessibility action" 2020-11-05 02:01:30 +00:00
Eugene Susla
3f1e82b12c Merge "Disregard annotation params for stale dataclass detection" 2020-11-04 23:57:15 +00:00
Eugene Susla
ddb2681455 Disregard annotation params for stale dataclass detection
Annotation processor seens annotation args with constants already inlined,
making it challenging to compare to the souce-generated metadata that contains
initial expressions.

For now just ignoring args for all non-DataClass annotations to prevent false positives

Test: . frameworks/base/tests/Codegen/runTest.sh
Exempt-From-Owner-Approval: changing metadata on multiple files
Change-Id: I640816ae0f20f36b1b828bc2161f53788c4a4dae
2020-11-04 12:40:58 -08:00
Riddle Hsu
efa6602e6a Merge "Reduce unnecessary invocation of setInputWindowInfo" 2020-11-04 05:35:51 +00:00
Taran Singh
fd4623c388 Merge "Measure baseline IMF latency (2/n)" 2020-11-03 23:30:05 +00:00
Rob Carr
9761e30c3b Merge "ViewRootImpl: Explicitly release BLASTBufferQueue" 2020-11-03 21:32:19 +00:00
Taran Singh
5c61eefbaf Measure baseline IMF latency (2/n)
Add methods to trace.
Refer to design doc in bug.

Bug: 167947940
Test: atest ImePerfTests and also refer to README.md
Change-Id: I423e4f3f9253707d9b6d3d5a2dee260f872b879f
2020-11-03 12:42:54 -08:00
TreeHugger Robot
0f540e233d Merge "Add IntDef annotations to fields" 2020-11-03 14:12:18 +00:00
Lan Wei
2b83476a43 API Review: InputConnection error handling is inconsistent
Make BaseInputConnection also throws IllegalArgumentException as API
defined.

Test: atest BaseInputConnectionTest#testInvalidGetTextBeforeOrAfterCursorRequest

BUG: 172313372
Change-Id: Ia99a7e0b6a652bc3995529780ba910fd370d3f5f
2020-11-03 21:35:33 +08:00
Tiger Huang
9e30941c7a Fix missing private flags in LayoutParams#tostring
Fix: 172317776
Test: adb shell dumpsys window
Change-Id: Ibbc8ff0c16f9ba902f5f106369a42bbb5436bf8f
2020-11-03 19:59:52 +08:00