OSDN Git Service

android-x86/frameworks-native.git
7 years agosurfaceflinger: protect Client::mParentLayer with a lock
Chia-I Wu [Thu, 15 Jun 2017 21:01:18 +0000 (14:01 -0700)]
surfaceflinger: protect Client::mParentLayer with a lock

Updates to wp<> is not atomic.  Use Client::mLock to protect
mParentLayer.

Bug: 38505866
Test: camera and youtube work
Change-Id: I2739382d5bb99961a47c1011963b6f676d34eec6

7 years agoFix getDisplayInfo() for SurfaceFlinger in HWC2 mode.
Alistair Strachan [Wed, 7 Jun 2017 23:34:44 +0000 (16:34 -0700)]
Fix getDisplayInfo() for SurfaceFlinger in HWC2 mode.

When HWC2 mode is enabled in SurfaceFlinger, the getDisplayInfo()
function would fail to return the correct active mode in some cases.

This bug was only noticable if you had more than one mode registered
by the HWC2 backend.

The SurfaceComposerClient::getDisplayInfo() function works by calling
getDisplayConfigs(), and de-referencing the config at the index
returned by getActiveConfig(). The active config returned was correct,
but the getDisplayConfigs() array was not properly sorted.

Tracing this back, this problem occurs because the configId is stored
alongside the config in an unordered_map, so when this is converted
to a vector and the configId is discarded, the conversion must be
sorted correctly; it can't just be the hash order returned from
the unordered_map.

There are a few ways to fix this problem, but the easiest was to nip
the problem in the bud by not allowing an unsorted list of configs
to exist on the base HWC2 class. It may be better still to just get
rid of the map and go back to a vector, as this data is more often
used as an array than it is indexed by configId, so the use of an
unordered_map was probably overkill.

Change-Id: Ibfb015a6d9b49c870f37a1c892f15f90abbd1e2c
Bug: 62617569
Test: ./cts-tradefed run cts -m CtsViewTestCases -t android.view.cts.DisplayRefreshRateTest#testRefreshRate

7 years agoMerge changes Ibc1444b8,I14c200d1 into oc-dev
Eino-Ville Talvala [Wed, 14 Jun 2017 08:09:40 +0000 (08:09 +0000)]
Merge changes Ibc1444b8,I14c200d1 into oc-dev

* changes:
  ConsumerBase: discardFreeBuffers() also needs to dump its own cache
  BufferQueueProducer: Call onBuffersReleased() in detachNextBuffer

7 years agoMerge changes from topic 'sensor_looper_crash' into oc-dev
Peng Xu [Wed, 14 Jun 2017 06:12:37 +0000 (06:12 +0000)]
Merge changes from topic 'sensor_looper_crash' into oc-dev

* changes:
  Fix race condition for SensorManager looper.
  SensorManager: attach background thread to JavaVM
  Framework sensor manager init not depends on ::android::SensorManager.

7 years agoFix race condition for SensorManager looper.
Yifan Hong [Wed, 14 Jun 2017 01:04:25 +0000 (18:04 -0700)]
Fix race condition for SensorManager looper.

Before the fix there could be two background threads started for two
loopers. Add a guard to prevent this from happening.

Test: pass
Bug: 62404135
Change-Id: I8230addaaa6b83670d7b83c96809b00fca95d352

7 years agoSensorManager: attach background thread to JavaVM
Yifan Hong [Wed, 14 Jun 2017 00:51:13 +0000 (17:51 -0700)]
SensorManager: attach background thread to JavaVM

Test: pass
Bug: 62404135

Change-Id: I63a128c3c933904211f5ff2483492674eaba93ed

7 years agoFramework sensor manager init not depends on ::android::SensorManager.
Yifan Hong [Tue, 9 May 2017 22:18:02 +0000 (15:18 -0700)]
Framework sensor manager init not depends on ::android::SensorManager.

Test: photo sphere
Change-Id: Ice37a758421827757226a9898bcf3e00857443ff
Merged-In: Ice37a758421827757226a9898bcf3e00857443ff
Fixes: 36448245

7 years agoConsumerBase: discardFreeBuffers() also needs to dump its own cache
Eino-Ville Talvala [Wed, 14 Jun 2017 00:09:11 +0000 (17:09 -0700)]
ConsumerBase: discardFreeBuffers() also needs to dump its own cache

ConsumerBase has its own cached slots with graphic buffer references,
so it's not enough to just ask the buffer queue consumer to free
buffers.

Add code equivalent to what happens in the onBuffersReleased callback.

Test:
Bug: 62593139
Change-Id: Ibc1444b868c6150aa2da1c209e06bdba42f1595d

7 years agoBufferQueueProducer: Call onBuffersReleased() in detachNextBuffer
Eino-Ville Talvala [Tue, 13 Jun 2017 23:39:11 +0000 (16:39 -0700)]
BufferQueueProducer: Call onBuffersReleased() in detachNextBuffer

Like detachBuffer(), detachNextBuffer() needs to inform the consumer,
who generally has a cache of buffer items, that a buffer is no longer
owned by the buffer queue.

Otherwise the consumer layer can leak the buffer reference until
consumer teardown/disconnect.

Test: Camera CTS is fine, using a camera app shows correct memory
  behavior
Bug: 62591036

Change-Id: I14c200d13e60dbbe21261343941f84fb786db117

7 years agoatrace.rc: Correct path to saved_cmdlines_size when setting permission
Joel Fernandes [Tue, 13 Jun 2017 03:47:27 +0000 (20:47 -0700)]
atrace.rc: Correct path to saved_cmdlines_size when setting permission

Bug: 62375794
Test: CTS test

Change-Id: Ie252be152ba26aced63af55734d3155ad93f2919
Signed-off-by: Joel Fernandes <joelaf@google.com>
(cherry picked from commit 0094a2d5962ed81c6c624c900450d84f1967ba49)

