OSDN Git Service

android-x86/frameworks-native.git
3 years agoMerge remote-tracking branch 'x86/nougat-x86' into cm-14.1-x86 cm-14.1-x86
Chih-Wei Huang [Mon, 21 Sep 2020 23:21:57 +0000 (07:21 +0800)]
Merge remote-tracking branch 'x86/nougat-x86' into cm-14.1-x86

3 years agoChanging input flinger to take in account screen rotation (hwrotation) in prop file nougat-x86 android-x86-7.1-r5
Nicolas Peslerbe [Tue, 26 Feb 2019 11:02:10 +0000 (12:02 +0100)]
Changing input flinger to take in account screen rotation (hwrotation) in prop file

4 years agoMerge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86
Chih-Wei Huang [Wed, 20 May 2020 14:12:39 +0000 (22:12 +0800)]
Merge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86

4 years agoDon't leak input events to dumpsys on user builds
Ashwini Oruganti [Fri, 6 Dec 2019 18:00:53 +0000 (10:00 -0800)]
Don't leak input events to dumpsys on user builds

Remove the details of KeyEvent and MotionEvent logs.
Bug: 139945049
Test: Tested on a device, the input functions work as expected and input
event logs are not leaked to dumpsys on user builds.

Merged-In: I98c9c375f18963177bf0c1d8829a217b4ad4acc6
(cherry picked from commit 3b7d779774cb81c5d922f74216392c9fd7004a1b)

[basilgello: Back-ported to 14.1:
 - motionActionToString and keyActionToString helpers are not present]
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
Change-Id: I98c9c375f18963177bf0c1d8829a217b4ad4acc6

4 years agoResize object capacity when shrinking Parcel
Michael Wachenschwanz [Tue, 15 Oct 2019 18:49:22 +0000 (11:49 -0700)]
Resize object capacity when shrinking Parcel

Bug: 140419401
Test: atest android.os.cts.ParcelTest
(cherry picked from commit c67d9f33b36cbb95b121d058f51d6653f1ec4334)
(cherry picked from commit d9d10dbdf2f20af3dd01376d2130c71c052e42f3)

Change-Id: I04edee415e1984ba5fb97c5c1b09892a360cf221

4 years agoSensor: use FlattenableUtils::align
Steven Moreland [Tue, 8 Oct 2019 00:30:23 +0000 (17:30 -0700)]
Sensor: use FlattenableUtils::align

Since it memsets skipped over memory now.

Bug: 141890807
Test: boot, check buffer is zero'd here

[basilgello: Back-ported to 14.1:
 - lib/sensor/Sensor.cpp -> lib/gui/Sensor.cpp]

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
Change-Id: Ieb3cd90215a3ccc1dc43365ecde251a50db08553
(cherry picked from commit d58cf5acb863eddbbeb9982439965e259045940e)
(cherry picked from commit dbd0eecfc7570231d5cbb76678b0358c43ee6d3c)

4 years agoMerge remote-tracking branch 'x86/nougat-x86' into cm-14.1-x86
Chih-Wei Huang [Tue, 22 Oct 2019 09:58:44 +0000 (17:58 +0800)]
Merge remote-tracking branch 'x86/nougat-x86' into cm-14.1-x86

4 years agoMerge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86
Chih-Wei Huang [Tue, 22 Oct 2019 09:56:16 +0000 (17:56 +0800)]
Merge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86

4 years agoMerge tag 'android-7.1.2_r39' into nougat-x86 android-x86-7.1-r3 android-x86-7.1-r4
Chih-Wei Huang [Wed, 16 Oct 2019 14:52:29 +0000 (22:52 +0800)]
Merge tag 'android-7.1.2_r39' into nougat-x86

Android 7.1.2 Release 39 (5787804)

5 years agoFix race between SensorManager ctor and callback
Brian Duddie [Thu, 6 Jun 2019 23:43:41 +0000 (16:43 -0700)]
Fix race between SensorManager ctor and callback

Avoids potential invalid memory access if system server crashes during
initialization.

Bug: 132927376
Test: confirm sensors initialize
Change-Id: If7421c452b5893ab2567323d265503a1ce304482
Merged-In: If7421c452b5893ab2567323d265503a1ce304482
(cherry picked from commit 4b23ed10ae94ff9e991cc6c1d0946b55733e8f89)

5 years agoFree mObjects if no objects left to realloc on resize
Michael Wachenschwanz [Tue, 4 Jun 2019 00:24:51 +0000 (17:24 -0700)]
Free mObjects if no objects left to realloc on resize

Bug: 134168436
Bug: 133785589
Bug: 34175893
Test: atest CtsOsTestCases:ParcelTest#testObjectDoubleFree
Change-Id: I82e7e8c7b4206fb45b832a71d174df45edb62710
Merged-In: I82e7e8c7b4206fb45b832a71d174df45edb62710
(cherry picked from commit edd3e3d8f441131b02e5a78d18babf9d16ef9e6e)

5 years agolibbinder: Status: check dataPosition sets.
Bryan Ferris [Wed, 5 Jun 2019 02:00:32 +0000 (19:00 -0700)]
libbinder: Status: check dataPosition sets.

Bug: 132650049
Test: fuzzer
Change-Id: Id230eae4316a444bc82b416b2049d5a5f589f89a
(cherry picked from commit f5edb02e9e96de8ff29bc4369d6dd6681ec0d7cf)

5 years agolibbinder: readCString: no ubsan sub-overflow
Steven Moreland [Fri, 17 May 2019 20:14:06 +0000 (13:14 -0700)]
libbinder: readCString: no ubsan sub-overflow

Bug: 131859347
Test: fuzzer
Change-Id: I95a0f59684a172925f1eab97ff21e5d14bc79cc8
Merged-In: I95a0f59684a172925f1eab97ff21e5d14bc79cc8
(cherry picked from commit d0d4b584fc294d2c124385644099852918416344)

5 years agoFix race between SensorManager ctor and callback
Brian Duddie [Thu, 6 Jun 2019 23:43:41 +0000 (16:43 -0700)]
Fix race between SensorManager ctor and callback

Avoids potential invalid memory access if system server crashes during
initialization.

Bug: 132927376
Test: confirm sensors initialize
Change-Id: If7421c452b5893ab2567323d265503a1ce304482
Merged-In: If7421c452b5893ab2567323d265503a1ce304482
(cherry picked from commit 4b23ed10ae94ff9e991cc6c1d0946b55733e8f89)

5 years agoFree mObjects if no objects left to realloc on resize
Michael Wachenschwanz [Tue, 4 Jun 2019 00:24:51 +0000 (17:24 -0700)]
Free mObjects if no objects left to realloc on resize

