3109 Commits

Author SHA1 Message Date
Romain Guy
dd2b7ccabc Merge "Rename getIntent() to getRenderIntent()" into oc-dev am: b2bb3bf268
am: 98e11587f2

Change-Id: Ic5c95f3f4f811a1f668ec6218371efd3fe169371
2017-04-06 22:47:21 +00:00
TreeHugger Robot
b2bb3bf268 Merge "Rename getIntent() to getRenderIntent()" into oc-dev 2017-04-06 21:34:17 +00:00
Romain Guy
1cf7b4fcb3 Rename getIntent() to getRenderIntent()
Bug: 37077433
Test: compile and ColorSpaceTests
Change-Id: I8eb1fa6136582eaac1d509ebfef7f67b0fffe1aa
2017-04-06 12:37:03 -07:00
Lucas Dupin
98bf27bff4 Add transfer mode support to ShapeDrawable
Test: runtest --path cts/tests/tests/graphics/src/android/graphics/drawable/cts/ShapeDrawableTest.java
Change-Id: I754cf20fda3fe5c28ba70aab089f9bebd27ca2bf
2017-04-05 11:05:15 -07:00
Seigo Nonaka
815c5b23ce Merge "Pass weight/italic pair instead of style." into oc-dev am: b4e3b344fa
am: 97b35a7089

Change-Id: Id75281df282cf6f0b77def2c7cffcc88ef92c417
2017-04-05 10:19:10 +00:00
TreeHugger Robot
b4e3b344fa Merge "Pass weight/italic pair instead of style." into oc-dev 2017-04-05 10:04:52 +00:00
Alan Viverette
c2c582bded Merge "Refresh opacity and statefulness on tint change" into oc-dev am: 8f6b9d8058
am: 77c7e2548a

Change-Id: Id5a18252950b93d2635a7eb1174052080511a07f
2017-04-04 19:31:19 +00:00
TreeHugger Robot
8f6b9d8058 Merge "Refresh opacity and statefulness on tint change" into oc-dev 2017-04-04 19:05:02 +00:00
TreeHugger Robot
4e4252354d Merge changes from topics 'KeyboardFocusHighlight_mUseDefaultFocusHighlight', 'KeyboardFocusHighlight', 'KeyboardFocusHighlight_DetectUnhandled'
* changes:
  Draw a default focus highlight if needed.
  Add a public API defaultFocusHighlightEnabled.
  Detect unhandled keyboard focused state.
2017-04-04 18:38:21 +00:00
Seigo Nonaka
fe04aa840e Pass weight/italic pair instead of style.
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
2017-04-04 10:12:55 -07:00
Seigo Nonaka
c802751704 Merge "Reorganize font enumeration API." into oc-dev am: 2ac9698271
am: de5fa6b3d8

Change-Id: I72a02f3f681b3b5f82cffc317fe0668e842464fe
2017-04-04 17:04:40 +00:00
TreeHugger Robot
2ac9698271 Merge "Reorganize font enumeration API." into oc-dev 2017-04-04 16:49:56 +00:00
Alan Viverette
ad7e748543 Refresh opacity and statefulness on tint change
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
2017-04-04 11:02:37 -04:00
Narayan Kamath
1163568d7c Merge "Properly guard access to CloseGuard in finalizers." 2017-04-04 12:27:02 +00:00
Ian Pedowitz
4d91cb1bd3 Merge "Revert "Refresh opacity and statefulness on tint change"" into oc-dev am: 61117c61d7
am: 3f4d2f28f8

Change-Id: I16f52d3dc55861bdbc9813a5ea2bf91f24eabf87
2017-04-04 03:53:51 +00:00
Ian Pedowitz
61117c61d7 Merge "Revert "Refresh opacity and statefulness on tint change"" into oc-dev 2017-04-04 03:38:58 +00:00
Yohei Yukawa
55fed16929 Revert "Refresh opacity and statefulness on tint change"
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
2017-04-04 03:30:01 +00:00
Alan Viverette
111f8509ea Merge "Refresh opacity and statefulness on tint change" into oc-dev am: 265dbc1f09
am: 1148bc819a

Change-Id: I76faf6d25666c1b5612c009cfd9081465f319589
2017-04-03 23:06:43 +00:00
TreeHugger Robot
265dbc1f09 Merge "Refresh opacity and statefulness on tint change" into oc-dev 2017-04-03 22:47:32 +00:00
Romain Guy
713604726e Merge "Make Color non-final because apps break..." into oc-dev am: c0c524af4f
am: 97497985ad

Change-Id: Id10b82a9f6e6092a121a3fb35b28ff120b35b86f
2017-04-03 21:36:32 +00:00
TreeHugger Robot
c0c524af4f Merge "Make Color non-final because apps break..." into oc-dev 2017-04-03 21:21:18 +00:00
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
Romain Guy
bae8b52c71 Make Color non-final because apps break...
Bug: 36858735
Test: Manual run of crashing app
Change-Id: I3eb06260074ee6950bc91731e7093a26d7e32b49
2017-04-03 11:51:11 -07:00
Bryce Lee
126159a88f Merge "Add app bounds to configuration." into oc-dev am: 7efe56b779
am: 59d1f8a024

