Typeface.NORMAL/BOLD/ITALIC/ITALIC_BOLD is used for specifying relative
from current Typeface. For example
Typeface face = Typeface.create("serif");
Typeface thickerFace = Typeface.create(face, Typeface.BOLD);
Typeface moreThickerFace = Typeface.create(tickerFace, Typface.BOLD);
For the purpose of providing font information, we should use weight/italic
value instead of style in Typeface.
The Columns.STYLE field was kept for preventing runtime crash of demo
apps.
Test: Manually
Change-Id: I732e8ee04a66f61321fc0a98dbfb8fdc0a4dd7a4
Also warns when LayerDrawable is created with an invalid child. This
is not guaranteed to fail, but it's usually a bad sign.
Bug: 33124798
Test: LayerDrawableTest, DrawableContainerTest
Change-Id: Ie3e4200b27a9814cee7f5711d7df9710db513953
This reverts commit 1eda069f7c9a36e58c17ecf185a5c0906be5df95.
Reason to revert:
The setup wizard started throwing android.view.InflateException due to
I89f6d804fb025f426aefdee67559778cf03015bb. Temporarily reverting that
change until we figure out what is going on.
Change-Id: I9344a3402f2fab02f4fe49a6a8ad91970b2d3b3e
Test: Manually verified that the setup wizard no longer crashes.
Bug: 33124798
Bug: 36870685
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
CloseGuard instances are allocated in constructors and usually
assigned to final fields. This implies they're non-null in finalizers
except in the case where the constructor throws. We add a null check
to make sure we can continue cleaning up other state in the finalizer
(if applicable).
Also, this change decouples closeguard warnings in constructors
from other state based logic. This because the logic there is usually
duplicated with the call to close().
NOTE: This change is not a "complete" fix. Many of these finalizers
are broken in the case where <init> throws. The only objective of
this change is to make such errors more obvious.
Note that some of these classes don't have CTS tests.
Test: make, CtsMediaTestCases.
Bug: 35609098
Change-Id: I24d9e0215f80e44914dba8ab99b6312fd6ed1fc0
The system previously overrode the display size for a specific scope
(task/activity/etc.) by setting the associated Configuration's
screenWidthDp/screenHeightDp. This leads to two issues. First, the
conversion of screen size from pixels to display independent pixels
and then upconverting later on leads to rounding errors. Secondly,
the screenWidthDp and screenHeightDp values account for insets, such
as the status bar. These however are not reflected in the display
size when returned from Display#getMetrics/getSize.
This changelist addresses the issue by adding a Rect value to
Configuration which stores the app display bounds. This is always set
at the display level and overridden as appropriate. As the proper
app insets are accounted for at the root configuration, all overrides
(outside of specific exceptions) are the result of the intersection
between the requested bound and the parent bound.
Change-Id: I2c4fcd0bee92af12aabbca258de05b4ec061d0e1
Fixes: 34338931
Bug: 36812336
Bug: 36676979
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
It tooks 10 years, but better late than never!
Bug: 32984164
Test: Compiled documentation and checked in Chrome
Change-Id: I6dfd7fba6d3077f8c774b203589083bdbc15f9d2
This follows the pattern established by other "out" fields
in BitmapFactory.Options
Bug: 32984164
Test: CtsGraphicsTestCases
Change-Id: Ie72e47338b578b41c550453e2698d2d49eddf6da
A View uses a Drawable as its background, which changes
its appearance according to the View's state. This commit
adds an algorithm to detect undefined state_focused in
state specs for those Drawables.
Test: cts-tradefed run singleCommand cts --skip-device-info
--skip-preconditions --abi armeabi-v7a -m CtsGraphicsTestCases
-t android.graphics.drawable.cts.DefaultFocusHighlightTest
Bug: 35096940
Change-Id: I5e9f07141679881fe88f9040aa116ea2f9d537c9
Currently there are over 170 font files are installed in system directory.
Opening 170+ files and keep them is not unacceptable. Pass URI instead.
At the same time, this CL hides full font path from FontConfig since
/system/fonts directory will be deprecated in future.
Bug: 36660849
Test: android.text.cts.FontManagerTest passed
Change-Id: I1d216dc9c6dec702a4ce3b946bfda6dcbe12b7fe
(cherry picked from commit 455f1bfc05bf972ee4fe8cd5fa135ed232126bb7)
Make the class final because its instances are immutable and
it contained only static methods prior to O. Fix a couple of
typos/issues reported by external developers. Add a new variant
of getComponents() to avoid allocations, as requested by
external dev.
Test: Color_ColorLongTest
Bug: 32984164
Change-Id: I3c22e124c9fdf66142d530afa4beb05fe0669359
(cherry picked from commit 48f38f18385e8aed0df48524d8ea3d20eba9199f)
Currently there are over 170 font files are installed in system directory.
Opening 170+ files and keep them is not unacceptable. Pass URI instead.
At the same time, this CL hides full font path from FontConfig since
/system/fonts directory will be deprecated in future.
Bug: 36660849
Test: android.text.cts.FontManagerTest passed
Change-Id: I1d216dc9c6dec702a4ce3b946bfda6dcbe12b7fe
Make the class final because its instances are immutable and
it contained only static methods prior to O. Fix a couple of
typos/issues reported by external developers. Add a new variant
of getComponents() to avoid allocations, as requested by
external dev.
Test: Color_ColorLongTest
Bug: 32984164
Change-Id: I3c22e124c9fdf66142d530afa4beb05fe0669359
- Add support for opaque RAW_DEPTH image format.
- Add support for RAW_DEPTH in ImageReader.
Bug: 36015382
Test: testPDStats
Change-Id: Id77b8e9fb22c2616a938c394c9ddc6c34bfff655
The certs needed to identify non preinstalled providers
can now be declared in XML, using a resources array.
Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
Bug: 35025705
Change-Id: Ibf12ad409aa5a873ddb32b1383c147728e664c23
These APIs are necessary to construct Typeface from various combination
TTC index, variation settings, etc.
Bug: 33062398
Test: android.graphics.cts.TypefaceTest passes
Change-Id: Ie069700ed4f67efbec55331bef867f94d58e2a61