4783 Commits

Author SHA1 Message Date
Treehugger Robot
cd3bbf1e70 Merge "ColorSpace.java,cosmetics: fix some typos" am: 65240d6ee5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2468880

Change-Id: Ic5baa7db6ce3db42b01fd8214f3a4907ee9fa980
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 21:14:59 +00:00
James Zern
df1b76b4e5 ColorSpace.java,cosmetics: fix some typos
Change-Id: I2cd5a5a4b27b1715e721fd0216be5fbd8a611ea0
Test: N/A
2023-03-02 19:11:45 -08:00
Leon Scroggins
9c6d82c50c Merge "Fix javadoc typos in Color and Context" am: d153fa3fe3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1238267

Change-Id: If3caca7db0214adc107d7226dca32ec3dc00ce66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 19:49:32 +00:00
Ian Baker
956a76ae36 Fix javadoc typos in Color and Context
Context: you're -> your
Color: blue -> alpha (copy-paste mistake from method above)

Change-Id: I4c4c5bd33f464c7902245e5fc32016a30e19a2a4
2023-02-28 12:40:37 +00:00
Cole Faust
d3c499dabc Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I8090e254f06a3b5fc7e9b23fdae6c5bd3db230c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:37:15 +00:00
Cole Faust
f9df26ae3c Merge "Fix errorprone warnings that should be errors" am: 677d6cd780
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I0e9c5077610407a117ee34ff688b40b52e161a03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:11:55 +00:00
Cole Faust
7da659bb6c Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
2022-11-14 17:57:30 -08:00
Nolan Scobie
a8d447ca9a Merge "docs: Note that antialiasing is not supported on multiple Canvas draw ops" into tm-dev am: 3b5f7cb4ba am: 7b351a48d8 am: 6f9c9792a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20376185

Change-Id: I148060de7166574a6e817b38b1d37d0e34a3593f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 20:54:07 +00:00
Nolan Scobie
6f9c9792a4 Merge "docs: Note that antialiasing is not supported on multiple Canvas draw ops" into tm-dev am: 3b5f7cb4ba am: 7b351a48d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20376185

Change-Id: If89172b1bdc4d6e75f0eaac3c3467924b8c8a6bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 20:40:30 +00:00
Nolan Scobie
3b5f7cb4ba Merge "docs: Note that antialiasing is not supported on multiple Canvas draw ops" into tm-dev 2022-11-14 19:30:01 +00:00
Nolan Scobie
6a23f4bf10 docs: Note that antialiasing is not supported on multiple Canvas draw ops
Fixes: 240457136
Test: Manually checked pages built from ABTD run
Change-Id: I024959a5d9bc74a1a45dfe65245f8952ad18c236
2022-11-03 16:19:17 -04:00
Sebastián Franco
3aaf48ffc6 Merge "Revert "Using clippath for adaptive icon drawable instead of bit..."" into tm-qpr-dev am: 132b386fc5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19991819

Change-Id: I27b89d458f6b7d3ba4fe3c85d5b6399fa7d1fc7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-20 15:51:32 +00:00
Sebastián Franco
132b386fc5 Merge "Revert "Using clippath for adaptive icon drawable instead of bit..."" into tm-qpr-dev 2022-09-20 15:27:07 +00:00
Sebastián Franco
3ccaff2fc7 Revert "Using clippath for adaptive icon drawable instead of bit..."
Revert "Fixing alpha tests for adaptive drawable"

Revert submission 19370745-no-clip-adaptive_icon

Reason for revert: Culprit cl for b/241010439
Reverted Changes:
Ieb428748a:Fixing alpha tests for adaptive drawable
I60ce42d91:Using clippath for adaptive icon drawable instead ...

Change-Id: I70a55c49ee6929a20a8bcda83284f5fe59256be0
2022-09-19 16:47:22 +00:00
Andrew Solovay
d9f47f36c9 Merge "Fix example AGSL code in the javadoc comments" into tm-dev am: 89acf500cb am: 0dc87cd904 am: 48a36fc521
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19889898

