14007 Commits

Author SHA1 Message Date
Romain Guy
253f2c213f Linear blending, step 1
NOTE: Linear blending is currently disabled in this CL as the
      feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
  or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
  colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
  to disable linear blending. This is only for GLES 2.0 GPUs
  with no hardware sRGB support. This flag is currently assumed
  to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
  This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
  why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
  of the source pixel. The asumption is that a bright pixel will be
  blended on a dark background and the other way around. The source
  alpha is gamma corrected to thicken dark on bright and thin
  bright on dark to match the intended design of fonts. This also
  matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
  could not be sampled in sRGB without a yet-to-be-defined GL
  extension
- The last column of color matrices is converted to linear space
  because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
2016-10-11 17:47:58 -07:00
TreeHugger Robot
4c4368e813 Merge "Update ClipboardService to extend SystemService." 2016-09-30 21:22:02 +00:00
Sudheer Shanka
ad70bc6c31 Update ClipboardService to extend SystemService.
Test: Existing tests still passing.
      cts-tradefed run singleCommand cts-dev --module CtsTextTestCases -t android.text.cts.ClipboardManagerTest
      cts-tradefed run singleCommand cts-dev --module CtsContentTestCases -t android.content.cts.ClipboardManagerTest
      cts-tradefed run singleCommand cts-dev --module CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testCrossProfileCopyPaste
Change-Id: Ibca156a412219f11a53f2a9250954b30b650b1aa
2016-09-30 12:17:37 -07:00
Sudheer Shanka
28537b6ae9 Don't limit RetailDemoModeService to start only during demo mode.
- Update RetailDemoModeService to not do anything outside demo mode.
- Add am command get-started-user-state which is needed for cts tests.
- Update unit tests for RetailDemoModeService.

Bug: 31342350
Test: adb shell am instrument -e class com.android.server.retaildemo.RetailDemoModeServiceTest -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: Idf50512facd27d47d7111e75cbc2f7b260f49740
2016-09-30 10:29:26 -07:00
Vitalii Tomkiv
3be72a7f0a Merge "Fix traceEnd call for KeyAttestationApplicationIdProviderService phase in System Server." 2016-09-26 21:24:19 +00:00
Selim Cinek
2cae5760c6 Added Emergency affordance feature am: 705442fa7d am: 0e1f78da65
am: 10691456b8

Change-Id: Ieb3a0da5d5693a186c92ab1c21ba189558207ae3
2016-09-26 08:46:30 +00:00
Andreas Gampe
0dd895901e resolve merge conflicts of b8fdf0a to master
Change-Id: Iee1e2229317084563d22a5cfc6e3a17ccc612bb1
2016-09-25 13:51:50 -07:00
Hugo Benichi
8389d6f0e1 New IpConnectivityMetrics service am: eab511b582 am: 3a353a2044
am: 0daeac5dd4

Change-Id: Id08f9c8426780578c0edde7a69cf118fac232177
2016-09-25 20:09:46 +00:00
Selim Cinek
10691456b8 Added Emergency affordance feature am: 705442fa7d
am: 0e1f78da65

Change-Id: I6f8220b18bce7889e3b9efe1b075a680a0ae7187
2016-09-23 22:12:33 +00:00
Selim Cinek
0e1f78da65 Added Emergency affordance feature
am: 705442fa7d

Change-Id: I03ebb84119f9cb310882ba9ea90ee1e1d7118d03
2016-09-23 22:00:42 +00:00
Vitalii Tomkiv
ca68aca2b7 Fix traceEnd call for KeyAttestationApplicationIdProviderService phase
in System Server.

Change code to use traceEnd() instead
Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER); to generate accurate
measurements.

Test: 1-line change. 0-risk change.
bug: 31654120
Change-Id: I24d1468ccf934dbe912822996174eb780a46994c
2016-09-23 11:01:41 -07:00
Ivan Podogov
b8fdf0aa16 Add property to disable camera service proxy.
am: 8adaec07f0