Bug: 134168436
Bug: 133785589
Bug: 34175893
Test: atest CtsOsTestCases:ParcelTest#testObjectDoubleFree
Change-Id: I82e7e8c7b4206fb45b832a71d174df45edb62710
Merged-In: I82e7e8c7b4206fb45b832a71d174df45edb62710
(cherry picked from commit edd3e3d8f441131b02e5a78d18babf9d16ef9e6e)

5 years ago[RESTRICT AUTOMERGE] libbinder: Status: check dataPosition sets.
Bryan Ferris [Wed, 5 Jun 2019 02:00:32 +0000 (19:00 -0700)]
[RESTRICT AUTOMERGE] libbinder: Status: check dataPosition sets.

Bug: 132650049
Test: fuzzer
Change-Id: Id230eae4316a444bc82b416b2049d5a5f589f89a
(cherry picked from commit f5edb02e9e96de8ff29bc4369d6dd6681ec0d7cf)

5 years agolibbinder: readCString: no ubsan sub-overflow
Steven Moreland [Fri, 17 May 2019 20:14:06 +0000 (13:14 -0700)]
libbinder: readCString: no ubsan sub-overflow

Bug: 131859347
Test: fuzzer
Change-Id: I95a0f59684a172925f1eab97ff21e5d14bc79cc8
Merged-In: I95a0f59684a172925f1eab97ff21e5d14bc79cc8
(cherry picked from commit d0d4b584fc294d2c124385644099852918416344)

5 years agoSanitize InputMessage before sending
Siarhei Vishniakou [Sat, 17 Nov 2018 06:18:53 +0000 (22:18 -0800)]
Sanitize InputMessage before sending

The struct InputMessage has many fields, and is force-aligned to 8-byte
boundaries. There are also some padding fields that carry no
information.

This struct is typically allocated in the stack and populated with
various values before being sent across as a stream of bytes through the
socket.

Therefore, the "unused" data portions of the struct could contain
portions of the stack, since there aren't ever writes to those memory
locations.

To avoid this information leak, forcefully sanitize the struct. Create a
new struct that is explicitly set to zero. Next, only fill the
meaningful fields manually.

Bug: 115739809
Test: cts-tradefed run cts -m CtsSecurityBulletinHostTestCases -t android.security.cts.Poc18_12; adb shell monkey 100000
Change-Id: I7e44dacf1e8fa3156c8e4d2f7784ef0c53dab507
Merged-In: I7e44dacf1e8fa3156c8e4d2f7784ef0c53dab507
(cherry picked from commit cb2f0ceed876b3c1cc62fc677c75a12c1f10b199)

5 years agoSanitize InputMessage before sending
Siarhei Vishniakou [Sat, 17 Nov 2018 06:18:53 +0000 (22:18 -0800)]
Sanitize InputMessage before sending

The struct InputMessage has many fields, and is force-aligned to 8-byte
boundaries. There are also some padding fields that carry no
information.

This struct is typically allocated in the stack and populated with
various values before being sent across as a stream of bytes through the
socket.

Therefore, the "unused" data portions of the struct could contain
portions of the stack, since there aren't ever writes to those memory
locations.

To avoid this information leak, forcefully sanitize the struct. Create a
new struct that is explicitly set to zero. Next, only fill the
meaningful fields manually.

Bug: 115739809
Test: cts-tradefed run cts -m CtsSecurityBulletinHostTestCases -t android.security.cts.Poc18_12; adb shell monkey 100000
Change-Id: I7e44dacf1e8fa3156c8e4d2f7784ef0c53dab507
Merged-In: I7e44dacf1e8fa3156c8e4d2f7784ef0c53dab507
(cherry picked from commit cb2f0ceed876b3c1cc62fc677c75a12c1f10b199)

5 years agoinputflinger: treat tablet-style inputs as absolute coordinate mouse pointer
Jon Doe [Sun, 23 Dec 2018 14:50:00 +0000 (22:50 +0800)]
inputflinger: treat tablet-style inputs as absolute coordinate mouse pointer

Qemu and VirtualBox use tablet-style inputs. However, it's difficult to
work with the current "invisible finger" or "drag pointer" interface
provided to the virtual absolute coordinate pointing devices.
Instead, this patch classifies them as a regular mouse pointer
(INPUT_DEVICE_CLASS_CURSOR), which is more intuitive to work with.

6 years agoIncrement when attempting to read protected Parcel Data
Michael Wachenschwanz [Tue, 17 Apr 2018 23:52:40 +0000 (16:52 -0700)]
Increment when attempting to read protected Parcel Data

Make sure to increment the parcel data position even when trying to
improperly read from protected data

Bug: 29833520

Test (M): cts-tradefed run cts -c android.os.cts.ParcelTest -m testBinderDataProtection
Test (M): cts-tradefed run cts -c android.os.cts.ParcelTest -m testBinderDataProtectionIncrements
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.cts.ParcelTest#testBinderDataProtection
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.cts.ParcelTest#testBinderDataProtectionIncrements

Change-Id: Ie4aae6277fc5f5c924f603d9828c3a608998b986
Merged-In: Ie4aae6277fc5f5c924f603d9828c3a608998b986
(cherry picked from commit 6a825e8ad1a3928dd872bb7c3fbcd94784d77267)
CVE-2018-9434

6 years agoDisallow reading object data from Parcels with non-object reads
Michael Wachenschwanz [Sat, 18 Nov 2017 02:25:05 +0000 (18:25 -0800)]
Disallow reading object data from Parcels with non-object reads

The check added to each non-object reads adds an overhead. If the
objects (binders and file descriptors) were written to the Parcel in
sequential order then check adds a small O(1) overhead to each read,
plus an O(N) overhead to the first read (to verify the N objects were
added in order).
If the objects were written out of order (as in by jumping around the Parcel
with setDataPosition and writing Binder, DON'T DO THIS!!) (writing non
objects out of order is fine), the first read is forced to sort the objects
in the internal bookkeeping. Based on the assumption non sequential writes
are infrequent and overall Parcels are probably mostly sorted, insertion
sort was used. Worst case sorts will add an O(N^2) overhead to the first
non object read from the Parcel.

Test: run cts -m CtsOsTestCases -t android.os.cts.ParcelTest

Bug: 29833520
Change-Id: I82de8eb5f5eb56f869542d5358e96884c24301b2
(cherry picked from commit c517681c66a1a387be657e0cf06da8d19659dd14)
CVE-2018-9434

6 years agoDon't pad before calling writeInPlace().
Martijn Coenen [Wed, 4 Apr 2018 09:46:56 +0000 (11:46 +0200)]
Don't pad before calling writeInPlace().