Change-Id: Ib78c5529a4f57da3b38e22e3c9c0ed964579219f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 20:35:25 +00:00
Andrew Solovay
e4f2b5f570 Merge "Fix example AGSL code in the javadoc comments" into tm-dev am: 89acf500cb am: c7a544b14d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19889898

Change-Id: Id531b6cdd0e9d4a205fa1baac4c28a19dce696a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 20:12:45 +00:00
Andrew Solovay
0dc87cd904 Merge "Fix example AGSL code in the javadoc comments" into tm-dev am: 89acf500cb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19889898

Change-Id: I37850fbf06135fc19137bab4c5dd33bdd250f2e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 19:17:31 +00:00
Brian Osman
640927e292 Fix example AGSL code in the javadoc comments
Need to land this fix in tm-dev for it to show up in the published reference docs.

Bug: 237562620
Test: [go/atsd docs build]
Change-Id: I5f562b70d04bc86779190002a2640fb51dc00531
(cherry picked from commit 0547bffe400ecc877e22701d6bd7f6af33c29b4d)
2022-09-07 22:56:42 +00:00
Cole Faust
9b3a5fc03b Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I7052a1f7391ed6701fe0e1036c27368609032e35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 20:44:00 +00:00
Cole Faust
584140c83a Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.

Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ia6f216cc36ad0a5758f39fd9b34962cd4adf9d8e
2022-08-25 10:57:12 -07:00
Sunny Goyal
63985967cb Fixing getSafeZone() method in AdaptiveIcon
Bug: 240335326
Test: atest FrameworksCoreTests:android.graphics.drawable.IconTest#testWithAdaptiveBitmap -- --abi x86_64
Change-Id: I1204bd759a347a9635dfb48e71ff65cef1f75f9d
2022-08-03 23:17:55 +00:00
Sunny Goyal
6d611a3054 Using clippath for adaptive icon drawable instead of bitmap shader
clipPath is already anti-aliased since Android S, so we do not
need to create extra bitmaps for this

Bug: 211896569
Bug: 238937089
Test: Updated tests / presubmit
Change-Id: I60ce42d91ca96babbde9faa4e5580b00f681de35
2022-07-21 20:59:17 +00:00
Jernej Virag
4dc2e413c6 Describe image loads in Traces
This adds tracing to ImageDecoder for image loads. When a drawable is
being loaded, it'll emit a short description of the resource and desired
loading sizes. This will make it significantly easier to find large,
slow bitmap loads when debugging regressions.

Bug: 235451049
Test: physically on a Raven device
Change-Id: I615342f1bd11d867e0bd33209507330848df8525
2022-06-20 09:14:03 +00:00
Charles Chen
fa3f9ca94c Respect minimum dimensions for embedded Activities
Before this CL, minimum dimensions of Activity wasn't respected,
that said, an Activity could be embedded in a TaskFragment of which
bounds are smaller its minimum dimensions.
This CL add the minimum dimensions on several places:

WM core:
1. Verify minimum dimension requirement before adding an Activity to
   a TaskFragment. It'll be early return if the requirement is not
   satisfied.
2. Propagate the minimum dimensions to the client side through
   TaskFragmentInfo to notify the requirement.
3. If TaskFragmentOrganizer tries to shrink a TaskFragment to
   the bounds that smaller than minimum dimensions of its children
   Activity, switch to match the parent bounds.
AndroidX Window extensions:
1. Early return if TaskFragment is resized to the bounds that smaller
   than minimum dimensions which dispatched from the server side.
2. When organizer tries to show Activities side-by-side, verify if
   minimum dimensions requirement of the primary Activiy. If the
   requirement is not satisfied, show Activities in fullscreen
   instead.
TODO: Add an API to check if an Activity intent is allowed to embed
   in a TaskFragment.