7 years agoMerge "Add missing VNDK pixel formats to AHardwareBuffer" into oc-dev
Mathias Agopian [Fri, 9 Jun 2017 19:02:45 +0000 (19:02 +0000)]
Merge "Add missing VNDK pixel formats to AHardwareBuffer" into oc-dev

7 years agoFix build
Jorim Jaggi [Fri, 9 Jun 2017 06:55:29 +0000 (23:55 -0700)]
Fix build

Test: builds
Bug: 36631902
Change-Id: Iec23f8ab2b16c923f07d1857aa3471cfefc057dd

7 years agoAdd missing VNDK pixel formats to AHardwareBuffer
Mathias Agopian [Fri, 9 Jun 2017 02:44:17 +0000 (19:44 -0700)]
Add missing VNDK pixel formats to AHardwareBuffer

AHardwareBuffer is now the only API available to
vendors to create graphic buffers in their HAL
implementations, unfortunately AHardwareBuffer
was designed for NDK use and was missing all
HAL specific pixel formats.

This CL adds these missing format to the VNDK-only
header.

The implementation is changed to accept all formats
which means, VNDK formats are indirectly exposed
to the NDK.

Bug: 38466076
Test: manual
Change-Id: I1e752cd33641aa861d9d15432cde6bec5a682e9a

7 years agoProperly run window animations at vsync-sf (2/2)
Jorim Jaggi [Thu, 8 Jun 2017 22:43:59 +0000 (15:43 -0700)]
Properly run window animations at vsync-sf (2/2)

- Add new Choreographer instance that runs on vsync-sf
- Use this new Choreographer for WindowAnimator, and remove all
the hacks around it

Test: Open apps and close apps, notice no stutter
Test: Screen zoom animations
Test: go/wm-smoke
Bug: 36631902
Change-Id: I72a8b39709303a38fc077100229b8a81a153ba3e

7 years agoMerge "Don't double-count external cached app data." into oc-dev
Jeff Sharkey [Thu, 8 Jun 2017 15:27:07 +0000 (15:27 +0000)]
Merge "Don't double-count external cached app data." into oc-dev

7 years agoMerge "No more ashmem equivalent checker false alarm" into oc-dev
TreeHugger Robot [Thu, 8 Jun 2017 10:16:09 +0000 (10:16 +0000)]
Merge "No more ashmem equivalent checker false alarm" into oc-dev

7 years agoMerge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw...
Matthew Bouyack [Wed, 7 Jun 2017 22:59:18 +0000 (22:59 +0000)]
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev am: 9e5585930a
am: f613f073b2  -s ours

Change-Id: I8a6e0a9b7e7810cfc33db9de074c2cdac139d233

7 years agoMerge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw...
Matthew Bouyack [Wed, 7 Jun 2017 22:53:37 +0000 (22:53 +0000)]
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev
am: 9e5585930a

Change-Id: I3b534f26c60bd8d6cf0736da7de807cf339a1cdd

7 years agoMerge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw...
Matthew Bouyack [Wed, 7 Jun 2017 22:46:08 +0000 (22:46 +0000)]
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev

7 years agoDO NOT MERGE: Eliminate redundant changes to hardware vsync state.
Matthew Bouyack [Thu, 1 Jun 2017 21:37:29 +0000 (14:37 -0700)]
DO NOT MERGE: Eliminate redundant changes to hardware vsync state.

When transitioning between NORMAL and DOZE power modes
we were redundantly calling resyncHardwareVsync.

Similarly, when transitioning from DOZE_SUSPEND to OFF
we were redundantly calling disableHardwareVsync.

This change eliminates those redundant calls.

Fixes bug 62235417

Change-Id: I513bbf94a7ab973ab258efe16436441ac2379b70

7 years agoDon't double-count external cached app data.
Jeff Sharkey [Wed, 7 Jun 2017 21:59:03 +0000 (15:59 -0600)]
Don't double-count external cached app data.

Cached app data is already counted in extStats.dataSize, so we don't
need to count it twice.

Test: builds, boots, verified Settings UI before/after
Bug: 62343684
Change-Id: Ic02cbe3f5938949730f9bc8d911ed398436f84d7

7 years agoNo crash from AHardwareBuffer_unlock on NULL fence
Jiwen 'Steve' Cai [Fri, 2 Jun 2017 22:23:26 +0000 (15:23 -0700)]
No crash from AHardwareBuffer_unlock on NULL fence

The API document states: "If fence is not NULL then it will be set to a
file descriptor that is signaled when all pending work on the buffer is
completed." As it's too late to change the document, we should probably
update the implement and use GraphicsBuffer::unlock under the hood.

Bug: 62302267
Test: Build, AHardware CTS
Change-Id: Ic0fac5d7addfba67baaa1b5d7c221fc25d02df56
(cherry picked from commit 6cdbb537105b663572e71afe06bde1164fc215f3)

7 years agoatrace: setup saved_cmdlines_size and write only if available
Joel Fernandes [Tue, 6 Jun 2017 19:20:29 +0000 (12:20 -0700)]
atrace: setup saved_cmdlines_size and write only if available

Older kernels (bullhead etc) don't have saved_cmdlines_size, check and
write only if available. Also make work on non-root by setting
permissions in rc file (thanks John Reck for suggestion).

Bug: 62375794

Change-Id: Iefffc3203afd092ffb6cf420a144b38844aaee39
Signed-off-by: Joel Fernandes <joelaf@google.com>
7 years agoMerge "Revert "Disable in-place vdex update"" into oc-dev
Nicolas Geoffray [Tue, 6 Jun 2017 20:20:33 +0000 (20:20 +0000)]
Merge "Revert "Disable in-place vdex update"" into oc-dev

