Commit graph

78923 commits

Author SHA1 Message Date
Jooyung Han
7bcb89317d Set min_sdk_version to be part of mainline modules
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.

Exempt-From-Owner-Approval: cherry-pick from aosp

Bug: 152655956
Test: m
Merged-In: Ifea5ed988fad2e0d29271e6e9cbf0e12100b37d9
Change-Id: Ifea5ed988fad2e0d29271e6e9cbf0e12100b37d9
(cherry picked from commit a395c8d9aa)
2020-05-11 08:33:49 +00:00
TreeHugger Robot
f9d44007cc Merge "Fix consumer closed input channel cause an error occurred (2/2)" into rvc-dev 2020-05-11 05:56:35 +00:00
TreeHugger Robot
0050943c5c Merge "Isolate statsd_write trace when reporting jank." into rvc-dev 2020-05-09 17:26:01 +00:00
Alec Mouri
30843e3b4d Isolate statsd_write trace when reporting jank.
Prior benchmarks shows that this should take 2.6-2.7 micros, but there
exist traces showing that the current slice can take ~700 micros, and
even up to 8 milliseconds, which confounds with the debug log that is
also expected to be cheap. There is evidence that logd occasionally
causes preemption in flinger, so isolate the two calls so that the next
time a bad trace comes in we know what the cause is.

Bug: 144289346
Test: builds
Change-Id: I899e9f99107fad1f5e501b783ce57bfd12300b85
2020-05-08 19:17:57 -07:00
TreeHugger Robot
16596ab14d Merge "SurfaceFlinger: use queueTime as well when calculating refresh rate" into rvc-dev 2020-05-08 23:56:40 +00:00
Alec Mouri
a511811bd9 Merge "Receive refresh rate callbacks from DMS" into rvc-dev 2020-05-08 23:54:17 +00:00
TreeHugger Robot
4b9467baec Merge "SF: Fix emulator DPI" into rvc-dev 2020-05-08 23:29:57 +00:00
Ady Abraham
49e65e422d SurfaceFlinger: use queueTime as well when calculating refresh rate
When calculating refresh rate, we want to make sure that the refresh
rate of a layer is "stable", meaning that the average we calculated
is correct for all the samples we have. If the app stops frame
production and then resumes we don't want to calculate the refresh
rate average across a different group of frames. This change enhances
the detection of when the app stops to produce a frame by looking at
the queue time of a frame if this frame doesn't have a timestamp.

Bug: 155710271
Test: Start an animation not driven by touch
Change-Id: Icef63a1ba86c1ad063592717115addd700e22cad
2020-05-08 22:15:05 +00:00
Dominik Laskowski
d125d0eb52 SF: Fix emulator DPI
ag/9776294 inadvertently set DPI to density.

Bug: 155797799
Test: setprop qemu.sf.lcd_density 440
Change-Id: I5bc6333130f7c79bea892b42435de6b4e4035e96
2020-05-08 12:36:39 -07:00
TreeHugger Robot
ca4cf8ad87 Merge "SF: Fix thread safety for RefreshRateOverlay" into rvc-dev 2020-05-08 19:26:58 +00:00
Jayant Chowdhary
c16fd55277 Merge "Add xml file for camera2 concurrent camera feature." into rvc-dev 2020-05-08 19:05:47 +00:00
Ady Abraham
e7d62aa536 Merge "SurfaceFlinger: refresh rate calculation when no timestamps" into rvc-dev 2020-05-08 18:54:49 +00:00
John Reck
b4cc5f4a55 Merge "Add hook for intercepting query" into rvc-dev 2020-05-08 18:44:55 +00:00
Dominik Laskowski
20134646cb SF: Fix thread safety for RefreshRateOverlay
Lock mStateLock when reading/writing the pointer, and writing layer
state. Destroy the layer on the main thread. Notify overlay when
viewport changes to avoid display lookup on refresh rate change.

Bug: 123715322
Test: Toggle overlay on flame.
Change-Id: I019c5cd49c94182f2c4364b0299fa3aa7783bd15
2020-05-08 10:00:06 -07:00
Alec Mouri
271de040ff Receive refresh rate callbacks from DMS
AChoreographer will use DMS as the source of truth for these callbacks
instead of SurfaceFlinger.

