OSDN Git Service

android-x86/frameworks-native.git
7 years agoVR: fix libvr_hwc-hal build
Chia-I Wu [Thu, 20 Apr 2017 18:30:57 +0000 (11:30 -0700)]
VR: fix libvr_hwc-hal build

libhwcomposer-client was updated to use
android.hardware.graphics.mapper@2.0.

Bug: 37540361
Test: boots
Change-Id: Id9f94087a04890de95711c91ce9d5aa2f6c8e35d

7 years agovr: Adjust for libui gralloc flags change
Chris Forbes [Thu, 20 Apr 2017 00:16:48 +0000 (17:16 -0700)]
vr: Adjust for libui gralloc flags change

Change-Id: I24dbe407ad9139ba1d206b9074c7c507537d198c
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agogui: Adjust for libui gralloc flags change
Chris Forbes [Thu, 20 Apr 2017 19:43:28 +0000 (12:43 -0700)]
gui: Adjust for libui gralloc flags change

Change-Id: I9f73a1753f9e991eb3a7f0a005c3ab240f0a38b4
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agonativewindow: Adjust for libui gralloc flags change
Chris Forbes [Thu, 20 Apr 2017 19:43:04 +0000 (12:43 -0700)]
nativewindow: Adjust for libui gralloc flags change

Change-Id: I451f045b42d1e3e3bfc35f1e30f27dedc35d4da3
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agoui: Rework GraphicBuffer + Allocator for 64bit usage
Chris Forbes [Wed, 19 Apr 2017 21:29:54 +0000 (14:29 -0700)]
ui: Rework GraphicBuffer + Allocator for 64bit usage

Removes gralloc1-style flags, and replaces with HIDL-style single 64bit
usage. Internal storage of the usage is still 32bit; to be addressed
with a future change.

Change-Id: I60062208cbb06bc8cf6c293e7c7e1530c1147912
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agoMerge "Remove/Cleanup Obselete References" into oc-dev
Luke Song [Sat, 22 Apr 2017 17:30:55 +0000 (17:30 +0000)]
Merge "Remove/Cleanup Obselete References" into oc-dev

7 years agoMerge "dumpstate: add graphics composer to hal_interfaces_to_dump" into oc-dev
TreeHugger Robot [Sat, 22 Apr 2017 09:00:07 +0000 (09:00 +0000)]
Merge "dumpstate: add graphics composer to hal_interfaces_to_dump" into oc-dev

7 years agodumpstate: add graphics composer to hal_interfaces_to_dump
Chia-I Wu [Thu, 20 Apr 2017 21:31:50 +0000 (14:31 -0700)]
dumpstate: add graphics composer to hal_interfaces_to_dump

Bug: 37152880
Test: adb shell dumpstate
Change-Id: Id9679d0f02350bc4f51b11b250c7703703dbdfe7

7 years agoMerge "Fix external cache and secondary user bugs." into oc-dev
Jeff Sharkey [Fri, 21 Apr 2017 20:01:36 +0000 (20:01 +0000)]
Merge "Fix external cache and secondary user bugs." into oc-dev

7 years agoMerge "Defer surfaceflinger composition until data latch" into oc-dev
Mike Stroyan [Fri, 21 Apr 2017 18:59:49 +0000 (18:59 +0000)]
Merge "Defer surfaceflinger composition until data latch" into oc-dev

7 years agoMerge "Fix AHardwareBuffer 10:10:10:2 format" into oc-dev
TreeHugger Robot [Fri, 21 Apr 2017 18:38:19 +0000 (18:38 +0000)]
Merge "Fix AHardwareBuffer 10:10:10:2 format" into oc-dev

7 years agoDefer surfaceflinger composition until data latch
Mike Stroyan [Thu, 20 Apr 2017 18:10:48 +0000 (12:10 -0600)]
Defer surfaceflinger composition until data latch

If layer data is not yet ready, latchBuffer will return an empty region.
SurfaceFlinger::handlePageFlip will now check if any layer has a queued
frame which succeeded in latching data.
If no new frame is latched, handlePageFlip will return false.
That will defer refresh until the next vsync.
That reduces HWC and GPU load, improving framerates.
It prevents dEQP tests from timing out on some devices.

Test: dEQP-VK.wsi.android.incremental_present.scale_down.fifo.reference
Bug: 37439915
Change-Id: Id46c82f79953f3a147af77bb0e8e81a395c606b3

7 years agoRemove/Cleanup Obselete References
Luke Song [Fri, 24 Mar 2017 21:17:31 +0000 (14:17 -0700)]
Remove/Cleanup Obselete References

Bug: 36039686
Bug: 36040117
Bug: 36039685
Bug: 36040550
Test: Build
Change-Id: Ifd5ae90138e39d0a14c6a5a8198a9145f74ec8f6
(cherry picked from commit 8126b9df8987fd9959eab1ae76620c343c32f4fc)

7 years agoMerge "Pose flicker fix on some devices" into oc-dev
TreeHugger Robot [Fri, 21 Apr 2017 08:09:37 +0000 (08:09 +0000)]
Merge "Pose flicker fix on some devices" into oc-dev

