194 Commits

Author SHA1 Message Date
Seigo Nonaka
ff55115121 Reorganize font enumeration API.
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
  This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
2017-04-03 13:55:07 -07:00
Andreas Gampe
41aa8e807d Frameworks: Re-add tagsoup to preloaded-classes
Too many third-party apps still rely on this transitively, and
static initialization is expensive.

Bug: 34890992
Bug: 35395100
Test: m
Test: Device boots
Change-Id: If5e2474ff11f34d7be5633793bc7f591cbe5ccf3
2017-02-17 10:15:41 -08:00
Andreas Gampe
0db10fd0bb Framework: Preloaded-classes tuning
Run the regular use case study.

Bug: 34890992
Test: m
Test: Device boots
Change-Id: I8387b3b09713bd3a031073c14109393a2583c764
2017-02-01 22:19:52 -08:00
Ashutosh Joshi
f1d9a7e6e4 Merge "Remove AR packages from preloaded classes." 2017-01-23 21:03:01 +00:00
Clara Bayarri
04d72abde1 Expose fonts.xml via public API with a service
This change creates a new FontManagerService, in charge of providing
font management data. It exposes a public API to retrieve the
information in fonts.xml without accessing it directly. To do this,
it also refactors FontListParser's internal classes into a new public
FontConfig class holding all the font data.

getSystemFonts() returns all the available information in fonts.xml
as well as file descriptors for all the fonts. This allows us to
share the memory consumed by these files between all clients.

Bug: 34190490
Test: See attached CTS change in topic
Change-Id: I0e922f8bcc9a197a1988d04071eb485328d66fb7
2017-01-23 15:02:23 +00:00
Ashutosh Joshi
b66fe64c22 Remove AR packages from preloaded classes.
Technically, they were commented out, this change removes them.
The AR HAL is deprecated, the framework does not load the HAL
anymore.

Bug: 21935130
Bug: 29094458

Test: Build and boot.
Change-Id: I304a0eebbc9d1a1eed7c21db365adb40051941c4
2017-01-20 15:47:31 -08:00
Ashutosh Joshi
420e45e9cb Move ContextHubService to a better location.
Move ContextHub service from system core to a more appropriate place
for a service.

Test: GTS tests pass.

Change-Id: Ie0f25414fc472a0214c0dd94e7ad4564cd38f842
2016-12-21 11:33:28 -08:00
Sudheer Shanka
78b1ea884e Update IActivityManager, ContentProviderHolder in preloaded-classes.
Bug: 30977067
Test: N/A
Change-Id: I42eb1f014a6784eeea71da6646fa958e39c129ea
2016-12-06 16:36:58 -08:00
Sudheer Shanka
2250d56a0b Rename MountService to StorageManagerService.
Bug: 30977067
Test: Existing tests pass
Change-Id: Ieac0f11c2b249dcd60441b14c1f391e6f8131d42
2016-11-15 12:43:37 -08:00
Sudheer Shanka
dc589ac82b Update usage of ActivityManagerNative.
- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
      adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
          -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
2016-11-14 11:27:12 -08:00
Sudheer Shanka
ea8e738b3e Remove ApplicationThreadNative from preloaded/compiled-classes.
And add IApplicationThread$Stub and IApplicationThread$Stub$Proxy.

Bug: 30977067
Test: N/A
Change-Id: I86f9517ac25bf68320e94524c617b101e5bbb80c
2016-10-27 18:19:45 -07:00
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
John Reck
aa67f684ff Fix a bunch of repeated reads of a ro.* property
SystemProperties.get() is not particularly fast,
especially if a string is returned. Since ro.* values
are unable to be changed, there's no need to
continously re-query them. Cache the value at
static init time to trivially fix this.

Test: refactoring CL.
Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
2016-09-21 16:10:54 -07:00
Tobias Thierer
8431c55fb8 Merge "Ensure apps cannot prevent uncaught exceptions being logged."
am: f61a449ee9

Change-Id: I826c175547a73123cd438ebe6991efee39a433d0
2016-08-09 09:02:27 +00:00
Tobias Thierer
addbf9015a Ensure apps cannot prevent uncaught exceptions being logged.
Let RuntimeInit use an UncaughtExceptionPreHandler to log an exception
rather than relying on UncaughtHandler, which apps can replace. This
makes it easier to diagnose application death, especially during app
compatibility testing for a new version of Android.

