Commit Graph

16122 Commits

Author SHA1 Message Date
Santos Cordon
c7f1d37c19 Clean up LogicalDisplayMapper
Organize the code so that it is easier to read.
Add lots of display-related tests.

Test: atest com.android.server.display
Bug: 168208162
Change-Id: I72a4eb6677e346f615e4730f4888d56333645844
2021-02-28 19:29:39 +00:00
Shuo Qian
8b8f2625db Merge changes from topic "cp-rvc-aosp" into sc-dev
* changes:
  [automerged blank] Add Emergency callback mode shell command 2p: b201f9b1e6
  Add Emergency callback mode shell command
2021-02-26 22:56:18 +00:00
Galia Peycheva
656d774184 Merge "Fix synchronisation in BackgroundBlurDrawable" into sc-dev 2021-02-26 14:30:04 +00:00
Jeff Sharkey
869d848e45 Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2 am: 4df29fd76a am: 2b3fee42d8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icb05293712e0b6127bda0e8e297e447956ee5aa1
2021-02-26 13:08:55 +00:00
Mark Renouf
20bd3d4935 Merge "Long screenshots framework update and API unhide" into sc-dev 2021-02-26 13:06:47 +00:00
Riddle Hsu
ed46310238 Merge "Optimize the Parcel read/write of common window data" into sc-dev 2021-02-26 04:07:39 +00:00
Mark Renouf
8f1b73e183 Long screenshots framework update and API unhide
This change includes a series of API review changes. The most
significant update is the addition of cancellation signals to
API methods where needed.

Renames some internal classes and interfaces to support the
API changes and to simplify tests and improve quality.

Test: numerous presubmits
Bug: 175830670
CTS-Coverage-Bug: 180419562
Change-Id: I9b1b950a2779fc902ecf4d6394e3c35171926700
2021-02-25 23:02:17 +00:00
Galia Peycheva
d129f1e00e Fix synchronisation in BackgroundBlurDrawable
The PositionUpdateListener in BackgroundBlurDrawable is called from
a thread pool to update the position of the BlurRegion. After that,
in frame drawing callback (RenderThread), the Aggregator takes all
the settings in BackgroundBlurDrawable and dispatches them to SF.
However, while the RenderThread is working on frame N, the Ui thread
is working on frame N+1. So when the frame drawing callback is
called on RenderThread for frame N, BackgroundBlurDrawable
might already be holding settings for frame N+1.

In this CL, we fix that by making BackgroundBlurDrawable work only on Ui
thread, while BlurRegion lives only on RenderThread. Just before
drawing, we copy the state of BackgroundBlurDrawable into a BlurRegion.
So when render thread starts doing its thing for frame N, Ui thread can
start setting up BackgroundBlurDrawable for frame N+1. The settings for
frame N are already copied over to BlurRegion. In frame drawing
callback, we take the blur regions if there is a pending update and send
them to SF.

Bug: 167166562
Test: m && atest BlurAggregatorTest
Change-Id: Icec0fa8e97de30b7bad15b97f848ae642076652f
2021-02-25 18:33:33 +01:00
Philip Junker
daeb58b574 Merge "Add support for navigation repeat sound effects" into sc-dev 2021-02-25 14:03:14 +00:00
Louis Chang
09f52aa440 Merge "Rename Stack to Task related terms (7/n)" into sc-dev 2021-02-25 04:58:24 +00:00
Louis Chang
7efc57797c Rename Stack to Task related terms (7/n)
- Renaming PinnedStack to PinnedTask
- Renaming DockedStack to DockedTask

Bug: 157876447
Test: presubmit
Change-Id: I51c10564647ed0d46eddc0c51a1ee06eef897e43
2021-02-25 04:57:26 +00:00
Alec Mouri
1a621e8eff Merge "JNI wrapper for FpsListener." into sc-dev 2021-02-24 22:41:10 +00:00
Jeff Sharkey
2b3fee42d8 Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2 am: 4df29fd76a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iab3982e777395a9579505ad90b143c3b6c04b6f3
2021-02-24 21:52:33 +00:00
Jeff Sharkey
4df29fd76a Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I916187da222fa9e100d9beb67866427b10481900
2021-02-24 20:59:35 +00:00
Siarhei Vishniakou
554afe2691 Merge "Add presentTime to FrameInfo" into sc-dev 2021-02-24 20:38:17 +00:00
Riddle Hsu
b293d933e0 Optimize the Parcel read/write of common window data
The Parcel read/write speed of MergedConfiguration/InsetsSource
becomes 4x+ faster.

