Commit Graph

4234 Commits

Author SHA1 Message Date
Kohsuke Yatoh
8e9f60a39a Merge "Do not crash if setSystemFont is called twice." 2020-12-17 05:09:04 +00:00
TreeHugger Robot
65144f2e3d Merge "Updated documentation of VectorDrawable" 2020-12-16 23:15:17 +00:00
TreeHugger Robot
567bb6de1a Merge "Use SkSamplingOptions when creating image-shader" 2020-12-16 18:08:31 +00:00
Leon Scroggins
64eff0b9b4 Merge "Add djsollen and scroggo to graphics OWNERS" am: ccdcfd5f43 am: 1cc6152362 am: aad0a30aa1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1530578

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifd8ddffb0705760491de707325bbf0383f0ea9e9
2020-12-16 15:54:43 +00:00
Leon Scroggins
aad0a30aa1 Merge "Add djsollen and scroggo to graphics OWNERS" am: ccdcfd5f43 am: 1cc6152362
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1530578

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If354c39063b22212c93ae58bb24105da3814c18e
2020-12-16 15:40:39 +00:00
Kohsuke Yatoh
88ae1a2dcc Do not crash if setSystemFont is called twice.
ActivityThread.mBoundApplication has @UnsupportedAppUsage, so apps can
re-send BIND_APPLICATION message with the same AppBindData by using
reflection.

Bug: 174969232
Test: manually tested with the test app in the bug
Change-Id: Ic96d670f6346d9d1373607b4ae6e78b78194a09c
2020-12-15 13:20:46 -08:00
Nader Jawad
b1ecff76c8 Merge "Added View#setRenderEffect API" 2020-12-15 18:37:04 +00:00
Leon Scroggins III
582e862543 Add djsollen and scroggo to graphics OWNERS
Bug: 174932174
Test: None

We are already OWNERS of the native side (libs/hwui), and we are active
in the development of the Java side as wel.

Change-Id: I3727411e0123b80843fc6f936b8b3700c8943825
2020-12-15 11:53:55 -05:00
Adrian Roos
1901cfd916 Merge "Add fonts/OWNERS for font-related files." am: 1ab0fea04b am: c8a88daa25 am: c5f061be72
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1529699

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0be56d133026293b3a4581833335fdf0e418ac91
2020-12-15 11:42:52 +00:00
Adrian Roos
c5f061be72 Merge "Add fonts/OWNERS for font-related files." am: 1ab0fea04b am: c8a88daa25
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1529699

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iffa9b6a2d4ac9b7593096ec718005f51935191ac
2020-12-15 10:23:39 +00:00
Kohsuke Yatoh
3383d0b93b Add fonts/OWNERS for font-related files.
Test: n/a
Change-Id: I98bd4b1c6274e1414c107fd75f08bcd0367ede00
2020-12-15 05:31:26 +00:00
Mike Reed
3ed3089fdb Use SkSamplingOptions when creating image-shader
Test: make

Change-Id: Ie979cdb10263a08ea3d8c817234b94c9b61abb76
2020-12-14 17:51:13 -05:00
Nader Jawad
89f45ca74b Updated documentation of VectorDrawable
Fixed grammatical errors in documentation for VectorDrawable

Fixes: 170729553
Test: N/A
Change-Id: I4dbdb0f9b30c94f1483b9474759264a8601a2ba1
2020-12-14 08:45:27 -08:00
Nader Jawad
8b5c9c6061 Added View#setRenderEffect API
Added View API to configure RenderEffect on the underlying
RenderNode

