Commit Graph

4284 Commits

Author SHA1 Message Date
Galia Peycheva
f83b52cc13 Revert "Make BackgroundBlurDrawable a SystemApi"
Revert "Add permission check for blurs in SurfaceFlinger"

Revert "Remove public usages of FLAG_BLUR_BEHIND"

Revert "Add pid and uid to SF::setClientStateLocked"

Revert "Add USE_BACKGROUND_BLUR to cts expected permissions"

Revert submission 13350963-blur_system_api

Reason for revert: This topic made blurs a system api. API council voted against that and we will instead aim to make it public for S. None of these changes are relevant in that case.

Reverted Changes:
I3683db296:Remove public usages of FLAG_BLUR_BEHIND
I23b21b603:Add USE_BACKGROUND_BLUR to cts expected permission...
Id21f03793:Add pid and uid to SF::setClientStateLocked
If5d8344a5:Add permission for blur SystemApi
I70d1e1715:Add permission check for blurs in SurfaceFlinger
Icf98c3607:Make window background blurs SystemApi
I0b881ec6e:Make BackgroundBlurDrawable a SystemApi

Bug: 177523043
Test: m
Change-Id: Iee4b89b06508c7dc3b7266452bb0b987f8670fac
Merged-In: Iee4b89b06508c7dc3b7266452bb0b987f8670fac
2021-02-02 23:02:05 +01:00
TreeHugger Robot
b23f6d71ee Merge "Move GameManager to android.app package." into sc-dev 2021-02-02 19:36:13 +00:00
John Reck
7cf75f0b15 Merge "Add stretch plumbing" into sc-dev 2021-02-02 14:49:42 +00:00
John Reck
5cb290bf54 Add stretch plumbing
Bug: 179047472
Test: builds & boots

Change-Id: I30b5d6683160af598f98555f61af1cf5a7639bbe
2021-02-01 14:41:07 -05:00
Peiyong Lin
235cb5086c Move GameManager to android.app package.
Bug: b/177611751
Bug: b/178112303
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Icf01f723f1323f6f91030e6005958b7da05e8177
2021-01-29 20:58:52 -08:00
Peiyong Lin
72036e758c Merge "Add GameManager service." into sc-dev 2021-01-29 23:47:19 +00:00
Peiyong Lin
32f6ff7e15 Add GameManager service.
GameManager service is a service to manage game related features. This
patch creates the initial service to manage the game mode and persist
the data across reboot.

Bug: b/174956354
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Iee2ab47c79d29f48847bc6d4b3eb781a5af18ff4
2021-01-29 09:18:34 -08:00
Siyamed Sinir
30900cac3f System font check for downloadable font
Adds a new attribute to downloadable font xml
that checks if downloaded font is on the system
already and uses that instead.

Test: added new tests
Test: atest ResourcesTest
Test: atest FontResourcesParserTest

Bug: 178589784
Change-Id: Ib7c32ba3037c534e9ab8c144716d68e46c908a39
2021-01-28 20:05:11 +00:00
TreeHugger Robot
7142180435 Merge "Implement AnimatedImageDrawable#setBounds" into sc-dev 2021-01-28 18:50:25 +00:00
Seigo Nonaka
9387e7f4cd Add more shell command for font
Bug: 173619554
Test: atest UpdatableFontDirTest PersistentSystemFontConfigTest FontManagerTest
Change-Id: I25917fa9e8c42742f74222f25c5ba68d96a2c2fd
2021-01-27 22:59:06 +00:00
Leon Scroggins III
be969efdb0 Implement AnimatedImageDrawable#setBounds
Bug: 160617841
Test: If6edcada514977c2f08c29927380d35000173dc5

AnimatedImageDrawable.java:
- Override onBoundsChange. Silently do nothing if mNativePtr is 0. This
matches setRepeatCount, setAutoMirrored, and onLayoutDirectionChanged.
While some other methods throw an IllegalStateException, doing nothing
is safer for backwards compatibility.

AnimatedImageDrawable.h:
- Add Properties.mBounds. Putting it here provides a safe way for the UI
thread to change it, like it does for other properties (alpha, color
filter).
- Remove redundant "virtual" modifiers on "override" methods.

hwui/AnimatedImageDrawable.cpp:
- Initialize mStagingProperties.mBounds to use the intrinsic bounds. The
official documentation requires a client of Drawable to call setBounds,
but AnimatedImageDrawable as introduced in P started with the intrinsic
bounds. This ensures we maintain that behavior without special casing a
client that never calls the method.
- Handle the bounds, using a scale and translate
- Update the SkAutoCanvasRestores to save, removing the need to manually
determine whether it's necessary to call save().
- Update onGetBounds to return SkRectMakeLargest. This matches
RenderNodeDrawable and ReorderBarrierDrawables. Since the Drawable may
be updated by a call to setBounds to draw anywhere, this ensures the
bounds always contains the drawing.