Because writeParcelable sends additional type info which is
unnecessary if the type is known on the reading side, replace
the usages to writeTypedObject and well-written readFromParcel.
That saves the time of class lookup and object creation.

Bug: 181025587
Test: vogar --mode app_process --benchmark \
frameworks/base/core/tests/benchmarks/src/android/os/ParcelableBenchmark.java

Change-Id: I29548ce6c2e5886f0e90a5dc70d8e9ecc0fb25a8
2021-02-24 23:33:16 +08:00
Anton Hansson
eaeaf0acac Merge "Revert "Adding public API to expose DisplayInfo.deviceProductInfo"" into sc-dev 2021-02-24 12:27:18 +00:00
Treehugger Robot
c61b65d3a3 Merge "Fix NPE in AutofillManager when feature autofill is disabled" am: 782fa90be7 am: 1b0afb17d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1511471

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I79501aa89e25a7b2470bb3f2572b44b4db636a4b
2021-02-23 23:22:09 +00:00
Treehugger Robot
1b0afb17d3 Merge "Fix NPE in AutofillManager when feature autofill is disabled" am: 782fa90be7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1511471

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9f8a8f1370fb9523f8a67b5ccafbe101aa495709
2021-02-23 23:10:15 +00:00
Marin Shalamanov
85bde7b023 Merge "Update ALLM and Game type support on hotplug" into sc-dev 2021-02-23 18:54:18 +00:00
Ulyana Trafimovich
d6bff72799 Revert "Adding public API to expose DisplayInfo.deviceProductInfo"
Revert "Adding aidl file to share deviceProductInfo constants bw..."

Revert "Changes in tvsystem/ DeviceProductInfo to mirror changes..."

Revert "Adding new CTS test for the API display#getDeviceProductInfo"

Revert submission 13552775-expose DisplayInfo.deviceProductInfo

Reason for revert: broken test android.compat.sjp.cts.StrictJavaPackagesTest#testBootClassPathAndSystemServerClasspath_nonDuplicateClasses
    on git_sc-dev on cf_x86_64_phone-userdebug at 7162420

Bug: 181021245

Reverted Changes:
Id6767127f:Adding aidl file to share deviceProductInfo consta...
I6959d2829:Adding public API to expose DisplayInfo.deviceProd...
I720dbfe84:Adding new CTS test for the API display#getDeviceP...
I6c726e12c:Changes in tvsystem/ DeviceProductInfo to mirror c...

Change-Id: I4c8545c651d1e399ed3ca5061d1ef5f526c3929a
2021-02-23 17:14:58 +00:00
Taran Singh
6ba3501f98 Merge "Avoid IME restart for configChanges" into sc-dev 2021-02-23 15:04:42 +00:00
Stevie Kideckel
990269dd07 Merge "Expose tint lists and other runtime functionality to RemoteViews" into sc-dev 2021-02-23 10:18:10 +00:00
Marin Shalamanov
1afe51de2f Update ALLM and Game type support on hotplug
In this CL we move ALLM and game contnet type support
to DynamicDisplayInfo and change LocalDisplayAdapter
to update them on hotplug. Unit tests for this scenario
are added.

Bug: 180108954
Test: atest LocalDisplayAdapterTest
Change-Id: Ida74d2782804f113fda784bdde00457ec3c80a2c
2021-02-23 10:58:35 +01:00
Philip Junker
e3a12e85c4 Add support for navigation repeat sound effects
NO_TYPO_CHECK=Existing typo in getContantForFocusDirection (e.g. b/3170596)

Test: atest android.view.cts.SoundEffectConstantsTest
Test: atest android.view.SoundEffectConstantsTest
Bug: 157407957
Change-Id: I7377b1df6b151ea0d77476f0186b4bb21f1a55fe
2021-02-23 08:48:34 +00:00
Chris Ye
98580a2e82 Merge changes from topic "LightsManager" into sc-dev
* changes:
  Support input device lights manager feature in frameworks.
  Add SET_REPORT data output to hid commandline tool.