Bug: 159712515
Test: Added CtsUiRenderingTestCase
Change-Id: Ic64009ac79927d61c7c1f63306ced3da18fce1da
2020-12-11 17:55:17 -08:00
Wale Ogunwale
c27f0525b7 Merge "Add more OWNERS coverages" am: 32ff0144bf am: 60f676c7d6 am: 926aa8da2c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519794

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib3dd38c02eb596d1223ecfae9b383931e985fe6d
2020-12-11 17:15:02 +00:00
Wale Ogunwale
926aa8da2c Merge "Add more OWNERS coverages" am: 32ff0144bf am: 60f676c7d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519794

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I32e5f8566ba916c892898f3f521a5a4309646142
2020-12-11 16:58:45 +00:00
Charles Chen
09f4e85ac2 Add more OWNERS coverages
Test: manual
Bug: 174932174
Change-Id: Ia798bdbce8516a3d675c55028ab637ad7f0695cf
2020-12-11 19:16:38 +08:00
TreeHugger Robot
f3eda767d7 Merge "Update for API council feedback" 2020-12-10 19:34:54 +00:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
24d251403b Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c am: c7c4a74a78
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5120a3701af3564f363900b20bca75f3ad2a854c
2020-12-08 16:43:17 +00: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
Kohsuke Yatoh
6fd7a0c41f Enable lazy typeface initialization.
Bug: 172891184
Test: atest FrameworksCoreTests:TypefaceTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Test: atest CtsWidgetTestCases
Change-Id: I958c33d40dd3bf510b6bdfe72021bd708eb7fd33
2020-12-03 21:55:20 -08:00
Seigo Nonaka
1aa57ec5c5 Parse fonts.xml when SystemFonts#getAvailableFonts is called
The fonts.xml is no longer parsed once we move to new model.
Thus, need to parse fonts.xml when SystemFonts#getAvailableFonts
is called.

Bug: 173752727
Test: atest NativeSystemFontTest
Change-Id: I628a2586f8450b942caf34ede5dc827e31fff0ef
2020-12-03 20:02:16 -08:00
John Reck
6f4fe2b195 Update for API council feedback
Test: N/A
Fixes: 169331021
Change-Id: I8ae9133d21f177db1a98fa43fde28a3f81820d5f
2020-12-03 16:44:32 -05:00
Seigo Nonaka
3a28205645 Create Font sets from native fonts
Bug: 173752727
Test: atest SystemFontsTest (with enabling LAZY flag)
Change-Id: Ic4e405a68e355919ee6493e51528fd44d79cd48e
2020-12-03 12:19:58 -08:00
TreeHugger Robot
b201a7e0ee Merge "Track per-window information in ViewFrameInfo" 2020-12-02 23:02:57 +00:00
Siarhei Vishniakou
efed16630a Track per-window information in ViewFrameInfo
FrameInfo will now be per-window; that is, per-ViewRootImpl.
Some of the information should remain “global” (it remain in Choreographer),
while some information is going to become ViewRootImpl-specific.
Before the information gets passed to the native layer,
 the ViewRootImpl-specific info will be stitched together
with the general Choreographer info.

This change is useful in order to correctly correlate frames with a specific
input event. In the unlikely scenario of a user touching two windows of the
same app simultaneously, this change will allow us to correctly measure the
latency of both frames produced by the windows.

Design doc: https://docs.google.com/document/d/1KMpMBlOxnl7zkWBCbXZZE6ZlaHEA4efYnN6WYK8n3FE/edit?resourcekey=0-eqooVNP0SskupljlTFvtOQ

Test: atest ViewFrameInfoTest
Bug: 169866723
Change-Id: Ib0bf9cd51cbcc0b9b70460c929c480eb490ec322
2020-12-01 15:07:50 -10:00
Kohsuke Yatoh
b11b963ed1 Prepare switching font loading to system server.
Currently, fonts are loaded in Zygote.
This CL adds a preparation to switch it to system server and
bindApplication(), so that system server will be able to update font map
at runtime.

(1) Zygote will be initialized without fonts.
(2) System server will maintain a serialized font map in ashmem.
(3) Apps will load font map from the ashmem in bindApplication().

The change is guarded by Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION,
and the new behavior is disabled by default.
I tested with ENABLE_LAZY_TYPEFACE_INITIALIZATION = true.

