Commit Graph

3591 Commits

Author SHA1 Message Date
Issei Suzuki
43190bdf40 Refactor DisplayCutout to use Rect instead of Region.
Test: unittest
Bug: 112296834

Change-Id: I4245543c26f99afa59a34f5b6e6650b93d052a6e
2018-10-03 18:52:33 +09:00
Jerome Gaillard
38304b594f Merge "Delete method kept for layoutlib" 2018-09-28 09:48:49 +00:00
TreeHugger Robot
18bec393e4 Merge "Address comments from API council" 2018-09-27 17:24:47 +00:00
Jerome Gaillard
746cd4208a Delete method kept for layoutlib
Typeface.buildSystemFallback was kept only because it was used in
layoutlib. Change I33f27f62 (commit a65f963) removed that last use case,
so this now deletes the unused method.

Bug: 112196940
Test: atest FrameworksCoreTests:TypefaceTest
Change-Id: I19b793d34c1ce16d5dc7430c08746261cd52b4b2
2018-09-27 17:08:07 +01:00
John Reck
6b1644022b De-couple RenderNode from View package
First step of moving RenderNode to the graphics package

Test: builds
Change-Id: Ife7f5ec6698e32393d1b85ed2bad909ef0210be4
2018-09-26 16:29:32 -07:00
Seigo Nonaka
aaa85d6818 Address comments from API council
This CL includes:
- Fix typo
- Make SystemFonts final
- Storing readonly buffer in Font

Bug: 116224077
Bug: 116224515
Test: m update-api && m docs
Change-Id: Ib7442bac6d2d8efea4deff1fd309940794c20a88
2018-09-26 11:11:27 -07:00
Seigo Nonaka
47e79a1626 Merge "Move hasEqualAttribute from Paint with adding some accessors" 2018-09-25 18:34:26 +00:00
TreeHugger Robot
e64d55010f Merge "Create plumbing for disabling force-dark" 2018-09-24 19:54:33 +00:00
TreeHugger Robot
03bc1ab26f Merge "Fix a typo in ImageDecoder documentation" 2018-09-24 17:03:18 +00:00
John Reck
1423e1331f Create plumbing for disabling force-dark
Test: sysui's rounded corners are no longer white
Bug: 102591313

Change-Id: Id99ae38c354cef06b94a5fb79b5b1a9a216a514c
2018-09-24 09:34:18 -07:00
Leon Scroggins III
3da032dcb6 Fix a typo in ImageDecoder documentation
Bug: None
Test: None - no change in behavior
Change-Id: Ibd1e8721b4cead7ba841cf0e1f982610f991698c
2018-09-21 15:47:47 -04:00
Seigo Nonaka
fa95b83df7 Unhide getTextRunCursor APIs
This API is necessary for identifying the cursor locations.

Bug: 112327179
Test: atest android.graphics.cts.PaintTest
Change-Id: Ief6770bd622a296ae356094fe3ce58e9c4371088
2018-09-18 15:06:19 -07:00
Seigo Nonaka
93890b2e2e Unhide getTextBounds for CharSequence
Bug: 112327179
Test: atest android.graphics.cts.PaintTest
Change-Id: I1d2c5c5710dbe15d0352735ce18d9bb9d6f4dbc7
2018-09-18 14:17:38 -07:00
Seigo Nonaka
32b87e01e0 Move hasEqualAttribute from Paint with adding some accessors
Paint#hasEqualAttributes is not a equal method in Paint.
TextLine depends on this method but making this public will make
developer confused. So, moving hasEqualAttributes to TextLine and
provide some accessors for shadow layer parameters.

For the TextPaint, unhide underlineColor and underlineThckness for
implementing equalAttributes in TextLine.

Bug: 112327179
Test: atest android.graphics.cts.PaintTest
Change-Id: I4565e18134856e31d26bd06bcddeb31ddbe7e093
2018-09-18 14:10:14 -07:00
Seigo Nonaka
14a081f271 Merge "Unhide Paint.getTextRunAdvances" 2018-09-17 18:55:54 +00:00
Seigo Nonaka
eb749119e6 Unhide Paint.getTextRunAdvances
This is necessary for getting individual character advances.

The only char[] version of getTextRunAdvances is used, so removing
String/CharSequence versions.

Bug: 112327179
Test: atest android.graphics.cts.PaintTest#testGetTextRunAdvances
Change-Id: Ic49a4742cccb2a5155f6afacef3555e29c7a061c
2018-09-14 11:57:20 -07:00
Mathew Inwood
db0657a4f4 Merge "Move some members to the "Q blacklist"." 2018-09-14 13:54:28 +00:00
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
2018-09-14 13:18:34 +01:00
Seigo Nonaka
0eb713d17a Create LocaleList and HashSet lazily to save OS boot time
Creating HashSet and LocaleList in Zygote make performance impact
to the boot time. Since this API is not called so frequently and less
application is expected to call this API. So let's make Set and
LocaleList only when it is requested.