Bug: 232871351
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest TaskFragmentOrganizerPolicyTest
Test: atest SplitActivityLifecycleTest
Test: atest CtsWindowManagerJetpackTestCases
Test: atest WmJetpackUnitTests

Merged-In: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
Change-Id: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
2022-06-15 00:32:34 +08:00
TreeHugger Robot
8745d54ced Merge "Reduce RippleDrawable background opacity when no window focus" into tm-qpr-dev 2022-06-09 15:18:20 +00:00
Louis Chang
642279e214 Reduce RippleDrawable background opacity when no window focus
Lower the background opacity when the window loses focus
while the view still has focus, in order to prevent user
confusion in a multi-window environment.

Bug: 230355625
Test: manually verified
Change-Id: I59cd7faf35f05a12451f015f8ef2da47077b1bf2
Merged-In: I59cd7faf35f05a12451f015f8ef2da47077b1bf2
2022-06-01 15:18:54 +08:00
Charles Chen
482fbfabd7 Respect minimum dimensions for embedded Activities
Before this CL, minimum dimensions of Activity wasn't respected,
that said, an Activity could be embedded in a TaskFragment of which
bounds are smaller its minimum dimensions.
This CL add the minimum dimensions on several places:

WM core:
1. Verify minimum dimension requirement before adding an Activity to
   a TaskFragment. It'll be early return if the requirement is not
   satisfied.
2. Propagate the minimum dimensions to the client side through
   TaskFragmentInfo to notify the requirement.
3. If TaskFragmentOrganizer tries to shrink a TaskFragment to
   the bounds that smaller than minimum dimensions of its children
   Activity, switch to match the parent bounds.
AndroidX Window extensions:
1. Early return if TaskFragment is resized to the bounds that smaller
   than minimum dimensions which dispatched from the server side.
2. When organizer tries to show Activities side-by-side, verify if
   minimum dimensions requirement of the primary Activiy. If the
   requirement is not satisfied, show Activities in fullscreen
   instead.
TODO: Add an API to check if an Activity intent is allowed to embed
   in a TaskFragment.

Bug: 232871351
Test: atest TaskFragmentOrganizerControllerTest
Test: atest TaskFragmentOrganizerTest TaskFragmentOrganizerPolicyTest
Test: atest SplitActivityLifecycleTest
Test: atest CtsWindowManagerJetpackTestCases
Test: atest WmJetpackUnitTests

Change-Id: Ib46c2cec2a0735b9e3f3420f2cb94754801b86b9
2022-05-31 23:25:18 +08:00
Nader Jawad
b9a8ed8b70 Merge "Fix memory leak with RenderNodeAnimator" into tm-dev 2022-05-11 16:49:16 +00:00
Nader Jawad
528b0d2824 Fix memory leak with RenderNodeAnimator
Update View logic to cancel all RenderNodeAnimators
when it is detached from a window.
Updated HWUI Animation logic to enable a cancellation
flag to cancel all animators operating on a RenderNode
whenever the staging parameters are pushed to RenderThread

Fixes: 229136453
Test: Added core test to RenderNodeAnimatorTests
Change-Id: Id674e8474757bfc8dfe30394dde29da49d139bfc
2022-05-10 14:02:40 -07:00
Rob Carr
7a0ee72bff Merge "ViewRootImpl/SurfaceView: Listen for queue stalls" into tm-dev 2022-05-05 15:11:39 +00:00
Jay Aliomer
b6dfbd9597 Merge "Set mask shader after matrix is set" into tm-dev 2022-04-30 13:28:28 +00:00
Jay Aliomer
dd1b5b147e Set mask shader after matrix is set
When the size of the drawable bounds changes, the mask shader is not updated properly
Assumed passed by reference instead of pass by value which resulted in
the wrong behavior