7 years agoMerge "libui: log an error on allocation failure" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 18:56:25 +0000 (18:56 +0000)]
Merge "libui: log an error on allocation failure" into oc-dev

7 years agoPose flicker fix on some devices
Okan Arikan [Wed, 12 Apr 2017 18:32:21 +0000 (11:32 -0700)]
Pose flicker fix on some devices

The issue was that when the sensord starts on some devices, the initial
IMU sensor fusion pose timestamps are 0 (the first 20-30). It then
starts sending the timestamps. But the latency model looks into the
latency in the initial samples and fixes the latency estimate.

Therefore the estimated latency was way off.

The solution is checking the pose timestamps before using it.

Bug: 37278649
Test: Restart device and run a VR app.
Change-Id: Ic472cb43b32de5d4af3b19547bdc32e906fbfa6a

7 years agolibui: log an error on allocation failure
Chia-I Wu [Thu, 20 Apr 2017 05:20:55 +0000 (22:20 -0700)]
libui: log an error on allocation failure

This was on the gralloc0/gralloc1 path, but was missing from the HIDL
gralloc path.

Bug: 37444686
Test: allocate an invalid buffer
Change-Id: If1ea0e27c228d82abbcd6f6290eb8fee423828e7

7 years agoMerge "libpdx_uds: Serialize access to connection socket between threads" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 04:11:17 +0000 (04:11 +0000)]
Merge "libpdx_uds: Serialize access to connection socket between threads" into oc-dev

7 years agoMerge "Fix reference loop in IEventQueue implementation." into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 04:08:29 +0000 (04:08 +0000)]
Merge "Fix reference loop in IEventQueue implementation." into oc-dev

7 years agoMerge "libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair" into...
TreeHugger Robot [Thu, 20 Apr 2017 03:57:16 +0000 (03:57 +0000)]
Merge "libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair" into oc-dev

7 years agoMerge "Calculate batching param in a smarter way" into oc-dev
Peng Xu [Thu, 20 Apr 2017 02:01:37 +0000 (02:01 +0000)]
Merge "Calculate batching param in a smarter way" into oc-dev

7 years agoFix reference loop in IEventQueue implementation.
Yifan Hong [Thu, 20 Apr 2017 01:45:30 +0000 (18:45 -0700)]
Fix reference loop in IEventQueue implementation.

EventQueue's destructor is never called because
EventQueueLooperCallback has a strong reference to it,
and EventQueueLooperCallback is never destroyed because
the file descriptor is never removed from the looper.

Bug: 37280081
Test: camera works
Test: event queue is destroyed when client removes
its reference (from logcat)

Change-Id: I12347b6d1cca354288382555d2d9a20acfa59233

7 years agoMerge "Fix default optics" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 01:20:01 +0000 (01:20 +0000)]
Merge "Fix default optics" into oc-dev

7 years agoMerge "Remove the lookup distortion class" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 01:19:47 +0000 (01:19 +0000)]
Merge "Remove the lookup distortion class" into oc-dev

7 years agoMerge "Otapreopt: Fix count" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 00:34:55 +0000 (00:34 +0000)]
Merge "Otapreopt: Fix count" into oc-dev

7 years agoMerge "Reflect removal of vndservice_manager SELinux object manager." into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 00:06:41 +0000 (00:06 +0000)]
Merge "Reflect removal of vndservice_manager SELinux object manager." into oc-dev

7 years agoFix default optics
Hendrik Wagenaar [Tue, 18 Apr 2017 22:12:30 +0000 (15:12 -0700)]
Fix default optics

* Prior cl caused an infinite loop with the defaults
* Removed linear approximation - it caused issues with
  inverse distortion

Bug: 37443861
Test: Manually ran on a few phones
Test: Wrote a program that compared the distortion and
      undistortion values with the old and new path
Change-Id: I7221679585dd7f0fe966ff11170e9d3ec74a51df

7 years agoMerge "Hold onto FileHandles for glBindSharedBufferQCOM calls" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 23:11:12 +0000 (23:11 +0000)]
Merge "Hold onto FileHandles for glBindSharedBufferQCOM calls" into oc-dev

7 years agoFix AHardwareBuffer 10:10:10:2 format
Jesse Hall [Wed, 19 Apr 2017 22:43:02 +0000 (15:43 -0700)]
Fix AHardwareBuffer 10:10:10:2 format

Rename this format to match the component ordering we use in the other
formats (RGBA, in LSB to MSB order), and associate it with the right
Vulkan format (A2B10G10R10_UNORM_PACK32, not the BGRA-order
A2R10G10B10_UNORM_PACK32): the former is required in Vulkan while the
latter isn't, and it makes sense for us to be consistent with that.

Also use the _FLOAT suffix for the 4xFP16 format, not _SFLOAT; we don't
use the latter anywhere else and we don't have unsigned floats.

Bug: 37515907
Test: make checkbuild
Change-Id: I4f9e5e39ddef41d373290c26c92d5b94a884a740

