4151 Commits

Author SHA1 Message Date
Kohsuke Yatoh
3383d0b93b Add fonts/OWNERS for font-related files.
Test: n/a
Change-Id: I98bd4b1c6274e1414c107fd75f08bcd0367ede00
2020-12-15 05:31:26 +00:00
Charles Chen
09f4e85ac2 Add more OWNERS coverages
Test: manual
Bug: 174932174
Change-Id: Ia798bdbce8516a3d675c55028ab637ad7f0695cf
2020-12-11 19:16:38 +08:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Xin Li
986e6eeddf Merge ab/6749736 in stage.
Bug: 167233921
Merged-In: Iecef31f7bf10ad97b7e0075cf302ae94e248474a
Change-Id: I9e9c873bc2e05a0cfe3af0bf74725500f3f108db
2020-10-10 20:38:57 -07:00
Leon Scroggins III
d172a0cff8 ImageDecoder: Use AssetFileDescriptor's length
Bug: 166069819
Test: ImageDecoderTest (cts)

The contained asset may only be a subset of the AssetFileDescriptor.
SkWebpCodec reads the entire stream into a contiguous block of memory.
(This is because libwebp does not provide a streaming API for creating
its demuxer.) If the AssetFileDescriptor contains data after the webp
file, this wastes memory. In some cases, there may be a *lot* of data
after the webp file, so this can use too much memory, particularly on
low memory devices.

Merged-In: I8d8e520f43a7ef0d7e4534ef165d8c7e4d2a0b55
Change-Id: I8d8e520f43a7ef0d7e4534ef165d8c7e4d2a0b55
2020-09-15 15:52:38 +00:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Peiyong Lin
b967a4c381 Use more inclusive terms inside GraphicsEnvironment.
Bug: b/162288333
Test: N/A
Change-Id: I2f1f13a892be0c8ff3f89e0ceabe39058390727d
2020-07-27 23:57:50 -07:00
Leon Scroggins
53ee2070ed Merge "Update graphics language to comply with Android’s inclusive language guidance" am: da4dc882af am: a97e560c61
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1370379

Change-Id: I5d853a84c0fe1550d86d0f948f76e532af42e073
2020-07-23 13:56:41 +00:00
Leon Scroggins III
f663182d52 Update graphics language to comply with Android’s inclusive language guidance
Bug: 161896447
Test: make

See https://source.android.com/setup/contribute/respectful-code for reference

Change-Id: I57b81fb5fd2177fbf96f9cc900097f7da1955fca
2020-07-22 13:00:12 -04:00
Makoto Onuki
42bec243c0 Remove unnecessarily @System/TestApi annotations
We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.

Exempt-From-Owner-Approval:Cherry-pick from goog/master
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Merged-in: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Change-Id: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
2020-06-24 18:02:10 +00:00
Philip P. Moltmann
8bbf9bae6f Fix small issue in PdfDocument docs
Test: Doc fix only
Fixes: 157396387
Change-Id: If1c7a875d8915f53726b832f51cb59fa1f12ae31
2020-05-26 16:29:43 -07:00
Andrew Solovay
b9001d1b8a docs: Removing spurious heading from Javadoc comment
There's an H3 at the top of the PorterDuff.Mode javadoc comment,
and that breaks the TOC in various ways. We don't need that
heading so I'm removing it.

Test: make ds-docs-java
Exempt-from-owner-approval: Docs-only change
Change-Id: I6d5f98b5103a77a7d0245a438b6961c4a21fb059
Bug: 311897143
2020-05-20 00:13:07 +00:00
Leon Scroggins III
e9b2cc829e Update ImageDecoder docs regarding Files
Bug: 139186570
Test: make docs

As part of enforcing Scoped Storage for the next Android release, we're
encouraging app developers to steer away from using raw file path access
and, instead, use FileDescriptor or Uri to access files.

Update createSource(File)'s docs to suggest why they might want to use a
different method.

Update the top level example to use createSource(ContentResolver, Uri)
instead of createSource(File).

Change-Id: Icbccdb5183edd0b6a052ec905f999f02ac4e61d3
(cherry picked from commit 405697458360779a9d7e731b4e8dbe0eeb9b3f0d)
Merged-In: Icbccdb5183edd0b6a052ec905f999f02ac4e61d3
2020-05-12 14:09:56 +00:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40baae30cf77e948db5258b78856d0e5)
2020-05-01 18:25:32 +00:00
Andrew Sapperstein
1f6e22cbd8 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
2020-05-01 00:42:22 +00:00
Leon Scroggins III
6419ebff5c Fix .equals call in ImageDecoder
Bug: 154954875
Bug: 143231863
Test: I93b01cb60a8c76110ea2ff4250d0048512629d8d