Test: Verified manually, with the help of a small sample app (not
checked in), that stacktraces for RuntimeExceptions thrown on main
or background threads are logged even when the app set a default
UncaughtExceptionHandler that swallows the exception with no action.

Note that such an inappropriate UncaughtExceptionHandler will still
cause threads to die without the app being killed, which it should be.
In an exception then happens on the main thread, the app will freeze
until the ANR dialog kicks in after a few seconds. I have manually
verified that this behavior is unchanged from before this CL.

No new integration tests are included because the default system
behavior has not changed.

Bug: 29624607
Change-Id: Ie87377b0bcadc3ba4083a8ab1bedb8f3dd95a4bd
2016-08-08 17:59:28 +01:00
Andreas Gampe
cbcb9e3ec6 Frameworks/base: Update preloaded-classes
Another update.

Bug: 27248115
Change-Id: Ie0c3b8624a0f43c400a71759c176c02c56d270af
2016-06-06 14:58:44 -07:00
Andreas Gampe
52764cba59 Frameworks/base: Add holder to BaseBundle
Move EMPTY_PARCEL into an inner holder class. Add holder to
preloaded-classes. Clean up dependencies.

Allows to compile-time initialize:
* android.os.BaseBundle
* android.os.Bundle
* android.os.PersistableBundle
* android.telephony.CarrierConfigManager

Bug: 27265238
Change-Id: Ib8017aa419c2985963b3c68a8046462a38652ef2
2016-04-19 20:46:43 -07:00
Andreas Gampe
859e278fcc Frameworks/base: Update preloaded-classes
Bug: 27248115
Change-Id: Ib7d73b3e24dd71ae1cc8c245bdc953dea6136486
2016-04-12 02:41:18 +00:00
Doris Liu
28cfd20f02 Support running AVD on UI thread
By default, AVD animates on RT thread. But since in some cases there's a
need for a finer control on when the frame update for the animation should
happen, such as coordiating the AVD animation with other animations that
run on UI thread, we are providing a way to force the AVD to run on UI
thread.

Bug: 27278616
Change-Id: I372ecd3dc52e3fa0bdce3a1e9c19443f9b199027
2016-02-23 14:40:47 -08:00
Andreas Gampe
571fc303a9 Frameworks/base: Preloaded classes for N
Update the preloaded-classes list for Android N.

Bug: 27248115
Change-Id: Iaf726fa318a4495a5af57d2845a427095bc5f831
2016-02-18 17:29:35 -08:00
Przemyslaw Szczepaniak
d5f0eb0c84 Remove merge markers from preloaded-classes
(cherry picked from commit b0868054720a05d9e6d8ef6ee7e4c8c2d176f456)

Change-Id: Ieb1953e33dab7f852740872af110a938eb5c1ca4
2015-12-22 13:10:55 +00:00
Przemyslaw Szczepaniak
6a8ad6d161 Move StrictJarFile from libcore to framework
Bug: 25337946

(cherry picked from commit 8a7c1606d88873c5a1b5764c16cb046b6f2275b2)

Change-Id: I1bfce4129887d7cbfc02d92641b44920d7cdbbee
2015-12-22 13:10:55 +00:00
Przemyslaw Szczepaniak
bb02b6704d Stop preloading fortress classes
(cherry picked from commit f1e520169309f1303d4383298dd5644df59efe4b)

Change-Id: I4fd13c4dc373482c1235b54746fdf7f029a80dc2
2015-12-22 13:10:55 +00:00
Przemyslaw Szczepaniak
b086805472 Remove merge markers from preloaded-classes
Change-Id: I8267fc4cd41868f406e32a64ee750c0e5ca6098d
2015-12-02 11:32:22 +00:00
Przemyslaw Szczepaniak
8a7c1606d8 Move StrictJarFile from libcore to framework
Bug: 25337946
Change-Id: Ib4fac6fa9f534b8654e5ca158bbaedb2393772ba
(cherrypicked from 43ea2cc2a81926a6b2ca13d41f4eab089640129e)
2015-11-27 15:33:15 +00:00
Przemyslaw Szczepaniak
f1e5201693 Stop preloading fortress classes
(cherry-picked from 90d8781876643dc730aecee20f34dbe9e695653c)

