Assigned
Status Update
Comments
al...@google.com <al...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 8543c0bbaec9d934547a78b720e31e7d6fd51696
Author: Kuan-Ying Chou <kuanyingchou@google.com>
Date: Fri Aug 19 17:59:17 2022
Add key parameter to hiltViewModel()
Add key parameter to hiltViewModel() to support creating multiple
instances of the same view model type.
Since Metalava complains that adding a parameter with default value
to an inline function is not binary compatible, we suppress it for
now: b/245139957 .
Test: HiltViewModelComposeTest.kt
Relnote: Add key parameter to hiltViewModel() to support creating multiple instances of the same view model type.
Change-Id: I6ee4727a4b690bc35af4280b61ba2986d9eebb9b
A hilt/hilt-navigation-compose/api/current.ignore
M hilt/hilt-navigation-compose/api/current.txt
M hilt/hilt-navigation-compose/api/public_plus_experimental_current.txt
A hilt/hilt-navigation-compose/api/restricted_current.ignore
M hilt/hilt-navigation-compose/api/restricted_current.txt
M hilt/hilt-navigation-compose/build.gradle
M hilt/hilt-navigation-compose/src/androidTest/java/androidx/hilt/navigation/compose/HiltViewModelComposeTest.kt
M hilt/hilt-navigation-compose/src/main/java/androidx/hilt/navigation/compose/HiltViewModel.kt
https://android-review.googlesource.com/2190956
Branch: androidx-main
commit 8543c0bbaec9d934547a78b720e31e7d6fd51696
Author: Kuan-Ying Chou <kuanyingchou@google.com>
Date: Fri Aug 19 17:59:17 2022
Add key parameter to hiltViewModel()
Add key parameter to hiltViewModel() to support creating multiple
instances of the same view model type.
Since Metalava complains that adding a parameter with default value
to an inline function is not binary compatible, we suppress it for
now:
Test: HiltViewModelComposeTest.kt
Relnote: Add key parameter to hiltViewModel() to support creating multiple instances of the same view model type.
Change-Id: I6ee4727a4b690bc35af4280b61ba2986d9eebb9b
A hilt/hilt-navigation-compose/api/current.ignore
M hilt/hilt-navigation-compose/api/current.txt
M hilt/hilt-navigation-compose/api/public_plus_experimental_current.txt
A hilt/hilt-navigation-compose/api/restricted_current.ignore
M hilt/hilt-navigation-compose/api/restricted_current.txt
M hilt/hilt-navigation-compose/build.gradle
M hilt/hilt-navigation-compose/src/androidTest/java/androidx/hilt/navigation/compose/HiltViewModelComposeTest.kt
M hilt/hilt-navigation-compose/src/main/java/androidx/hilt/navigation/compose/HiltViewModel.kt
Description
Adding optional parameters to Kotlin inline functions would make
./gradlew checkApiRelease
fail with message "Your change has API compatibility issues."I can bypass it with
./gradlew ignoreApiChange && ./gradlew updateApi
, but it should be compatible as inline functions can't be called from Java and the old versions are already inlined in compiled Kotlin code.CL:https://android-review.googlesource.com/c/platform/frameworks/support/+/2190956