I9229039b752bafa9a9b85b914a62093dff1eec34 switched from "==" to
".equals", but it did not take into account that Uri#getScheme() can
return null. Switch around the .equals check so that it is called on
SCHEME_CONTENT, which will never be null.

Change-Id: I0df5d2407a32fad0e21e597697af293fbc2fb315
Merged-In: I0df5d2407a32fad0e21e597697af293fbc2fb315
2020-04-28 14:14:30 +00:00
Rob Carr
9005cdcf01 Merge "BLAST: Two start-up optimizations" into rvc-dev 2020-04-27 17:20:42 +00:00
Robert Carr
b9cf275b9b BLAST: Two start-up optimizations
1. Avoid a seperate IPC querying in to system-server
   to initialize the mUseBLAST flag.
2. Avoid calling property_get_bool with each BufferQueue
   creation.

Instead we piggy-back both values inside addWindow return values.

Bug: 152501005
Test: Existing tests pass
Change-Id: If130560a8230f8d399cf7631264d551522939faa
2020-04-24 14:42:55 -07:00
Sumir Kataria
67d06a9965 Update doc formatting.
Add missing <p> tags which should make some methods
more readable.  Also added a few {@code} tags and a
couple of missing {@link} tags.

Fixes: 154547852
Test: m offline-sdk-docs

Change-Id: I1b8d0212b54e902378d5d25f6d555f69af207604
2020-04-20 16:13:13 -07:00
John Reck
9c52543162 Merge "Document that getTransformMatrix can inset" into rvc-dev 2020-04-17 19:20:38 +00:00
John Reck
62f8b4f3d6 Document that getTransformMatrix can inset
Bug: 152621633
Test: none, docs only change
Change-Id: I4a357affdf698c8eb70ed7abbfa828586b2da0ec
2020-04-16 15:42:14 -07:00
Leon Scroggins III
865f0f1ec9 Support Skia's gray SkColorSpaces
Bug: 153410582
Test: I0a280cdfdb02766f5e415408386cce49a59504ab

For gray color spaces, Skia creates a special toXYZD50 matrix which does
not have any concept of primaries. Update the Java ColorSpace to
recognize such a matrix and treat it specially. Instead of creating
primaries, use a set of dummy values.

This fixes a bug where the Java ColorSpace was invalid (NaNs in its
transforms) and applying it to a new Bitmap yielded incorrect results.

Fix up the @see links in getPrimaries and surrounding methods.

Change-Id: I94fe232e10f56a69832d4a39a2e5909eac641264
(cherry picked from commit d82d585f283d59264c2e8459d4bda5ef69301044)
Merged-In: I94fe232e10f56a69832d4a39a2e5909eac641264
2020-04-14 18:43:16 +00:00
Ryan Mitchell
26ff673458 Add mSourceDrawableId to copy constructor
The copy constructor of AdaptiveIconDrawable#LayerState currently does
not copy mSourceDrawableId from the original layer state. This prevents
drawables created from preloaded AdaptiveIconDrawables from having the
correct source drawable resource id.

Bug: 148488431
Test: CtsContentTestCases:android.content.pm.cts.PackageManagerTest
Change-Id: I7795a337a2a364677e375776c7aec5bc9189e0da
2020-03-27 10:32:52 -07:00
Derek Sollenberger
f8d4a6684c Fix mmap errors when reading font files via the AssetManager.
Previous attempts to do this ignored the offset that the
AssetFileDescriptor may have.

Bug: 149927583
Test: CtsTextTestCases and androidx.appcompat.widget.AppCompatTextViewTest
Change-Id: Idcc8cb83a7f265cfa12707b7ce643b35f7f72352
2020-02-27 15:12:43 -05:00
TreeHugger Robot
781185099b Merge "Do not attempt to special case uncompressed font assets." 2020-02-21 22:35:55 +00:00
Derek Sollenberger
dd03a8ef81 Do not attempt to special case uncompressed font assets.
The logic to attempt to directly mmap uncompressed font assets
has resulted in breakages for some applications and utilities.
This CL disables this speculative optimzation until we can determine
the problem with this approach and if such an optimization is required.