jni/AnimatedImageDrawable.cpp:
- Plumb the new bounds to the native object.

Change-Id: If8d7ed51a56e0f64714f15e6041ed883e8ce23f8
2021-01-27 16:54:03 +00:00
Seigo Nonaka
46d6a3f9ce Add FontManager API and font manager shell commands
FontManager is an interface of communicating with FontManaserService.
With this CL, system apps can know the primitive information about
what font files are installed and how it is configured.

This CL also adds shell command of dumping font configuration.
Example usages are:

  # dump primitive font configuration.
  adb shell dumpsys font

  # dump fallback font list
  adb shell cmd font dump serif

Bug: 173619554
Test: atest FontManagerTest
Test: Manually confirmed above commands works.
Change-Id: I5cb855308e199ac38bd7b56b60821346247bdce3
2021-01-25 08:51:41 -08:00
Kohsuke Yatoh
4fc6b1a86b Merge "Use fs-verity for protecting updatable font files." 2021-01-22 16:05:12 +00:00
Kohsuke Yatoh
755199eab1 Use fs-verity for protecting updatable font files.
- Updatable font files should have fs-verity enabled.
- PostScript name metadata is checked to detect if files are swapped.
- Font revision metadata is checked to detect if version downgrade
  happens.

Bug: 176939176
Test: atest FrameworksServicesTests:UpdatableFontDirTest
Change-Id: Ie59012e17ef4f9db2419db259e0773067ace4120
2021-01-21 11:00:20 -08:00
Seigo Nonaka
7cdfcd8a87 Merge "Add utility method for identifying font type." 2021-01-21 17:58:54 +00:00
Seigo Nonaka
9d5ab7e41a Add utility method for identifying font type.
Bug: 176939176
Test: atest FontFileUtilTest
Change-Id: Iaf4e23128ee274c2beb10280eb64ba73e6bc2ad8
2021-01-20 22:50:09 -08:00
Chavi Weingarten
857a3713bb Merge "Remove preserve surfaces when surface format changes." 2021-01-20 22:08:10 +00:00
Wale Ogunwale
c04c4c1098 WindowContainerTransaction for setting adjacent roots
Ability to specify that 2 root tasks are adjcent there by allowing them
to occlude their parent. Similar to how the legacy primary/secondary
split windowing modes are used to occlude their parent.

Also, occlude parent if a child in multi-window mode as a matching
bounds.

Bug: 177166639
Test: AppConfigurationTests#testSplitscreenPortraitAppOrientationRequests
Change-Id: I7d54bfa188700a76b0bca911d2011123c21553ad
2021-01-20 06:37:04 -08:00
Galia Peycheva
f78234f112 Merge changes from topic "blur_system_api"
* changes:
  Make BackgroundBlurDrawable a SystemApi
  Make window background blurs SystemApi
  Add permission for blur SystemApi
2021-01-20 05:04:01 +00:00
Seigo Nonaka
f5859819cd Refactor font parser for making SystemApi.
This CL breaks system font initialization step into three sub-steps
to be able to expose font configuration as SystemApi. The font
initialization step is now following three steps:
 1. Parse XML files. This is SystemFonts#getSystemFontConfig and
    SystemFonts#getSystemPreinstalledFontConfig. The first API gives
    you the current FontConfig and the second API gives you plain
    vanilla FontConfig without any updates.
 2. Build font family fallback list from FontConfig. The font family
    fallback is a intermediate state that can be used for custom
    Typeface. This state is kept for dumping in shell command later.
    This is useful for checking what font will be used by the fallback
    since family fallback is still printable.
 3. Build typeface mapping. The typeface mapping is the final state to
    be used by application. This is no longer printable.

Bug: 173619554
Test: atest TypefaceTest TypefaceSystemFallbackTest StaticLayoutTest
Test: atest CtsGraphicsTestCases CtsTextTestCases
Change-Id: I4e21fc7c41f2fb7975d03c1d5f5536a23e8abb09
2021-01-19 15:55:41 -08:00
Galia Peycheva
42f19b6163 Make BackgroundBlurDrawable a SystemApi
Bug: 177524486
Test: check that using the drawable in the PermissionController works