2021-02-23 08:19:13 +00:00
TreeHugger Robot
1284ffd3f5 Merge "Refine the condition about force layout" into sc-dev 2021-02-23 07:52:11 +00:00
TreeHugger Robot
4a94d3965b Merge "SurfaceControlViewHost: Always set FLAG_HARDWARE_ACCELERATED for embedded views" into sc-dev 2021-02-23 05:49:53 +00:00
Joanne Chung
3278c403c7 Merge "Fix NPE in AutofillManager when feature autofill is disabled" into sc-dev 2021-02-23 03:03:11 +00:00
Mark Renouf
08b97003b3 Add OWNERS for long screenshots framework code
Change-Id: If7680b6d2124c63aa29421d5c2b717db8e5cbf1a
2021-02-22 19:53:46 -05:00
Chris Ye
cbb480c25e Support input device lights manager feature in frameworks.
Add lights manager support to input frameworks.

Bug: 161633625
Test: atest LightsManagerTest, atest InputDeviceLightsManagerTest
Change-Id: Ic6c701cad84f277325583c77195592d96d9296b8
2021-02-22 16:06:35 -08:00
John Reck
3b1ded1768 Merge "Wire up SurfaceView stretch effect" into sc-dev 2021-02-22 22:30:29 +00:00
Marin Shalamanov
1b520a6d3f Merge "Introduce DynamicDisplayInfo" into sc-dev 2021-02-22 18:28:27 +00:00
Tiger Huang
657ec55928 Merge "Only update mAboveInsetsState when necessary" into sc-dev 2021-02-22 17:12:17 +00:00
Joanne Chung
134d041153 Fix NPE in AutofillManager when feature autofill is disabled
When feature_autofill is not present on device IAutoFillManager
service could be null. It is proposed to check service for null
before trying to add client to prevent NPE.

Bug: 180913556
Test: cts-tradefed run cts-dev -m CtsWidgetTestCases \
    -t android.widget.cts.DatePickerTest#testPartsVisibilityInSpinnerMode
Test: atest CtsAutoFillServiceTestCases
Change-Id: I4d65fe4f664e37115d653e981094f1a52c1d97e8
2021-02-23 00:31:44 +08:00
Stevie Kideckel
41c60e0ccb Expose tint lists and other runtime functionality to RemoteViews
Bug: 180086170
Test: sample app using new methods, atest
Change-Id: I5aa5476d95d6c9fb992c4548d97f577234d747a7
2021-02-22 15:09:18 +00:00
Artem Radchenko
3218ac8864 Fix NPE in AutofillManager when feature autofill is disabled
When feature_autofill is not present on device IAutoFillManager service could be null.
It is proposed to check service for null before trying to add client to prevent NPE.

Bug: 174444980
Test: cts-tradefed run cts-dev -m CtsWidgetTestCases \
    -t android.widget.cts.DatePickerTest#testPartsVisibilityInSpinnerMode
Signed-off-by: Artem Radchenko <artem.radchenko@globallogic.com>
Change-Id: Id6bad7e652452343ed674e4a7452a1b8231f72c5
Merged-In: I10ce988603f47117d0efddcc014ec51b72d3b3b4
2021-02-22 14:51:08 +00:00
Kriti Dang
bcd8ea64de Merge "Adding public API to expose DisplayInfo.deviceProductInfo" into sc-dev 2021-02-22 13:31:42 +00:00
Tiger Huang
07981b4f3f Refine the condition about force layout
This CL applies SOFT_INPUT_MASK_ADJUST before comparing to
SOFT_INPUT_ADJUST_RESIZE.

Bug: 161781474
Test: atest ForceRelayoutTest ForceRelayoutSdk29Test
Change-Id: I275faafd7520df06f512c638f7c5255cc460aa02
2021-02-22 18:17:42 +08:00
Xin Li
be473bf819 Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4bf82035631ccff6d5a6144d6d9b1d203b076851
Change-Id: I1b5f3a672a55eaabba0f5389bab110b395553559
2021-02-21 09:39:53 -08:00
Evan Rosky
aa1d38db25 Merge "Don't rotate inputflinger's display" into sc-dev 2021-02-20 01:46:25 +00:00
Chris Li
21dad1954c Merge "Fix non-zero window inset" into sc-dev 2021-02-19 19:02:32 +00:00
Kriti Dang
0a40860bc1 Adding public API to expose DisplayInfo.deviceProductInfo
Changing class DeviceProductInfo to public class with hidden ctor to expose via
Display#getDeviceProductInfo. Removing the relative address and changing
to connectionToSinkType.