Bug: 149780695
Test: CtsTextTestCases and androidx.appcompat.widget.AppCompatTextViewTest
Change-Id: I3b10a801a5600aefe8573fab1b28cd79c848c892
2020-02-21 15:28:52 -05:00
Derek Sollenberger
76e7430bae Merge changes from topic "HWUI_JNI"
* changes:
  Export symbols for the newly exposed APEX/internal headers
  Remove dependence on libandroid_runtime from Bitmap.cpp
  Update Region.cpp to use AParcel NDK APIs
  Cleanup header and build targets for libhwui clients.
  Remove dependencies on headers outside UI module
  Cleanup LOG_TAG when bundled in HWUI
  Move android.graphics JNI & APEX files into HWUI
2020-02-21 11:43:02 +00:00
Derek Sollenberger
42c50042d1 Remove dependence on libandroid_runtime from Bitmap.cpp
The end goal is to have Bitmap.cpp use AParcel, but until that
API is extended to support this use case this is an alternative
way to isolate the graphics files from the libandroid_runtime.

Test: CtsGraphicsTestCases
Bug: 145227478
Change-Id: Ie3854fe03dec4f7b1b485295bb9a5ebba52ddb7c
2020-02-20 21:50:06 -05:00
Leon Scroggins
251888e9eb Merge "Add details regarding setConvexPath deprecation" 2020-02-20 20:00:38 +00:00
Leon Scroggins III
076bbe1ceb Add details regarding setConvexPath deprecation
Bug: 149857968
Test: make docs
Change-Id: I995e035fc7d73d196a50b4e515db38110baa0fe5
2020-02-20 11:16:11 -05:00
Leon Scroggins III
5a190b19bb Add Bitmap#getHardwareBuffer
Bug: 148155907
Bug: 135299581
Test: TODO

Hidden for now. We'd like to make it an SDK API eventually
(b/148155907).

Internal code is currently calling createGraphicBufferHandle. This is
not something we plan to expose from the UI rendering module, so add a
method to get a HardwareBuffer instead. This is something we were
already planning to add. It seems that clients of
createGraphicBufferHandle really wanted a Parcelable to pass the
HARDWARE Bitmap to another thread. This should satisfy that use case.

Change-Id: Id701f7c7eab37830cd7d2cdb929cbe6ba4eca119
2020-02-18 16:35:56 -05:00
Derek Sollenberger
db8164c0ac Merge "Move RenderNodeAnimator to android.graphics.animation package" 2020-02-14 16:32:50 +00:00
TreeHugger Robot
8780aae16c Merge "Create a ParcelableColorSpace" 2020-02-14 00:58:30 +00:00
Derek Sollenberger
8c2f6b6e15 Move RenderNodeAnimator to android.graphics.animation package
A wrapper still exists at android.view.RenderNode animator
as it needs access to internals of the view that would violate
the package layering if moved into android.graphics.animation.

This CL also moves the Java and cpp files associated with creating
a native interpolator that can be run directly on the RenderThread.

Bug: 149293249
Test: CtsViewTestCases
Change-Id: I5260331fedbd634cf2f6d6d392941e7284527420
2020-02-13 16:14:06 -05:00
John Reck
aa5f38577a Create a ParcelableColorSpace
Bug: 148412652
Test: ParcelableColorSpaceTest CTS
Change-Id: If0901367e501e2ecfc71b9ed29ec7d8dd4d0550f
2020-02-12 14:28:10 -08:00
Derek Sollenberger
e2edcebb2b Merge "Consolidate AssetManager calls in Font/FontFamily" 2020-02-11 13:11:42 +00:00
Derek Sollenberger
4db7bd28e7 Consolidate AssetManager calls in Font/FontFamily
The Font/FontFamily classes use private API calls in native
code to get the contents of an Asset.  These calls need to
be made on public APIs in order to isolate the graphics module
from the rest of the system.  Public Java APIs already exist so
this CL refactors the code to use those methods.