7 years agoMerge changes If30bfa71,Ib8f78967 into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 22:34:25 +0000 (22:34 +0000)]
Merge changes If30bfa71,Ib8f78967 into oc-dev

* changes:
  pdx_benchmarks: Let the service create sockets by itself
  libpdx_uds: Fix send/receive over socket to handle signal interrupts

7 years agoDO NOT MERGE: SF: disable HW vsync while dozing am: 46d455b3ab
Zheng Zhang [Wed, 19 Apr 2017 22:31:37 +0000 (22:31 +0000)]
DO NOT MERGE: SF: disable HW vsync while dozing am: 46d455b3ab
am: eee8fc1cd2  -s ours

Change-Id: I27ca7dfc0618b18865379441f0ab32d06477d220

7 years agoDO NOT MERGE: SF: disable HW vsync while dozing
Zheng Zhang [Wed, 19 Apr 2017 22:29:07 +0000 (22:29 +0000)]
DO NOT MERGE: SF: disable HW vsync while dozing
am: 46d455b3ab

Change-Id: I8e2eb78fc79b5127d9baa6079095115c431e1823

7 years agoOtapreopt: Fix count
Andreas Gampe [Wed, 19 Apr 2017 20:58:49 +0000 (13:58 -0700)]
Otapreopt: Fix count

Don't count null for argc.

Bug: 37158297
Test: m
Test: OTA pre-versioned -> OTA versioned
Change-Id: I378b0b7b445f34c766460182d724d6abd84ff773

7 years agoMerge "Otapreopt: Add non-profile fallback" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 20:31:59 +0000 (20:31 +0000)]
Merge "Otapreopt: Add non-profile fallback" into oc-dev

7 years agoMerge "Run dex2oat from the staged apk directory." into oc-dev
Jeff Hao [Wed, 19 Apr 2017 20:16:18 +0000 (20:16 +0000)]
Merge "Run dex2oat from the staged apk directory." into oc-dev

7 years agoMerge "DVRBuffer functions should acquire AHardwareBuffer" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 19:51:37 +0000 (19:51 +0000)]
Merge "DVRBuffer functions should acquire AHardwareBuffer" into oc-dev

7 years agolibpdx_uds: Serialize access to connection socket between threads
Alex Vakulenko [Tue, 18 Apr 2017 21:41:33 +0000 (14:41 -0700)]
libpdx_uds: Serialize access to connection socket between threads

Added a mutex to allow only one client thread to perform atomic
send-request/receive-responce actions.

Also added a unit test that perfroms multiple parallel client requests
to the same service to ensure it can handle multithreaded access
correctly.

Bug: 37443070
Test: `libpdx_uds_tests` pass
Change-Id: Ica516f7806f9146fb530b5cb371d2ee89146fed7

7 years agolibpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair
Alex Vakulenko [Tue, 18 Apr 2017 21:37:20 +0000 (14:37 -0700)]
libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair

This is important to enable Service/Client operation in unit tests.
Being able to create a pair of Unix domain sockets and construct both
Service and Client so that they can talk to each other without having
to create a physical socket file is convenient.

This change makes it possible to create an instance of Endpoint and
ClientChannel classes based just on a pair of sockets (Endpoint does
take another socket to simulate the main endpoint FD to accept incoming
connection on, but it is not used for this, only the shutdown events
are received from that main socket. Endpoint uses the channel FD to
perform actual communication with the client).

Bug: 37443070
Test: `libpdx_uds_tests` pass
Change-Id: Ifa1a9d03b97bd90282a04715c2105ad37a8de936

7 years agopdx_benchmarks: Let the service create sockets by itself
Alex Vakulenko [Mon, 17 Apr 2017 23:19:51 +0000 (16:19 -0700)]
pdx_benchmarks: Let the service create sockets by itself

Default implementation of Endpoint::Create() takes the socket name
as provided by the init process when it forks. pdx_benchmark is not
a service but a command-line utility and it is being started manually
and not through init process. So, named sockets are not available.
Instead, it must create a socket by the specified name. For this,
it must use Endpoint::CreateAndBindSocket() method.

Bug: 37507039
Test: Tested manually on device: `pdx_benchmarks --service foo`.
Change-Id: If30bfa7138f5a97ba0bff9e61460c6bd3697ec19

7 years agoMerge "Return error when trying to disconnect twice" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 18:47:44 +0000 (18:47 +0000)]
Merge "Return error when trying to disconnect twice" into oc-dev

7 years agoRun dex2oat from the staged apk directory.
Jeff Hao [Thu, 6 Apr 2017 00:11:39 +0000 (17:11 -0700)]
Run dex2oat from the staged apk directory.

The frameworks/base change makes the PackageManager pass relative paths
of previous code paths as shared library paths. This change passes the
base directory for these relative paths to dex2oat using the new switch
--classpath-dir.

Part of a multi-project change.

Bug: 34169257
Test: cts-tradefed run singleCommand cts -d --module
CtsAppSecurityHostTestCases -t android.appsecurity.cts.SplitTests

(cherry-picked from commit cc5c4e32637601432bc6359fb7ff34e4cadb6502)