Bug: 154874011
Test: ChoreographerNativeTest
Tes: Manually verify that HWUI is processing refresh rate callbacks
Change-Id: I961a7d1ab335800d3e260ba7564ddca9c0595cfc
2020-05-07 19:17:54 -07:00
Ady Abraham
38601a9beb SurfaceFlinger: refresh rate calculation when no timestamps
Frames without presentation timestamp should be excluded from refresh
rate calculation. This changes skips these frames instead of just
declaring refresh rate unknown. This impacts scenarios that we get few
frames without presentation timestamps where the majority does include
them.

Bug: 155710271
Test: Facebook feed videos
Change-Id: Id79f4d6cb87b2fd6fb787fab2d863f50be99cac5
2020-05-08 00:30:02 +00:00
John Reck
401cda638e Add hook for intercepting query
Bug: 143555869
Test: verified no kgsl maps in RenderThread
Change-Id: Ifac5869cd6b29570286f8fd2aa641701f77fde94
2020-05-07 16:49:19 -07:00
Ady Abraham
a7e92558ee SurfaceFlinger: move refresh rate overlay slightly down
Test: Enable overlay from developer option
Bug: 156026107
Change-Id: I771b7c0383cc4d5b54ba3bd4b03931f911c6e79c
2020-05-07 22:04:44 +00:00
Yiwei Zhang
4264917141 Vulkan: remove the fallback path to load Vulkan driver
This fallback loading path was for backwards compatibility with devices
being upgraded from pre-Oreo (i.e. pre-Treble) to Oreo or later. Those
devices weren't required to follow a lot of the Treble rules, so linker
namespaces (or binaries compatible with them) couldn't be enforced. This
change removes it so that we can discover issues around loading Vulkan
driver from sphal namespace.

Bug: 156021362
Test: build, flash and boot
Change-Id: I505bdbdb40a06e1d837f1d0b75822b0c60de96c9
2020-05-07 14:05:57 -07:00
Siarhei Vishniakou
7e838c2377 Merge "Use <chrono> for input-related timeouts" into rvc-dev 2020-05-07 17:46:17 +00:00
TreeHugger Robot
bd1a5621b6 Merge "Add test to call setInputWindows twice" into rvc-dev 2020-05-07 16:47:00 +00:00
Siarhei Vishniakou
b1a1627da8 Rename ANR -> Anr
To follow the code style, rename ANR -> Anr, because we are about to add
a lot more ANR-related stuff, and we don't want to keep adding new code
that doesn't follow the code style.

Bug: 143459140
Test: build only
Change-Id: I5a97ba4dcd8baa8a34fbb790e68fb63fd3c3ca75
2020-05-07 05:55:42 +00:00
Siarhei Vishniakou
097c3db9fc Use <chrono> for input-related timeouts
There is a lot of confusion in input tests about the units used for the
timeouts. In a lot of cases, the timeouts are set too short, which
causes failures when they start getting enforced. To avoid this, use
std::chrono::duration for the timeouts.

Ideally, we should convert InputWindowInfo and InputApplicationInfo to
use std::chrono::nanoseconds, but that would be a larger change reserved
for a future release.

Bug: 143459140
Test: atest inputflinger_tests libinput_tests inputflinger_benchmarks
Change-Id: Ie7536e8a042a71b372f03314501e0d635a6ac1d4
2020-05-06 21:25:36 -07:00
Siarhei Vishniakou
fb9fcdae2f Add test to call setInputWindows twice
Currently, I'm observing some strange behaviour, where calling
setInputWindows twice results in the touchable region becoming empty.
Add this test to R to see what's going on, and potentially bisect on
this.

Bug: 143459140
Test: atest inputflinger_tests
Change-Id: Ia0acef5d4ee4acc29d20174fe44c9f94172ccd96
2020-05-06 21:25:31 -07:00
arthurhung
d352cb3827 Fix consumer closed input channel cause an error occurred (2/2)
An input channel specifies the file descriptors used to send input
events to a window in another process. And All of the file descriptors
open in the calling process shall be closed when process terminated.

The server side could receive the socket broken event when the process
terminated, we should do the unregister channel before close the file
descriptor or do it automatically without error if there is no valid
window.

Bug: 133782251
Test: open app and exit by back key or recent apps, check if any
      error log occurs.