Here is a result of boot time perf test:
Before: TOTAL_BOOT_TIME : 16229.5
After : TOTAL_BOOT_TIME : 11704.0

Bug: 114774424
Test: atest android.graphics.fonts
Test: atest TypefaceSystemFallbackTest
Change-Id: I07247a78f6091c8adfaac748fe4a77a4597b1ae2
2018-09-13 10:58:14 -07:00
Seigo Nonaka
f18fadb7c0 Merge "Move maximum weight constant from Typeface to Font and make it public" 2018-09-11 05:02:46 +00:00
Seigo Nonaka
3005995a34 Merge "Unhide HyphenEdit related methods" 2018-09-11 05:01:34 +00:00
Philip P. Moltmann
04cec0a84c Merge "Expose the ability to resolve icon as a different app" 2018-09-10 20:45:19 +00:00
Seigo Nonaka
abd11b27a1 Merge "Introduce new Typeface.Builder2 for creating Typeface from FontFamily" 2018-09-10 19:59:56 +00:00
Seigo Nonaka
a8fab8acdb Move maximum weight constant from Typeface to Font and make it public
Now we have Font class. It is good to move max weight constant from
Typeface to Font.

Bug: 112327179
Test: atest FontTest

Change-Id: I3946ac150a02bf0cafa0fc81e61e69c31b45ed1d
2018-09-10 10:34:23 -07:00
Seigo Nonaka
9033e0c1a4 Unhide HyphenEdit related methods
These APIs are necessary to implement hyphenation by third party developers.

Bug: 112327179
Test: atest android.graphics.cts.PaintTest#testSetGetHyphenEdit
Change-Id: I692a56d3d1b15100503eb6d8e0f59d6c5c8af81b
2018-09-10 09:42:28 -07:00
Seigo Nonaka
18df22767e Merge "Introduce system font enumeration API" 2018-09-07 17:14:13 +00:00
Seigo Nonaka
601622ab5c Merge "Make text related Paint API public" 2018-09-06 00:12:43 +00:00
TreeHugger Robot
b1559cdfac Merge "API Review: StateListDrawables#getDrawableForState" 2018-09-05 23:33:57 +00:00
Seigo Nonaka
c7b3e62f0d Introduce system font enumeration API
To be able to use font file in their apps, provides blob and path to the
font file and locale list as well.

Bug: 26116537
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest
    CtsGraphicsTestCases:android.graphics.font

Change-Id: I1ae1302c6906b808012e1e91b1e4ab393c887cb6
2018-09-05 14:54:12 -07:00
Seigo Nonaka
3ffe6176b6 Make text related Paint API public
Following APIs are used by the text stack, and there is no reason for
them to be hidden. Make them public.
- getStrikeThruPosition
- getStrikeThruThickness
- getUnderlinePosition
- getUnderlineThickness
- getWordSpacing
- setWordSpacing

Bug: 112327179
Test: m docs
Test: atest android.graphics.cts.PaintTest
Change-Id: I651a5d620968fedcff2059e0e0694aa4ee770014
2018-09-05 10:31:22 -07:00
Nader Jawad
071149a9e7 API Review: StateListDrawables#getDrawableForState
Renamed getStateDrawableIndex to findStateDrawableIndex
based on API review feedback.

Change-Id: If07fe279fb02bc8180a28c7f58ea84ca030773ad
Fixes: 113856171
Test: Re-ran CTS
2018-09-05 17:28:37 +00:00
Nader Jawad
5078f4e79b Addressing API Review feedback
Marked Insets class as final and added nullability
annotations for static factory methods

Change-Id: Id2092704e0e464bf783a5f33a90cad2e37972b57
Fixes: 113855954
Test: re-ran CTS test cases
2018-09-05 15:28:39 +00:00
Seigo Nonaka
3c3e13fa65 Introduce new Typeface.Builder2 for creating Typeface from FontFamily
Typeface.Builder2 is a new builder class for creating Typeface from
FontFamily object.

Bug: 72665240
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest
    CtsGraphicsTestCases:android.graphics.fonts

Change-Id: Ib6fff07e97e9b3370d1d7e6351f1697fb29a91d5
2018-09-04 13:47:51 -07:00
Philip P. Moltmann
4236ccb7c4 Expose the ability to resolve icon as a different app
This is needed as the Permission Controller needs to get the icons for
permissions declared by 3rd party apps.