Change-Id: I8f941eb9982a051c1f49256d5489f2575af1d80f

7 years agolibpdx_uds: Fix send/receive over socket to handle signal interrupts
Alex Vakulenko [Mon, 17 Apr 2017 19:02:38 +0000 (12:02 -0700)]
libpdx_uds: Fix send/receive over socket to handle signal interrupts

Previous implementation of send/receive didn't account for the fact that
send/receive operation might be interrupted by a signal and transfer
fewer bytes than requested.

Fix this by repeatedly calling send/recv until all the requested data
is transferred over sockets.

Also added a number of unit tests for send/receive functions.

Bug: 37427314
Test: `m -j32` succeeds for Sailfish.
      `libpdx_uds_tests` pass on device

Change-Id: Ib8f78967af3c218d9f18fb3dfe8953c35800540b

7 years agoOtapreopt: Add non-profile fallback
Andreas Gampe [Tue, 18 Apr 2017 03:04:02 +0000 (20:04 -0700)]
Otapreopt: Add non-profile fallback

Slightly refactor compilation flow. Add a fallback option: if the
compilation fails and was profile-guided, attempt a non-profile-
guided compilation. This makes A/B OTA more robust to profile
format changes.

Bug: 37256688
Test: m
Test: manual OTA N -> O
Change-Id: I20c4b44a87c0f7faa8920abdae01e39379405eca

7 years agoMerge "libui: remove gralloc0/gralloc1 support" into oc-dev
Chia-I Wu [Wed, 19 Apr 2017 16:16:21 +0000 (16:16 +0000)]
Merge "libui: remove gralloc0/gralloc1 support" into oc-dev

7 years agoDVRBuffer functions should acquire AHardwareBuffer
Hendrik Wagenaar [Wed, 19 Apr 2017 05:03:09 +0000 (22:03 -0700)]
DVRBuffer functions should acquire AHardwareBuffer

Bug: 37488135
Test: Updated DVR buffer tests
Change-Id: Ia255aca571e7162382e7be3c13be8ea192adbc90

7 years agoRemove the lookup distortion class
Hendrik Wagenaar [Wed, 19 Apr 2017 03:45:10 +0000 (20:45 -0700)]
Remove the lookup distortion class

* This class is no longer used.

Test: Compiled locally
Bug: 37487610
Change-Id: Ie0bd1441e04086990309d5eb4ca3b4f64351ae05

7 years agoFix external cache and secondary user bugs.
Jeff Sharkey [Mon, 17 Apr 2017 22:44:41 +0000 (16:44 -0600)]
Fix external cache and secondary user bugs.

External cache files now have their own GID range, so measure using
those quotas.  Fix secondary user code measurement, since it always
lives under user 0.  Fix secondary user data measurement in manual
mode; we need to match based on appId instead of pure UID.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 358128993584491937193650
Change-Id: Ic3b153798164c33ea10e8a4dabc65edff26c56ca

7 years agoMerge "atrace: Don't NPE if we can't access hal-related tracepoint files." into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 01:06:26 +0000 (01:06 +0000)]
Merge "atrace: Don't NPE if we can't access hal-related tracepoint files." into oc-dev

7 years agoMerge "Add atrace_userdebug.rc to enable some tracepoints for userdebug only." into...
Carmen Jackson [Tue, 18 Apr 2017 23:37:48 +0000 (23:37 +0000)]
Merge "Add atrace_userdebug.rc to enable some tracepoints for userdebug only." into oc-dev

7 years agoDO NOT MERGE: SF: disable HW vsync while dozing
Zheng Zhang [Fri, 17 Mar 2017 10:19:39 +0000 (11:19 +0100)]
DO NOT MERGE: SF: disable HW vsync while dozing

It cancels any in-progress resync when display goes to sleep, then
it avoids any unexpected wake up due to delayed frames once device
has just switched to ambient mode.

In DOZE_SUSPEND, screen displays a still image in a self-refresh mode,
so there is no need to keep aligned with HW vsync. At the opposite, DOZE
mode is used to refresh the screen in Ambient (i.e. watchface refresh,
nofications, app updates in ambi-active), hence resync SF to HW vsync.

Bug: 35998607
Bug: 36215242
Change-Id: I22cd8f84e9aca04b4f657fe07785751cf31a7c68

7 years agoatrace: Don't NPE if we can't access hal-related tracepoint files.
Carmen Jackson [Tue, 18 Apr 2017 22:37:57 +0000 (15:37 -0700)]
atrace: Don't NPE if we can't access hal-related tracepoint files.

This currently NPEs when Traceur attempts to start a trace.
Based on b/34242478, this is currently expected and we should fail
gracefully instead.

Bug: 37281960

Test: Starting a trace using Traceur on a userdebug build succeeds.

Change-Id: I082d5750625dec0e1db4a1dd341dc332d8dd752f

7 years agoMerge "Fix query management in GpuProfiler" into oc-dev
Steven Thomas [Tue, 18 Apr 2017 22:25:39 +0000 (22:25 +0000)]
Merge "Fix query management in GpuProfiler" into oc-dev