7 years agofix race condition that can cause a use after free am: 59485525a6 am: 5da64c91d0...
Mathias Agopian [Tue, 6 Jun 2017 17:59:02 +0000 (17:59 +0000)]
fix race condition that can cause a use after free am: 59485525a6 am: 5da64c91d0 am: 46361c6c2b am: ee464e00d3
am: 21e9397776  -s ours

Change-Id: If0f229ba54f2c9978ba83beca331896d1d303db4

7 years agofix race condition that can cause a use after free am: 59485525a6 am: 5da64c91d0...
Mathias Agopian [Tue, 6 Jun 2017 17:46:30 +0000 (17:46 +0000)]
fix race condition that can cause a use after free am: 59485525a6 am: 5da64c91d0 am: 46361c6c2b
am: ee464e00d3

Change-Id: Ifb22956eadae06f2ff6b0445d5e92e450c947942

7 years agofix race condition that can cause a use after free am: 59485525a6 am: 5da64c91d0
Mathias Agopian [Tue, 6 Jun 2017 17:40:00 +0000 (17:40 +0000)]
fix race condition that can cause a use after free am: 59485525a6 am: 5da64c91d0
am: 46361c6c2b

Change-Id: I33758163baac3c96525751d313091a5bce0d5377

7 years agofix race condition that can cause a use after free am: 59485525a6
Mathias Agopian [Tue, 6 Jun 2017 17:33:59 +0000 (17:33 +0000)]
fix race condition that can cause a use after free am: 59485525a6
am: 5da64c91d0

Change-Id: I6358492afbd410f20a96ceccc7957a67112c58bc

7 years agofix race condition that can cause a use after free
Mathias Agopian [Tue, 6 Jun 2017 17:27:59 +0000 (17:27 +0000)]
fix race condition that can cause a use after free
am: 59485525a6

Change-Id: I42d7ee49dc3dcbd9d5d4a86fc9d018ff6c29534d

7 years agoMerge "surfaceflinger: fix layer count" into oc-dev
Chia-I Wu [Tue, 6 Jun 2017 15:32:08 +0000 (15:32 +0000)]
Merge "surfaceflinger: fix layer count" into oc-dev

7 years agoRevert "Disable in-place vdex update"
Nicolas Geoffray [Mon, 5 Jun 2017 12:38:10 +0000 (12:38 +0000)]
Revert "Disable in-place vdex update"

Reverting to only apply this when doing dexlayout.
PS1 is a pure revert. PS2 contains the fix.

This reverts commit e446fede9258359b61d4c8753d7e96477fa29388.

Bug: 38113240
Test: OTA and dexopt

(cherry picked from commit b03814f39559c824e097bf2d869c7a56d8b41b67)

Change-Id: Ibabb1ec3af1101c6c44fbea498f8625c9515af8f

7 years agofix race condition that can cause a use after free
Mathias Agopian [Tue, 4 Apr 2017 00:14:31 +0000 (17:14 -0700)]
fix race condition that can cause a use after free

Backported from 12a0ccd6f7201bac706d903ac3f436c4358fe203.

Bug: 33004354
Test: manual
Change-Id: I9b38ee644b02268c9b995a330db758aa2e568399

7 years agoMerge "Clockwork: add feature android.software.input_methods" into oc-dev
Mark Renouf [Mon, 5 Jun 2017 21:42:59 +0000 (21:42 +0000)]
Merge "Clockwork: add feature android.software.input_methods" into oc-dev

7 years agoMerge "atrace: Enable sched_waking if available" into oc-dev
Joel Fernandes [Mon, 5 Jun 2017 20:41:07 +0000 (20:41 +0000)]
Merge "atrace: Enable sched_waking if available" into oc-dev

7 years agoatrace: Set saved_cmdline_size to 8192
Joel Fernandes [Fri, 2 Jun 2017 17:19:28 +0000 (10:19 -0700)]
atrace: Set saved_cmdline_size to 8192

This increases the size of the table tracking comms and pids and
prevents overwriting them easily.

Bug: 38167231

Change-Id: I69b9000e4f9d0c2c7969efd38e02d8c1bffdad5c
Signed-off-by: Joel Fernandes <joelaf@google.com>
(cherry picked from commit ed80bd04cc3bf80082b1d733ef06d90a29c6270a)

7 years agoatrace: Enable sched_waking if available
Joel Fernandes [Sun, 4 Jun 2017 20:05:59 +0000 (13:05 -0700)]
atrace: Enable sched_waking if available

sched_waking helps to know when a wakeup happens at the earliest.
wakeups can originate on different CPUs which makes it impossible to
know just from sched_wakeup what the source was. Thankfully sched_waking
is just for that, enable it if its available.

Bug: 36415990

Change-Id: I489ca0112d5e0ed781888866a9efa57f17ca8a53
Signed-off-by: Joel Fernandes <joelaf@google.com>
7 years agosurfaceflinger: fix layer count
Chia-I Wu [Tue, 30 May 2017 21:54:08 +0000 (14:54 -0700)]
surfaceflinger: fix layer count

When a layer is removed, mLayerCount is always decremented by 1 even
though the layer has children.  This commit fixes that by making
sure mLayerCount is properly decremented, and makes sure that a
parent layer must be a valid layer in mCurrentState.

Bug: 37121786
Test: manually open and close Camera app
Change-Id: I5a3e18be41646b167b4d361dfe08db4d06e1c2d0
(cherry picked from commit 98f1c108b016dda77c808f3d099e7a45bdd70768)

7 years agoMerge "Add media.codec process to native stack dump list" into oc-dev
TreeHugger Robot [Sat, 3 Jun 2017 02:19:50 +0000 (02:19 +0000)]
Merge "Add media.codec process to native stack dump list" into oc-dev

