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
This change adds support for static shared libraries that
emulate static linking allowing apps that statically link
against the same library version to share a common
implementation. A library is hosed by a package in a standard
APK.
Static shared libraries have a name and a version declared
by a dedicated manifest tag. A client uses also a new tag
to refer to the static library it uses by specifying the
lib name, version, and the hash of the signing certificate.
This allows two apps to rely on two different library versions
and prevents impersonation of the shared library by a side-loaded
app with the same package name.
Internally apps providing static libs use synthetic package
name generated from the manifest package name and the library
version. This allows having different "versions" of the same
package installed at the same time.
An application cannot be installed if a static shared lib it
depends on is missing. A used shared library cannot be uninstalled.
Shared libraries can rotate certificates like normal apps. The
versions of these libs should be ordered similarly to the version
codes of the hosting package. Such libs cannot use shared user
id, cannot be ephemeral, cannot declare other libraries, cannot
rename their package, cannot declare child-packages. They must
target O SDK. Also they cannot be suspended or hidden or their
uninstall blocked. Generally, speaking policy regarding code in
static shared libs should be applied to the packages using the
library as it could have just statically linked the code.
We now have APIs to query information about the shared libraries
on the device in general. To clients static shared libraries are
presented as multiple versions of the same package which is how
they are declared and published. Therefore, one can have two
versions of the same package which means we need way to query
for and uninstall a specific version of a package. Also static
shared libs can depend on other static shared libs which are
versioned packages. To ease representation we add the concept
of a versioned package which should be used in the case of
static shared libs.
A client can see only the static shared libs it depends on and
more specifically only the versions it depends would be retrieved
by using the standard package manager APIs. There is a new
dedicated API to get info about all shared libraries which
would provide data about all static shared lib versions. Also
these libraries must use v2 signing scheme.
Test: CTS tests pass
bug:30974070
Change-Id: I4f3d537ee7a81f880950377b996e1d9d4813da5c
Reason: The changes that this CL depends on, had to be reverted.
This reverts commit 7a1cab2c9606ca5aab0f030c0022b864d5c05888.
Bug: 34378805
Change-Id: I6bd05082060199c1907743b9f72d4c2438371aa6
Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.
Apps with these properties are exempted from background restrictions:
- persistent process
- currently on the idle battery whitelist
- global whitelist for things like bluetooth services
Bug 30953212
Change-Id: Icc19b2fbc05f40dcf8c3fc4abf718c373dc8d4f6
Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.
Apps with these properties are exempted from background restrictions:
- persistent process
- currently on the idle battery whitelist
- global whitelist for things like bluetooth services
Bug 30953212
Change-Id: Ib444829a2d222125f64ff19e8218823fa78373f9
libandroidfw needs to make use of StringPiece, so
move it to libandroidfw and update all code referencing
StringPiece in aapt2.
Test: make libandroidfw_tests libaapt2_tests
Change-Id: I68d7f0fc7c651b048d9d1f5e7971f10ef5349fa1
Move all the render test utility methods to a separate class and leave
only tests in RenderTests class (old Main).
The idea is to improve the organization to allow to create a set of
performance tests and also to allow the tests to grow more structured.
Test: Just moved tests around
Change-Id: I3b773d0745700dd2a52f937b9b668a2d374b8686
And update the relevant golden files as the time in the status bar
is changed.
Test: Run layoutlib tests
Change-Id: I421b5495291f2d62091366bc0c066e77e0f3e107
* changes:
Add missing attributes to old themes
Fix plurals support in layoutlib
Do not log errors while loading string arrays
Hack to deal with android:pointerIcon in layoutlib
Force animateFirstValue to false
Avoid passing antialias when measuring scaled text
Catch all exceptions in NativeAllocationRegistry free
Because we always use the latest framework code, some resources might
fail to resolve when using old themes (they haven't been backported).
Since this is an artifact caused by us using always the latest code, we
check for some of those values and replace them here.
Bug: http://b.android.com/225105
Test: Included new testActivityOnOldTheme
Change-Id: Ia7a8a27fb81fe0b4a1e0c9610a2033a87720864d
Bug: http://b.android.com/213000
Test: Manually tested on Android Studio. Adding tests for this specific
case requires bringing a new sdk-common prebuilt to the the maintenance
branch so it's not really practical.
Change-Id: I0646aab656d5d5769355c6cc026e877b8784d173
When arrays contain references, if we can not resolve them, just return
the reference string. This matches the behaviour of resource resolution
in BridgeTypeArray.
Bug: http://b.android.com/228620
Test: Updates existing tests
Change-Id: Ia324f18d9128b8abf2ba676a83d4b424914e2c88
android:pointerIcon is a View attribute that can be an enum or a
reference. Layoutlib cannot easily deal with the way that is handled
in the platform. As the property would not have any impact on the
result in layoutlib, that property is bypassed.
Test: Main.testAllWidgets
Change-Id: I38c6c6df45c1836d44b4f80245a453fb432ea251
This CL forces both animateFirstValue and animateLayoutChanges to false
in themes when running layoutlib. This helps with the rendering of some
widgets so they do not rely on animations.
Test: Test as part of testActivity
Change-Id: Ic9214929d3582bc3e0a196d198cc4fb36347c782
This is a workaround for a JDK bug that crashes the VM when
measuring scaled antialsed text.
This disables antialiasing when measuring scaled text in a specific
version of the VM.
Bug: http://b.android.com/211659
Change-Id: I637ed03cf827b65c993550998ac55d42869237ad
The NativeAllocationRegistry delegate free calls might run in the
context of the finalizer thread. If a crash happens during the free
call, it might bring down the finalizer thread and the VM.
Bug: http://b.android.com/213927
Change-Id: I8d4b8ab5b8d0532aad46f27d039a943894e021a0
Test: Modified testScrolled to check the only-measure behaviour
Change-Id: Ie86c329e0f7d9135d53274977e24f431f5edc201
(cherry picked from commit 2d657bc344717281e470430b05adaa32fbd0af00)
Also add back script information for Yiddish old code (ji) that was
removed in ICU.
Bug: 26756576
Test: none
Change-Id: Ia785f86bf0407aeed6134ef9d44e504494256da2
This CL allows a reason to be specified when installing a package. The
install reason is a sticky piece of metadata: When a package is e.g.
installed via enterprise policy and an update is then manually
installed or sideloaded, the install reason will remain "policy."
The install reason is tracked separately for each user.
With this CL, two install reasons exist: "policy" and "unknown." Other
install reasons will likely be supported in the future.
Bug: 32692748
Bug: 33415829
Test: Tested manually with "adb install" / "adb uninstall"
Change-Id: I0c9b9e1b8eb666bb6962564f6efd97e41703cd86
Upcoming platform features need to cluster apps together into broad
categories to help summarize information to users. (For example,
when presenting battery, network, and disk usage.)
We are tightly limiting the set of categories to keep them easily
presentable to users when summarizing information. This feature is
not designed to be a general-purpose taxonomy, nor should it be
allowed to become one.
Older apps may not have defined a category in their manifests, so
allow the installing app to define a category on their behalf.
Test: builds, boots
Bug: 33815939
Change-Id: I785b882ee7c18072ef47d56e0fc19ad72888e1b7
Pass information about content insets of a snapshotted task to
SystemUI and use it there to correctly offset the snapshot
when drawing.
Test: Open app, go to recents, make sure app aligns before
and after the animation.
Bug: 31339431
Change-Id: I2ff9bd44534bd8f66b591385da1e1e3aec40b6c5
All this functionality is hidden behind a flag. If this flag is
active, we disable the regular screenshots.
Instead, we take a screenshot when an app transition for which a
task is disappearing is starting. The screenshot gets stored
into a gralloc buffer. SystemUI uses a new method to retrieve
a snapshot gralloc buffer and then draws it using GraphicBuffer.
createHardwareBitmap().
When starting an existing activity in an existing tasks, or when
bringing an existing tasks to front from recents, we add a new
snapshot starting window. For that, we reuse the existing
starting window, but when creating the window, we use a fake
window that draws the contents of the starting window.
Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotControllerTest
Bug: 31339431
Change-Id: If72df07b3e56f30413db5029d0887b8c9665aaf4
Recycler view gets the refresh rate of the display during its setup.
Implementing a Mode that returns a fake refresh rate.
Bug: 32328330
Change-Id: I1025641ec37ca3ec90309b30ad270fd996fd8d46
(cherry picked from commit 4a1c85c71f4de5faeeab2791f80dd7a1ad423f2c)