7 years agoMerge "[vr] Add DVR API to get native handle for buffers" into oc-dev
TreeHugger Robot [Tue, 18 Apr 2017 22:08:09 +0000 (22:08 +0000)]
Merge "[vr] Add DVR API to get native handle for buffers" into oc-dev

7 years agoMerge "SurfaceFlinger: Inherit non-transform Scaling from parent." into oc-dev
Rob Carr [Tue, 18 Apr 2017 20:10:44 +0000 (20:10 +0000)]
Merge "SurfaceFlinger: Inherit non-transform Scaling from parent." into oc-dev

7 years agoReflect removal of vndservice_manager SELinux object manager.
Dan Cashman [Tue, 18 Apr 2017 18:17:49 +0000 (11:17 -0700)]
Reflect removal of vndservice_manager SELinux object manager.

Bug: 34454312
Bug: 36052864
Test: policy builds and device boots.
Change-Id: Ic2aebb15f4ae9085bf2cb440cceef6b4beb5ddc5

7 years agoMerge "Move VR HWC HAL impl to vr/hardware_composer and cleanup deps" into oc-dev
TreeHugger Robot [Tue, 18 Apr 2017 19:39:07 +0000 (19:39 +0000)]
Merge "Move VR HWC HAL impl to vr/hardware_composer and cleanup deps" into oc-dev

7 years agoMerge "Expose EGL_ANDROID_native_fence_sync." into oc-dev
TreeHugger Robot [Tue, 18 Apr 2017 19:37:37 +0000 (19:37 +0000)]
Merge "Expose EGL_ANDROID_native_fence_sync." into oc-dev

7 years ago[vr] Add DVR API to get native handle for buffers
John Bates [Tue, 18 Apr 2017 17:45:23 +0000 (10:45 -0700)]
[vr] Add DVR API to get native handle for buffers

This is required to support GPU late latching features in
VRCore. This can be removed once vendors support using
AHardwareBuffer instead of int fd for shared memory
buffer objects.

Bug: b/37472908
Test: builds and runs
Change-Id: I2a957723c4025773181071491a45a53b83e5ba64

7 years agoSurfaceFlinger: Inherit non-transform Scaling from parent.
Robert Carr [Mon, 17 Apr 2017 21:56:57 +0000 (14:56 -0700)]
SurfaceFlinger: Inherit non-transform Scaling from parent.

When a Layer is fixed-size, we may apply additional scaling
to the buffer not accounted for in the transform. This means
that if the WindowManager calls setSize we will scale the parent
surface but not the child surfaces, breaking the contract that
the WM can treat the child surfaces as pixels in the parent.

Test: Included test in Transaction_test.
Bug: 36820947
Bug: 37344435
Change-Id: I5478bad176388fe8e5407379bc36cdfd6600ab97

7 years agoMerge "Dvr api usages should follow AHardwareBuffer" into oc-dev
TreeHugger Robot [Tue, 18 Apr 2017 17:36:18 +0000 (17:36 +0000)]
Merge "Dvr api usages should follow AHardwareBuffer" into oc-dev

7 years agoFix query management in GpuProfiler
Steven Thomas [Mon, 17 Apr 2017 18:55:34 +0000 (11:55 -0700)]
Fix query management in GpuProfiler

GL query objects were being used incorrectly in GpuProfiler across GL
context resets, which could cause endless creation of additional GL
query objects.

Have the compositor notify the GpuProfiler when the GL context is
created and destroyed, so it can reset its state appropriately.

Also impose a limit of 32 outstanding queries to help prevent endless
query object creation in the future. If we hit the limit we print a log,
reset everything, and start over.

Bug: 34256609

Test: Manually tested that: (a) we no longer get GL errors after
glGetQueryObjectiv() calls after a context destroy/create cycle, and (b)
the queue overflow handling works as expected.

Change-Id: I64905b766a3ea7cb62d543b776ac975d0762868e

7 years agolibui: remove gralloc0/gralloc1 support
Chia-I Wu [Mon, 17 Apr 2017 22:20:19 +0000 (15:20 -0700)]
libui: remove gralloc0/gralloc1 support

We now talk to HIDL gralloc exclusively.

Bug: 37433368
Test: boots
Change-Id: Iecd2f9a02c7066b2f33f24c1de57e9c4af8e28f5

7 years agoHold onto FileHandles for glBindSharedBufferQCOM calls
John Bates [Mon, 17 Apr 2017 21:58:58 +0000 (14:58 -0700)]
Hold onto FileHandles for glBindSharedBufferQCOM calls

The internal implementation of glBindSharedBuffer does not dup
the file descriptor, so to be pedantic about fd lifetime we
need to hold onto the fd until the gl buffer is deleted.

Bug: b/34256609
Test: manually switched between apps
Change-Id: I35bfbfe6a6b793bc3bdf38d7ddca31699ee0f4ff

7 years agoMove VR HWC HAL impl to vr/hardware_composer and cleanup deps
Daniel Nicoara [Thu, 13 Apr 2017 19:19:15 +0000 (15:19 -0400)]
Move VR HWC HAL impl to vr/hardware_composer and cleanup deps