7 years agoAdd media.codec process to native stack dump list
Chong Zhang [Fri, 2 Jun 2017 23:13:16 +0000 (16:13 -0700)]
Add media.codec process to native stack dump list

This is needed for non-treble devices.

Test: do 'adb shell bugreport' on angler, and check that
'Cmd line: media.codec' section is present and stacks are there.

bug: 62297059
Change-Id: I2573bb48d021e7750adf44eb00f06f5b9efb3a85

7 years agoMerge changes I87a57825,I3721d163 into oc-dev
TreeHugger Robot [Fri, 2 Jun 2017 20:33:50 +0000 (20:33 +0000)]
Merge changes I87a57825,I3721d163 into oc-dev

* changes:
  SurfaceFlinger: Fix final cropping of child layers.
  SurfaceFlinger: Update parent pointer while performing transaction.

7 years agoSurfaceFlinger: Fix final cropping of child layers.
Robert Carr [Thu, 1 Jun 2017 23:11:34 +0000 (16:11 -0700)]
SurfaceFlinger: Fix final cropping of child layers.

Straightforward mistake documented by the test case. Not sure how it
made it this long.

Test: Included in Transaction_test.cpp. Manual from bug. go/wm-smoke.
Bug: 37511473
Change-Id: I87a57825cca879c5519fe72fef199168f7c23479

7 years agoSurfaceFlinger: Update parent pointer while performing transaction.
Robert Carr [Thu, 1 Jun 2017 21:59:25 +0000 (14:59 -0700)]
SurfaceFlinger: Update parent pointer while performing transaction.

To understand the change at a high level, notice that all the usage
of getParent() is assosciated with the drawing state. We see in this way
that the parent is a part of the drawing state and should only be updated
when transactions occurs.

More specifically we can consider the following scenario:

1. Imagine that we have a visible surface, with a visible child surface
2. Now imagine we create a new surface, which is hidden, and post a buffer to it.
   It is configured such that it would be visible if it were not hidden.
3. We open a transaction
4. We reparent the child from the old surface to the new one
5. We show the new surface
6. We close the transaction

At this point we would expect the child to remain visible, as it is atomically
reparented with the visibility change of the parent. However prior to this CL
we see a flash, as the sequence can continue as follows:

7. Closing the transaction triggers setClientState, causing Layer::reparentChildren
   which would call setParent updating the parent pointer.
8. setClientState updates the current but not drawing visibility of the new parent and marks
   a transaction to occur.
9. We return to the main thread, MESSAGE_REFRESH occurs before MESSAGE_TRANSACTION
   and we render a frame
10. We observe the child window as invisible, as it has the new parent
    but it's new parent is not yet visible.

We simply have to ensure the parent pointer is updated at transaction time.
I chose a location in commitChildList where mDrawingChildren was copied
from mCurrentChildren as it seemed to express the intent well.