writeInplace() itself already pads securely, by masking off
the padded bytes. If the padding is done before calling
writeInplace(), no mask is applied, and heap data can leak.

Bug: 77237570
Test: builds
Change-Id: Ide27a0002d4ed4196530430760245b971f6a3f44
Merged-In: Ide27a0002d4ed4196530430760245b971f6a3f44

(cherry picked from commit f8542381b72a7bb2452a5278a00ca8c34edbf8a0)
(cherry picked from commit 732132b765cd7b667f16cf32f0fe4c852d7d44dd)

Change-Id: Id65e4573e18ab68b804f1cf63a6977a71da01e5d
CVE-2018-9421

6 years agoIncrement when attempting to read protected Parcel Data
Michael Wachenschwanz [Tue, 17 Apr 2018 23:52:40 +0000 (16:52 -0700)]
Increment when attempting to read protected Parcel Data

Make sure to increment the parcel data position even when trying to
improperly read from protected data

Bug: 29833520

Test (M): cts-tradefed run cts -c android.os.cts.ParcelTest -m testBinderDataProtection
Test (M): cts-tradefed run cts -c android.os.cts.ParcelTest -m testBinderDataProtectionIncrements
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.cts.ParcelTest#testBinderDataProtection
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.cts.ParcelTest#testBinderDataProtectionIncrements

Change-Id: Ie4aae6277fc5f5c924f603d9828c3a608998b986
Merged-In: Ie4aae6277fc5f5c924f603d9828c3a608998b986
(cherry picked from commit 6a825e8ad1a3928dd872bb7c3fbcd94784d77267)

6 years agoDon't pad before calling writeInPlace().
Martijn Coenen [Wed, 4 Apr 2018 09:46:56 +0000 (11:46 +0200)]
Don't pad before calling writeInPlace().

writeInplace() itself already pads securely, by masking off
the padded bytes. If the padding is done before calling
writeInplace(), no mask is applied, and heap data can leak.

Bug: 77237570
Test: builds
Change-Id: Ide27a0002d4ed4196530430760245b971f6a3f44
Merged-In: Ide27a0002d4ed4196530430760245b971f6a3f44

(cherry picked from commit f8542381b72a7bb2452a5278a00ca8c34edbf8a0)
(cherry picked from commit 732132b765cd7b667f16cf32f0fe4c852d7d44dd)

6 years agoDisallow reading object data from Parcels with non-object reads
akirilov [Tue, 3 Apr 2018 19:56:06 +0000 (12:56 -0700)]
Disallow reading object data from Parcels with non-object reads

The check added to each non-object reads adds an overhead. If the
objects (binders and file descriptors) were written to the Parcel in
sequential order then check adds a small O(1) overhead to each read,
plus an O(N) overhead to the first read (to verify the N objects were
added in order).
If the objects were written out of order (as in by jumping around the Parcel
with setDataPosition and writing Binder, DON'T DO THIS!!) (writing non
objects out of order is fine), the first read is forced to sort the objects
in the internal bookkeeping. Based on the assumption non sequential writes
are infrequent and overall Parcels are probably mostly sorted, insertion
sort was used. Worst case sorts will add an O(N^2) overhead to the first
non object read from the Parcel.

Test: run cts -m CtsOsTestCases -t android.os.cts.ParcelTest

Bug: 29833520
Change-Id: Id0119caf530023fe8b61be6d15f5b6a9c49c08df
Merged-In: I82de8eb5f5eb56f869542d5358e96884c24301b2
(cherry picked from commit f784183c17a4985b9703ac22d063ad4ef8b9090f)

6 years agoMerge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86
Chih-Wei Huang [Wed, 2 May 2018 14:34:04 +0000 (22:34 +0800)]
Merge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86

Conflicts:
opengl/libs/EGL/egl_object.cpp

6 years agoHandle glGetString returning NULL
Jesse Hall [Fri, 29 Sep 2017 22:57:42 +0000 (15:57 -0700)]
Handle glGetString returning NULL

When two contexts are shared, and one is lost/reset, the other can be
lost as well. A lost context can return NULL from glGetString. On the
first eglMakeCurrent to a context, we fetch the extension list, and
weren't checking for NULL, leading to a crash in the rare case where a
context is lost and then another context sharing with it is made
current for the first time.

Bug: 64024627
Test: dEQP-EGL.functional.robustness.reset_context.shaders.infinite_loop.shared_context_status.*
Change-Id: Ib7e1b932490ec587df159e9e461c211d3dac35d4

6 years agoTriple the available egl function pointers available to a process
Aaron Kling [Fri, 17 Nov 2017 03:01:38 +0000 (21:01 -0600)]
Triple the available egl function pointers available to a process
for certain Nvidia devices.

Change-Id: Id0141140c3b44af93fbd37aaf7810bb92e335111

6 years agoMerge remote-tracking branch 'x86/nougat-x86' into cm-14.1-x86
Chih-Wei Huang [Mon, 12 Feb 2018 10:00:06 +0000 (18:00 +0800)]
Merge remote-tracking branch 'x86/nougat-x86' into cm-14.1-x86

6 years agoMerge tag 'android-7.1.2_r36' into nougat-x86 android-x86-7.1-r1 android-x86-7.1-r2
Chih-Wei Huang [Thu, 4 Jan 2018 08:27:30 +0000 (16:27 +0800)]
Merge tag 'android-7.1.2_r36' into nougat-x86

Android 7.1.2 Release 36 (N2G48H)

6 years agoDO NOT MERGE Remove window obscurement information.
Siarhei Vishniakou [Fri, 4 Aug 2017 19:37:47 +0000 (12:37 -0700)]
DO NOT MERGE Remove window obscurement information.

If ACTION_OUTSIDE_EVENTS contain information about whether the touch is
obscured, then a pattern of invisible, untouchable, unfocusable
SYSTEM_ALERT_WINDOWS can be placed across the screen to determine
approximate locations of touch events without the user knowing.

Bug: 31097064
Test: cts-tradefed run cts --class android.security.cts.MotionEventTest
Change-Id: Iebbb68231cbb76f87241201e7640a1fe3e188625
(cherry picked from commit 5508ca2c191f8fdf29d8898890a58bf1a3a225b3)

6 years agoMerge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86
meijjaa [Sat, 21 Oct 2017 11:42:31 +0000 (13:42 +0200)]
Merge remote-tracking branch 'cm/cm-14.1' into cm-14.1-x86