Bug: 172891184
Test: atest FrameworksCoreTests:TypefaceTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Test: atest CtsWidgetTestCases
Change-Id: I40832962a4b27f6160c4dc6268689c52f6a4dd33
2020-12-01 16:05:33 -08:00
Ady Abraham
d90ac7139c Merge "Handle DISPLAY_EVENT_FRAME_RATE_OVERRIDE" 2020-11-23 23:20:48 +00:00
TreeHugger Robot
c826b936b9 Merge "Decouple font collection logic from fallback building logic" 2020-11-23 22:07:30 +00:00
Ady Abraham
15d23d83a7 Handle DISPLAY_EVENT_FRAME_RATE_OVERRIDE
When getting DISPLAY_EVENT_FRAME_RATE_OVERRIDE from SurfaceFlinger,
expose the overridden frame rate to the relevant application
if the current refresh rate allows that.

Bug: 169271059
Bug: 169271062
Bug: 170503758
Test: manual test using SF backdoor
adb shell service call SurfaceFlinger 1039 i32 <uid> f <refresh rate>

Change-Id: I6ae1a98e6ca13e9d3d095a5713a6b0ca99652256
2020-11-23 20:02:48 +00:00
TreeHugger Robot
531245a7e9 Merge "Add perf test for Typeface serialization." 2020-11-21 01:05:22 +00:00
Seigo Nonaka
4823031728 Decouple font collection logic from fallback building logic
Bug: 173752727
Test: atest SystemFontsTest
Change-Id: I87030852a31c48a702becd406a56d7af6a101c48
2020-11-20 16:52:13 -08:00
Kohsuke Yatoh
2309375646 Add perf test for Typeface serialization.
Bug: 172891184
Test: atest TypefaceSerializationPerfTest
Change-Id: I3a0c8ba26350d6ca51a93a458e73362ac23c566f
2020-11-20 11:28:04 -08:00
Seigo Nonaka
4131277bc1 Remove SystemFonts#getSystemFallback and use Typeface instead for fallback
Bug: 173752727
Test: atest CtsTextTestCases
Test: atest CtsGraphicsTestCases
Test: atest TextViewTests
Test: atest TypefaceSystemFallbackTest
Test: atest TypefaceTest
Change-Id: I1c242ef6f651876e83d72fc5620035805fed2475
2020-11-19 19:17:41 -08:00
TreeHugger Robot
3acf806a9e Merge "Add the related tests for Icon in TEST_MAPPING" 2020-11-19 10:14:11 +00:00
Tiger Huang
33ffcac4d4 Merge "Remove legacy frames from WindowFrames and DisplayFrames" 2020-11-18 09:26:46 +00:00
Tiger Huang
b73471b4ec Remove legacy frames from WindowFrames and DisplayFrames
These frames are used for computing the legacy insets which won't be
used anymore. We should only maintain the new insets system now.

This CL also unhides Rect#inset APIs.

Bug: 149813814
Test: atest WindowFrameTests DisplayPolicyLayoutTests InsetsPolicyTest
            SplashscreenTests ManifestLayoutTests WindowMetricsTests
            WindowInsetsAnimationImeTests WindowInsetsControllerTests
            WindowUntrustedTouchTest DisplayContentTests
Change-Id: I06e40be6342b2ae35f7cc3e6f4ebdbe68edf0499
2020-11-18 10:59:15 +08:00
John Reck
2d2bd12935 Merge "Remove SaveFlags from saveLayer(Alpha)" 2020-11-17 21:48:30 +00:00
John Reck
a00eef21de Remove SaveFlags from saveLayer(Alpha)
This has been hardcoded as ALL_SAVE_FLAGS for a couple releases now.

Since it's now permanent behavior, remove the last bit of plumbing
for SaveFlags on saveLayer

Test: builds & boots
Change-Id: Iec92f27199d0b4781c2293dcdcfd45a1562a1b4e
2020-11-16 18:26:08 -05:00
Felka Chang
2547398797 Add the related tests for Icon in TEST_MAPPING
It's necessary to run the following two tests if
android.graphic.drawable.Icon is modified.
* CtsGraphicsTestCases:android.graphics.drawable.cts.IconTest
* FrameworksCoreTests:android.graphics.drawable.IconTest