Change-Id: I0b881ec6e9a41c5aed3ca17589a6d66ced0539bf
2021-01-19 13:50:53 +01:00
TreeHugger Robot
0ce28292cd Merge "Add helper class to read/write updatable font dir." 2021-01-16 03:05:06 +00:00
Alec Mouri
d3ef461fcd Merge "Remove Point#dump" 2021-01-15 23:24:03 +00:00
Kohsuke Yatoh
77c955268f Add helper class to read/write updatable font dir.
Bug: 173619554
Test: atest FrameworksCoreTests:TypefaceSystemFallbackTest
Test: atest FrameworksServicesTests:UpdatableFontDirTest
Change-Id: I950ed71a14d536eaeba5ab754a6c56a637b97217
2021-01-15 14:06:05 -08:00
TreeHugger Robot
106f1b33b4 Merge "Refactor RuntimeShader to support easier assignment of uniforms." 2021-01-15 20:16:55 +00:00
Derek Sollenberger
783e5aeb2e Refactor RuntimeShader to support easier assignment of uniforms.
uniforms are no longer set as single block of bytes where the caller
has to know the offset, but instead by the string identfier in the
shader.  This CL only supports floats, but future expansions of this
will provide helpers for ints, colors, and byte[].

Also by storing the shaders and uniforms in the RuntimeShaderBuilder
we can more easily copy them.  This enables Canvas.drawRipple to not
just copy the compiled SkSL effect, but also all the uniforms and
other input shaders set on the RuntimeShader.

Bug: 177051137
Test: HwAccelerationTest
Change-Id: I4733f42ba662546be6bebc37f0b89832778e66ce
2021-01-15 13:03:25 -05:00
chaviw
41117a4be7 Remove preserve surfaces when surface format changes.
When format is changed, there's no need to preserve surfaces. We can
just update the consumer to use the new format. There shouldn't be any
issues since the next dequeue will get a buffer with the new format. The
current buffer on screen won't change and the layer properties aren't changed
when format is updated. There's no need to recreate a new surface.

Instead, move the format updating logic to the client in VRI and send
the new format to BLASTBufferQueue so it can update the consumer.

Test: go/wm-smoke
Bug: 177557720
Change-Id: I26806cfd4b482e8b6165045f4af3c55a5955da0c
2021-01-15 09:36:09 -08:00
TreeHugger Robot
c1c9ca965c Merge "Add PostScript name and font revision retrival method" 2021-01-15 00:16:55 +00:00
John Reck
f0b5b1a076 Merge changes I1d7806aa,Ie906e628,Idf5a4acc
* changes:
  Convert DisplayList to a value-type wrapper
  Remove forward-decleration of SkiaDisplayList
  Avoid DisplayList* hitting the JNI layer
2021-01-14 18:02:57 +00:00
Seigo Nonaka
47b6c1bc2a Add PostScript name and font revision retrival method
Bug: 176939176
Test: Manually done (will add in subsequent CL.)
Change-Id: I2acbec7ee4362a91c1e6b3b765894106775ef2c4
2021-01-13 19:37:39 -08:00
John Reck
dc1a696f7c Avoid DisplayList* hitting the JNI layer
Keep the actual display list type internal to HWUI/native
avoids requiring that the recording type fits in a jlong

aka, opens up a usage of value types here instead

Test: boots
Change-Id: Idf5a4acc7dbcb61e6742a6bf6369bd351f595be4
2021-01-12 13:57:23 -05:00
Alec Mouri
f2d993ae93 Remove Point#dump
This is in response to API feedback - dump() methods for most of the
public classes describe complex internal state, which does not fit for
the Point class. Point#dump does not need to exist anyways, because
1. Point#toString exists, and
2. Point#dump only printed out the x,y coordinates, which are already
part of the public api, so printing out a more concise string
representation is trivial.

So, this patch removes Point#dump and just has RemoteAnimationTarget
implement its own print method for Point, since it was the only caller.

Bug: 159683987
Test: builds
Change-Id: I5c947330768b3e4e450eba3971de939a904d30d4
2021-01-11 17:38:19 -08:00
Kohsuke Yatoh
87036d61ec Check updatable font dir in FontListParser.
If updatable font dir is provided by caller and fonts exist in the dir,
FontListParser will use the updated fonts.
Currently, updatable font dir is used only in test.

Bug: 173619554
Test: atest TypefaceSystemFallbackTest
Change-Id: I631764fe235d258b6b5cb6d6906c17d48c7e4608
2021-01-11 16:11:53 +00:00
TreeHugger Robot
a6a7ea7ed2 Merge "Initial framework needed to draw circle with RuntimeShader." 2021-01-08 15:42:48 +00:00
Derek Sollenberger
df301aaa54 Initial framework needed to draw circle with RuntimeShader.
This also adds the ability for RenderThread to animate a few
predefined shader uniforms.