Change-Id: If184fe9e40ba4c21fdb05d38c2975abfb4d0410b
2015-11-20 15:42:51 +00:00
Chad Brubaker
78d4712f27 Install the Network Security Config Provider
The provider is installed early in ActivityThread to ensure that no
TLS objects are created in the application before the provider is
installed.

Change-Id: I5f77addfa75a4ee19301de54e01507d8dca33657
2015-11-18 14:48:29 -08:00
Roozbeh Pournader
112d9c7f11 Remove EmojiFactory and its mentions from frameworks.
Bug: 18134313
Bug: 20158206
Change-Id: If46cdbd9d558e6592280b2b95f00b87d04de70a2
2015-08-07 12:57:01 -07:00
Andreas Gampe
61e7b66bc2 Frameworks/base: Update preloaded-classes
Update for Android M release.

Bug: 21760614
Change-Id: Ib1b1ac60da894ad4a4b6b7db37d8930b0d2b9046
2015-06-18 20:35:10 -07:00
Alex Klyubin
dcdaf87ed0 Move Android Keystore impl to android.security.keystore.
This moves the non-public API classes backing Android Keystore from
android.security to android.security.keystore, a package specially
created for Android Keystore.

Bug: 18088752
Change-Id: Ibf04d6a26c54d310b0501fc5e34f37b1176324ad
2015-05-13 16:17:40 -07:00
Alex Klyubin
4812563f68 AndroidKeyStore keys should not be handled by Bouncy Castle.
Bouncy Castle JCA provider incorrectly declares that its Cipher, Mac,
Signature, and KeyAgreement implementations accept arbitrary keys (
including AndroidKeyStore keys). As a result, when a Cipher, Mac,
Signature, or KeyAgreement instance is requested from JCA without
explicitly specifying the provider (which follows best practices)
and then initialied with an AndroidKeyStore key, JCA chooses the
BouncyCastle's implementation, which in turn blows up because it
can't handle such keys.

The workaround is to install Cipher, Mac, Signature, and
KeyAgreement implementations backed by AndroidKeyStore as a
higher-priority JCA provider than the Bouncy Castle one. This is
achieved by splitting out the above implementations from
AndroidKeyStoreProvider into AndroidKeyStoreBCWorkaroundProvider
and installing the AndroidKeyStoreProvider at the usual priority
(below Bouncy Castle) and the AndroidKeyStoreBCWorkaroundProvider
at above Bouncy Castle priority.

Bug: 20691708
Change-Id: I336464f4a49bc30c6845ddc4e84b07f4105424dd
2015-04-29 13:28:56 -07:00
Fyodor Kupolov
946646e4b9 Added SystemServiceRegistry to preloaded-classes
SystemServiceRegistry class should be preloaded in the zygote.

Bug: 20559324
Change-Id: I3120c7e42b50c54213513a04d7135d745c8abd7c
2015-04-24 13:34:00 -07:00
Neil Fuller
dad03bf185 am a921fa0f: am ff1e7e01: am 0e29681f: Merge "Load ICU4J data on boot"
* commit 'a921fa0fc354fed48d29822109c573a124a95dfd':
  Load ICU4J data on boot
2015-04-24 11:11:14 +00:00
Neil Fuller
9f7cd10134 Load ICU4J data on boot
Bug: 20252074
Bug: 20396452
Change-Id: I17de761e0d81caa2fc280b5cc368ee6113a5d655
2015-04-23 14:50:34 +01:00
Chet Haase
575217fc3d Make ActionBar animations work correctly
Previous ActionBar animations didn't handle configuration changes
or other situations in which the view would get detached. listeners
would stay on the view and would attempt to do something nonsensical
in the new window. This new approach removes listeners on window
detach to avoid this problem.

Issue #20125407 Settings Crashes when changing orientation of device

Change-Id: I0b3bbd0f6fc23cdb4cbd646b0d2772d72d3d795d
2015-04-14 14:09:26 +00:00
Alex Klyubin
6def5afcbc Load fewer classes when AndroidKeyStore provider is installed.
This avoids loading all AndroidKeyStore crypto SPI classes when the
AndroidKeyStore provider is instantiated and installed. This provider
is installed early on during the initialization of each app. Most apps
don't need these classes loaded.