Test: atest -p framewroks/base/graphics/java/android/graphics/drawable
Test: cd framewroks/base/graphics/java/android/graphics/drawable; \
      atest --enable-file-patterns --collect-tests-only
Bug: 172183870
Change-Id: Ic5bcaf3231ead515aeb2cba5b7f977dbbd41f5a9
2020-11-17 00:49:50 +08:00
TreeHugger Robot
474cac5066 Merge "Fix SystemUI count down doesn't work" 2020-11-16 15:56:51 +00:00
Felka Chang
920dcad2d3 Fix SystemUI count down doesn't work
StatusBarIconView uses Icon#loadDrawableAsUser to load drawable defined
by the customized Drawable class. context.createContextAsUser with flag
Context.CONTEXT_INCLUDE_CODE can fix the ClassNotFound found problem.
And, it needs to prevent any security issue by checking if the context
is the same app with the process.

If the parameter userId is the same with context.getUserId(), it
shouldn't create the extra Context instance.

Fixes: 171712189
Test: atest \
    CtsGraphicsTestCases:android.graphics.drawable.cts.IconTest \
    FrameworksCoreTests:android.graphics.drawable.IconTest
Change-Id: I267fc6eed90a6a6bba39b9976c1d843734e49dec
2020-11-16 14:20:13 +00:00
Kohsuke Yatoh
d56d2e9a67 Retry "Support loading system font map from SharedMemory."
This is the second try of
commit c7a5b3a90d, which was reverted in
commit 735d447d48

Changes:
- Use reflection to update static final fields, because some apps and
  tests rely on Typeface.create() to return references to static final
  fields (which is a behavior resulted from the use of internal cache).
- Make setSystemFontMap() thread safe.
- Hold a reference to ByteBuffer so that the memory won't be unmapped.

Bug: 172891184
Test: atest FrameworksCoreTests:TypefaceTest
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewPrecomputedTextTest
Change-Id: I1dea26c08a8585ea10e866c063bef6d682d8b15e
2020-11-13 19:52:27 +00:00
TreeHugger Robot
7ff909b97a Merge "Revert "Support loading system font map from SharedMemory."" 2020-11-12 15:37:35 +00:00
Mohammad Samiul Islam
735d447d48 Revert "Support loading system font map from SharedMemory."
This reverts commit c7a5b3a90d.

Reason for revert: DroidMonitor: Potential culprit for Bug 173096532 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: If71083df98155ae9e7f55ed1ca49b15456d12a82
2020-11-12 11:46:46 +00:00
TreeHugger Robot
a14eb1ec75 Merge "Support loading system font map from SharedMemory." 2020-11-12 01:41:13 +00:00
Kohsuke Yatoh
c7a5b3a90d Support loading system font map from SharedMemory.
Bug: 172891184
Test: atest FrameworksCoreTests:TypefaceTest
Change-Id: Ibcf10ccb160d83f7d01188b612c615b093696202
2020-11-11 15:28:37 -08:00
Leon Scroggins
6e597584c8 Merge changes I3f6c3260,I0f4d685d
* changes:
  Remove @SystemApi from Compatibility
  Revert "Make createSource(ContentResolver, Uri, Resources) a SystemApi"
2020-11-11 20:43:06 +00:00
Leon Scroggins III
2af10003c4 Remove @SystemApi from Compatibility
Bug: 152322291
Bug: 172934376
Test: make

The UI Rendering mainline module is on hold for now, so this does not
need to be @SystemApi. The system can still access it through @hide.

This leaves in place the new Compatibility class (added in
Ie7172fb93364a1e04ab844b8fa64887bf9d8b005), which seems just as good as
the old approach, and we can switch it back to @SystemApi if/when we
restart the module.

Change-Id: I3f6c32603c4eace55ece04936bff6f9336cf6627
2020-11-10 14:57:09 -05:00