Fixes: 227624349
Test: RippleMicrobenchmark
Change-Id: Iedc3f06441414455fcfedf8cabd61e5b334a7441
2022-04-28 21:01:30 +00:00
Tim Murray
e8c5addab3 Revert "Revert "Icon: make Icon's Bitmaps immutable""
This reverts commit 8fd35436faeee6968dbd1509c118706f34017db9.

Reason for revert: NotificationTemplateTest fixed
Test: atest CtsAppTestCases:android.app.cts.NotificationTemplateTest
Bug: 227920378

Change-Id: I61dc3cb7620d64a55deb669cb1f08f4676d36456
2022-04-25 17:49:24 +00:00
Xiaowen Lei
8fd35436fa Revert "Icon: make Icon's Bitmaps immutable"
This reverts commit 47032a209517ccdc50bbcc27b2f4e5bbaaf28552.

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

Change-Id: I22f5aa5bd57e37d638292773986b479428e5cdbc
2022-04-22 23:26:47 +00:00
Tim Murray
47032a2095 Icon: make Icon's Bitmaps immutable
Because Bitmap mutability is propagated across Parcel and Binder, the
following problem can happen when sending an Icon containing a Bitmap
as part of a Notification:

1. App creates Icon with a mutable Bitmap (1 alloc)
2. App sends Icon to system_server, often creating ashmem Bitmap (2 allocs)
3. system_server converts ashmem Bitmap back to heap Bitmap (3 allocs)
4. system_server sends heap Bitmap to each NotificationListener individually,
converting the heap Bitmap to ashmem each time (3+N allocs)
5. NotificationListener converts ashmem Bitmap to heap Bitmap (3+2N allocs)

This is inefficient. This is especially bad because the API to update
a Notification involves sending a full Notification object, including
Icons, repeatedly, and some apps do that several times per second.

Instead, ensure that all Bitmaps transmitted as part of Icons are
immutable. Instead, we get:

1. App creates Icon, which may copy to immutable Bitamp (1 or 2 allocs)
2. App sends Icon to system_server over ashmem (still 1 or 2 allocs)
3. system_server uses received ashmem Bitmap directly (still 1 or 2 allocs)
4. system_server sends same ashmem Bitmap to NotificationListeners (1 or 2)
5. Each NotificationListener uses the same ashmem Bitmap (1 or 2)

This solves the per-NotificationListener amplification, but it does
not solve sending what is likely the same Bitmap N times per second
when apps update Notifications. That will require either app changes
or Notification API changes to avoid bytewise comparisons for all
Bitmaps.

Test: boot, notifications work, memory in maps/gearhead remains good
Bug: 227920378

Change-Id: If92835f647a76da599f358c7c02888e3e2f59235
2022-04-21 18:54:53 +00:00
Treehugger Robot
814a75d586 Merge "Exclude flaky tests from CtsGraphicsTestCases" am: 64c920c24d am: 5d145dbcc0 am: ff646ddc80
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2068130

Change-Id: I2be1a106f68dbef3d2b0c85fd9d3eb406c7502c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 18:24:18 +00:00
Dan Shi
99476cf78c Exclude flaky tests from CtsGraphicsTestCases
Bug: 229142513
Test: none
Change-Id: I294431cb4c8d1b7d7d8d9e8320f2a4b9e01a28b8
2022-04-19 10:02:20 -07:00
Robert Carr
7e53d0e9f5 ViewRootImpl/SurfaceView: Listen for queue stalls
Native machinery now reports queue stalls from native layer
up to java layer, which can more appropriately handle errors.
The first case we handle is the case of "stuck fences", generally
indicating GPU hangs. In this case we trigger a bespoke ANR rather
than waiting for an ANR in dequeueBuffers later. dequeueBuffers
ANR could have any number of causes, and this large cluster
is difficult to debug.

Bug: 216160569
Test: Existing tests pass
Change-Id: I7b4429ce96d0bbfa1b74534ddf2b447facb22d10
2022-04-15 15:13:04 -07:00
chaviw
845d5ad06e Default to true for updateDestinationFrame in BBQ
In most cases, we do want the destination frame to be updated by BBQ.
The exception is SV due to multiple threads involved in property
changes. Change the default updateDestinationFrame to true and let SV
set it to false for their scenario.