Change-Id: I59d0084c2c771544e7ee226ce53c574f60c6b988
2020-05-07 10:22:35 +08:00
Wei Sheng Shih
7fb7a6a1a5 Merge "Makes TYPE_NOTIFICATION_SHADE as trusted overlay" into rvc-dev 2020-05-07 01:37:07 +00:00
TreeHugger Robot
2f116e22b0 Merge "CompositionEngine: base inverse transform on primary display" into rvc-dev 2020-05-06 23:38:36 +00:00
Snild Dolkow
9e217d60b6 CompositionEngine: base inverse transform on primary display
Layers with geomBufferUsesDisplayInverseTransform set (usually layers
showing a camera preview) were not being rotated correctly on external
displays with hardware composition. Forcing GPU composition avoided
the issue, since BufferLayer.prepareClientLayer() uses the *primary*
display's orientation to create the inverse transformation.

But, the HWC path used each screen's orientation, resulting in a bad
layer rotation when the primary and external displays' orientation
differed. So let's do what the GPU path does.

This, of course, only makes a difference when the primary and secondary
display rotations differ. In our case, we noticed the problem when
running the landscape-oriented CinemaPro app, while our default camera,
which runs in portrait, did not have a problem.

Co-authored-by: Mikael Magnusson <mikael.magnusson@sony.com>

Note: This is an updated version of the change with the same Change-Id
as uploaded to AOSP, as refactoring has continued, and more tests were
added since.

Bug: 155329360
Test: the new unit test fails without the patch
Test: the new unit test passes with the patch
Test: record using Cinema Pro app with an external screen
Reference: I0da22423490a93fe943fd59e6c122aa6aaf30b11
Change-Id: I8b4975a14a0ae42d10e4eeaa66385e72ff00c23d
2020-05-06 13:34:50 -07:00
TreeHugger Robot
58dc474b3d Merge "CE: Must dequeue a buffer if flipClientTarget requested" into rvc-dev 2020-05-06 19:07:04 +00:00
TreeHugger Robot
c0a8645e4e Merge "Generate a new id for each window" into rvc-dev 2020-05-06 18:11:14 +00:00
Hui Yu
ae1e9f614a Merge "Revert "Add isUidActiveOrForeground for camera/audio to use."" into rvc-dev 2020-05-06 16:59:34 +00:00
Vishnu Nair
5d3244b469 Remove unsafe cast in Client::createWithSurfaceParent am: a03e1302db am: f5d934e7ba
Change-Id: If3d0f2b2fae6093bce54cae34e92cfb40e49acc5
2020-05-06 01:52:38 +00:00
Vishnu Nair
f5d934e7ba Remove unsafe cast in Client::createWithSurfaceParent am: a03e1302db
Change-Id: I5b890ef48b214ed9702acd7a2cac52162a9c0ddb
2020-05-06 01:36:37 +00:00
Siarhei Vishniakou
540dbaee09 Generate a new id for each window
When input receives a list of windows from surfaceflinger, each window
has a unique id. But when we run tests, all ids are the same. This
causes some unexpected test failures for the cases where we have more
than 1 window per display.

To avoid this issue, mirror the surfaceflinger approach of generating
the ids by keeping a static variable that gets incremented every time we
create a new window

Bug: 143459140
Test: atest inputflinger_tests
Change-Id: I36731e78e16892b4bf48d6eba8db3e4c2684b54d
2020-05-06 01:25:56 +00:00
Jayant Chowdhary
16b0d7b6c4 Add xml file for camera2 concurrent camera feature.
Bug: 155188113

Test: atest CameraManagerTest.java on cuttlefish

Change-Id: I488f6d172a2a27b69dcbe44f79900526c2580f9d
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-05-05 15:47:23 -07:00
Lloyd Pique
e9eff9744a CE: Must dequeue a buffer if flipClientTarget requested
To match the logic that always queues a buffer if the HWC has a
flipClientTarget request for the current frame, we must also always
dequeue a buffer, even if no client composition is being performed.

This is an port of an (as yet uncommitted) AOSP change with a ChangeId of
I933cbae2f09f81eef6555b1bb1e5991d2c450930, due to the underlying code
having been refactored.

This version also adds and updates unit tests which were added as part
of the refactoring.

Bug: 151698217
Test: libcompositionengine_test
Test: libsurfaceflinger_test
Change-Id: Ia8a1470affb2596b27986cc4153417f48cf4ed1c
2020-05-05 15:19:59 -07:00
TreeHugger Robot
547bea0331 Merge "Remove unsafe cast in Client::createWithSurfaceParent" into rvc-dev 2020-05-05 17:36:09 +00:00
wilsonshih
9499a112e3 Makes TYPE_NOTIFICATION_SHADE as trusted overlay
Fix the side effect after we split notification_shade window from status
bar.