Change-Id: Iae8e43872eee11214347cfb935793e9356a50e08
2017-04-03 18:00:08 +00:00
Hyunyoung Song
4794829a1e Merge "Prevent NPE when draw is called without bounds being set Test: unit test inside AdaptiveIconDrawableTest.java" into oc-dev am: 891e03203c
am: d16d17881e

Change-Id: I96db9ee1a5bb9fc2085e43733638a6b21f50fe65
2017-04-03 17:49:19 +00:00
Narayan Kamath
492e9e851c Properly guard access to CloseGuard in finalizers.
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
2017-04-03 18:12:04 +01:00
Bryce Lee
7efe56b779 Merge "Add app bounds to configuration." into oc-dev 2017-04-03 14:30:49 +00:00
Hyunyoung Song
55211c032c Prevent NPE when draw is called without bounds being set
Test: unit test inside AdaptiveIconDrawableTest.java

Change-Id: Ic3260ce9c6bae595c7eba7be1cd7ae249939a1cf
2017-04-03 00:23:49 -07:00
Bryce Lee
7566d76c61 Add app bounds to configuration.
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
2017-03-31 21:34:30 -07:00
Romain Guy
0e5adc0d78 Merge changes from topic 'bitmapfactory-options-outdecodecolorspace' into oc-dev am: 81b292abdf
am: 66421a8d81

Change-Id: Ib4f0f82441553ff8862f6f4d2dc7e6ef61f16e47
2017-04-01 04:32:15 +00:00
Romain Guy
c7dacca008 Documentation for PorterDuffXfermode
It tooks 10 years, but better late than never!

Bug: 32984164
Test: Compiled documentation and checked in Chrome
Change-Id: I6dfd7fba6d3077f8c774b203589083bdbc15f9d2
2017-03-31 18:56:37 -07:00
Romain Guy
90fc43b33d Query color space before decoding a bitmap
This follows the pattern established by other "out" fields
in BitmapFactory.Options

Bug: 32984164
Test: CtsGraphicsTestCases

Change-Id: Ie72e47338b578b41c550453e2698d2d49eddf6da
2017-03-31 09:09:57 -07:00
Jiaquan He
f380072eef Detect unhandled keyboard focused state.
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
2017-03-30 12:28:40 -07:00
Alan Viverette
1eda069f7c Refresh opacity and statefulness on tint change
Bug: 33124798
Test: DrawableContainerTest#testOpacityChange #testStatefulnessChange
Test: LayerDrawableTest#testOpacityChange #testStatefulnessChange
Change-Id: I89f6d804fb025f426aefdee67559778cf03015bb
2017-03-29 20:26:09 +00:00
Seigo Nonaka
c0cf4f09f4 Do not use many FDs in FontManagerService.
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)
2017-03-29 17:01:16 +00:00
Romain Guy
026a558ab0 Update Color API
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)
2017-03-28 18:33:47 +00:00
TreeHugger Robot
b37e97bba6 Merge "Update Color API" 2017-03-28 18:32:22 +00:00
TreeHugger Robot
32f93274bd Merge "Do not use many FDs in FontManagerService." 2017-03-28 17:54:05 +00:00
Seigo Nonaka
455f1bfc05 Do not use many FDs in FontManagerService.
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
2017-03-28 08:34:14 -07:00
TreeHugger Robot
186c0d1d91 Merge "Add RAW_DEPTH image format" 2017-03-28 07:17:11 +00:00
Romain Guy
48f38f1838 Update Color API
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
2017-03-25 23:51:38 +00:00
Emilian Peev
f7fec7397e Add RAW_DEPTH image format
- Add support for opaque RAW_DEPTH image format.
- Add support for RAW_DEPTH in ImageReader.

Bug: 36015382
Test: testPDStats
Change-Id: Id77b8e9fb22c2616a938c394c9ddc6c34bfff655
2017-03-24 16:23:35 +00:00
Seigo Nonaka
a4ab320e0a Use variation settings for Typeface creation.
Bug: 35416390
Test: android.graphics.cts.TypefaceTest passed
Change-Id: Ieefa2cf095fb1031d3c7ac99fd59710311d7ede3
2017-03-23 10:03:55 -07:00
TreeHugger Robot
2a820bdf50 Merge "Revive old method to prevent crash internal app." 2017-03-22 18:03:45 +00:00
Philip P. Moltmann
6a4486e1c5 Merge "Use only official pdfium APIs" 2017-03-22 16:20:41 +00:00
Seigo Nonaka
2660aca491 Revive old method to prevent crash internal app.
Bug: 36509029
Test: N/A
Change-Id: I4e04847de7b61a790323257c09da9a960a6689d5
2017-03-22 09:14:33 -07:00
TreeHugger Robot
c34f786677 Merge "Unhide Typeface construction APIs." 2017-03-22 15:40:23 +00:00
Clara Bayarri
fb483cc90c XML Support for non system font providers
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
2017-03-22 11:47:51 +00:00
Seigo Nonaka
b2c20d880d Unhide Typeface construction APIs.
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
2017-03-21 19:55:38 -07:00
TreeHugger Robot
713b869aad Merge "Expose Typeface creation APIs with ttc and font variation." 2017-03-21 22:50:20 +00:00