Bug: 18088752
Change-Id: Ib43c9dd6a7d434b128916e0f9c8652ba61df0d47
2015-04-03 12:45:16 -07:00
Brian Carlstrom
0b36620014 Manually add SignalStrength to preloaded-classes
Bug: 19323020
Change-Id: I61e9d2dd5d06fe2353da17e5646f259122e5ea98
2015-03-04 21:56:26 -08:00
Alex Klyubin
f162066db5 Remove DefaultHostnameVerifier from preloaded-classes.
libcore's DefaultHostnameVerifier no longer exists. See
https://android-review.googlesource.com/#/c/117453/.

Bug: 18481199
Change-Id: I5c07e058aaaf8531d420058cfd104c4e751757a3
2014-12-04 09:41:46 -08:00
Andreas Gampe
dcad4caa84 Revert "Revert "Frameworks/base: Update to preloaded-classes""
This reverts commit 16626a7ee9f18c70b2f6437b4ab85753dbbb2263.

Remove three classes that break Shamu booting.

Bug: 17480683
Bug: 17791590
Change-Id: Ic487c5344d4186ea5205f117f07ca3ab7d945fb7
2014-10-02 19:05:44 -07:00
Andreas Gampe
16626a7ee9 Revert "Frameworks/base: Update to preloaded-classes"
Breaks shamu for unknown reason.

This reverts commit da3050614fc9dc31d39ff87ae5df0261fb76f93c.

Bug: 17480683
Change-Id: Id10ff18ef6e3acb5eb84196f7e5608add7edeb66
2014-10-02 08:45:09 +00:00
Andreas Gampe
da3050614f Frameworks/base: Update to preloaded-classes
Bug: 17480683
Change-Id: I06d2a64d2f9544cac0f5940cb9129cd5668740ba
2014-09-29 08:14:54 -07:00
Torne (Richard Coles)
b5de924fad Remove WebView library preloading mechanism.
We don't want to preload the WebView library in the zygote process any
more, as loading an updatable WebView in the zygote is a stability risk.
The memory benefits of preloading will be obtained in other ways.

Bug: 13005501
Change-Id: Ic89f2a1d057dc92b01fb775bf326b47ac2d4caa2
2014-07-17 09:18:43 -07:00
Lajos Molnar
e0e77cb5bb Remove VideoEditor
remove android.media.videoeditor.*

No longer supported and should not be used.

Bug: 13542518
Change-Id: I12de122443f0289ab1dfdd8b553e572a830cf412
2014-04-21 16:11:51 -07:00
Mike Lockwood
54d3bcfdf5 Remove non-existent classes from preloaded-classes
Change-Id: I0f86f7ab2ef132fbd12f85ff96e448d189af7177
2014-02-27 13:51:00 -08:00
Kenny Root
faa1057d4c am aa6ff54e: am 85ee57d1: am c064a1b5: Merge "Remove DRLCertFactory"
* commit 'aa6ff54ef57936024e98d9f565afe9fff24df2e4':
  Remove DRLCertFactory
2014-01-31 23:07:24 +00:00
Kenny Root
4f2323106b Remove DRLCertFactory
No longer needed since Conscrypt is the main provider.

Change-Id: Iee741ef376af2de52db79df07e96057438778bc6
2014-01-31 14:10:15 -08:00
Chris Craik
5438979e49 Move GLES20DisplayList functionality into DisplayList
Removes unneeded indirection layer

Change-Id: I75d3e369eda2788cbc52a3575c4e1c521e842f59
2013-12-20 13:53:50 -08:00
Kenny Root
e6585b32ea Use java.util.Objects instead on internal API
Not needed since java.util.Objects implements all the needed
functionality.

Change-Id: Icd31d49a9801d1705427f028e9ac927d58e7d34c
2013-12-13 13:40:30 -08:00
Kenny Root
e1263de835 Add GCMParameterSpec to preloaded-classes
Needed for Bouncycastle 1.50 upgrade with art.

Change-Id: I901122c1ce21abba437a7537e70331724c3cbc9c
2013-12-13 00:40:00 +00:00
Kenny Root
53bcf2264c preloaded-classes: remove some OpenSSLCipher modes
Some cipher modes were removed from OpenSSLCipher. This change removes
those classes from the preloaded classes list.

Change-Id: Ib4450c392513973836684b4d5df7fffb200b6260
2013-12-09 14:03:02 -08:00