Fixed
Status Update
Comments
al...@google.com <al...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e7b4b06e67951ab47157d06ff314a5c8b2e8fdc6
Author: Andrei Shikov <ashikov@google.com>
Date: Mon Jan 08 15:54:51 2024
Count recursive local declarations as captures
Local declarations were already counted as captures for composable lambdas before, but the traversal ordering missed the recursive captures, converting some of them into singletons.
Test: Compiler test
Fixes: 318745941
Change-Id: I9097d1be71fb67b73e5027f723fd187c4272f6b4
M compose/compiler/compiler-hosted/integration-tests/src/androidUnitTest/kotlin/androidx/compose/compiler/plugins/kotlin/ComposeBytecodeCodegenTest.kt
M compose/compiler/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/AbstractCodegenTest.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerLambdaMemoization.kt
https://android-review.googlesource.com/2900890
Branch: androidx-main
commit e7b4b06e67951ab47157d06ff314a5c8b2e8fdc6
Author: Andrei Shikov <ashikov@google.com>
Date: Mon Jan 08 15:54:51 2024
Count recursive local declarations as captures
Local declarations were already counted as captures for composable lambdas before, but the traversal ordering missed the recursive captures, converting some of them into singletons.
Test: Compiler test
Fixes: 318745941
Change-Id: I9097d1be71fb67b73e5027f723fd187c4272f6b4
M compose/compiler/compiler-hosted/integration-tests/src/androidUnitTest/kotlin/androidx/compose/compiler/plugins/kotlin/ComposeBytecodeCodegenTest.kt
M compose/compiler/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/AbstractCodegenTest.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerLambdaMemoization.kt
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 1f3662b880b32c0b6bbd1f332bc40f4dfbb58e6f
Author: Alex Clarke <alexclarke@google.com>
Date: Mon Jun 26 12:22:46 2023
Expose watch face IntDef constants
Prior to ag/2470904 IntDefs in the watch face library had publically
visible constants. That patch was correct to restrict the IntDefs,
the problem is the constants shouldn't have been defined in a
companion object of the IntDef. Unfortunately that ship has sailed
but here we can expose the constants, and update our samples
accordingly. The constants on the IntDef companion objects have
been retained in case there's code that uses them.
Test: Presubmit
Relnote: This ptach exposes WatchFaceType constants in WatchFaceTypes, CanvasType constants in CanvasTypes, TapType contants in TapTypes and ComplicationsSlotBoundsType constants in ComplicationsSlotBoundsType.
Bug: 288750666
Change-Id: I3b85afb17aa66668bb1b012c1eb9849b38affeb9
M wear/watchface/watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceControlClientTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/HeadlessWatchFaceClientTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/TestNopCanvasWatchFaceService.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/TestWatchFaceServices.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt
M wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
M wear/watchface/watchface-client/src/test/java/androidx/wear/watchface/client/WatchFaceMetadataClientTest.kt
M wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
M wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
M wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
M wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableCanvasRenderer2Test.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableCanvasRendererTest.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableGlesRenderer2Test.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableGlesRendererTest.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableWatchFaceServiceTest.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableXmlWatchfaceServiceTest.kt
M wear/watchface/watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
M wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
M wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java
M wear/watchface/watchface-samples-minimal-instances/src/main/java/androidx/wear/watchface/samples/minimal/instances/WatchFaceRenderer.java
M wear/watchface/watchface-samples-minimal-instances/src/main/java/androidx/wear/watchface/samples/minimal/instances/WatchFaceService.java
M wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
M wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceService.java
M wear/watchface/watchface/api/current.txt
M wear/watchface/watchface/api/restricted_current.txt
M wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
M wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceService.java
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleHierarchicalStyleWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
M wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
M wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
M wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/XmlDefinedUserStyleSchemaAndComplicationSlotsTest.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/Renderer.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/XmlSchemaAndComplicationSlotsDefinition.kt
M wear/watchface/watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
M wear/watchface/watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
M wear/watchface/watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
https://android-review.googlesource.com/2636578
Branch: androidx-main
commit 1f3662b880b32c0b6bbd1f332bc40f4dfbb58e6f
Author: Alex Clarke <alexclarke@google.com>
Date: Mon Jun 26 12:22:46 2023
Expose watch face IntDef constants
Prior to ag/2470904 IntDefs in the watch face library had publically
visible constants. That patch was correct to restrict the IntDefs,
the problem is the constants shouldn't have been defined in a
companion object of the IntDef. Unfortunately that ship has sailed
but here we can expose the constants, and update our samples
accordingly. The constants on the IntDef companion objects have
been retained in case there's code that uses them.
Test: Presubmit
Relnote: This ptach exposes WatchFaceType constants in WatchFaceTypes, CanvasType constants in CanvasTypes, TapType contants in TapTypes and ComplicationsSlotBoundsType constants in ComplicationsSlotBoundsType.
Bug: 288750666
Change-Id: I3b85afb17aa66668bb1b012c1eb9849b38affeb9
M wear/watchface/watchface-client-guava/src/androidTest/java/androidx/wear/watchface/client/guava/ListenableWatchFaceControlClientTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/HeadlessWatchFaceClientTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/SerializationTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/TestNopCanvasWatchFaceService.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/TestWatchFaceServices.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceControlClientTest.kt
M wear/watchface/watchface-client/src/androidTest/java/androidx/wear/watchface/client/test/WatchFaceMetadataServiceTest.kt
M wear/watchface/watchface-client/src/main/java/androidx/wear/watchface/client/InteractiveWatchFaceClient.kt
M wear/watchface/watchface-client/src/test/java/androidx/wear/watchface/client/WatchFaceMetadataClientTest.kt
M wear/watchface/watchface-complications-rendering/src/main/java/androidx/wear/watchface/complications/rendering/CanvasComplicationDrawable.kt
M wear/watchface/watchface-complications-rendering/src/test/java/androidx/wear/watchface/complications/rendering/ComplicationDrawableTest.java
M wear/watchface/watchface-editor/src/androidTest/java/androidx/wear/watchface/editor/EditorSessionTest.kt
M wear/watchface/watchface-editor/src/main/java/androidx/wear/watchface/editor/EditorSession.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableCanvasRenderer2Test.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableCanvasRendererTest.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableGlesRenderer2Test.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableGlesRendererTest.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableWatchFaceServiceTest.kt
M wear/watchface/watchface-guava/src/androidTest/java/androidx/wear/watchface/AsyncListenableXmlWatchfaceServiceTest.kt
M wear/watchface/watchface-guava/src/test/java/androidx/wear/watchface/ListenableWatchFaceServiceTest.kt
M wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceRenderer.java
M wear/watchface/watchface-samples-minimal-complications/src/main/java/androidx/wear/watchface/samples/minimal/complications/WatchFaceService.java
M wear/watchface/watchface-samples-minimal-instances/src/main/java/androidx/wear/watchface/samples/minimal/instances/WatchFaceRenderer.java
M wear/watchface/watchface-samples-minimal-instances/src/main/java/androidx/wear/watchface/samples/minimal/instances/WatchFaceService.java
M wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceRenderer.java
M wear/watchface/watchface-samples-minimal-style/src/main/java/androidx/wear/watchface/samples/minimal/style/WatchFaceService.java
M wear/watchface/watchface/api/current.txt
M wear/watchface/watchface/api/restricted_current.txt
M wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceRenderer.java
M wear/watchface/watchface/samples/minimal/src/main/java/androidx/wear/watchface/samples/minimal/WatchFaceService.java
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasDigitalWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleHierarchicalStyleWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLBackgroundInitWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleOpenGLWatchFaceService.kt
M wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/KDocExampleWatchFace.kt
M wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceControlServiceTest.kt
M wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/WatchFaceServiceImageTest.kt
M wear/watchface/watchface/src/androidTest/java/androidx/wear/watchface/test/XmlDefinedUserStyleSchemaAndComplicationSlotsTest.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlot.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/ComplicationSlotsManager.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/RenderParameters.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/Renderer.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/TapEvent.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFace.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/WatchFaceService.kt
M wear/watchface/watchface/src/main/java/androidx/wear/watchface/XmlSchemaAndComplicationSlotsDefinition.kt
M wear/watchface/watchface/src/test/java/androidx/wear/watchface/AsyncWatchFaceInitTest.kt
M wear/watchface/watchface/src/test/java/androidx/wear/watchface/TestCommon.kt
M wear/watchface/watchface/src/test/java/androidx/wear/watchface/WatchFaceServiceTest.kt
al...@google.com <al...@google.com> #5
That patch is subject to API council review, but hopefully it improves the situation. I'll arrange for another alpha in due course.
ia...@gmail.com <ia...@gmail.com> #6
Is there a reason you needed to change any part of the public API surface? Given that the annotation itself isn't part of the public API, couldn't you have just renamed the IntDef annotation class?
E.g.,
public object WatchFaceType {
/* The WatchFace has an analog time display. */
public const val ANALOG: Int = 0
/* The WatchFace has a digital time display. */
public const val DIGITAL: Int = 1
}
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef(value = [WatchFaceType.DIGITAL, WatchFaceType.ANALOG])
public annotation class WatchFaceTypes
al...@google.com <al...@google.com> #7
OK if we can rename the IntDefs that does sound better.
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #8
Oops I'm probably going to confuse the tooling here. I landed a follow up patch:
ia...@gmail.com <ia...@gmail.com> #9
Thanks so much - that follow up change looks great! I'll be sure to test it once the next release comes out.
Description
Component used: Wear-Watchface
Version used: 1.2.0-alpha08 or higher
After upgrading to Wear Watchface 1.2.0-alpha08 or higher, I noticed an error in Android Studio on both the
WatchFaceType
andCanvasType
integers that they should only be used within the androidx.wear.watchface library:It appears this is an unintended side effect of this CL that marked those annotation classes as
@RestrictTo(RestrictTo.Scope.LIBRARY)
.Would it be possible to separate the constants (which really could just be on a regular Kotlin
object
, rather than as part of acompanion object
of a restricted class) from the restricted annotation class (which it doesn't matter what the class name of that annotation actually is)?It is really annoying to have the red underlines in Android Studio and associated lint failures.
FWIW, I noticed that this does not apply to constants such as
WatchFaceStyle.PROTECT_STATUS_BAR
, but only to constants within apublic annotation class
that is restricted.From this search , it appears this issue affects:
WatchFaceType
constantsCanvasType
constantsTapType
constantsComplicationsSlotBoundsType
constants