VR HWC is no longer built into VR WM, but in VR HWC, so update its
location. Also cleanup dead code.

Bug: 36051907
Test: Compiled
Change-Id: I15763234fa93bf3b95b8df6461428fe65fd5f611

7 years agoExpose EGL_ANDROID_native_fence_sync.
Craig Donner [Mon, 17 Apr 2017 22:31:06 +0000 (15:31 -0700)]
Expose EGL_ANDROID_native_fence_sync.

Bug: 37439141
Test: Manually tried to use function cross-process from user app
Change-Id: Ia260cb3d11d6667df9de34402c27adea7374c2bc

7 years agoDvr api usages should follow AHardwareBuffer
Hendrik Wagenaar [Mon, 17 Apr 2017 22:24:19 +0000 (15:24 -0700)]
Dvr api usages should follow AHardwareBuffer

* Since vrcore doesn't have access to gralloc1 usages
* Since gralloc1 may be replaced in the future

Bug: 37435415
Test: TestNamedBufferUsage
Change-Id: Iaa47396aca26460541d1b9031dce0b971b630555

7 years agoOtaPreopt: Add version support
Andreas Gampe [Sat, 15 Apr 2017 03:39:56 +0000 (20:39 -0700)]
OtaPreopt: Add version support

Add versioning to otapreopt:

Give up on having otapreopt being a mostly-ignorant frontend to a
blackbox dexopt function. Remove the dexopt helper taking a char*[], and
replace with a direct call to the typed signature.

Add support for a versioned dexopt command. The current version is
"2." An unversioned command string is either version "1" (N) or
version "2" (O pre-versioning).

Translate version 1 to version 2 by
* filter DEXOPT_OTA
* override dexopt_needed to DEX2OAT_FROM_SCRATCH
* add null se_info

Bug: 37256688
Test: m
Test: Manual OTA N (v1) -> O (v2)
Test: Manual OTA O (pre-versioning) -> O (v2)
Test: Manual OTA O (v2) -> O (v2)
Change-Id: I9fff673f3ba99833e88cf1c5c9625f42436ec150

7 years agoMerge "Otapreopt: Remove param count checking in otapreopt_chroot" into oc-dev
TreeHugger Robot [Mon, 17 Apr 2017 23:05:46 +0000 (23:05 +0000)]
Merge "Otapreopt: Remove param count checking in otapreopt_chroot" into oc-dev

7 years agoMerge "Move AHardwareBuffer_getNativeHandle to VNDK" into oc-dev
Jesse Hall [Mon, 17 Apr 2017 21:52:20 +0000 (21:52 +0000)]
Merge "Move AHardwareBuffer_getNativeHandle to VNDK" into oc-dev

7 years agoMove AHardwareBuffer_getNativeHandle to VNDK
Jesse Hall [Mon, 17 Apr 2017 15:52:32 +0000 (08:52 -0700)]
Move AHardwareBuffer_getNativeHandle to VNDK

This was added to the NDK only because we didn't have a way to do
VNDK-only declarations. Now we do.

Bug: 34050596
Test: make checkbuild
Change-Id: I039fccfd9f29c5cc960e7691f0baa70101659949

7 years agoOtapreopt: Remove param count checking in otapreopt_chroot
Andreas Gampe [Fri, 14 Apr 2017 18:15:17 +0000 (11:15 -0700)]
Otapreopt: Remove param count checking in otapreopt_chroot

Pass on parameters without a check. This will simplify future updates.

Bug: 37256688
Test: m
Test: manual OTA
Change-Id: I9db3749856a1281a777136436ce255c5dd7f7f3c

7 years agoMerge "Fix use-after-free issue caught by ASAN." into oc-dev
TreeHugger Robot [Sat, 15 Apr 2017 22:47:06 +0000 (22:47 +0000)]
Merge "Fix use-after-free issue caught by ASAN." into oc-dev

7 years agoMerge "Fix profile disk space accounting bugs." into oc-dev
TreeHugger Robot [Sat, 15 Apr 2017 22:39:29 +0000 (22:39 +0000)]
Merge "Fix profile disk space accounting bugs." into oc-dev

7 years agoMerge "Hopefully fix funky SELinux labels." into oc-dev
TreeHugger Robot [Sat, 15 Apr 2017 22:39:04 +0000 (22:39 +0000)]
Merge "Hopefully fix funky SELinux labels." into oc-dev

7 years agoHopefully fix funky SELinux labels.
Jeff Sharkey [Sat, 15 Apr 2017 18:09:22 +0000 (12:09 -0600)]
Hopefully fix funky SELinux labels.

We've seen reports of cases where DE storage cache directories are
missing the SELinux category information, so explicitly offer to
restorecon those directories to fix the labels.

This matches what we're already doing for CE storage.

Test: builds, boots
Bug: 35991539
Change-Id: I0eb6df801e933fbb005e3f8fdfe57a4e5ce3313d