Test: Apps with NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW work
Fixes: 228008717
Change-Id: I90ae6f0797633aa963c540a94f1cbaea9e498f23
2022-04-11 14:35:01 -05:00
Chavi Weingarten
c1f9e4c0b9 Merge "Add call to disable RT Animations" into tm-dev 2022-03-23 23:23:35 +00:00
chaviw
adba0b1861 Add forceDrawNextFrame function for HardwareRenderer
The forceDraw flag in HardwareRenderer will ensure a frame is drawn when
requested even if it would end up drawing multiple frames in a single
vsync.

This is to help blast sync when we want to synchronize the
buffer. We want to make sure we are guaranteed a callback since we don't
want to wait for retries, especially in the case when trying to synchronize
multiple buffers.

There was already a global flag to handle this, but would use the flag
for all draws. This new function is set per draw so once a frame is
drawn it's unset. The global flag was only used for tests so updated the
test to set the flag before every draw and deleted the global property.

Test: Underlying code was in place. This is just piping a new setter. No
usages yet.
Test: TestSceneRunner
Bug: 200284684

Change-Id: Ie1c9950cabb7331cfed1721564a51a1a15cd1624
2022-03-22 18:08:38 -05:00
chaviw
01053d4350 Add call to disable RT Animations
HWUI already supports disabling RT animations, but there was no correct
way to call it from the application. Adding a call to enable or disable
RT animations on the RenderThread so RT animations can be disabled
during a blast sync.

Test: Builds
Bug: 200284684
Change-Id: Ia1ae3498c38b84b4975f08d37bc764f0c690ed9f
2022-03-22 15:41:24 -05:00
Jay Aliomer
973fc119c5 Merge "Fix faint ripple" into tm-dev 2022-03-21 17:03:41 +00:00
Jay Aliomer
475648ae02 Fix faint ripple
Fixes: 224547325
Test: manual
Change-Id: I9c1da7a5065dca9620ebc1f3d88d5525f0d3527c
2022-03-18 01:32:15 -04:00
Jeremy Meyer
88000ab26e Merge "Have Typeface pass a cookie of -1 to search through all assets" into tm-dev 2022-03-16 20:44:06 +00:00
Jeremy Meyer
a07474c452 Have Typeface pass a cookie of -1 to search through all assets
Without this, when font are overlayed it will fail because it is looking
in the wrong place to load the font

Bug: 151770185
Test: Manual, example app that has a font that is overlayed
Change-Id: I64c5a436b7250cfd0a75f5de36c64f07a20d523a
2022-03-15 23:52:15 +00:00
Garfield Tan
bce590e356 Merge "Add argument checks in setScale and setCrop" into tm-dev 2022-03-15 20:53:04 +00:00
TreeHugger Robot
e8acb4a612 Merge "Update the text wrapping API." into tm-dev 2022-03-14 23:09:41 +00:00
Jay Aliomer
579e07b4dc Ripple mask shader not drawing properly
Test: using a test app
Fixes: 200069735
Fixes: 188112758
Fixes: 198177042
Fixes: 189485964
Change-Id: Ibc08e9945b1a57483beb93fa428be1ab0a5da9bb
2022-03-10 13:24:00 -05:00
James.cf Lin
396c789426 Update the text wrapping API.
1) Update the LineBreakConfig class to be immutable.
2) Do not return null in the PrecomputedText.Params#getLineBreaiConfig API

Bug: 216638444
Test: atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest; atest TextViewPrecomputedTextTest; atest StaticLayoutLineBreakingVariantsTest
Merged-In: I93bcb6ebc35344e34e9bb8a24df375aa7b3a8d81
Merged-In: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
Change-Id: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
2022-03-10 09:58:40 +00:00