Bug: 177051137
Test: demo in ag/13296877
Change-Id: I6e58e671ad1242a07ecb1cf4cdb48031f85c2088
2021-01-08 12:47:31 +00:00
Mathew Inwood
7840d20929 Merge "Derestrict mSurfaceTexture, mProducer." am: 8e6ce38bde am: c1dbf374d0 am: 83b6163810
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1541665

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iea731e7ccdea5bc8618bbed1e206f9a07b2a6e3c
2021-01-07 12:26:28 +00:00
Mathew Inwood
83b6163810 Merge "Derestrict mSurfaceTexture, mProducer." am: 8e6ce38bde am: c1dbf374d0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1541665

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie3321c80292eada053fa4ef3319d9d3555fee3e6
2021-01-07 11:47:32 +00:00
Mathew Inwood
2702a6662d Merge "Derestrict RippleDrawable.mState." am: b698722956 am: f11b14dfe0 am: 6d1ff42ee6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1541666

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I370ce36e69b1daf56762eb2184ff780ff77e862b
2021-01-07 11:12:55 +00:00
Mathew Inwood
6d1ff42ee6 Merge "Derestrict RippleDrawable.mState." am: b698722956 am: f11b14dfe0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1541666

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If77c45731d85f983573da7f05dcc1fd912a2be9c
2021-01-07 10:51:44 +00:00
Mathew Inwood
8e6ce38bde Merge "Derestrict mSurfaceTexture, mProducer." 2021-01-07 09:47:42 +00:00
TreeHugger Robot
8ce762dd9f Merge "Updated RenderEffect documentation" 2021-01-07 02:32:06 +00:00
Nader Jawad
a59368e0fe Updated RenderEffect documentation
-Added documentation on RenderEffect usage
-Updated documentation regarding coordinate space
of dst rect to be within bounds of target
RenderNode
-Updated createBlendModeEffect documentation to
remove references to nullability since the parameters
are required to be non-null

Bug: 173657415
Test: N/A
Change-Id: Ief136650e40d1b820de9e175ac906f87c67ea864
2021-01-06 15:48:28 -08:00
Mathew Inwood
cc42f71234 Derestrict mSurfaceTexture, mProducer.
Usage has been discovered by an app so reverting this to its previous
state. This is conceptually a partial revert of change 5d123b6775.

NoNonSdkCheck: b/170729553

Bug: 176388660
Test: m
Change-Id: I4399e4d431f8a443343de312e131fbf86d0f60b5
2021-01-06 17:51:07 +00:00
Mathew Inwood
d5d9dc6828 Derestrict RippleDrawable.mState.
Usage has been discovered by an app so reverting this to its previous
state. This is conceptually a partial revert of change 5d123b6775.

NoNonSdkCheck: b/170729553

Bug: 175939224
Test: m
Change-Id: I277b085b490407bbe1899dd7f4614f51cd9ce36e
2021-01-06 17:49:09 +00:00
Jeff DeCew
8c59be26f7 Merge "Correct the resource type annotation on Icon.getResId()" 2021-01-05 21:45:56 +00:00
Vishnu Nair
0aa41a85fe Merge SV transactions to VRI BlastBufferQueue
Currently SV with blast sync requests a sync transaction from VRI and
merges its transactions with VRI's sync transaction. This can break if
we are not able to set the request in time.

Instead this change will merge SV transaction from the renderthread to
the VRI BlastBufferQueue specifying the framenumber which the
transaction should be merged with. The transaction will be queued until
we submit a VRI buffer with the requested frame number.

Test: open bubbles with sv blast
Test: atest SurfaceViewSyncTest
Bug: 175594838
Change-Id: I87ba346d782f615bab2e8a692adb2b3c49ef4021
2020-12-28 10:10:56 -08:00
Jeff DeCew
09424eadc4 Correct the resource type annotation on Icon.getResId()
Test: n/a
Fixes: 176106341
Change-Id: Id473e728ad6ce43eff8105c6817a5d52137bc5e9
2020-12-22 15:13:59 -05:00
chaviw
351e9cf9be Handle multiple relayout calls with blast sync
The issue is the following:
1. Call relayout from VRI. drawsNeededToReport = 1
2. SV also will need to be updated. drawsNeedToReport = 2
3. VRI is finished rendering, but SV is not. drawsNeedToReport = 1
4. VRI calls relayout again. drawsNeedToReport = 2
5. SV finishes drawing. drawsNeedToReport = 1

BBQ will get stuck since it's waiting indefinitey for a transaction
callback. The previous transaction can never get applied since we're
still waiting until drawsNeededToReport = 0.

This prevents situations like this from happening since it will not
allow a relayout to get called until the previous transaction has been
applied.

Test: Split screen with chrome
Bug: 167202096
Change-Id: I167a90ef00fa6677b3c55239e74eefb6a1384baf
2020-12-21 16:37:35 -08:00
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