7 years agoFix profile disk space accounting bugs.
Jeff Sharkey [Sat, 15 Apr 2017 18:03:31 +0000 (12:03 -0600)]
Fix profile disk space accounting bugs.

Profile data is only stored on internal storage (it doesn't move to
adoptable devices), so only count it when asking about internal
storage (which has a null UUID).

Also fix bug where "current" profile data was being double-counted
for apps.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/pm/InstallerTest.java
Bug: 3610217236101738
Change-Id: I22b82e8cfb3bf1be1155fb827a538c21f09d88eb

7 years agoFix use-after-free issue caught by ASAN.
Jeff Sharkey [Sat, 15 Apr 2017 00:54:49 +0000 (18:54 -0600)]
Fix use-after-free issue caught by ASAN.

Keep strong references to std::string objects around while we're
actively using them in fts_open().

Test: builds, boots
Bug: 36975037
Change-Id: Icd7cba5852a01f0a1015e7d0d7dcd3087fa44ae8

7 years agoMerge "Avoid a potential race condition on mDisplays" into oc-dev
TreeHugger Robot [Sat, 15 Apr 2017 00:08:31 +0000 (00:08 +0000)]
Merge "Avoid a potential race condition on mDisplays" into oc-dev

7 years agoMerge "Add "android.software.preview_sdk" feature" into oc-dev
Justin Klaassen [Fri, 14 Apr 2017 22:39:58 +0000 (22:39 +0000)]
Merge "Add "android.software.preview_sdk" feature" into oc-dev

7 years agoAdd atrace_userdebug.rc to enable some tracepoints for userdebug only.
Carmen Jackson [Fri, 14 Apr 2017 18:58:58 +0000 (11:58 -0700)]
Add atrace_userdebug.rc to enable some tracepoints for userdebug only.

These tracepoints are currently approved by security for userdebug only
(see linked bug).

These are enabled for use in Traceur, which is currently only available
for userdebug builds.

Bug: 37110010
Test: Compiled and installed for userdebug and verified correct permissions
for a file in atrace.rc as well as a file in atrace_userdebug.rc:

(atrace_userdebug.rc)
$ adb shell ls -al /sys/kernel/debug/tracing/events/workqueue/enable
-rw-rw-rw- 1 root shell 0 1970-01-01 00:00 /sys/kernel/debug/tracing/events/workqueue/enable

(atrace.rc only)
$ adb shell ls -al /sys/kernel/debug/tracing/trace_clock
-rw-rw-r-- 1 root shell 0 1970-01-01 00:00 /sys/kernel/debug/tracing/trace_clock

Test: Compiled and installed a user build and verified correct
permissions for the file modified in atrace.rc, but that
atrace_userdebug.rc was not executed:

(atrace_userdebug.rc)
$ adb shell ls -al
/sys/kernel/debug/tracing/events/workqueue/enable
-rw-r--r-- 1 root root 0 1969-12-31 19:00

(atrace.rc
$ adb shell ls -al /sys/kernel/debug/tracing/trace_clock
-rw-rw-r-- 1 root shell 0 1969-12-31 19:00
/sys/kernel/debug/tracing/trace_clock

Change-Id: Ifb0ce9942a2e7a48f480b46bf944fcbc69c1707d

7 years agoMerge "Fix gralloc direct channel bug and polish log messages" into oc-dev
Peng Xu [Fri, 14 Apr 2017 20:29:47 +0000 (20:29 +0000)]
Merge "Fix gralloc direct channel bug and polish log messages" into oc-dev

7 years agoMerge "Release virtual display hwcId during vr mode transition." into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 20:11:41 +0000 (20:11 +0000)]
Merge "Release virtual display hwcId during vr mode transition." into oc-dev

7 years agoAvoid a potential race condition on mDisplays
Stephen Kiazyk [Wed, 5 Apr 2017 23:46:49 +0000 (16:46 -0700)]
Avoid a potential race condition on mDisplays

I've now run this on a HWC1 and HWC2 build. Both appear to be running
correctly.

Original Message:

The race could occur when transitioning in/out of VR flinger mode.
It is now avoided by ensuring that the primary |DisplayDevice| is always
created once |mStateLock| is released, and ensuring that all accesses
to the primary |DisplayDevice| are guarded by |mStateLock|.

Bug: 36194616
Bug: 37249613
Bug: 37288476

Test: Compiled, installed, and ran with both HWC1 and HWC2 variants.
  HWC1 was tested on Nexus 6P. Was able to boot, install apps, run apps,
  turn screen on/off, and reboot phone.
  HWC2 was tested on sailfish. Was able to boot, install apps, run apps,
  run VR apps using both N path, and O1 path, turn screen on/off, and
  reboot phone.

Change-Id: I0e80c2553f40cce2116b718bbb0d2566679f794a

7 years agoMerge "vrwm: Push all the properties to vr window manager" into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 19:45:06 +0000 (19:45 +0000)]
Merge "vrwm: Push all the properties to vr window manager" into oc-dev

7 years agoMerge "libbinder: vendor_available" into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 17:57:40 +0000 (17:57 +0000)]
Merge "libbinder: vendor_available" into oc-dev