Change-Id: I9477a39ae23c346437f9eb37bd0bbeaf946dbbd4
2016-09-23 11:10:22 +00:00
Ivan Podogov
fa10c2869b Merge "Add property to disable camera service proxy." into cw-f-dev 2016-09-23 11:04:09 +00:00
Hugo Benichi
0daeac5dd4 New IpConnectivityMetrics service am: eab511b582
am: 3a353a2044

Change-Id: I5cf485edd3ab1ebb81a2a9d35dfb8bd6d8bcc305
2016-09-23 03:54:06 +00:00
Hugo Benichi
3a353a2044 New IpConnectivityMetrics service
am: eab511b582

Change-Id: Iad65f10f079be13570e1f687dacb30f4f657a163
2016-09-23 03:49:04 +00:00
Selim Cinek
705442fa7d Added Emergency affordance feature
Added a service that listens whether emergency affordances
are necessary.

If the they are needed, it adds an option to the
global actions dialog that directly launches the
emergency call and also adds a long-press listener
to the keyguard emergency button.

Test: adb shell settings put global force_emergency_affordance 1 && adb shell settings put global emergency_affordance_number 111112
Fixes: 30404490
Change-Id: Ib96a15da2ef4b568a8d77140ebca6aa6f20f5ddb
2016-09-22 12:25:57 -07:00
Hugo Benichi
eab511b582 New IpConnectivityMetrics service
This patch defines a new metrics service for IpConnectivity events
defined in android.net.metrics, separate from currently existing
MetricsLoggerService.

Similarly to MetricsLoggerService, the new service has an event buffer.
It also implements a dumpsys interface that can be used to flush events
and output a serialized proto.

Bug: 31254800
Change-Id: I0c3faeb4008b283f85d9ba9460371fa68956ea3b
2016-09-22 22:25:27 +09:00
Ivan Podogov
8adaec07f0 Add property to disable camera service proxy.
This service proxy (together with the native server) are not needed on
Android Wear, as we don't have any watches with cameras.

Bug: 28560707
Change-Id: Ie4a830a3ba48c90d3e968fc5cdf57ccafcc1f5d8
2016-09-22 09:59:05 +01:00
Svetoslav Ganov
8b6456bc88 Merge "Move device serial behing a permission" 2016-09-21 03:32:47 +00:00
Wei Liu
03d0a367cf resolve merge conflicts of 82d5fc1 to master
Test: device boots

Change-Id: I78e5667577e413763b6be3b06a2feda99ef0d739
2016-09-20 10:25:51 -07:00
Wei Liu
82d5fc17b5 Make VrManager service optional.
am: ef89d21a1b

Change-Id: Ia0a194d34b19ca89e5acdb110a87479187fa4d85
2016-09-20 01:01:18 +00:00
Wei Liu
ef89d21a1b Make VrManager service optional.
b/31244699

Change-Id: I7d276e6945f19b575f880df16f140b84b03052a9
2016-09-19 15:18:53 -07:00
Colin Cross
7af8c2a8b9 resolve merge conflicts of 15de376 to master
Change-Id: Id76c6ef0a592fde8ee0f6fef0d1e9352aa21c9fe
2016-09-12 21:12:49 -07:00
Svet Ganov
37e43275ee Move device serial behing a permission
Build serial is non-user resettable freely available deivice
identifier. It can be used by ad-netowrks to track the user
across apps which violates the user's privacy.

This change deprecates Build.SERIAL and adds a new Build.getSerial()
API which requires holding the read_phone_state permission.
The Build.SERIAL value is set to "undefined" for apps targeting
high enough SDK and for legacy app the value is still available.

bug:31402365

Change-Id: Iddd13430b2bd1d9ab4966e31038ecabdbdcec06d
2016-09-11 18:44:38 +00:00
Wei Liu
15de376b90 Make consumer_ir an optional service.
am: 09de41950c

Change-Id: Idf3f97ed6615b130318442c81fed74cb4eefce59
2016-09-09 17:32:35 +00:00
Wei Liu
09de41950c Make consumer_ir an optional service.
b/31244699