Bug: 155373298
Test: follow the steps from b/149320322
Change-Id: I3362186b22505d21ec6e0ad779d4a26304ed782c
Merged-In: I3362186b22505d21ec6e0ad779d4a26304ed782c
2020-05-05 04:44:23 +00:00
Steven Thomas
0abfdcad57 Merge "Give touch boost higher priority than idle detection" into rvc-dev 2020-05-05 01:33:55 +00:00
TreeHugger Robot
2e7d28cc8e Merge "GLESRenderEngine: validate eglQueryStringImplementationANDROID for nullptr" into rvc-dev 2020-05-05 00:19:14 +00:00
TreeHugger Robot
a2fad15aac Merge "SurfaceFlinger: add frame rate to dumpsys" into rvc-dev 2020-05-04 23:12:07 +00:00
Steven Thomas
bb37432c0f Give touch boost higher priority than idle detection
When the non-kernel idle timer is used, touch boost wasn't being applied
when the device was idle. I moved the code around to ensure touch boost
is applied when the device is idle.

Bug: 154571341

Test: - Wrote a new unit test to confirm correct idle behavior.
      - Locally modified a Pixel 4 to use the regular idle timer rather
        than the kernel idle timer, and confirmed we now apply touch
        boost correctly.

Change-Id: Id998405a4d79f7a89fc0523b6503fe1a3dea8cce
2020-05-04 15:23:15 -07:00
Ady Abraham
be23e6a1d7 SurfaceFlinger: add frame rate to dumpsys
Print frame rate if explicitly set by setFrameRate to dumpsys

Bug: 155676501
Test: adb shell dumpsys SurfaceFlinger
Change-Id: I1016f8a56921f7f465ca50298f49d05b02be585c
2020-05-04 22:12:45 +00:00
Hui Yu
94ea7ac7e0 Revert "Add isUidActiveOrForeground for camera/audio to use."
Revert submission 10829580-isUidForeground

Reason for revert: In CameraService.cpp, before this change, around "am.isUidActive", there was up to 300 ms retry. After this change, the code could move forward fast without retry, but at "mAppOpsManager->startOpNoThrow" call, for the same reason as uid is not updated fast enough, "mAppOpsManager->startOpNoThrow" could also fail.

This CL does not really fix the root cause, but it changes the timing and now the code fails at "mAppOpsManager->startOpNoThrow" call.

Also the timing change may also cause recent multiple CTS test failures.

Bug: 154570809, 155032617, 154849083


Reverted Changes:
Iffed63293:Add isUidActiveOrForeground() for camera/audio to ...
I3685e0c8d:Add isUidActiveOrForeground() for camera/audio to ...
I51ed1fe78:Add isUidActiveOrForeground for camera/audio to us...

Change-Id: I9fbeb190c5a0ac640ad5be8140fe4aaeb7cfe33d
2020-05-04 18:07:46 +00:00
Calin Juravle
e13827d3dc Merge "Handle the boot profile format when analyzing profiles" into rvc-dev 2020-05-04 17:59:43 +00:00
Michael Hoisie
49497c9af7 Merge "Update libgui to use android::base properties instead of cutils" into rvc-dev 2020-05-02 20:49:42 +00:00
Suren Baghdasaryan
6c245b42f5 Replace direct pid writes with setting task profiles
For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.

Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I3e06e25a75cf79674d8381b3356c64790fd5a597
Merged-In: I3e06e25a75cf79674d8381b3356c64790fd5a597
2020-05-02 06:20:28 +00:00
Steven Thomas
32bc62dc0e Merge "Split refresh rate range into two ranges" into rvc-dev 2020-05-02 02:12:38 +00:00
Dheeraj Shetty
5b7d7e2150 Merge "Revert^2 "libui: rewrite Region with FatVector"" into rvc-dev 2020-05-01 23:27:43 +00:00
Michael Hoisie
53e19a76a4 Update libgui to use android::base properties instead of cutils
Clean up cutils/properties.h headers as some files were including it and
not using it.

Also update DebugEGLImageTracker to use android::base properties because
it works on host and is generally more concise.

Bug: 155436554
Test: build, flash and boot
Change-Id: I1dc7060cae9811b69aac9bb36b71b69cd6ecba93
2020-05-01 17:57:38 -04:00