7 years agoMerge "Move include/binder to libs/binder/include" into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 17:57:36 +0000 (17:57 +0000)]
Merge "Move include/binder to libs/binder/include" into oc-dev

7 years agoMerge "Update optics" into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 17:31:15 +0000 (17:31 +0000)]
Merge "Update optics" into oc-dev

7 years agoMerge "binder: allow repeated invocations of initWithDriver" into oc-dev
Iliyan Malchev [Fri, 14 Apr 2017 15:08:32 +0000 (15:08 +0000)]
Merge "binder: allow repeated invocations of initWithDriver" into oc-dev

7 years agobinder: allow repeated invocations of initWithDriver
Iliyan Malchev [Fri, 14 Apr 2017 07:34:57 +0000 (00:34 -0700)]
binder: allow repeated invocations of initWithDriver

As long as the driver name is the same, calls to
ProcessState::initWithDriver() will succeed, returning the
already-created object.

Test: marlin

Change-Id: I87d5ca2a105becd8d4fa6fa85c00b879360229b3
Signed-off-by: Iliyan Malchev <malchev@google.com>
7 years agoMerge "Refine the binder latency test" into oc-dev
PO HUNG CHEN [Fri, 14 Apr 2017 06:42:50 +0000 (06:42 +0000)]
Merge "Refine the binder latency test" into oc-dev

7 years agoget rid of IGraphicBufferAlloc
Mathias Agopian [Wed, 22 Mar 2017 22:49:32 +0000 (15:49 -0700)]
get rid of IGraphicBufferAlloc

Buffers can now be allocated directly through
the graphic allocator HAL.

Test: marlin: run full camera cts
Test: angler: take screenshot, take photo w/ and w/o HDR, video, panorama, refocus, slo-mo
Bug: 36462585
Bug: 36333314
Change-Id: Ie5222c53c3b9462e0ac7a41568718aad131eb328

7 years agolibbinder: vendor_available
Steven Moreland [Fri, 14 Apr 2017 04:19:48 +0000 (21:19 -0700)]
libbinder: vendor_available

By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 36426473
Bug: 36079834
Test: m -j libbinder
Test: attempt to compile with BOARD_VNDK_VERSION := current
Change-Id: Iec94a66adbc852f7f23352307cf36f49a79ee3a6

7 years agoUpdate optics
Hendrik Wagenaar [Tue, 4 Apr 2017 21:38:36 +0000 (14:38 -0700)]
Update optics

* Specify optics via system properties

Bug: 36039976
Test: Ran on device

Change-Id: I7a38e5a9eb3b8a861f1997d5011ec109f5e79cca

7 years agoRefine the binder latency test
Howard Chen [Mon, 10 Apr 2017 10:51:20 +0000 (18:51 +0800)]
Refine the binder latency test

* limit the output line length be be under 80.
* fix the target service when pair > 2

Bug:36705188
Test: sailfish with prebuilt kernel on oc-dev
Change-Id: I5ce2754418a669a61f9913a30dbeb7176796e230

7 years agoMove include/binder to libs/binder/include
Vijay Venkatraman [Fri, 24 Mar 2017 23:13:58 +0000 (16:13 -0700)]
Move include/binder to libs/binder/include

Also moved include/private/binder to libs/binder/include/private/binder.
This allows libbinder to be compiled without depending on global
headers.

Bug: 33241851
Test: Build, flash, and run sailfish.
Test: Try building with BOARD_VNDK_VERSION := current
Change-Id: I0a82b733353add589de26eb2db7af5a246e5c97f

7 years agoMerge "Update to allow multiple HALs in a manifest." into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 00:11:05 +0000 (00:11 +0000)]
Merge "Update to allow multiple HALs in a manifest." into oc-dev

7 years agoMerge "Import broadcast_ring.h from GVR (reland)" into oc-dev
TreeHugger Robot [Fri, 14 Apr 2017 00:07:42 +0000 (00:07 +0000)]
Merge "Import broadcast_ring.h from GVR (reland)" into oc-dev

7 years agoCalculate batching param in a smarter way
Peng Xu [Sat, 2 Jul 2016 00:13:10 +0000 (17:13 -0700)]
Calculate batching param in a smarter way

Calculate batching parameter in a better way by lower-bound the
latency specification by sample period.

Bug: 28353456
Test: run sensor cts tests
Change-Id: I13a6a33d3d0dedb246ac602e634656f516dccfc3

7 years agoMerge "libpdx_uds: Handle EACCES error when connecting to PDX service" into oc-dev
TreeHugger Robot [Thu, 13 Apr 2017 22:21:03 +0000 (22:21 +0000)]
Merge "libpdx_uds: Handle EACCES error when connecting to PDX service" into oc-dev

7 years agovrwm: Push all the properties to vr window manager
Albert Chaulk [Mon, 10 Apr 2017 17:53:32 +0000 (13:53 -0400)]
vrwm: Push all the properties to vr window manager

Bug: 37204430
Test: Manual
Change-Id: I6cda2732f4aff2433152ffc3549677d23bc598b3