Test: CtsTextTestCases
Bug: 147136234
Change-Id: I35a6558b597684e59279d7a841669c5f909d5152
2020-02-10 20:05:31 +00:00
Stan Iliev
c90438175f Refactor GraphicsStatsService for updateability
Move GraphicsStatsService to android.graphics package.
Move GraphicsStatsService JNI from libservices.core to
libandroid_runtime.
Declare GraphicsStatsService ctor as the only @SystemApi.
Remove MemoryFile usage from GraphicsStatsService, but use
SharedMemory and other SDK APIs instead. This is done to
avoid using unstable API MemoryFile.getFileDescriptor.
Propose new SharedMemory.getFdDup API for next release, which
is hidden for now.
Refactor statsd puller to avoid proto serialization by moving
data directly into AStatsEventList.
"libprotoutil" is added as a static dependancy to libhwui, which
should be fine because its implementation does not link anything.

Bug: 146353313
Test: Ran "adb shell cmd stats pull-source 10068"
Test: Passed unit tests and GraphicsStatsValidationTest CTS
Change-Id: If16c5addbd519cba33e03bd84ac312595032e0e1
2020-02-07 12:27:07 -05:00
Derek Sollenberger
1863d94e9a Ensure SkiaPipeline always has a valid colorspace.
Previously we didn't assign a colorspace to the pipeline until it
was provided a surface to render into.  This resulted in undefined
behavior if the application attempted to render an offscreen layer
before the OS provided the main window with its surface. Now instead
of deferring setting whether or not the application is wide gamut we
do initialize it to a default setting when the pipeline is created.

Bug: 148042673
Test: apct/device_boot_health_check_extra_postsubmit
Change-Id: I84d743511e949ac977486470bb14eec936de7f88
2020-02-06 07:41:50 -05:00
Leon Scroggins III
a49beaaa69 Replace Outline#setConvexPath with Outline#setPath
Bug: 148544953
Test: No change in behavior, no new tests

setConvexPath no longer requires that the Path be Convex, so deprecate
the method and replace it with a name that does not imply it must be
Convex.

Update internal references to the Path being Convex as well.

Change-Id: I8935dc8ac7f7fb7db0d667e35fda67afdf2e6ac8
2020-01-31 14:21:46 -05:00
Leon Scroggins
e98ae477cc Merge "Deprecate Path#isConvex" 2020-01-29 18:10:14 +00:00
TreeHugger Robot
e428a2cc04 Merge "Deprecate Canvas.EdgeType" 2020-01-28 18:13:01 +00:00
John Reck
efac0521d6 Improve bitmap IPC
Make all received bitmaps immutable as this
improves re-use for subsequent transfers.

Remove minimum size to stay on ashmem, as
Parcel's writeBlob already has similar logic.
This effectively reduces the minimum size to 16kB.

Bug: 148301859
Test: device booted, a notification showed up
Change-Id: I2fafb0989944c0ef82de6edcb4924056a592cf66
2020-01-24 16:06:14 -08:00
Leon Scroggins III
2410b90e06 Deprecate Canvas.EdgeType
Bug: 129694386
Test: No change in behavior, no new tests

EdgeType is only used as a parameter to quickReject, but it is always
ignored. Deprecate it and the existing quickReject methods. Add new
versions of quickReject without EdgeType parameters. Switch clients to
the new versions.

Change-Id: Id932f10915a8c4959fe0e85f507ce7fd2da8a576
2020-01-23 20:43:34 +00:00
Leon Scroggins III
6a0cdd24df Deprecate Path#isConvex
Bug: 133807397
Test: No change in behavior, no new tests

isConvex is unreliable. We may change how we compute it from release to
release, and it could change based on various factors like a rotation.

Change-Id: Ib76246fc24f09bd13cf63b4b96b56afa613d0bc9
2020-01-23 12:41:08 -05:00
Sunny Goyal
77a2416924 Adding API to check if an icon returned by PackageManager
is a fallback icon

Bug: 141588119
Test: atest PackageManagerTest
Change-Id: I9ae5a74dd0b0c0c49a078d46914986ecb0d27a94
2020-01-21 16:17:49 -08:00
Xin Li
e13851556b DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master
Bug: 146167222
Change-Id: Ifeb003ec9b3bf824f04d31a117aea65d517241fb
2020-01-15 16:15:41 -08:00
Haoyu Zhang
9f9301ccc2 Restrict UnsupportedAppUsage after Q
Bug: 145986883
Test: atest FontFamilyTest
Test: adb shell am instrument -w -r -e class 'androidx.core.graphics.TypefaceCompatTest' androidx.core.test/androidx.test.runner.AndroidJUnitRunner
Change-Id: I1cf0444b93df00532536531903e889ade9612597
2020-01-14 15:28:09 -08:00