Fixed
Status Update
Comments
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/tools/metalava
Branch: metalava-main
commit b48703daf63321ceeb6edeca15f6f6e83f70718b
Author: Alan Viverette <alanv@google.com>
Date: Fri Apr 28 12:31:37 2023
Allow checking API compatibility conditionally based on annotations
Bug: 278769092
Test: CompatibilityCheckTest
Change-Id: I3c566bb0219b358795a7acb74ecebb269b217083
M src/main/java/com/android/tools/metalava/CompatibilityCheck.kt
M src/main/java/com/android/tools/metalava/Issues.kt
M src/main/java/com/android/tools/metalava/Options.kt
M src/main/java/com/android/tools/metalava/model/Item.kt
M src/main/java/com/android/tools/metalava/model/ModifierList.kt
M src/test/java/com/android/tools/metalava/CompatibilityCheckTest.kt
M src/test/java/com/android/tools/metalava/DriverTest.kt
M src/test/java/com/android/tools/metalava/OptionsTest.kt
https://android-review.googlesource.com/2571751
Branch: metalava-main
commit b48703daf63321ceeb6edeca15f6f6e83f70718b
Author: Alan Viverette <alanv@google.com>
Date: Fri Apr 28 12:31:37 2023
Allow checking API compatibility conditionally based on annotations
Bug: 278769092
Test: CompatibilityCheckTest
Change-Id: I3c566bb0219b358795a7acb74ecebb269b217083
M src/main/java/com/android/tools/metalava/CompatibilityCheck.kt
M src/main/java/com/android/tools/metalava/Issues.kt
M src/main/java/com/android/tools/metalava/Options.kt
M src/main/java/com/android/tools/metalava/model/Item.kt
M src/main/java/com/android/tools/metalava/model/ModifierList.kt
M src/test/java/com/android/tools/metalava/CompatibilityCheckTest.kt
M src/test/java/com/android/tools/metalava/DriverTest.kt
M src/test/java/com/android/tools/metalava/OptionsTest.kt
cl...@google.com <cl...@google.com> #3
aosp/2571751 implemented support in Metalava.
Remaining work:
- Update Metalava used by
androidx-main
- Add flags to suppress compatibility for
@RequiresOptIn
- Remove extra Metalava invocation in AndroidX plugin
- Re-generate API files to combine
current
andexperimental
- Update API Council guidance and send out PSA
zy...@gmail.com <zy...@gmail.com> #5
Project: platform/tools/metalava
Branch: metalava-main
commit ca39b114eb67d316ba1252b5e724cca7b8182c55
Author: Alan Viverette <alanv@google.com>
Date: Thu May 04 17:06:42 2023
Refactor compatibility suppression APIs
Bug: 278769092
Test: CompatibilityCheckTest
Change-Id: I5b1672b84b3a79b568d6b358abf6e2e34244ba6f
M src/main/java/com/android/tools/metalava/CompatibilityCheck.kt
M src/main/java/com/android/tools/metalava/Options.kt
M src/main/java/com/android/tools/metalava/model/Item.kt
M src/main/java/com/android/tools/metalava/model/ModifierList.kt
M src/test/java/com/android/tools/metalava/CompatibilityCheckTest.kt
M src/test/java/com/android/tools/metalava/DriverTest.kt
M src/test/java/com/android/tools/metalava/OptionsTest.kt
https://android-review.googlesource.com/2579373
Branch: metalava-main
commit ca39b114eb67d316ba1252b5e724cca7b8182c55
Author: Alan Viverette <alanv@google.com>
Date: Thu May 04 17:06:42 2023
Refactor compatibility suppression APIs
Bug: 278769092
Test: CompatibilityCheckTest
Change-Id: I5b1672b84b3a79b568d6b358abf6e2e34244ba6f
M src/main/java/com/android/tools/metalava/CompatibilityCheck.kt
M src/main/java/com/android/tools/metalava/Options.kt
M src/main/java/com/android/tools/metalava/model/Item.kt
M src/main/java/com/android/tools/metalava/model/ModifierList.kt
M src/test/java/com/android/tools/metalava/CompatibilityCheckTest.kt
M src/test/java/com/android/tools/metalava/DriverTest.kt
M src/test/java/com/android/tools/metalava/OptionsTest.kt
Description
Component used: Navigation
Version used: 2.8.5
The attempts to fill in the
NavDestination.fillInLabel
methodlabel
of theNavDestination
with arguments. However, it does this by (in every case butNavType.ReferenceType
) by just callingargs[argName].toString()
- e.g., just directly callingtoString()
on the object in theSavedState
bundle.While this approach works for simple types, a custom
NavType
might not store their class directly in the Bundle - for example, if using the@Serializable
support, it would be stored as aBundle
, which means thetoString()
is unlikely to actually be what is needed.Instead,
fillInLabel
should take into account theNavType
and use itsget
method to give theNavType
control over exactly the object that is synthesized from the arguments. That way, developers could implement a customtoString()
implementation on their object to control how it is displayed in the label.