Change-Id: Id851b0139d476a829097399374bb196cbfe96cf0
2016-09-07 13:33:49 -07:00
TreeHugger Robot
357773aa62 Merge "Add KeyAttestationApplicationIdProviderService to SystemServer" 2016-08-29 16:18:51 +00:00
Vitalii Tomkiv
4887e67c0b Add granular profiling to every SystemServer step.
In attempt to speed up Android Boot time we need better understand parts
that are taking long time during boot phase. SystemServer accounts to
~30-40% of boot time, so profiling and monitoring it should help
identify problematic parts.

Along with systrace logcat messages were added to simplify on the glance
check of boot process timing without the need to collect systrace.

Change-Id: Ice203eb3e6aa662d1a7cefc8bcd76f372347f4a0
2016-08-25 13:11:04 -07:00
Jeff Sharkey
d79d203b35 Bring back wtf() for missing services.
Publish DropBox extremely early during boot process so that it can
pick up wtf() calls while booting.

Bug: 28634953
Change-Id: Ie71d53fc125ebc47fa08ef59a8b7e4f66f2e805c
2016-08-23 15:19:18 -06:00
Felipe Leme
bb10d26ba6 Removed screen on/off callbacks from NPMS. am: f8dd7b4e8d
am: 6a3706a08c

Change-Id: I025326d7b89a60920c0db3aa6e363541974cd204
2016-08-19 23:01:27 +00:00
Janis Danisevskis
8ff1e193ac Add KeyAttestationApplicationIdProviderService to SystemServer
Add getKeyAttestationApplicationId and the Parcelables
KeyAttestationPackageInfo and KeyAttestationApplicationId,
needed by keystore.

Bug: 22914603
Change-Id: I89a88cd9cd80e9b132ca67fc452e9cae8b8ad241
2016-08-19 13:50:55 +01:00
Felipe Leme
f8dd7b4e8d Removed screen on/off callbacks from NPMS.
NetworkPolicyManagerService (NPMS) used to depend on screen on/off
changes to determine if a foreground activity should have network
restrictions, but such check is now redundant since ActivityManager
already changes the proper UID state (like going from TOP to
TOP_SLEEPING) when the screen status is changed.

Removing such code decreases the NPMS lock contention when the screen is
turned on in about 3-5ms.

Change-Id: I2853443efedbf14961ae9a5b2e72689d4d1a646c
BUG: 30785671
(cherry picked from commit 88f40ad9a721ee30708be82f66fb58c64f1d36b5)
2016-08-18 09:57:11 -07:00
Jeff Sharkey
4d24cfe6ce Merge "Fix bugs around manager fetching." 2016-08-11 18:52:44 +00:00
Felipe Leme
88f40ad9a7 Removed screen on/off callbacks from NPMS.
NetworkPolicyManagerService (NPMS) used to depend on screen on/off
changes to determine if a foreground activity should have network
restrictions, but such check is now redundant since ActivityManager
already changes the proper UID state (like going from TOP to
TOP_SLEEPING) when the screen status is changed.

Removing such code decreases the NPMS lock contention when the screen is
turned on in about 3-5ms.

Change-Id: I2853443efedbf14961ae9a5b2e72689d4d1a646c
BUG: 30785671
2016-08-11 16:43:54 +00:00
Jeff Sharkey
73ea0ae15f Fix bugs around manager fetching.
A recent patch started returning "null" when a Binder service
required to provide a manager wasn't yet registered.

This fixes four locations where that new logging was triggered: in
two cases by adjusting the fetching ordering, and in two other cases
by only fetching when the device supports the manager.

Bug: 28634953
Change-Id: I84dbccffa4ac760c10a2bbcb234f21272bfecb91
2016-08-11 09:44:34 -06:00
joonyoung.cho
19acc9023a Merge "fix safeMode status in AppWidgetService" am: 78a72f0698 am: cbd4ad1f7e am: 5a3034f8ff
am: 2f51366c1a