Test: Difficult to automatically test. Manually try resizing Chrome/Youtube/etc in docked stack before flicker should be ~1/10 after flicker should be <1/100 (I haven't seen one yet)
Bug: 62099658
Change-Id: I3721d16361b53128146510d3fda43e1c12f93223

7 years agoMerge "egl: handle failed eglMakeCurrent EGL_NO_CONTEXT" into oc-dev
TreeHugger Robot [Fri, 2 Jun 2017 00:42:59 +0000 (00:42 +0000)]
Merge "egl: handle failed eglMakeCurrent EGL_NO_CONTEXT" into oc-dev

7 years agoegl: handle failed eglMakeCurrent EGL_NO_CONTEXT
Mike Stroyan [Thu, 1 Jun 2017 19:56:18 +0000 (13:56 -0600)]
egl: handle failed eglMakeCurrent EGL_NO_CONTEXT

The recovery code for failed eglMakeCurrent didn't correctly
handle the case when the previous context was EGL_NO_CONTEXT.
Leave the original EGL context unrestored in that case.
The driver should be able to handle that case without help.

Bug: 3834161737244059
Change-Id: I38f3450005a4eec5f1a684ee7d66363e88f6d92f
Fixes: 38341617
Test: android.server.cts.ActivityManagerDisplayTests, Run Minions Rush app.

7 years agoDisable in-place vdex update
David Sehr [Fri, 26 May 2017 23:32:55 +0000 (16:32 -0700)]
Disable in-place vdex update

Vdex files can be corrupted by dexlayout or by previously dexlayout-ed
files being recompiled if they are used as both input and output.
Disable this feature.

Bug: 38113240
Test: OTA and dexopt
Change-Id: Iee2d9a6c1ba8cddda25290f68f50649d5288d588
(cherry picked from commit e446fede9258359b61d4c8753d7e96477fa29388)

7 years agoClockwork: add feature android.software.input_methods
Mark Renouf [Thu, 1 Jun 2017 18:43:41 +0000 (14:43 -0400)]
Clockwork: add feature android.software.input_methods

BUG: 38123013
Change-Id: I4532cefda9c24541450f5e0e739ab5d44c1111fd

7 years agoInstalld: deleteOdex's outputPath can be null
Andreas Gampe [Wed, 31 May 2017 23:39:58 +0000 (16:39 -0700)]
Installd: deleteOdex's outputPath can be null

Add @nullable, as the outputPath can be null for system apps.

Bug: 62236497
Test: m
Test: Fill up /data, apply OTA
Change-Id: I61d86721b485f85195b153d76ce25412dcb68be6

7 years agoDelete vdex file in delete_odex.
Nicolas Geoffray [Thu, 25 May 2017 12:58:06 +0000 (13:58 +0100)]
Delete vdex file in delete_odex.

(cherry picked from commit 192fb9662ce8b2a60da2b280d8000283fb3b6f6b)

bug: 38513395
Test: unfortunately no unit test here, so after discussing
      with agampe@ just relied on build.

Change-Id: I305ddaadc813673fb55473f5e8ca357f39cf98f3

7 years agolibgui: Add Surface::getLastDequeueStartTime
Dan Stoza [Wed, 31 May 2017 20:50:16 +0000 (13:50 -0700)]
libgui: Add Surface::getLastDequeueStartTime

Adds the getLastDequeueStartTime method, which allows the caller to
determine whether the last dequeueBuffer call fell into a given time
window.

Bug: 62213889
Test: SurfaceTest.TestGetLastDequeueStartTime in libgui_test
Change-Id: I1684deb09273745a3adc751554624d2257fa890e

7 years agoMerge "Consistent "low storage" behavior." into oc-dev
Jeff Sharkey [Wed, 31 May 2017 14:18:24 +0000 (14:18 +0000)]
Merge "Consistent "low storage" behavior." into oc-dev

7 years agoMerge "EGL: Do not look up default namespace when sphal is defined" into oc-dev
TreeHugger Robot [Wed, 31 May 2017 07:01:38 +0000 (07:01 +0000)]
Merge "EGL: Do not look up default namespace when sphal is defined" into oc-dev

7 years agoMerge "Mark libui as vendor_available" into oc-dev
Jayant Chowdhary [Wed, 31 May 2017 03:59:44 +0000 (03:59 +0000)]
Merge "Mark libui as vendor_available" into oc-dev

7 years agoMerge "add missing lib dependency to libvndksupport" into oc-dev
TreeHugger Robot [Wed, 31 May 2017 00:26:11 +0000 (00:26 +0000)]
Merge "add missing lib dependency to libvndksupport" into oc-dev

7 years agoConsistent "low storage" behavior.
Jeff Sharkey [Tue, 30 May 2017 20:38:42 +0000 (14:38 -0600)]
Consistent "low storage" behavior.

When freeing cached data, the caller can now provide a "reserved"
size which we won't clear cached data from.

Bug: 38008706
Test: cts-tradefed run commandAndExit cts-dev -m CtsJobSchedulerTestCases -t android.jobscheduler.cts.StorageConstraintTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Change-Id: Ieb91b3e5345a950d4785fd7915f520f0a68a567a

7 years agoadd missing lib dependency to libvndksupport
Jiyong Park [Sat, 27 May 2017 06:29:41 +0000 (15:29 +0900)]
add missing lib dependency to libvndksupport

libutils is now depending on libvndksupport. So any client that
statically links to libutils needs to link against libvndksuppor as
well.

Bug: 62084107
Test: start an app, run 'adb shell atrace gfx --stream'. atrace from the
graphics driver are visible.

Change-Id: I98917dc92a1b8bde52e69e1923a1c1530a088bd6

7 years agoMerge "Playback activity monitoring: add player types" into oc-dev
TreeHugger Robot [Fri, 26 May 2017 20:05:48 +0000 (20:05 +0000)]
Merge "Playback activity monitoring: add player types" into oc-dev

7 years agoEGL: Do not look up default namespace when sphal is defined
Justin Yun [Mon, 22 May 2017 06:13:40 +0000 (15:13 +0900)]
EGL: Do not look up default namespace when sphal is defined

If sphal name space exists, try to load drivers from sphal.
This patch stops loading the driver if it fails to find the driver
from sphal, instead of falling back to the default namespace.

Bug: 38435840
Test: sailfish builds and boots
Change-Id: Ib8ba73f57aa25431c4a2efe7c61a3699237cc3d2
Merged-In: Ib8ba73f57aa25431c4a2efe7c61a3699237cc3d2
(cherry picked from commit b732030e847e74f00ecd37ff15a36b103efd97b9)

7 years agoPlayback activity monitoring: add player types
Jean-Michel Trivi [Thu, 25 May 2017 22:17:39 +0000 (15:17 -0700)]
Playback activity monitoring: add player types

Add player types for playback activity monitoring:
 - AAudio
 - hardware sources
 - proxy for external players

Test: n/a
Bug: 62027849
Change-Id: I17f4879dd79cc89eb7db373754a79e2e38c97457

7 years agoMerge "Newly create idmap only when it is stale" into oc-dev
TreeHugger Robot [Thu, 25 May 2017 21:50:52 +0000 (21:50 +0000)]
Merge "Newly create idmap only when it is stale" into oc-dev

7 years agolibgui: fix BQ buffer allocation error checking
Chia-I Wu [Thu, 25 May 2017 16:34:56 +0000 (09:34 -0700)]
libgui: fix BQ buffer allocation error checking

The error path was broken since we moved away from
IGraphicBufferAlloc.

Bug: 37956614
Test: simulate buffer allocation failures
Change-Id: I1e1ec840fafd3075b84126c6dbf6194568175a42

7 years agoMerge "Delete SurfaceFlinger BYPASS codepath" into oc-dev
TreeHugger Robot [Wed, 24 May 2017 22:13:36 +0000 (22:13 +0000)]
Merge "Delete SurfaceFlinger BYPASS codepath" into oc-dev

7 years agoMerge "libgui: Add test for OOB slot number in dequeue" into oc-dev
TreeHugger Robot [Wed, 24 May 2017 18:24:03 +0000 (18:24 +0000)]
Merge "libgui: Add test for OOB slot number in dequeue" into oc-dev

7 years agoDelete SurfaceFlinger BYPASS codepath
Fabien Sanglard [Thu, 4 May 2017 18:25:46 +0000 (11:25 -0700)]
Delete SurfaceFlinger BYPASS codepath

Test: AUPT, Manual
Change-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030
Merged-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030

7 years agoNewly create idmap only when it is stale
Jaekyun Seok [Wed, 17 May 2017 15:13:44 +0000 (00:13 +0900)]
Newly create idmap only when it is stale

For now, OverlayManagerService calls Installd.idmap() whenever a user
is changed, and then a idmap is re-generated even though there are no
changes on its target apk and overlay apk.
This CL is to avoid such unnecessary re-generation of idmap. Instead
only a group id will be updated when the idmap isn't outdated.

To correctly check staleness of idmap, "--verify" function of idmap is
invented as well.

Test: building succeeded and tested on sailfish.
Bug: 37179531
Change-Id: I874be9765d37bfa6c562c3f39a395040dc6a7d1f

7 years agoMerge "Do not set the trace clock in atrace.rc." into oc-dev
TreeHugger Robot [Tue, 23 May 2017 21:50:28 +0000 (21:50 +0000)]
Merge "Do not set the trace clock in atrace.rc." into oc-dev

7 years agoMerge "Surface: Use buffer id to synchronize slots" into oc-dev
TreeHugger Robot [Tue, 23 May 2017 19:52:17 +0000 (19:52 +0000)]
Merge "Surface: Use buffer id to synchronize slots" into oc-dev

7 years agoDo not set the trace clock in atrace.rc.
Carmen Jackson [Tue, 23 May 2017 18:54:01 +0000 (11:54 -0700)]
Do not set the trace clock in atrace.rc.

This reverts only the atrace.rc change from commit ea826794184be368f65f099ceac4fc31234700f6.
"Set the atrace clock to the best available value: boot, mono, or global."

This change caused a 100+ms regression in boot time. We also confirm that
the clock is set to the correct value when we call atrace, so we will
still see correct behavior after reverting this change.

Bug: 38504158
Test: Manually tested that the trace clock is updated when atrace is
called.
Change-Id: Ifa302694964a4f9fc54db16e7125d5279067bbfd

7 years agoSurface: Use buffer id to synchronize slots
Shuzhen Wang [Tue, 23 May 2017 16:41:54 +0000 (09:41 -0700)]
Surface: Use buffer id to synchronize slots

For the same buffer, GraphicBuffer's buffer_handle_t* may change when
doing attach/detach. Use Id instead.

Test: Call attach/detach, and observe mRemovedBuffers is updated
Bug: 38238747
Change-Id: I6ab1ae5340565f98cb981b7e38c31a4f85190e56

7 years agoMerge "SurfaceFlinger: setGeometryAppliesWithResize crop latching fixes." into oc-dev
TreeHugger Robot [Tue, 23 May 2017 04:09:52 +0000 (04:09 +0000)]
Merge "SurfaceFlinger: setGeometryAppliesWithResize crop latching fixes." into oc-dev

7 years agoOtapreopt: Add some static_asserts
Andreas Gampe [Mon, 22 May 2017 20:36:06 +0000 (13:36 -0700)]
Otapreopt: Add some static_asserts

Add some checks that indicate version issues.

Bug: 38501464
Test: m
Change-Id: Iec2043eda19126166139d7220618d11032e98af0

7 years agoMerge "vulkan: Translate usage flags before passing to driver" into oc-dev
Chris Forbes [Sat, 20 May 2017 00:54:29 +0000 (00:54 +0000)]
Merge "vulkan: Translate usage flags before passing to driver" into oc-dev

7 years agoMerge "Set the atrace clock to the best available value: boot, mono, or global."...
TreeHugger Robot [Fri, 19 May 2017 22:04:11 +0000 (22:04 +0000)]
Merge "Set the atrace clock to the best available value: boot, mono, or global." into oc-dev

7 years agovulkan: Translate usage flags before passing to driver
Chris Forbes [Fri, 19 May 2017 21:47:29 +0000 (14:47 -0700)]
vulkan: Translate usage flags before passing to driver

Previously we just cast the 32bit flags and jammed them in the two
gralloc1 slots. Use the helper which does the correct translation.

(Yes, all these gralloc1isms are going away in favor of a single 64bit
flags field, but Vulkan HALs expect us to implement our side of
ANDROID_native_buffer correctly.)

Test: boot sailfish, run vulkan demo
Bug: 37686587
Change-Id: I806011986e8140d7f608d281798605bd9ca9a86b

7 years agoMerge "DO NOT MERGE Revert "Logging for catching memory issue in Parcel"" into oc-dev
Michael Wachenschwanz [Fri, 19 May 2017 18:27:10 +0000 (18:27 +0000)]
Merge "DO NOT MERGE Revert "Logging for catching memory issue in Parcel"" into oc-dev

7 years agoMerge changes from topic 'move-hwc2on1' into oc-dev
Logan Chien [Fri, 19 May 2017 02:14:23 +0000 (02:14 +0000)]
Merge changes from topic 'move-hwc2on1' into oc-dev

* changes:
  libhwc2on1adapter: Move to vendor partition
  Remove stale dependency to libhwc2on1adaptor.so.

7 years agoMerge "Delete secondary dex profiles during reconciliation" into oc-dev
Calin Juravle [Fri, 19 May 2017 00:50:19 +0000 (00:50 +0000)]
Merge "Delete secondary dex profiles during reconciliation" into oc-dev

7 years agoMerge "Fix race condition in displayservice." into oc-dev
TreeHugger Robot [Thu, 18 May 2017 23:59:15 +0000 (23:59 +0000)]
Merge "Fix race condition in displayservice." into oc-dev

7 years agoSet the atrace clock to the best available value: boot, mono, or global.
Carmen Jackson [Fri, 5 May 2017 18:42:32 +0000 (11:42 -0700)]
Set the atrace clock to the best available value: boot, mono, or global.

This reverts commit dc34097448a76a4bb09636f25567113d7a6551dc.
"Revert "Set the atrace clock to boot when possible and mono otherwise.""

...and includes a fix for devices that break with that change. Write will
fail with an Invalid Argument exception if we programmatically write a
value to the trace_file that doesn't exist in the file. So, we'll check
for both potential values we might set. If neither of them exist, fall
back to setting to 'global', which should be safe since we were doing it
before without checking.

Bug: 32379831
Test: cts-tradefed run singleCommand cts-dev --module
CtsAtraceHostTestCases passed.
Test: Manually examining trace_clock before and after running atrace shows that the
trace_clock changes as expected (for this test I disabled atrace.rc and added an
additional debug print statement):
$ cat /d/tracing/trace_clock
[local] global counter uptime perf mono boot
$ atrace --async_start freq
capturing trace...marlin:/ $ cat /d/tracing/trace_clock
local global counter uptime perf mono [boot]
$ atrace --async_stop > /dev/null
$ cat /d/tracing/trace_clock
local global counter uptime perf mono [boot]
$ atrace --async_start freq
clock is already correct!
$ atrace --async_stop > /dev/null

Change-Id: I267056d19bcdbea58881ab2b32f093caac5f14c1

7 years agoDelete secondary dex profiles during reconciliation
Calin Juravle [Thu, 18 May 2017 22:33:05 +0000 (15:33 -0700)]
Delete secondary dex profiles during reconciliation

Test: manual inspections after adb shell dumpsys package dexopt
Bug: 38430319
Change-Id: I8401288b753a0c38ee3020d12e8e02c4a25723d2

7 years agoSurfaceFlinger: setGeometryAppliesWithResize crop latching fixes.
Robert Carr [Thu, 18 May 2017 21:02:49 +0000 (14:02 -0700)]
SurfaceFlinger: setGeometryAppliesWithResize crop latching fixes.

The same sort of thing we had with setPosition...not sure why I didn't
realize we would need the fixes here too! In particular we need to ensure
the following scenarios work:

1. Additional calls to set(Final)Crop while in the setGeometryAppliesWithResize
   state are eventually applied.
2. Additional calls to set(Final)Crop while in the setGeometryAppliesWithResize
   state are not immediately applied.
3. In LayerRejector.cpp we have to be sure we are not just latching a buffer
   at the old size, which we still allow. This is the correct time to latch
   the transparentRegion as it is content dependent, but doesn't represent
   a size changing.

The difference between this and the original CL which was reverted has to do with
point 3. The original CL tried to solve point 3 by moving the latching logic from
the LayerRejecter in to Layer::doTransaction. However, in general doTransaction
will not be called in between Latching the buffer and drawing the frame, so this
introduced errors. The new test "FinalCropLatchingBufferOldSize" encapsulates this.

Bug: 37621737
Bug: 37531386
Test: Included in Transaction_test.cpp
Change-Id: I14bd09d01ac6b85895caa1b707d6fa7dac962074

7 years agoDO NOT MERGE Revert "Logging for catching memory issue in Parcel"
Michael Wachenschwanz [Thu, 18 May 2017 22:08:32 +0000 (22:08 +0000)]
DO NOT MERGE Revert "Logging for catching memory issue in Parcel"

This reverts commit c65de59762cfc284bd203d97281f5a8f86aba877.

Bug: 37298089
Change-Id: Ib42d27f91bf1408d633a98e6ac7f316175f1e289

7 years agosurfaceflinger: clear HWC layers in Layer::onRemoved v2
Chia-I Wu [Wed, 17 May 2017 21:36:16 +0000 (14:36 -0700)]
surfaceflinger: clear HWC layers in Layer::onRemoved v2

Explicitly destroy HWC layers in Layer::onRemoved rather than doing
that implicitly in the destructor.  The layer may be destructed by
any thread that holds a sp<Layer>, but only the main thread should
talk to the composer.

v2 fixes build breakage for non-HWC2 targets.

Bug: 38151478
Bug: 37978067
Test: manual
Change-Id: I8858fc46de1fc6facded219740b931c6486e317e

7 years agoMerge "Revert "surfaceflinger: clear HWC layers in Layer::onRemoved"" into oc-dev
Przemyslaw Szczepaniak [Thu, 18 May 2017 09:27:07 +0000 (09:27 +0000)]
Merge "Revert "surfaceflinger: clear HWC layers in Layer::onRemoved"" into oc-dev

7 years agoRevert "surfaceflinger: clear HWC layers in Layer::onRemoved"
Przemyslaw Szczepaniak [Thu, 18 May 2017 09:17:02 +0000 (09:17 +0000)]
Revert "surfaceflinger: clear HWC layers in Layer::onRemoved"

Causing failures due to lack of clearHwcLayers in git_master and few
other branches/builds. Looks like clearHwcLayers needs USE_HWC2
to be defined, seems to be not defined in few branches/builds?

This reverts commit 06837418fe9fb0c6deeab7d62ac5bf65c7bb2b98.

Change-Id: Ic0e3a99b45543503d5fa8a90f3569764ebe922e3

7 years agolibhwc2on1adapter: Move to vendor partition
Logan Chien [Tue, 16 May 2017 05:15:49 +0000 (13:15 +0800)]
libhwc2on1adapter: Move to vendor partition

libhwc2on1adapter is a shim layer for legacy hwcomposer HALs.  This is
only used by android.hardware.graphics.composer@2.1-impl.so.  This must
not be accessed by framework modules.  Thus, this commit moves
libhwc2on1adapter to the vendor partition and removes vendor_available.

Bug: 38302528
Test: Sailfish builds and boots.
Change-Id: I425d090fb213abc767916db3f80cff8eb4ffb876
Merged-In: I43d66c8c62f3dc90e75805f6a459573c093f9f14

7 years agoRemove stale dependency to libhwc2on1adaptor.so.
Logan Chien [Tue, 16 May 2017 02:18:17 +0000 (10:18 +0800)]
Remove stale dependency to libhwc2on1adaptor.so.

This commit removes stale dependency to libhwc2on1adaptor.  Since commit
831d48ed, mAdapter has become an unused private member.  In addition,
this unused unique_ptr leads to an unnecessary symbol reference to the
destructor of HWC2on1Adaptor.  This commit removes them completely.

Bug: 38302528
Test: Sailfish builds and boots.
Change-Id: I0208d7fb21ff2f5d59d367162bc5f982f1515982
Merged-In: I479f12ddbae91282a13464159f00513aa7cb3208

7 years agoMerge "surfaceflinger: clear HWC layers in Layer::onRemoved" into oc-dev
TreeHugger Robot [Thu, 18 May 2017 04:36:30 +0000 (04:36 +0000)]
Merge "surfaceflinger: clear HWC layers in Layer::onRemoved" into oc-dev

7 years agoMerge "libui: flush hwbinder commands in Allocator::allocate" into oc-dev
TreeHugger Robot [Thu, 18 May 2017 02:29:27 +0000 (02:29 +0000)]
Merge "libui: flush hwbinder commands in Allocator::allocate" into oc-dev

7 years agoFix race condition in displayservice.
Steven Moreland [Thu, 18 May 2017 01:15:15 +0000 (18:15 -0700)]
Fix race condition in displayservice.

Also addressed a couple of format nits and added copyright headers.

Note, this race condition wouldn't have occured as is because the
service is only being served on one thread.

Test: no race condition still
Bug: 38311538
Change-Id: I7516c800eb89280a16468934677fa978daa5dcec

7 years agoMerge "surfaceflinger: fix a release fence leak" into oc-dev
TreeHugger Robot [Thu, 18 May 2017 00:29:43 +0000 (00:29 +0000)]
Merge "surfaceflinger: fix a release fence leak" into oc-dev

7 years agoMerge "libvulkan: Enable GSC2 and SPI extensions" into oc-dev
Chris Forbes [Wed, 17 May 2017 21:42:59 +0000 (21:42 +0000)]
Merge "libvulkan: Enable GSC2 and SPI extensions" into oc-dev

7 years agosurfaceflinger: clear HWC layers in Layer::onRemoved
Chia-I Wu [Wed, 17 May 2017 21:36:16 +0000 (14:36 -0700)]
surfaceflinger: clear HWC layers in Layer::onRemoved

Explicitly destroy HWC layers in Layer::onRemoved rather than doing
that implicitly in the destructor.  The layer may be destructed by
any thread that holds a sp<Layer>, but only the main thread should
talk to the composer.

Bug: 38151478
Bug: 37978067
Test: manual
Change-Id: If6fcfaa5a70d247b751f2b4d9aec9eca890e3aa5

7 years agoMerge "Surface: add unit test for GetAndFlushRemovedBuffers" into oc-dev
TreeHugger Robot [Wed, 17 May 2017 21:32:27 +0000 (21:32 +0000)]
Merge "Surface: add unit test for GetAndFlushRemovedBuffers" into oc-dev

7 years agosurfaceflinger: fix a release fence leak
Chia-I Wu [Wed, 17 May 2017 20:43:16 +0000 (13:43 -0700)]
surfaceflinger: fix a release fence leak

We leak release fence fds when we believe hwcomposer2 gives us any
invalid layer and return early.

Bug: 38151478
Test: boots
Change-Id: I299721eca8bc7927052170fe87ee51e9b91006aa

7 years agolibgui: Add test for OOB slot number in dequeue
Dan Stoza [Tue, 16 May 2017 22:12:48 +0000 (15:12 -0700)]
libgui: Add test for OOB slot number in dequeue

Adds a unit test that verifies that a malicious BnGraphicBufferProducer
cannot pass an invalid slot number to a Surface and thus cause the
Surface to segfault (or otherwise access out-of-bounds memory).

Bug: 36991414
Test: The new Malicious* tests pass after applying the security patch
Change-Id: I2083465a496cfcc8e8c3b3bc288f5f6904005ac3

7 years agoMerge "Add displayservice." into oc-dev
TreeHugger Robot [Wed, 17 May 2017 20:19:59 +0000 (20:19 +0000)]
Merge "Add displayservice." into oc-dev

7 years agoAdd displayservice.
Steven Moreland [Wed, 17 May 2017 00:42:50 +0000 (17:42 -0700)]
Add displayservice.

This hidl service provides information about vsync and hotplug
to vendor services which is required by at least some camera
hal implementations.

Test: VtsFwkDisplayServiceV1_0TargetTest
Bug: 38311538
Change-Id: Ifc344c11ca4b3c8cebc6f0145f506d1aa774506d

7 years agoMerge "Fix error BufferQueue attaching flow." into oc-dev
TreeHugger Robot [Wed, 17 May 2017 05:29:50 +0000 (05:29 +0000)]
Merge "Fix error BufferQueue attaching flow." into oc-dev

7 years agoMerge "Revert "Newly create idmap only when it is outdated"" into oc-dev
Adam Lesinski [Wed, 17 May 2017 00:12:48 +0000 (00:12 +0000)]
Merge "Revert "Newly create idmap only when it is outdated"" into oc-dev

7 years agoNo more ashmem equivalent checker false alarm
Peng Xu [Tue, 16 May 2017 22:12:22 +0000 (15:12 -0700)]
No more ashmem equivalent checker false alarm

The checker for ashmem file descriptor equivalency is
too strict and false alarms. This CL fix the issue.

Bug: 38352409
Test: successfully register multiple ashmem sensor direct channels
      without "Duplicate create channel request for the
      same share memory"

Change-Id: Ib80b47944940ce708953632855174d2f90c41b49