Bug: 179775994
Test: atest CtsDisplayTestCases
Change-Id: I6959d2829f7ff9ba609f9e4e3cb7b52e0f555c3f
2021-02-19 15:14:41 +01:00
Chavi Weingarten
c14465c2bb Merge "Added public APIs to generate and validate a DisplayHash." into sc-dev 2021-02-19 01:47:14 +00:00
Siarhei Vishniakou
4bcbffd584 Add presentTime to FrameInfo
Present time is available to apps, but is not currently stored inside
FrameInfo. In this CL, we add a location for storing the present time inside
FrameInfo.

Currently, the metrics reporter is triggered after the buffer is sent to
SurfaceFlinger. That means, metrics for anything that happens after gpu
draw completes are currently not available.

In a future CL, we will populate the 'presentTime' field.

In a future CL, we will register a metrics observer inside ViewRootImpl
in order to send this data to InputDispatcher. This will enable
end-to-end touch latency metrics collection.

Bug: 169866723
Test: printed present time inside FrameTimeline.cpp (surfaceflinger
side) and compared to the values printed inside a metrics observer
registered in ViewRootImpl (not done in this CL)
Test: atest ViewFrameInfoTest

Change-Id: I7d0f8c5d7b5a2572abdc4e107123e8938a36f582
2021-02-18 22:07:09 +00:00
Tiger Huang
c891f22678 Only update mAboveInsetsState when necessary
This CL only updates mAboveInsetsState while the z-order of a window is
changed or the display info has been updated.

This can be a step to make client compute its window frame locally.

Bug: 161810301
Bug: 175861127
Test: atest DisplayPolicyTests DisplayPolicyLayoutTests
Change-Id: Ic202ca82ae3b0aeaf4d95ba6d0847970aa9896a6
2021-02-19 03:22:40 +08:00
Taran Singh
d6f8a1ada1 Avoid IME restart for configChanges
Handle onConfigurationChanged() in order to prevent restarting
InputMethodService everytime. We introduce a new API attribute
"configChanges" in InputMethod(attrs.xml) which when declared
by IME, will be responsible for handling mentioned
configuration changes.

Bug: 167948419
Test: atest InputMethodServiceTest
    Manually:
      1. Patch Ie91e7a8e06b80864ef9409031e8543858552d70d to use dual
         display area.
      2. Open applications with editors on both display areas.
      3. Attach a debug point for IMS#onConfigurationChanged().
      4. Make sure IMS#resetStateForNewConfiguration() is not called
         when IME moves between these two identical DisplayAreas

Change-Id: Iff88b768c6b06cf5cf1fe9e97ee97f8f78e6f0bd
2021-02-18 18:22:27 +00:00
Marin Shalamanov
463ad8ee22 Introduce DynamicDisplayInfo
In this CL we introduce SurfaceContorl.getDynamicDisplayInfo
which replaces the current seprate calls for supported and
active display mode, supproted and active color modes and
HDR capabilities.

This way display capabilities can be queried atomically.

Additionally this CL pipes an DisplayMode IDs from
SurfaceFlinger and updates LocalDislayAdapter to use
IDs instead of array indices.

Test: presubmit
Bug: 159590486
Bug: 175678215
Change-Id: I169e3055d07905e2330e11f158b61ffd366f97e6
2021-02-18 18:54:41 +01:00
Vishnu Nair
8a3568667f SurfaceControlViewHost: Always set FLAG_HARDWARE_ACCELERATED for embedded views
If FLAG_HARDWARE_ACCELERATED is not set, view
framework will not use hw rendering and the shadows
will not be rendered.

Fix this by adding the flag when setting the view in
SurfaceControlViewHost. The public api already sets this
flag, so this brings parity to the internal api as well.

Test: Embedded window can draw shadows
Fixes: 180613222
Change-Id: Ife84ea9e09d415679fdf973bbc572eda360921e4
2021-02-18 09:04:16 -08:00
Evan Rosky
1db6aa54ae Don't rotate inputflinger's display
This "undoes" the rotation in incoming displayviewports
so that inputflinger always works in the orientation the display
grew-up in

It also modifies existing gesture-monitors to deal with unrotated
coordinates

This is behind a flag:
   adb shell setprop persist.debug.per_window_input_rotation 1

Bug: 179274888
Test: phone should work like normal
      atest MotionEventTest (coretests)
Change-Id: Iaa7ff7d62e9f756af2c9c622ec508c5e538ec8bd
2021-02-17 17:52:40 -08:00