Change-Id: I64ed50a3f2d6fa20650c047bda0da1ad0cd292f4
2016-08-08 22:25:20 +00:00
joonyoung.cho
2f51366c1a Merge "fix safeMode status in AppWidgetService" am: 78a72f0698 am: cbd4ad1f7e
am: 5a3034f8ff

Change-Id: Iaefa29636ecc0367c3ad40d06a5e2099c9e506f4
2016-08-08 22:14:43 +00:00
joonyoung.cho
cbd4ad1f7e Merge "fix safeMode status in AppWidgetService"
am: 78a72f0698

Change-Id: I21559690f6371102cf48132d8930343923d60011
2016-08-08 21:53:34 +00:00
Treehugger Robot
78a72f0698 Merge "fix safeMode status in AppWidgetService" 2016-08-08 21:36:46 +00:00
Wale Ogunwale
b699ce0d06 Added foundation for supporting unit tests in WindowManager
- Check for null where appropriate when using WM from a test
- Inject WindowManagerPolicy for test can have its own policy
- Added skeleton for WindowStateTests that will contain tests
for WindowState class.

Bug: 30060889
Change-Id: I0cd7d50c98de16c7412759401075c4bb48d13dfe
2016-07-18 18:47:00 -07:00
Nancy Zheng
11b8f8a018 Merge \\"Add WearWifiMediatorService to SystemServer.\\" into nyc-mr1-dev am: 0171a6ef8b
am: 2885331cef

Change-Id: I207eac40616bd5b2e462cc6c2b108cef883c2a9b
2016-07-12 01:50:03 +00:00
Nancy Zheng
0171a6ef8b Merge "Add WearWifiMediatorService to SystemServer." into nyc-mr1-dev 2016-07-11 18:14:27 +00:00
Justin Klaassen
029c2f4e3f Merge \\"Add Night display feature\\" into nyc-mr1-dev am: 76262b8e14
am: 1228803cde

Change-Id: I855bf48a271b15f671957b1451caab24d08d8293
2016-07-08 21:46:23 +00:00
Nancy Zheng
f3d8b81d4b Add WearWifiMediatorService to SystemServer.
Bug: 28347905
Change-Id: I4218f908f83eb3a9fe3f75e5d6eaf312c652ba67
2016-07-08 12:55:48 -07:00
Justin Klaassen
911e88939c Add Night display feature
Bug: 28615069

Tints the display at night automatically according to your schedule or
using the sunrise/sunset corresponding to your current location.

Change-Id: Ie56b4eed88cc2fcbae88002492b1edad5820b6b1
2016-07-08 11:47:50 -07:00
Andreas Gampe
8f4731db63 Merge \\"Revert \\"Frameworks/base: Refactor UserHandle and Environment a bit\\"\\" into nyc-mr1-dev am: 56177bf81b
am: 5c1dc014ca

Change-Id: Ia51a5349ea826ca56ec0c5f8baf1c1afac7c6b81
2016-07-08 18:27:10 +00:00
Andreas Gampe
56177bf81b Merge "Revert "Frameworks/base: Refactor UserHandle and Environment a bit"" into nyc-mr1-dev 2016-07-08 18:09:54 +00:00
Andreas Gampe
d281b4204a Revert "Frameworks/base: Refactor UserHandle and Environment a bit"
Breaks monkey in root mode.

This reverts commit 6e16714c688ed9c52763696f5a5e7b90802a471b.

Bug: 29338430
Change-Id: I238f89dad77d7dcae6d02eccbda52eb9c6c6466c
2016-07-08 03:50:27 +00:00
Jeff Sharkey
5c1d5461c9 Merge \\"Remove \\"starting apps\\" boot message.\\" into nyc-mr1-dev am: bb2d9ab98e
am: cb2dce0352

Change-Id: Ieee93cccfb67ff3e9f28ed76813bc789208492db
2016-07-07 19:56:13 +00:00
TreeHugger Robot
bb2d9ab98e Merge "Remove "starting apps" boot message." into nyc-mr1-dev 2016-07-07 19:37:24 +00:00