Bug: 110953302
Test: Built
Change-Id: I3fa643ad46150283c33c8fac918df158ed9b5a30
2018-08-31 12:11:02 -07:00
TreeHugger Robot
2672466f38 Merge "Implement #mutate for ColorStateListDrawable" 2018-08-30 15:47:28 +00:00
TreeHugger Robot
84f7d7b37c Merge "Deprecate Resources#getMovie()" 2018-08-27 21:06:28 +00:00
Ashley Rose
931435cf26 Implement #mutate for ColorStateListDrawable
ColorStateListDrawable did not implement #mutate correctly. This adds an
implementation for it.

Change-Id: I823b2096194ebc4e3424283ad5bad9d0f8df10df
Fixes: 113099852
Test: atest ColorStateListDrawable
2018-08-24 14:36:14 -04:00
TreeHugger Robot
83f8d6d2e1 Merge "Fix robolectric test" 2018-08-22 21:45:20 +00:00
Aurimas Liutikas
f0764b5c46 Deprecate Resources#getMovie()
Movie class has been deprecated, deprecate the getMovie as well.

Bug: 113054577
Test: None
Change-Id: Ic217adc002c7cfbe795e855689af1a58447b7d39
2018-08-22 13:13:07 -07:00
Ashley Rose
e3b135743f Create ColorStateListDrawable
Previously, you could not use references to colors in places that
expected a Drawable. This new class, ColorStateListDrawable bridges the
gap by attaching a ColorStateList to a ColorDrawable, and hooks it into
resource loading wherever you might expect a Drawable.

Fixes: 18126411
Test: Unit tests to be added to CTS
Change-Id: I0ff9a089669da96e6b22b214f04d6726bc278152
2018-08-22 14:08:30 -04:00
Seigo Nonaka
2bc7087125 Fix robolectric test
Bug: 112843740
Test: N/A
Change-Id: I54663725ace7bbc9b0c3ad582937162e82fec682
2018-08-22 10:46:29 -07:00
Seigo Nonaka
c02b7544f1 Fix NPE with Roboletric by returning emptyArray
Previous change I69e21940eaec4427f62abe59ae003b4f60855f22
did not handle the case of missing /system/etc/fonts.xml
This happens on roboletric test and crash with NPE.

Bug: 112843740
Test: N/A
Change-Id: I6d183dab9af66abf777f2e5b1fa633ff979fea55
2018-08-20 11:38:32 -07:00
Seigo Nonaka
c937328ba6 Address comments from API council for Font/FontFamily
- Change Font/FontFamily final
- Introduce equals/hashCode to Font class
-- Add equals and hashCode to FontVariationAxis as well
- Rename FontFamily.getFontCount to FontFamily.getSize
- Change Font ctor not to throw IOException and throw that in build()
  instead.

Bug: 112303038
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest
    CtsGraphicsTestCases:android.graphics.fonts

Change-Id: I079c99cfd579d07b6f3643e41415e58dc8b26492
2018-08-16 11:57:45 -07:00
Seigo Nonaka
eaa917e694 Rewrite system fallback construction with new FontFamily
Bug: 111133573
Bug: 112196940
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest
    CtsGraphicsTestCases:android.graphics.fonts

Change-Id: I69e21940eaec4427f62abe59ae003b4f60855f22
2018-08-14 11:17:12 -07:00
Doris Liu
f6bdfbc979 Merge "Support theme attrs in non-stateful CSL for VD" 2018-08-03 21:12:44 +00:00
Doris Liu
5035238d95 Support theme attrs in non-stateful CSL for VD
BUG: 111446567
Test: ag/4686005
Change-Id: Ic79b13b62252d6ff294984ae82aec09708c9ba68
2018-08-03 01:36:49 +00:00
Seigo Nonaka
ef855275fc Merge "Introduce FontFamily and its builder" 2018-08-02 23:41:44 +00:00
John Reck
410c9d7396 Merge "Remove unneccessary #isHardwareAccelerated" 2018-08-02 19:28:44 +00:00
Seigo Nonaka
88930f1df4 Introduce FontFamily and its builder
This CL is a ground work of the new Typeface construction API and
nobody uses this class except for CTS now.
I'll add new builder in Typeface to be able to create Typeface
from this FontFamily.

Bug: 72665240
Test: atest FontFamilyTest
Test: CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: I15d412c367037554d911fc9e20c0cfb44aefb89a
2018-08-02 11:04:44 -07:00
John Reck
8530853158 Remove unneccessary #isHardwareAccelerated
Test: CameraTests#testBasicTranslate
Change-Id: I2b5378edc3c975609bd1b427eac5677f87f601ac
2018-08-01 16:39:22 -07:00