6 years agoMerge cherrypicks of [2973982, 2974657, 2974658, 2973983, 2973984, 2974689, 2974690...
android-build-team Robot [Thu, 28 Sep 2017 17:16:50 +0000 (17:16 +0000)]
Merge cherrypicks of [2973982297465729746582973983297398429746892974690297469129746922974710297471129747132974714297421529742162974217297421829742192974220297472929747302974731297473229747332974734297473529747362974737297473829747392974740297474129747422974749297475029747512974752297475329746472974744297469329746942974648297451329746652974746] into nyc-mr2-release

Change-Id: I1dcef704bea95d9d3e289807299d8d3fff0ea049

6 years agoDO NOT MERGE Remove window obscurement information.
Siarhei Vishniakou [Fri, 4 Aug 2017 19:37:47 +0000 (12:37 -0700)]
DO NOT MERGE Remove window obscurement information.

If ACTION_OUTSIDE_EVENTS contain information about whether the touch is
obscured, then a pattern of invisible, untouchable, unfocusable
SYSTEM_ALERT_WINDOWS can be placed across the screen to determine
approximate locations of touch events without the user knowing.

Bug: 31097064
Test: cts-tradefed run cts --class android.security.cts.MotionEventTest
Change-Id: Iebbb68231cbb76f87241201e7640a1fe3e188625
(cherry picked from commit 5508ca2c191f8fdf29d8898890a58bf1a3a225b3)

7 years agoDO NOT MERGE Remove window obscurement information.
Siarhei Vishniakou [Fri, 4 Aug 2017 19:37:47 +0000 (12:37 -0700)]
DO NOT MERGE Remove window obscurement information.

If ACTION_OUTSIDE_EVENTS contain information about whether the touch is
obscured, then a pattern of invisible, untouchable, unfocusable
SYSTEM_ALERT_WINDOWS can be placed across the screen to determine
approximate locations of touch events without the user knowing.

Bug: 31097064
Test: cts-tradefed run cts --class android.security.cts.MotionEventTest
Change-Id: Iebbb68231cbb76f87241201e7640a1fe3e188625
(cherry picked from commit 5508ca2c191f8fdf29d8898890a58bf1a3a225b3)

7 years agolibEGL: use SwiftShader if hardware gralloc is not set
Chih-Wei Huang [Thu, 14 Sep 2017 10:20:23 +0000 (18:20 +0800)]
libEGL: use SwiftShader if hardware gralloc is not set

The old implementation to disable hardware acceleration is reverted.

7 years agoInputDispatcher_test: fix pokeUserActivity after afbd1c1265de317f5ecf44cd400586c53a001ee7
Dan Pasanen [Sun, 20 Aug 2017 20:58:33 +0000 (15:58 -0500)]
InputDispatcher_test: fix pokeUserActivity after afbd1c1265de317f5ecf44cd400586c53a001ee7

* emulatorx86 needs this apparently

Change-Id: I870dbd0a33904eb9055f60fc9af379ab901c35b6

7 years agoInputDispatcher: On keypress, deliver keycode to pokeUserActivity
Corinna Vinschen [Sat, 12 Aug 2017 19:22:57 +0000 (21:22 +0200)]
InputDispatcher: On keypress, deliver keycode to pokeUserActivity

Change-Id: I8f64a6fa9b4b2e4520e25731f55e89f5087c70da
Signed-off-by: Corinna Vinschen <xda@vinschen.de>
7 years agoPowerManager.h: Define USER_ACTIVITY_FLAG values
Corinna Vinschen [Sat, 12 Aug 2017 19:22:27 +0000 (21:22 +0200)]
PowerManager.h: Define USER_ACTIVITY_FLAG values

Change-Id: I90daada0d887008d56e84ce29b3f0b011a298698
Signed-off-by: Corinna Vinschen <xda@vinschen.de>
7 years agonative: Increase ART heap limit to 192MB for 1024MB RAM devices
Adrian DC [Wed, 16 Nov 2016 12:02:04 +0000 (13:02 +0100)]
native: Increase ART heap limit to 192MB for 1024MB RAM devices

 * Needed for Google SetupWizard to start

 * Without this, SetupWizard is compiled by ART on boot
   and runs out of memory (heap) while running, resulting
   in the SetupWizard crashing and blocking boot

Change-Id: Ic5b8caf4352f6d104af9121a09a01adad1c5bcc3
Signed-off-by: Adrian DC <radian.dc@gmail.com>
7 years agoMerge tag 'android-7.1.2_r33' into nougat-x86
Chih-Wei Huang [Fri, 11 Aug 2017 05:27:24 +0000 (13:27 +0800)]
Merge tag 'android-7.1.2_r33' into nougat-x86

Android 7.1.2 Release 33 (NZH54D)

7 years agoSF: Improve hwrotation handling
Christopher N. Hesse [Wed, 9 Aug 2017 22:10:37 +0000 (00:10 +0200)]
SF: Improve hwrotation handling

Avoid getprop() calls in performance critical display
code paths.
Instead of querying the property each time we need it,
we read it once during initialization and then reuse
the cached value.

This is more appropriate here because we do not expect
the value to change at runtime. In fact, this property
behaves like a compile time constant in the real world:
Set it once and never again (because the angle of your
panel is fixed and does not change after the device
leaves the factory).

Change-Id: I55c4131735a65c7bdde8b00c166913bffa6c4ec3

7 years agoMerge tag 'android-7.1.2_r29' into cm-14.1
Dan Pasanen [Mon, 7 Aug 2017 21:13:35 +0000 (16:13 -0500)]
Merge tag 'android-7.1.2_r29' into cm-14.1

Android 7.1.2 Release 29 (NJH47F)

# gpg: Signature made Fri 28 Jul 2017 01:56:01 PM CDT
# gpg:                using DSA key E8AD3F819AB10E78
# gpg: Can't check signature: No public key

7 years agoRenderEngine: support non-RGBA_8888 format
Chih-Wei Huang [Fri, 28 Jul 2017 11:44:57 +0000 (19:44 +0800)]
RenderEngine: support non-RGBA_8888 format

Some of our GPUs (e.g., radeon) don't support RGBA_8888 well.
To workaround it, just get the EGL config by a simpler query.

This patch should be reverted once all of our GPUs support
RGBA_8888.

7 years agoAdd alpha channel for the EGLConfig
neo.he [Tue, 21 Mar 2017 03:48:36 +0000 (11:48 +0800)]
Add alpha channel for the EGLConfig

If the alpha channel is not assigned, the framebuffer will be opaque.
And it will mask the underlying video and make the video invisible
when play video width mediaplayer

Issue: 258684
Test: media player
Change-Id: If756ad2aaa789f6ddb178333b3e8854f52c8eac3

7 years agoMerge tag 'android-7.1.2_r27' into nougat-x86
Chih-Wei Huang [Tue, 18 Jul 2017 05:49:31 +0000 (13:49 +0800)]
Merge tag 'android-7.1.2_r27' into nougat-x86

Android 7.1.2 release 27

7 years agoSurface: Use async lock/unlock in copyBlt
Francis Hart [Fri, 9 Jan 2015 09:10:54 +0000 (11:10 +0200)]
Surface: Use async lock/unlock in copyBlt

The Surface::lock() function now uses the asynchronous versions of
gralloc lock/unlock when copying the previously drawn content to the
backbuffer. This allows for optimisations in the gralloc module
implementation and so can improve performance and avoid CPU waits.

Change-Id: I57193f327db2ff0422e1b58b3484f613201d994c

7 years agoSurface: Ensure synchronisation of copyBlt
Francis Hart [Mon, 1 Dec 2014 14:04:49 +0000 (16:04 +0200)]
Surface: Ensure synchronisation of copyBlt

The Surface::lock() function has an optimisation for copying the
previously drawn contents from the frontbuffer to the (current)
backbuffer, so that the client does not have to redraw the whole surface
contents. This logic was not using the sync fence FD from
dequeueBuffer() and so was not correctly synchronised with pending
operations on the backbuffer.

Change-Id: Ib44574d50f8bdb4a23078cd8da1c5c512c876320

7 years agosurfaceflinger: Validate setposition parameters
Ramakant Singh [Thu, 9 Feb 2017 12:53:36 +0000 (18:23 +0530)]
surfaceflinger: Validate setposition parameters

Validate setposition parameters width and height to
fix hang issues becuase of wrong values set by clients.

Change-Id: I786fc6f986fdb1d7de46ac3845f6a77cdcf34f93
CRs-Fixed: 2005153

7 years agosf: Fix GPU coordinates computation.
Pullakavi Srinivas [Thu, 16 Feb 2017 10:51:47 +0000 (16:21 +0530)]
sf: Fix GPU coordinates computation.

Along with Viewport, final crop need to be
considered to maintain aspect ratio.

CRs-Fixed: 2001126
Change-Id: Ia499cc059a2b0ef65002c60215d2f01ac706867f

7 years agosf: Limit co-ordinates difference fix for high res panel
Baldev Sahu [Thu, 19 Jan 2017 11:02:04 +0000 (16:32 +0530)]
sf: Limit co-ordinates difference fix for high res panel

- Limit co-ordinate difference fix for high res panel as this
  is causing pixel shift on low res panel due to rounding.

Change-Id: I1d697bc76ff6f962f399f6f692e347d04a059443

7 years agosurfaceflinger: Fix continuous SF dump.
Namit Solanki [Fri, 9 Dec 2016 04:43:54 +0000 (10:13 +0530)]
surfaceflinger: Fix continuous SF dump.

- Pass false in dumpdrawCycle() to append
  SF dumps for each draw cycle in a file.

Change-Id: Ibea496635b0d5a63e963f01754b5b6ddf8b09b4c
CRs-Fixed: 1099278

7 years agoMerge tag 'android-7.1.2_r24' into cm-14.1
Dan Pasanen [Wed, 5 Jul 2017 22:30:22 +0000 (17:30 -0500)]
Merge tag 'android-7.1.2_r24' into cm-14.1

Android 7.1.2 release 24

# gpg: Signature made Fri 30 Jun 2017 01:19:30 PM CDT
# gpg:                using DSA key E8AD3F819AB10E78
# gpg: Can't check signature: No public key

7 years agoinstalld: a workaround for 9p filesystem
Chih-Wei Huang [Tue, 27 Jun 2017 06:21:26 +0000 (14:21 +0800)]
installd: a workaround for 9p filesystem

SELinux and getxattr seem not work on 9p filesystem.
Ignore the errors as a workaround.

TEST: be able to boot to Home on QEMU with shared 'data' folder.

7 years agoMerge cherrypicks of [2419615, 2419671, 2419656, 2419633, 2419709, 2419634, 2419635...
android-build-team Robot [Fri, 16 Jun 2017 17:21:50 +0000 (17:21 +0000)]
Merge cherrypicks of [24196152419671241965624196332419709241963424196352419617241961824196192419658241969724196592419673241972624197472419596241974824195972419636241971124197492419660241971324197142419727241967424197822419752241973124197322419677241971724197342419784] into nyc-mr2-security-c-release

Change-Id: I8ad2f36ffeb8ead54643cf3d7707099f422df47c

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
(cherry picked from commit 59485525a6047453e6ba16c03989381e2a0d56ec)

7 years agoMerge cherrypicks of [2413468, 2413357, 2413489, 2413431, 2413506, 2413398, 2413399...
android-build-team Robot [Thu, 15 Jun 2017 19:16:32 +0000 (19:16 +0000)]
Merge cherrypicks of [2413468241335724134892413431241350624133982413399241331924135072413508241337124134102413432241335824134902413359241336024133202413509241349124140612413372241349224134332413469241341124140622413373241337424134702413400241406324140642413447241343424141012413412] into nyc-mr2-release

Change-Id: I3468d071cdcf838e73b0317fa1b9e9df6d81a12d

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
(cherry picked from commit 59485525a6047453e6ba16c03989381e2a0d56ec)

7 years agoMerge cherrypicks of [2413849, 2413760, 2413901, 2413776, 2413658, 2413792, 2413850...
android-build-team Robot [Thu, 15 Jun 2017 19:04:21 +0000 (19:04 +0000)]
Merge cherrypicks of [24138492413760241390124137762413658241379224138502413851241379324138662413738241365924136602413867241386824138852413829241381424138862413921241377724138872413854241388924138902413855241386924137402413816241383124138322413817241389224137972413779] into nyc-mr2-pixel-monthly-release

Change-Id: Ibdc8a041b91966025cb8dd8398903f789803cd25

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
(cherry picked from commit 59485525a6047453e6ba16c03989381e2a0d56ec)

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
(cherry picked from commit 59485525a6047453e6ba16c03989381e2a0d56ec)

7 years agoMerge tag 'android-7.1.2_r17' into nougat-x86
Chih-Wei Huang [Wed, 7 Jun 2017 03:07:24 +0000 (11:07 +0800)]
Merge tag 'android-7.1.2_r17' into nougat-x86

Android 7.1.2 Release 17 (NJH47B)

7 years agoMerge tag 'android-7.1.2_r17' into cm-14.1
Dan Pasanen [Mon, 5 Jun 2017 23:26:31 +0000 (18:26 -0500)]
Merge tag 'android-7.1.2_r17' into cm-14.1

Android 7.1.2 Release 17 (NJH47B)

# gpg: Signature made Fri 02 Jun 2017 05:09:05 PM CDT
# gpg:                using DSA key E8AD3F819AB10E78
# gpg: Can't check signature: No public key

7 years agoMerge cherrypicks of [2310999, 2310925, 2310891, 2311000, 2310892, 2310858, 2310986...
android-build-team Robot [Wed, 24 May 2017 22:54:12 +0000 (22:54 +0000)]
Merge cherrypicks of [231099923109252310891231100023108922310858231098623109632311043231092823110442310990231102223110232310917231099423110242311045231096723109952311003231105923110252311060231095323110612311004231104623110052311047231100623110792310954231102623108962310898231099723110622310955231102923109982311080231111923110302310933231114023110632310934231104923110502311084231103123111452311164] into nyc-mr2-security-c-release

Change-Id: Ib0aca10827997b0ecfcbc15b8c2db7117beab266

7 years agolibgui: check for invalid slot in attachBuffer
Chia-I Wu [Mon, 15 May 2017 17:32:27 +0000 (10:32 -0700)]
libgui: check for invalid slot in attachBuffer

Bug: 37478824
Test: manual
Change-Id: I369337d53539bf7f7e3d925bccdae4045da1b404
(cherry picked from commit c79a29689c1046f1f0301c75df9b9a67cba8bf04)

7 years agolibgui: Check slot received from IGBP in Surface
Dan Stoza [Mon, 1 May 2017 23:31:53 +0000 (16:31 -0700)]
libgui: Check slot received from IGBP in Surface

Checks that the slot number received from mGraphicBufferProducer in
Surface::dequeueBuffer is on the interval [0, NUM_BUFFER_SLOTS) to
protect against a malicious BnGraphicBufferProducer.

Bug: 36991414
Change-Id: I1a76fd1bcce1c558f1c0c30f03638278288ed4fa
(cherry picked from commit 90ce2a9c1d3af422c66b4061805831cb208263d8)

7 years agoui: Fix bad size check in Fence::unflatten
Chris Forbes [Wed, 10 May 2017 20:12:00 +0000 (13:12 -0700)]
ui: Fix bad size check in Fence::unflatten

Differs slightly from mnc+ patch: GetFlattenedSize was fixed in mnc.

Test: Boot device, run poc from bug, observe no longer crashes
Bug: 37285689
Change-Id: Id8b851733b088cce0d07493fbf76e7e24f9299ad
(cherry picked from commit 9809602ac32dcb7bceaa5bc34df5b7fb68aacd38)

7 years agoMerge cherrypicks of [2310196, 2310339, 2310340, 2310175, 2310320, 2310321, 2310322...
android-build-team Robot [Wed, 24 May 2017 22:12:52 +0000 (22:12 +0000)]
Merge cherrypicks of [2310196231033923103402310175231032023103212310322231032323102172310311231034923103132310331231031423102862310368231038323102722310439231031723103182310370231035223104592310287231038423102372310422231044023103722310289231037423103552310461231042323103752310376231038523103862310275231046223104422310443231053923103782310445231023823104462310540231033523105822310454231065923103922310393231043723106792310626] into nyc-mr2-release

Change-Id: I716e667bb925d01972a6e9ef26bf11cbf3628cc5

7 years agolibgui: check for invalid slot in attachBuffer
Chia-I Wu [Mon, 15 May 2017 17:32:27 +0000 (10:32 -0700)]
libgui: check for invalid slot in attachBuffer

Bug: 37478824
Test: manual
Change-Id: I369337d53539bf7f7e3d925bccdae4045da1b404
(cherry picked from commit c79a29689c1046f1f0301c75df9b9a67cba8bf04)

7 years agolibgui: Check slot received from IGBP in Surface
Dan Stoza [Mon, 1 May 2017 23:31:53 +0000 (16:31 -0700)]
libgui: Check slot received from IGBP in Surface

Checks that the slot number received from mGraphicBufferProducer in
Surface::dequeueBuffer is on the interval [0, NUM_BUFFER_SLOTS) to
protect against a malicious BnGraphicBufferProducer.

Bug: 36991414
Change-Id: I1a76fd1bcce1c558f1c0c30f03638278288ed4fa
(cherry picked from commit 90ce2a9c1d3af422c66b4061805831cb208263d8)

7 years agoui: Fix bad size check in Fence::unflatten
Chris Forbes [Wed, 10 May 2017 20:12:00 +0000 (13:12 -0700)]
ui: Fix bad size check in Fence::unflatten

Differs slightly from mnc+ patch: GetFlattenedSize was fixed in mnc.

Test: Boot device, run poc from bug, observe no longer crashes
Bug: 37285689
Change-Id: Id8b851733b088cce0d07493fbf76e7e24f9299ad
(cherry picked from commit 9809602ac32dcb7bceaa5bc34df5b7fb68aacd38)

7 years agoMerge cherrypicks of [2307556, 2307630, 2307631, 2307557, 2307632, 2307656, 2307743...
android-build-team Robot [Wed, 24 May 2017 17:28:04 +0000 (17:28 +0000)]
Merge cherrypicks of [230755623076302307631230755723076322307656230774323076352307799230757723078002307707230780323077812307773230763723078042307618230773423077082307805230770923078062307820230774623077742307839230773523077822307808230784023077382307783230774923077752307860230789923078222307823230788023077782307825230788223077872307919230784423079052307883230782923079072307832230794423079452307911] into nyc-mr2-pixel-monthly-release

Change-Id: I28eae9950c92e96e8d5a9ec0ae450f7bdfb0b28f

7 years agolibgui: check for invalid slot in attachBuffer
Chia-I Wu [Mon, 15 May 2017 17:32:27 +0000 (10:32 -0700)]
libgui: check for invalid slot in attachBuffer

Bug: 37478824
Test: manual
Change-Id: I369337d53539bf7f7e3d925bccdae4045da1b404
(cherry picked from commit c79a29689c1046f1f0301c75df9b9a67cba8bf04)

7 years agolibgui: Check slot received from IGBP in Surface
Dan Stoza [Mon, 1 May 2017 23:31:53 +0000 (16:31 -0700)]
libgui: Check slot received from IGBP in Surface

Checks that the slot number received from mGraphicBufferProducer in
Surface::dequeueBuffer is on the interval [0, NUM_BUFFER_SLOTS) to
protect against a malicious BnGraphicBufferProducer.

Bug: 36991414
Change-Id: I1a76fd1bcce1c558f1c0c30f03638278288ed4fa
(cherry picked from commit 90ce2a9c1d3af422c66b4061805831cb208263d8)

7 years agoui: Fix bad size check in Fence::unflatten
Chris Forbes [Wed, 10 May 2017 20:12:00 +0000 (13:12 -0700)]
ui: Fix bad size check in Fence::unflatten

Differs slightly from mnc+ patch: GetFlattenedSize was fixed in mnc.

Test: Boot device, run poc from bug, observe no longer crashes
Bug: 37285689
Change-Id: Id8b851733b088cce0d07493fbf76e7e24f9299ad
(cherry picked from commit 9809602ac32dcb7bceaa5bc34df5b7fb68aacd38)

7 years agolibgui: check for invalid slot in attachBuffer
Chia-I Wu [Mon, 15 May 2017 17:32:27 +0000 (10:32 -0700)]
libgui: check for invalid slot in attachBuffer

Bug: 37478824
Test: manual
Change-Id: I369337d53539bf7f7e3d925bccdae4045da1b404
(cherry picked from commit c79a29689c1046f1f0301c75df9b9a67cba8bf04)

7 years agolibgui: Check slot received from IGBP in Surface
Dan Stoza [Mon, 1 May 2017 23:31:53 +0000 (16:31 -0700)]
libgui: Check slot received from IGBP in Surface

Checks that the slot number received from mGraphicBufferProducer in
Surface::dequeueBuffer is on the interval [0, NUM_BUFFER_SLOTS) to
protect against a malicious BnGraphicBufferProducer.

Bug: 36991414
Change-Id: I1a76fd1bcce1c558f1c0c30f03638278288ed4fa
(cherry picked from commit 90ce2a9c1d3af422c66b4061805831cb208263d8)

7 years agoui: Fix bad size check in Fence::unflatten
Chris Forbes [Wed, 10 May 2017 20:12:00 +0000 (13:12 -0700)]
ui: Fix bad size check in Fence::unflatten

Differs slightly from mnc+ patch: GetFlattenedSize was fixed in mnc.

Test: Boot device, run poc from bug, observe no longer crashes
Bug: 37285689
Change-Id: Id8b851733b088cce0d07493fbf76e7e24f9299ad
(cherry picked from commit 9809602ac32dcb7bceaa5bc34df5b7fb68aacd38)

7 years agoMerge cherrypicks of [2278225, 2279882, 2279862, 2278226, 2277057, 2279863, 2278227...
android-build-team Robot [Thu, 18 May 2017 00:55:56 +0000 (00:55 +0000)]
Merge cherrypicks of [2278225227988222798622278226227705722798632278227] into nyc-mr2-pixel-monthly-release

Change-Id: I6774ef85615b095adca014cd9a8dbf126aea7f4c

7 years agobinder: remove cgroup interactions [ DO NOT MERGE ]
Tim Murray [Tue, 7 Mar 2017 17:31:09 +0000 (09:31 -0800)]
binder: remove cgroup interactions [ DO NOT MERGE ]

Having binder change cgroups on the fly is too expensive in the common case to be useful.

Test: builds

bug 34825105

Change-Id: Ia692c9d2ab261d852cb2fac8f27d6779d0e2b057
(cherry picked from commit 05f4679d035b8ff8023e75f58b576518b8c3f064)

7 years agorelease-request-513a9883-0d18-4c2f-80ce-cadb234b4e89-for-git_nyc-mr2-pixel-monthly...
android-build-team Robot [Wed, 17 May 2017 22:44:51 +0000 (22:44 +0000)]
release-request-513a9883-0d18-4c2f-80ce-cadb234b4e89-for-git_nyc-mr2-pixel-monthly-release-3938523 snap-temp-L39300000065258774

Change-Id: I7a78c6e34ffa32907d81f5e19af217421745c2ca

7 years agorelease-request-513a9883-0d18-4c2f-80ce-cadb234b4e89-for-git_nyc-mr2-pixel-monthly...
android-build-team Robot [Wed, 17 May 2017 22:44:33 +0000 (22:44 +0000)]
release-request-513a9883-0d18-4c2f-80ce-cadb234b4e89-for-git_nyc-mr2-pixel-monthly-release-3938523 snap-temp-L39300000065258774 (snap-temp-branch)

Change-Id: Id2f1da1207e472264239e5bbe1b5e38cee120fbf

7 years agosensorservice: Fix orientation sensor for HAL's missing rotation vector sensor
Arne Coucheron [Tue, 16 May 2017 07:02:16 +0000 (07:02 +0000)]
sensorservice: Fix orientation sensor for HAL's missing rotation vector sensor

Some HAL's doesn't have a hardware rotation sensor, and with the
current check, the orientation sensor depends on it before it's
available to the system. Remove the dependency.

Fixes compass on some devices.

Change-Id: I58f746b3dee1eb5a637b21efb8fecddc10c31e3a

7 years agoRename dump methods to dumpState
Colin Cross [Tue, 27 Sep 2016 01:10:16 +0000 (18:10 -0700)]
Rename dump methods to dumpState

The dump methods shadow the IBinder dump method.  The warnings were being
hidden by the use of -isystem to include frameworks/native/include.

Bug: 31752268
Test: m -j
Merged-in: Iafc64da43032d5d9d84b64640e70d93fd7051bcf
Change-Id: Iafc64da43032d5d9d84b64640e70d93fd7051bcf

7 years agoRun SurfaceFlinger with root privilege
Chih-Wei Huang [Wed, 3 Aug 2016 17:38:50 +0000 (01:38 +0800)]
Run SurfaceFlinger with root privilege

To control virtual consoles, SurfaceFlinger needs the root privilege.

7 years agolibEGL: select pixel format by EGL_NATIVE_VISUAL_ID
Chih-Wei Huang [Mon, 23 Nov 2015 17:08:11 +0000 (01:08 +0800)]
libEGL: select pixel format by EGL_NATIVE_VISUAL_ID

We need this workaround until Mesa supports HAL_PIXEL_FORMAT_RGBA_8888.

7 years agoMerge branch 'android-ia' into nougat-x86
Chih-Wei Huang [Fri, 5 May 2017 03:39:08 +0000 (11:39 +0800)]
Merge branch 'android-ia' into nougat-x86

7 years agoEnable 64-bit support in libs/gui/Sensor.cpp
Byron Gardner [Mon, 3 Nov 2014 23:54:28 +0000 (15:54 -0800)]
Enable 64-bit support in libs/gui/Sensor.cpp

Change-Id: Iaaa112bd821a6a0e3234461df8f7b6acc47b254e
Orig-Change-Id: I04c22e6f2c6f4271ca451b775c8d7f86e4c97c38
Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-9998
Category: aosp improvement
Domain: SENSORS.VIRT-Common
Origin: internal
Upstream-Candidate: yes
Signed-off-by: Byron Gardner <byron.gardner@intel.com>
Reviewed-on: https://android.intel.com:443/296325

7 years agoSurfaceFlinger: disable VSync thread if no clients requiring.
Wang, Yue A [Tue, 21 Jan 2014 09:42:13 +0000 (17:42 +0800)]
SurfaceFlinger: disable VSync thread if no clients requiring.

In EventThread, 2 VSYNCs are needed to do composition and update
the client status. So, a 30FPS video may leads to 60FPS VSYNC,
which means the DispSync thread would be waked 60FPS. This is a
unexpected behavior which takes more power consumption. Now we
update the SF status soon after the first VSYNC, which means no
extra VSYNC needed, and the DispSync could be awaked as expected,
and consequently power get saved.

Change-Id: If486eb9b87f109a71f71b510768f15dd733f1233
Orig-Change-Id: I1d3b166021e15a81b2ad770b039761fc2c15fddf
Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-12211
Category: aosp improvement
Domain: Graphics-SF
Origin: internal
Upstream-Candidate: yes
Signed-off-by: Wang, Yue A <yue.a.wang@intel.com>
Reviewed-on: https://android.intel.com:443/238344

7 years agoSet PS2 Keyboard controller as not a ketboard type
juntingwang [Fri, 1 Mar 2013 08:02:56 +0000 (16:02 +0800)]
Set PS2 Keyboard controller as not a ketboard type

The Eventhub detects the platforms built-in PS/2 keyboard controller
as a physical keyboard. So the system will not display the software
keyboard by default. Modify it device type in Keyboard-less tablets,
so that ActivityManager will not ignore the PS/2 controller.

Issue: AXIA-1875

Change-Id: Ia5b7592e82aaf1970066bab5e9ca5f46ac83ab1c
Signed-off-by: juntingwang <Junting.Wang@windriver.com>
7 years agobinder: Fix service initialization race vs. service manager
Andy Ross [Tue, 19 Feb 2013 22:39:34 +0000 (14:39 -0800)]
binder: Fix service initialization race vs. service manager

The framework relies on the global IServiceManager running before a
BinderService object is instantiated.  But there was no detection of
the error condition when it was not (specifically: mediaserver can be
initialized before system_server), and in fact the default error
behavior (kill the proxy object) ensured that the process would never
be able to add services again.  Retry the addService() code, and allow
transient binder failures for the special case of the service manager
proxy.

Issue: AXIA-1706
Change-Id: Icac10bb0f47a2fe33ac9605a13633b83afa3ebff
Signed-off-by: Andy Ross <andy.ross@windriver.com>
7 years agoPrevent EventHub from adding input device twice
Daniel Leung [Thu, 13 Sep 2012 20:43:41 +0000 (13:43 -0700)]
Prevent EventHub from adding input device twice

When Android first starts up, it scans /dev/input for input devices.
In some rare instances, the EventHub gets another notification that
some device nodes are created. It then proceeds to add the same
input device again. This causes the system to get two events per
touch or key stroke.

This adds a check to prevent adding the same device if the operation
is triggerd by inotify.

Issue: AXIA-858
Change-Id: I68b02594f1c7f14067611735db0b3763378ec7ea
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
7 years agoegl_extensions: remove force of extension not supported
Daniel Charles [Fri, 13 Jul 2012 23:11:49 +0000 (16:11 -0700)]
egl_extensions: remove force of extension not supported

This problem was introduced by commit 48d438d05f14c.

When the extension GL_EXT_debug_marker is not supported by h/w
the dummy version is used already. Whenever the h/w is ready
to support the extension it will show up and be used by the
OpenGLRenderer.

Change-Id: Iddb58859b187d872a9a3a2986d30f24b8f83e76b
Signed-off-by: Daniel Charles <daniel.charles@intel.com>
7 years agoPre-test native window pointer for validity
Paul Drews [Wed, 18 Jan 2012 19:01:49 +0000 (11:01 -0800)]
Pre-test native window pointer for validity

This fixes a segfault in the oglconform tests when running
the test:

  adb shell /data/app/oglconform -v 4 -minFmt -es -test egl-basic negative.drawables.winSurfBadWin

According the the egl specification this should return
EGL_BAD_NATIVE_WINDOW.  The segfault was resulting from the
fact that the window handle is a (cast to opaque) pointer,
and there are not straightforward ways of pre-testing a
pointer for validity.  The fix implemented here is:

  () Take advantage of the msync() system-call logic to test
     pre-test basic pointer validity
  () Once confirmed that we can reference through the
     pointer, look for the "magic" value dropped in by the
     implementation to mark this type at runtime.

Change-Id: Id7d21c822c8a416e45caba25c63d7076d1e547a5
Original-Change-Id: I3c8df8ef5ece5c0fa71c47417766b5453c355f8b
Signed-off-by: Russell Webb <russell.webb@intel.com>
Signed-off-by: Paul Drews <paul.drews@intel.com>
7 years agoegl: Add NULL check for eglGetconfigs num_config parameter
Pauli Nieminen [Wed, 4 Jan 2012 14:25:10 +0000 (16:25 +0200)]
egl: Add NULL check for eglGetconfigs num_config parameter

EGL 1.4 specification says in 3.4.1:
"An EGL_BAD_PARAMETER error is generated if num config is NULL."

We have to check for the condition and return the required error to
application.

Change-Id: Ib42709f0420161ce661536394d4c0779bc62be57
Original-Change-Id: I4fe670c4362f4ae494f91d69ae105e29ccf3c769
Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
7 years agoFix build problem when including hal and egl to same c file
Pauli Nieminen [Tue, 15 Nov 2011 18:33:05 +0000 (20:33 +0200)]
Fix build problem when including hal and egl to same c file

If including hal and egl headers to same c file compilation files
because ANativeWindow type is defined in two headers. In HC egl didn't
include system/core/include/system/window.h which hid the type conflict.

Change-Id: Icaf7b29f913f3d7fa8f6d70bb196585d22e7d05c
Original-Change-Id: Icd37329d80fb4e8b9baf9015c9b00e43ebc4f76b
Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
7 years agoInputReader: add 5-point calibration
Chih-Wei Huang [Sat, 1 Nov 2014 17:21:12 +0000 (01:21 +0800)]
InputReader: add 5-point calibration

Updated for Android 5.0.

7 years agoauto determine the density if not provided in surfaceflinger
Chih-Wei Huang [Sun, 26 Oct 2014 07:39:53 +0000 (15:39 +0800)]
auto determine the density if not provided in surfaceflinger

We hope to support tablet UI for different resolutions.
So adjust the density according to the resolution.

7 years agoSurfaceFlinger: enable console management
Chih-Wei Huang [Sun, 26 Oct 2014 07:38:15 +0000 (15:38 +0800)]
SurfaceFlinger: enable console management

The console management was removed since ICS. But it's useful for debugging.
Re-implement it based on the original class ConsoleManagerThread of class
DisplayHardwareBase.