Upgrade to Kotlin 1.5.0, KSP to 1.5.0-1.0.0-alpha09
Test: bos
Change-Id: I5a247876c9a964f59f5e0feb5b87a5d810bf3f18
diff --git a/androidx-plugin/build.gradle b/androidx-plugin/build.gradle
index 3b6650b..8dafbe6 100644
--- a/androidx-plugin/build.gradle
+++ b/androidx-plugin/build.gradle
@@ -16,6 +16,7 @@
dependencies {
classpath(libs.androidGradlePlugin)
classpath(libs.kotlinGradlePlugin)
+ classpath(libs.kgpLeakPatcher)
classpath(libs.dokkaGradlePlugin)
}
}
diff --git a/androidx-plugin/gradle-plugin/build.gradle b/androidx-plugin/gradle-plugin/build.gradle
index 854007d..e7241ab 100644
--- a/androidx-plugin/gradle-plugin/build.gradle
+++ b/androidx-plugin/gradle-plugin/build.gradle
@@ -20,6 +20,7 @@
implementation(libs.androidGradlePlugin)
implementation(libs.dexMemberList)
implementation(libs.kotlinGradlePlugin)
+ implementation(libs.kgpLeakPatcher)
implementation(libs.kotlinPoet)
implementation(libs.dokkaGradlePlugin)
diff --git a/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalDetector.kt b/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalDetector.kt
index 89cded5..faed43e 100644
--- a/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalDetector.kt
+++ b/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalDetector.kt
@@ -233,7 +233,7 @@
const val JAVA_OPT_IN_ANNOTATION =
"androidx.annotation.OptIn"
- @Suppress("DefaultLocale")
+ @Suppress("DefaultLocale", "DEPRECATION") // b/187985877
private fun issueForLevel(level: String, severity: Severity): Issue = Issue.create(
id = "UnsafeOptInUsage${level.capitalize()}",
briefDescription = "Unsafe opt-in usage intended to be $level-level severity",
diff --git a/benchmark/common/src/main/java/androidx/benchmark/CpuInfo.kt b/benchmark/common/src/main/java/androidx/benchmark/CpuInfo.kt
index 81b08dd..ecfd672 100644
--- a/benchmark/common/src/main/java/androidx/benchmark/CpuInfo.kt
+++ b/benchmark/common/src/main/java/androidx/benchmark/CpuInfo.kt
@@ -69,11 +69,9 @@
)
} ?: emptyList()
- @Suppress("DEPRECATION")
- // TODO: Rename `max`->`maxOrNull` when all of androidx (not just compose) uses Kotlin 1.4
maxFreqHz = coreDirs
.filter { it.maxFreqKhz != -1L }
- .maxBy { it.maxFreqKhz }
+ .maxByOrNull { it.maxFreqKhz }
?.maxFreqKhz?.times(1000) ?: -1
locked = isCpuLocked(coreDirs)
@@ -85,9 +83,10 @@
fun isCpuLocked(coreDirs: List<CoreDir>): Boolean {
val { it.online }
- @Suppress("DEPRECATION")
- // TODO: Rename `max`->`maxOrNull` when all of androidx (not just compose) uses Kotlin 1.4
- if (onlineCores.any { it.availableFreqs.max() != onlineCores[0].availableFreqs.max() }) {
+ if (onlineCores.any {
+ it.availableFreqs.maxOrNull() != onlineCores[0].availableFreqs.maxOrNull()
+ }
+ ) {
Log.d(TAG, "Clocks not locked: cores with different max frequencies")
return false
}
@@ -97,9 +96,7 @@
return false
}
- @Suppress("DEPRECATION")
- // TODO: Rename `min`->`minOrNull` when all of androidx (not just compose) uses Kotlin 1.4
- if (onlineCores.any { it.availableFreqs.min() == it.currentMinFreq }) {
+ if (onlineCores.any { it.availableFreqs.minOrNull() == it.currentMinFreq }) {
Log.d(TAG, "Clocks not locked: online cores with min freq == min avail freq")
return false
}
diff --git a/benchmark/common/src/main/java/androidx/benchmark/MetricNameUtils.kt b/benchmark/common/src/main/java/androidx/benchmark/MetricNameUtils.kt
index 18b422d..438812f 100644
--- a/benchmark/common/src/main/java/androidx/benchmark/MetricNameUtils.kt
+++ b/benchmark/common/src/main/java/androidx/benchmark/MetricNameUtils.kt
@@ -20,7 +20,7 @@
@SuppressLint("DefaultLocale")
internal fun String.toSnakeCase(): String = replace(Regex("([a-z])([A-Z0-9])")) {
- it.groups[1]!!.value + "_" + it.groups[2]!!.value.toLowerCase()
+ it.groups[1]!!.value + "_" + it.groups[2]!!.value.lowercase()
}
/**
diff --git a/benchmark/common/src/main/java/androidx/benchmark/Profiler.kt b/benchmark/common/src/main/java/androidx/benchmark/Profiler.kt
index 36207f9..2ed9bec 100644
--- a/benchmark/common/src/main/java/androidx/benchmark/Profiler.kt
+++ b/benchmark/common/src/main/java/androidx/benchmark/Profiler.kt
@@ -82,7 +82,7 @@
"Sampled" to MethodSampling,
"ConnectedSampled" to ConnectedSampling
)
- .mapKeys { it.key.toLowerCase() }[name.toLowerCase()]
+ .mapKeys { it.key.lowercase() }[name.lowercase()]
}
}
diff --git a/benchmark/junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt b/benchmark/junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
index 664f5be..8c2652d 100644
--- a/benchmark/junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
+++ b/benchmark/junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
@@ -192,7 +192,7 @@
"The test name $invokeMethodName is too short",
invokeMethodName.length > 5
)
- invokeMethodName = invokeMethodName.substring(4, 5).toLowerCase() +
+ invokeMethodName = invokeMethodName.substring(4, 5).lowercase() +
invokeMethodName.substring(5)
}
internalState.traceUniqueName = description.testClass.simpleName + "_" +
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index deed960..57adec7 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -9,7 +9,8 @@
}
dependencies {
- classpath libs.kotlinGradlePlugin
+ classpath(libs.kotlinGradlePlugin)
+ classpath(libs.kgpLeakPatcher) // KT-46368
}
configurations.classpath.resolutionStrategy {
@@ -41,7 +42,10 @@
"-Xskip-runtime-version-check",
"-Xskip-metadata-version-check",
// Allow `@OptIn` and `@UseExperimental`
- "-Xopt-in=kotlin.RequiresOptIn"
+ "-Xopt-in=kotlin.RequiresOptIn",
+ // Issue where sam conversion in gradle's kts file causes task-out-of-date
+ // Details: KT-46445 and https://github.com/gradle/gradle/issues/17052
+ "-Xsam-conversions=class"
]
}
}
@@ -75,13 +79,15 @@
// root project doesn't need to re-resolve them and their dependencies on every build
cacheableRuntimeOnly(libs.hiltAndroidGradlePlugin)
// room kotlintestapp uses the ksp plugin but it does not publish a plugin marker yet
- cacheableRuntimeOnly(libs.kspGradlePlugin)
+ cacheableApi(libs.kspGradlePlugin)
+ cacheableApi(libs.kgpLeakPatcher)
// dependencies whose resolutions we don't need to cache
compileOnly(findGradleKotlinDsl()) // Only one file in this configuration, no need to cache it
implementation(project("jetpad-integration")) // Doesn't have a .pom, so not slow to load
}
apply plugin: "java-gradle-plugin"
+apply plugin: "dev.zacsweers.kgp-150-leak-patcher"
sourceSets {
main.java.srcDirs += "${supportRootFolder}/benchmark/gradle-plugin/src/main/kotlin"
diff --git a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
index f3053ae..1312776 100644
--- a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
@@ -61,6 +61,7 @@
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
+import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.findByType
@@ -210,6 +211,10 @@
if (project.hasProperty(EXPERIMENTAL_KOTLIN_BACKEND_ENABLED)) {
task.kotlinOptions.freeCompilerArgs += listOf("-Xuse-ir=true")
}
+
+ // Not directly impacting us, but a bunch of issues like KT-46512, probably prudent
+ // for us to just disable until Kotlin 1.5.10+ to avoid end users hitting users
+ task.kotlinOptions.freeCompilerArgs += listOf("-Xsam-conversions=class")
}
project.afterEvaluate {
if (extension.shouldEnforceKotlinStrictApiMode()) {
@@ -225,6 +230,9 @@
configureAndroidLibraryWithMultiplatformPluginOptions()
}
}
+
+ // https://youtrack.jetbrains.com/issue/KT-46368
+ project.apply(plugin = "dev.zacsweers.kgp-150-leak-patcher")
}
@Suppress("UnstableApiUsage") // AGP DSL APIs
diff --git a/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt
index 6769724..f079592 100644
--- a/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt
@@ -67,7 +67,6 @@
}
project.tasks.withType(KotlinCompile::class.java).configureEach { compile ->
- compile.kotlinOptions.useIR = true
// TODO(b/157230235): remove when this is enabled by default
compile.kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
compile.inputs.files({ kotlinPlugin.files })
@@ -128,10 +127,14 @@
apply(plugin = "org.jetbrains.kotlin.android")
}
+ // https://youtrack.jetbrains.com/issue/KT-46368
+ apply(plugin = "dev.zacsweers.kgp-150-leak-patcher")
+
configureManifests()
- configureForKotlinMultiplatformSourceStructure()
- if (isMultiplatformEnabled) {
+ if (isMultiplatformEnabled()) {
configureForMultiplatform()
+ } else {
+ configureForKotlinMultiplatformSourceStructure()
}
tasks.withType(KotlinCompile::class.java).configureEach { compile ->
diff --git a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
index 279ab0b..1733609 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
@@ -82,7 +82,7 @@
*/
internal lateinit var kspVersion: String
val KSP_VERSION get() = kspVersion
-const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32"
+const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"
const val KOTLIN_METADATA_JVM = "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.2.0"
diff --git a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/RobolectricCameraPipeTestRunner.kt b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/RobolectricCameraPipeTestRunner.kt
index f4d8d0f..0debeec 100644
--- a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/RobolectricCameraPipeTestRunner.kt
+++ b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/RobolectricCameraPipeTestRunner.kt
@@ -47,7 +47,7 @@
}
}
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class TestValue(public val value: String)
public data class TestData(
diff --git a/camera/camera-camera2-pipe-testing/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt b/camera/camera-camera2-pipe-testing/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt
index 13a41fc..03cbedb 100644
--- a/camera/camera-camera2-pipe-testing/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt
+++ b/camera/camera-camera2-pipe-testing/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt
@@ -47,7 +47,7 @@
}
}
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class TestValue(public val value: String)
public data class TestData(
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/CameraDevices.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/CameraDevices.kt
index 699764b..3bb50f9 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/CameraDevices.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/CameraDevices.kt
@@ -58,7 +58,7 @@
public fun awaitMetadata(camera: CameraId): CameraMetadata
}
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class CameraId(public val value: String) {
public companion object {
public inline fun fromCamera2Id(value: String): CameraId = CameraId(value)
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Metadata.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Metadata.kt
index 1497e95..71132fe 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Metadata.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Metadata.kt
@@ -174,14 +174,14 @@
* A [RequestTemplate] indicates which preset set list of parameters will be applied to a request by
* default. These values are defined by camera2.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class RequestTemplate(public val value: Int)
/**
* A [RequestNumber] is an artificial identifier that is created for each request that is submitted
* to the Camera.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class RequestNumber(public val value: Long)
/**
@@ -189,7 +189,7 @@
* increase within a specific CameraCaptureSession, and are not created until the HAL begins
* processing a request.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class FrameNumber(public val value: Long)
/**
@@ -203,7 +203,7 @@
* operate based on a real-time clock, while audio/visual systems commonly operate based on a
* monotonic clock.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class CameraTimestamp(public val value: Long)
/**
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/StreamFormat.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/StreamFormat.kt
index c8f0bf2..367593c 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/StreamFormat.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/StreamFormat.kt
@@ -23,7 +23,7 @@
* or not listed.
* // TODO: Consider adding data-space as a separate property, or finding a way to work it in.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class StreamFormat(public val value: Int) {
public companion object {
public val UNKNOWN: StreamFormat = StreamFormat(0)
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Streams.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Streams.kt
index 1c5b493..c55acf7 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Streams.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Streams.kt
@@ -97,7 +97,7 @@
/**
* This identifies a single surface that is used to tell the camera to produce one or more outputs.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class StreamId(public val value: Int) {
override fun toString(): String = "Stream-$value"
}
@@ -205,7 +205,7 @@
/**
* This identifies a single output.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class OutputId(public val value: Int) {
override fun toString(): String = "Output-$value"
}
@@ -225,7 +225,7 @@
/**
* This identifies a single input.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class InputId(public val value: Int) {
override fun toString(): String = "Input-$value"
}
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2StreamGraph.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2StreamGraph.kt
index 8debb14..5e4dc4a 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2StreamGraph.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2StreamGraph.kt
@@ -53,7 +53,7 @@
private val groupIds = atomic(0)
internal fun nextGroupId(): Int = groupIds.incrementAndGet()
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
internal inline class CameraConfigId(val value: Int) {
override fun toString(): String = "OutputConfig-$value"
}
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/core/Timestamps.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/core/Timestamps.kt
index abb9ba8..5b06ccc 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/core/Timestamps.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/core/Timestamps.kt
@@ -23,7 +23,7 @@
/**
* A nanosecond timestamp
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class TimestampNs constructor(public val value: Long) {
public inline operator fun minus(other: TimestampNs): DurationNs =
DurationNs(value - other.value)
@@ -32,7 +32,7 @@
TimestampNs(value + other.value)
}
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class DurationNs(public val value: Long) {
public inline operator fun minus(other: DurationNs): DurationNs =
DurationNs(value - other.value)
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt
index 13a41fc..03cbedb 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/RobolectricCameraPipeTestRunner.kt
@@ -47,7 +47,7 @@
}
}
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
public inline class TestValue(public val value: String)
public data class TestData(
diff --git a/camera/camera-testing/src/main/java/androidx/camera/testing/ObservableExtensions.kt b/camera/camera-testing/src/main/java/androidx/camera/testing/ObservableExtensions.kt
index 5c5d80b..75f3384 100644
--- a/camera/camera-testing/src/main/java/androidx/camera/testing/ObservableExtensions.kt
+++ b/camera/camera-testing/src/main/java/androidx/camera/testing/ObservableExtensions.kt
@@ -28,7 +28,7 @@
import kotlinx.coroutines.launch
import kotlin.coroutines.ContinuationInterceptor
-public fun <T> Observable<T>.asFlow(): Flow<T> = callbackFlow {
+public fun <T> Observable<T>.asFlow(): Flow<T?> = callbackFlow {
val observer = object : Observable.Observer<T> {
override fun onNewData(value: T?) {
launch(start = CoroutineStart.UNDISPATCHED) {
diff --git a/camera/camera-video/build.gradle b/camera/camera-video/build.gradle
index 4527837..b43a004 100644
--- a/camera/camera-video/build.gradle
+++ b/camera/camera-video/build.gradle
@@ -84,4 +84,3 @@
"consistent and reliable camera foundation that enables great camera driven " +
"experiences across all of Android."
}
-
diff --git a/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/Viewfinder.kt b/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/Viewfinder.kt
index 0e2f0f4..cd16141 100644
--- a/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/Viewfinder.kt
+++ b/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/Viewfinder.kt
@@ -424,7 +424,7 @@
companion object {
fun parseString(layoutMode: String): ViewfinderLayout {
- return when (layoutMode.toLowerCase(Locale.ROOT)) {
+ return when (layoutMode.lowercase(Locale.ROOT)) {
"fit" -> FIT
"fill" -> FILL
"center" -> CENTER
diff --git a/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/transformations/DataTransformationsKeyValue.kt b/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/transformations/DataTransformationsKeyValue.kt
index 254ba7e..42a3b41 100644
--- a/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/transformations/DataTransformationsKeyValue.kt
+++ b/camera/integration-tests/camerapipetestapp/src/main/java/androidx/camera/integration/camera2/pipe/transformations/DataTransformationsKeyValue.kt
@@ -69,7 +69,7 @@
private fun typeTransformation(key: CameraMetadataKey, keyData: Any?): String? {
return when (keyData) {
is Number -> keyData.toString()
- is Boolean -> keyData.toString().toUpperCase()
+ is Boolean -> keyData.toString().uppercase()
else -> nullOrInvalid(
key,
keyData
diff --git a/camera/integration-tests/timingtestapp/src/main/java/androidx/camera/integration/antelope/TestUtils.kt b/camera/integration-tests/timingtestapp/src/main/java/androidx/camera/integration/antelope/TestUtils.kt
index 5b00e8b..72e3e10 100644
--- a/camera/integration-tests/timingtestapp/src/main/java/androidx/camera/integration/antelope/TestUtils.kt
+++ b/camera/integration-tests/timingtestapp/src/main/java/androidx/camera/integration/antelope/TestUtils.kt
@@ -111,10 +111,10 @@
}
}
- api = CameraAPI.valueOf(PrefHelper.getSingleTestApi(activity).toUpperCase())
- focusMode = FocusMode.valueOf(PrefHelper.getSingleTestFocus(activity).toUpperCase())
+ api = CameraAPI.valueOf(PrefHelper.getSingleTestApi(activity).uppercase())
+ focusMode = FocusMode.valueOf(PrefHelper.getSingleTestFocus(activity).uppercase())
imageCaptureSize =
- ImageCaptureSize.valueOf(PrefHelper.getSingleTestImageSize(activity).toUpperCase())
+ ImageCaptureSize.valueOf(PrefHelper.getSingleTestImageSize(activity).uppercase())
camera = PrefHelper.getSingleTestCamera(activity)
config.setupTestResults()
}
diff --git a/compose/androidview/androidview/src/main/java/androidx/compose/androidview/adapters/ArrayAdapter.kt b/compose/androidview/androidview/src/main/java/androidx/compose/androidview/adapters/ArrayAdapter.kt
index 5f84e52..f7fda52 100644
--- a/compose/androidview/androidview/src/main/java/androidx/compose/androidview/adapters/ArrayAdapter.kt
+++ b/compose/androidview/androidview/src/main/java/androidx/compose/androidview/adapters/ArrayAdapter.kt
@@ -144,7 +144,7 @@
results.values = list
results.count = list.size
} else {
- val prefixString = prefix.toString().toLowerCase()
+ val prefixString = prefix.toString().lowercase()
val values = synchronized(lock) { ArrayList<T>(originalValues!!) }
@@ -153,7 +153,7 @@
for (i in 0 until count) {
val value = values[i]
- val valueText = value.toString().toLowerCase()
+ val valueText = value.toString().lowercase()
// First match against the whole, non-splitted value
if (valueText.startsWith(prefixString)) {
diff --git a/compose/animation/animation-core/build.gradle b/compose/animation/animation-core/build.gradle
index 0e876b3..7cf02c9 100644
--- a/compose/animation/animation-core/build.gradle
+++ b/compose/animation/animation-core/build.gradle
@@ -75,6 +75,14 @@
* corresponding block above
*/
sourceSets {
+
+ jvmMain {
+ dependencies {
+ implementation(KOTLIN_STDLIB)
+ api(KOTLIN_COROUTINES_CORE)
+ }
+ }
+
commonMain.dependencies {
implementation(project(":compose:runtime:runtime"))
implementation(project(":compose:ui:ui-unit"))
@@ -82,12 +90,19 @@
implementation(KOTLIN_STDLIB_COMMON)
api(KOTLIN_COROUTINES_CORE)
}
- androidMain.dependencies {
- api("androidx.annotation:annotation:1.1.0")
- implementation(KOTLIN_STDLIB)
+
+ androidMain {
+ dependencies {
+ api("androidx.annotation:annotation:1.1.0")
+ implementation(KOTLIN_STDLIB)
+ }
+ dependsOn(jvmMain)
}
- desktopMain.dependencies {
- implementation(KOTLIN_STDLIB)
+ desktopMain {
+ dependencies {
+ implementation(KOTLIN_STDLIB)
+ }
+ dependsOn(jvmMain)
}
androidTest.dependencies {
diff --git a/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/SpringSimulation.kt b/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/SpringSimulation.kt
index fc34151..e7fd777 100644
--- a/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/SpringSimulation.kt
+++ b/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/SpringSimulation.kt
@@ -42,7 +42,7 @@
* damping (i.e. damping ratio = 0), the mass will oscillate forever.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
internal inline class Motion(val packedValue: Long) {
val value: Float
get() = unpackFloat1(packedValue)
diff --git a/compose/animation/animation-core/src/desktopMain/kotlin/androidx/compose/animation/core/ActualDesktop.kt b/compose/animation/animation-core/src/desktopMain/kotlin/androidx/compose/animation/core/ActualDesktop.kt
deleted file mode 100644
index 537e0ce..0000000
--- a/compose/animation/animation-core/src/desktopMain/kotlin/androidx/compose/animation/core/ActualDesktop.kt
+++ /dev/null
@@ -1,21 +0,0 @@
-// ktlint-disable filename
-
-/*
- * Copyright 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.compose.animation.core
-
-internal actual typealias AtomicReference<V> = java.util.concurrent.atomic.AtomicReference<V>
\ No newline at end of file
diff --git a/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/RememberIntrinsicTransformTests.kt b/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/RememberIntrinsicTransformTests.kt
index e0863c1..5f547b0 100644
--- a/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/RememberIntrinsicTransformTests.kt
+++ b/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/RememberIntrinsicTransformTests.kt
@@ -969,8 +969,7 @@
}
}
val foo = remember({
- val tmp0_return = Foo()
- tmp0_return
+ Foo()
}, %composer, 0)
used(foo)
used(a)
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt
index b1c5f10..08e3fe9 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/ComposePlugin.kt
@@ -159,7 +159,7 @@
project: Project,
configuration: CompilerConfiguration
) {
- val KOTLIN_VERSION_EXPECTATION = "1.4.32"
+ val KOTLIN_VERSION_EXPECTATION = "1.5.0"
KotlinCompilerVersion.getVersion()?.let { version ->
val suppressKotlinVersionCheck = configuration.get(
ComposeConfiguration.SUPPRESS_KOTLIN_VERSION_COMPATIBILITY_CHECK,
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/AbstractComposeLowering.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/AbstractComposeLowering.kt
index e1db3b5..900b237 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/AbstractComposeLowering.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/AbstractComposeLowering.kt
@@ -76,7 +76,6 @@
import org.jetbrains.kotlin.ir.declarations.impl.IrTypeParameterImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl
-import org.jetbrains.kotlin.ir.descriptors.WrappedVariableDescriptor
import org.jetbrains.kotlin.ir.expressions.IrBranch
import org.jetbrains.kotlin.ir.expressions.IrCall
import org.jetbrains.kotlin.ir.expressions.IrConst
@@ -923,19 +922,17 @@
isVar: Boolean = false,
origin: IrDeclarationOrigin = IrDeclarationOrigin.IR_TEMPORARY_VARIABLE
): IrVariableImpl {
- val descriptor = WrappedVariableDescriptor()
return IrVariableImpl(
value.startOffset,
value.endOffset,
origin,
- IrVariableSymbolImpl(descriptor),
+ IrVariableSymbolImpl(),
Name.identifier(name),
irType,
isVar,
false,
false
).apply {
- descriptor.bind(this)
initializer = value
}
}
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt
index c448eee..4164418 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt
@@ -71,7 +71,6 @@
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl
import org.jetbrains.kotlin.ir.declarations.name
-import org.jetbrains.kotlin.ir.descriptors.WrappedVariableDescriptor
import org.jetbrains.kotlin.ir.expressions.IrBlock
import org.jetbrains.kotlin.ir.expressions.IrBody
import org.jetbrains.kotlin.ir.expressions.IrBreakContinue
@@ -3850,7 +3849,6 @@
): IrChangedBitMaskVariable {
used = true
val temps = params.mapIndexed { index, param ->
- val descriptor = WrappedVariableDescriptor()
IrVariableImpl(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
@@ -3859,14 +3857,13 @@
// dirty variable encodes information that could be useful for tooling to
// interpret.
IrDeclarationOrigin.DEFINED,
- IrVariableSymbolImpl(descriptor),
+ IrVariableSymbolImpl(),
Name.identifier(if (index == 0) "\$dirty" else "\$dirty$index"),
param.type,
isVar,
isConst = false,
isLateinit = false
).apply {
- descriptor.bind(this)
initializer = irGet(param)
}
}
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableSymbolRemapper.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableSymbolRemapper.kt
index f014f8d..722fd6c 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableSymbolRemapper.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableSymbolRemapper.kt
@@ -16,29 +16,12 @@
package androidx.compose.compiler.plugins.kotlin.lower
-import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
-import org.jetbrains.kotlin.descriptors.FunctionDescriptor
-import org.jetbrains.kotlin.descriptors.ParameterDescriptor
-import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor
-import org.jetbrains.kotlin.descriptors.PropertySetterDescriptor
-import org.jetbrains.kotlin.descriptors.SourceElement
-import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.declarations.IrConstructor
-import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
-import org.jetbrains.kotlin.ir.descriptors.WrappedClassConstructorDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedDeclarationDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedFunctionDescriptorWithContainerSource
-import org.jetbrains.kotlin.ir.descriptors.WrappedPropertyGetterDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedPropertySetterDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedReceiverParameterDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedTypeParameterDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedValueParameterDescriptor
import org.jetbrains.kotlin.ir.util.DeepCopySymbolRemapper
import org.jetbrains.kotlin.ir.util.DescriptorsRemapper
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
@@ -69,67 +52,9 @@
*/
class ComposableSymbolRemapper : DeepCopySymbolRemapper(
object : DescriptorsRemapper {
- override fun remapDeclaredConstructor(
- descriptor: ClassConstructorDescriptor
- ): ClassConstructorDescriptor =
- if (descriptor is WrappedClassConstructorDescriptor) {
- WrappedClassConstructorDescriptor()
- } else {
- super.remapDeclaredConstructor(descriptor)
- }
-
- override fun remapDeclaredSimpleFunction(
- descriptor: FunctionDescriptor
- ): FunctionDescriptor =
- if (descriptor is WrappedSimpleFunctionDescriptor) {
- when (descriptor) {
- is PropertyGetterDescriptor -> WrappedPropertyGetterDescriptor()
- is PropertySetterDescriptor -> WrappedPropertySetterDescriptor()
- is WrappedFunctionDescriptorWithContainerSource -> {
- WrappedFunctionDescriptorWithContainerSource()
- }
- else -> WrappedSimpleFunctionDescriptorWithSource(descriptor.source)
- }
- } else {
- super.remapDeclaredSimpleFunction(descriptor)
- }
-
- override fun remapDeclaredValueParameter(
- descriptor: ParameterDescriptor
- ): ParameterDescriptor =
- when (descriptor) {
- is WrappedValueParameterDescriptor -> {
- WrappedValueParameterDescriptor()
- }
- is WrappedReceiverParameterDescriptor -> {
- WrappedReceiverParameterDescriptor()
- }
- else -> {
- super.remapDeclaredValueParameter(descriptor)
- }
- }
-
- override fun remapDeclaredTypeParameter(
- descriptor: TypeParameterDescriptor
- ): TypeParameterDescriptor =
- if (descriptor is WrappedTypeParameterDescriptor) {
- WrappedTypeParameterDescriptor()
- } else {
- super.remapDeclaredTypeParameter(descriptor)
- }
}
)
-/**
- * Special case to keep the original source element from the functions remapped in the
- * [ComposerParamTransformer.wrapDescriptor]
- */
-private class WrappedSimpleFunctionDescriptorWithSource(
- private val source: SourceElement
-) : WrappedSimpleFunctionDescriptor() {
- override fun getSource(): SourceElement = source
-}
-
@OptIn(ObsoleteDescriptorBasedAPI::class)
object WrappedComposableDescriptorPatcher : IrElementVisitorVoid {
override fun visitElement(element: IrElement) {
@@ -137,31 +62,18 @@
}
override fun visitConstructor(declaration: IrConstructor) {
- (declaration.descriptor as? WrappedClassConstructorDescriptor)?.bindIfNeeded(declaration)
super.visitConstructor(declaration)
}
override fun visitSimpleFunction(declaration: IrSimpleFunction) {
- (declaration.descriptor as? WrappedSimpleFunctionDescriptor)?.bindIfNeeded(declaration)
super.visitSimpleFunction(declaration)
}
- @Suppress("DEPRECATION")
override fun visitValueParameter(declaration: IrValueParameter) {
- (declaration.descriptor as? WrappedValueParameterDescriptor)?.bindIfNeeded(declaration)
- (declaration.descriptor as? WrappedReceiverParameterDescriptor)?.bindIfNeeded(declaration)
super.visitValueParameter(declaration)
}
- @Suppress("DEPRECATION")
override fun visitTypeParameter(declaration: IrTypeParameter) {
- (declaration.descriptor as? WrappedTypeParameterDescriptor)?.bindIfNeeded(declaration)
super.visitTypeParameter(declaration)
}
-
- private fun <T : IrDeclaration> WrappedDeclarationDescriptor<T>.bindIfNeeded(declaration: T) {
- if (!isBound()) {
- bind(declaration)
- }
- }
}
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt
index 0460d30..bff6adf 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerParamTransformer.kt
@@ -25,12 +25,10 @@
import org.jetbrains.kotlin.backend.common.ir.copyTo
import org.jetbrains.kotlin.backend.jvm.ir.isInlineParameter
import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.InlineClassAbi
-import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor
import org.jetbrains.kotlin.descriptors.PropertySetterDescriptor
-import org.jetbrains.kotlin.descriptors.SourceElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
@@ -43,10 +41,6 @@
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
import org.jetbrains.kotlin.ir.declarations.copyAttributes
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
-import org.jetbrains.kotlin.ir.descriptors.WrappedFunctionDescriptorWithContainerSource
-import org.jetbrains.kotlin.ir.descriptors.WrappedPropertyGetterDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedPropertySetterDescriptor
-import org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor
import org.jetbrains.kotlin.ir.expressions.IrCall
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -85,7 +79,6 @@
import org.jetbrains.kotlin.load.java.JvmAbi
import org.jetbrains.kotlin.resolve.BindingTrace
import org.jetbrains.kotlin.resolve.DescriptorUtils
-import org.jetbrains.kotlin.serialization.deserialization.descriptors.DescriptorWithContainerSource
import org.jetbrains.kotlin.util.OperatorNameConventions
import kotlin.math.min
@@ -345,23 +338,6 @@
return newInvoke
}
- private fun wrapDescriptor(descriptor: FunctionDescriptor): WrappedSimpleFunctionDescriptor {
- return when (descriptor) {
- is PropertyGetterDescriptor ->
- WrappedPropertyGetterDescriptor()
- is PropertySetterDescriptor ->
- WrappedPropertySetterDescriptor()
- is DescriptorWithContainerSource ->
- WrappedFunctionDescriptorWithContainerSource()
- else ->
- object : WrappedSimpleFunctionDescriptor() {
- override fun getSource(): SourceElement {
- return descriptor.source
- }
- }
- }
- }
-
@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun IrFunction.copy(
isInline: Boolean = this.isInline,
@@ -369,13 +345,12 @@
): IrSimpleFunction {
// TODO(lmr): use deepCopy instead?
val descriptor = descriptor
- val newDescriptor = wrapDescriptor(descriptor)
return IrFunctionImpl(
startOffset,
endOffset,
origin,
- IrSimpleFunctionSymbolImpl(newDescriptor),
+ IrSimpleFunctionSymbolImpl(),
name,
visibility,
modality,
@@ -390,7 +365,6 @@
isFakeOverride,
containerSource
).also { fn ->
- newDescriptor.bind(fn)
if (this is IrSimpleFunction) {
val propertySymbol = correspondingPropertySymbol
if (propertySymbol != null) {
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/KlibAssignableParamTransformer.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/KlibAssignableParamTransformer.kt
index dcc153e..1f6bb1d 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/KlibAssignableParamTransformer.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/KlibAssignableParamTransformer.kt
@@ -23,7 +23,6 @@
import org.jetbrains.kotlin.ir.declarations.IrFunction
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
import org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl
-import org.jetbrains.kotlin.ir.descriptors.WrappedVariableDescriptor
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrGetValue
import org.jetbrains.kotlin.ir.expressions.IrSetValue
@@ -74,19 +73,17 @@
}
val variables = assignableParams.map {
- val variableDescriptor = WrappedVariableDescriptor()
val variable = IrVariableImpl(
startOffset = UNDEFINED_OFFSET,
endOffset = UNDEFINED_OFFSET,
origin = IrDeclarationOrigin.DEFINED,
- symbol = IrVariableSymbolImpl(variableDescriptor),
+ symbol = IrVariableSymbolImpl(),
name = it.name,
type = it.type,
isVar = true,
isConst = false,
isLateinit = false
)
- variableDescriptor.bind(variable)
variable.parent = declaration
variable.initializer = IrGetValueImpl(
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/LiveLiteralTransformer.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/LiveLiteralTransformer.kt
index 37dd46c..44934b5 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/LiveLiteralTransformer.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/LiveLiteralTransformer.kt
@@ -58,9 +58,6 @@
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
import org.jetbrains.kotlin.ir.declarations.IrVariable
-import org.jetbrains.kotlin.ir.declarations.lazy.IrLazyFunction
-import org.jetbrains.kotlin.ir.descriptors.WrappedFunctionDescriptorWithContainerSource
-import org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor
import org.jetbrains.kotlin.ir.expressions.IrBlock
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
import org.jetbrains.kotlin.ir.expressions.IrBody
@@ -884,18 +881,12 @@
}
fun IrFactory.buildFunction(builder: IrFunctionBuilder): IrSimpleFunction = with(builder) {
- val withContainerSource = originalDeclaration is IrLazyFunction || containerSource != null
- val wrappedDescriptor = if (withContainerSource)
- WrappedFunctionDescriptorWithContainerSource()
- else WrappedSimpleFunctionDescriptor()
createFunction(
startOffset, endOffset, origin,
- IrSimpleFunctionSymbolImpl(wrappedDescriptor),
+ IrSimpleFunctionSymbolImpl(),
name, visibility, modality, returnType,
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect,
isFakeOverride, containerSource,
- ).also {
- wrappedDescriptor.bind(it)
- }
+ )
}
}
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/decoys/DecoyTransformBase.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/decoys/DecoyTransformBase.kt
index dcee57ce..cd726fb 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/decoys/DecoyTransformBase.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/decoys/DecoyTransformBase.kt
@@ -60,11 +60,16 @@
val signature = symbol.signature
?: signatureBuilder.composeSignatureForDeclaration(this)
- return when (signature) {
- is IdSignature.PublicSignature -> signature.id!!
- is IdSignature.AccessorSignature -> signature.accessorSignature.id!!
- is IdSignature.FileLocalSignature -> signature.id
- is IdSignature.ScopeLocalDeclaration -> signature.id.toLong()
+ return signature.getSignatureId()
+ }
+
+ private fun IdSignature.getSignatureId(): Long {
+ return when (this) {
+ is IdSignature.PublicSignature -> id!!
+ is IdSignature.AccessorSignature -> accessorSignature.id!!
+ is IdSignature.FileLocalSignature -> id
+ is IdSignature.ScopeLocalDeclaration -> id.toLong()
+ is IdSignature.SpecialFakeOverrideSignature -> memberSignature.getSignatureId()
}
}
diff --git a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnImpl.kt b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnImpl.kt
index 83a2f34..5406975 100644
--- a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnImpl.kt
+++ b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnImpl.kt
@@ -125,7 +125,7 @@
targetSpace - fixedSpace - arrangementSpacingPx * (weightChildrenCount - 1)
val weightUnitSpace = if (totalWeight > 0) remainingToTarget / totalWeight else 0f
- var remainder = remainingToTarget - rowColumnParentData.sumBy {
+ var remainder = remainingToTarget - rowColumnParentData.sumOf {
(weightUnitSpace * it.weight).roundToInt()
}
diff --git a/compose/foundation/foundation/build.gradle b/compose/foundation/foundation/build.gradle
index ca1170a..69cbf3f 100644
--- a/compose/foundation/foundation/build.gradle
+++ b/compose/foundation/foundation/build.gradle
@@ -103,6 +103,7 @@
}
desktopMain.dependsOn(jvmMain)
+ androidMain.dependsOn(jvmMain)
desktopMain.dependencies {
implementation(KOTLIN_STDLIB)
diff --git a/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextFieldValueDemo.kt b/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextFieldValueDemo.kt
index 15abca1..2e72308 100644
--- a/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextFieldValueDemo.kt
+++ b/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextFieldValueDemo.kt
@@ -61,7 +61,7 @@
BasicTextField(
value = uppercaseValue,
>
- uppercaseValue = it.toUpperCase(java.util.Locale.US)
+ uppercaseValue = it.uppercase(java.util.Locale.US)
},
textStyle = TextStyle(fontSize = fontSize8),
modifier = demoTextFieldModifiers
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/DataIndex.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/DataIndex.kt
index 9c34dd5..c037ca7 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/DataIndex.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/DataIndex.kt
@@ -19,7 +19,7 @@
/**
* Represents an index in the list of items of lazy list.
*/
-@Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("NOTHING_TO_INLINE", "INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
internal inline class DataIndex(val value: Int) {
inline operator fun inc(): DataIndex = DataIndex(value + 1)
inline operator fun dec(): DataIndex = DataIndex(value - 1)
diff --git a/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt b/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
index e90c1cf..c228f39 100644
--- a/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
+++ b/compose/integration-tests/demos/src/androidTest/java/androidx/compose/integration/demos/test/DemoTest.kt
@@ -86,7 +86,7 @@
@MediumTest
fun testAllDemosAreBeingTested() {
assertThat(
- SplitDemoCategories.sumBy { it.allLaunchableDemos().size }
+ SplitDemoCategories.sumOf { it.allLaunchableDemos().size }
).isEqualTo(AllButIgnoredDemos.allLaunchableDemos().size)
}
diff --git a/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/compose/integration/macrobenchmark/target/IoSettingsActivity.kt b/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/compose/integration/macrobenchmark/target/IoSettingsActivity.kt
index 589753f..b652055 100644
--- a/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/compose/integration/macrobenchmark/target/IoSettingsActivity.kt
+++ b/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/compose/integration/macrobenchmark/target/IoSettingsActivity.kt
@@ -149,7 +149,7 @@
openWebsiteLink: (String) -> Unit
) {
Text(
- text = stringResource(R.string.io_about_title).toUpperCase(
+ text = stringResource(R.string.io_about_title).uppercase(
LocaleListCompat.getDefault().get(0)
),
style = MaterialTheme.typography.body2,
diff --git a/compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/ColorPickerDemo.kt b/compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/ColorPickerDemo.kt
index 2fe2f1a..a9603aa 100644
--- a/compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/ColorPickerDemo.kt
+++ b/compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/ColorPickerDemo.kt
@@ -220,7 +220,7 @@
Row(modifier) {
Box(Modifier.weight(0.25f).fillMaxHeight().background(color))
// Add `#` and drop alpha characters
- val text = "#" + Integer.toHexString(color.toArgb()).toUpperCase(Locale.ROOT).drop(2)
+ val text = "#" + Integer.toHexString(color.toArgb()).uppercase(Locale.ROOT).drop(2)
val textStyle = LocalTextStyle.current.copy(textAlign = TextAlign.Center)
Text(
text = text,
diff --git a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/ComposableNamingDetector.kt b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/ComposableNamingDetector.kt
index b45d87b..74296ff 100644
--- a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/ComposableNamingDetector.kt
+++ b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/ComposableNamingDetector.kt
@@ -54,6 +54,7 @@
if (node.returnsUnit) {
if (!capitalizedFunctionName) {
+ @Suppress("DEPRECATION") // b/187985877
val capitalizedName = name.capitalize(Locale.getDefault())
context.report(
ComposableNaming,
@@ -72,6 +73,7 @@
}
} else {
if (capitalizedFunctionName) {
+ @Suppress("DEPRECATION") // b/187985877
val lowercaseName = name.decapitalize(Locale.getDefault())
context.report(
ComposableNaming,
diff --git a/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/realworld4/RealWorld4_Utilities.kt b/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/realworld4/RealWorld4_Utilities.kt
index 23308ba..faf1d5b 100644
--- a/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/realworld4/RealWorld4_Utilities.kt
+++ b/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/realworld4/RealWorld4_Utilities.kt
@@ -24,7 +24,7 @@
val random = Random(5)
fun createWord(): String {
- return (5..10).map { ('a'.toInt() + random.nextInt(26)).toChar() }.joinToString(" ")
+ return (5..10).map { ('a'.code + random.nextInt(26)).toChar() }.joinToString(" ")
}
fun createSomeText(sentences: Int = 10): String {
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Composer.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Composer.kt
index c904ccf..ba6eb68 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Composer.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Composer.kt
@@ -3021,7 +3021,7 @@
*
* @see ComposeNode
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class Updater<T> constructor(
@PublishedApi internal val composer: Composer
) {
@@ -3135,7 +3135,7 @@
composer.apply<Unit, T>(Unit, { this.block() })
}
}
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class SkippableUpdater<T> constructor(
@PublishedApi internal val composer: Composer
) {
diff --git a/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/CornerRadius.kt b/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/CornerRadius.kt
index d0f5466e..c3b70e3 100644
--- a/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/CornerRadius.kt
+++ b/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/CornerRadius.kt
@@ -39,7 +39,7 @@
* function constructor as it is represented as an inline class with 2 float
* parameters packed into a single long to reduce allocation overhead
**/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class CornerRadius internal constructor(@PublishedApi internal val packedValue: Long) {
diff --git a/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Offset.kt b/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Offset.kt
index 23321e1..d86fb2c 100644
--- a/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Offset.kt
+++ b/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Offset.kt
@@ -56,7 +56,7 @@
* Creates an offset. The first argument sets [x], the horizontal component,
* and the second sets [y], the vertical component.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class Offset internal constructor(internal val packedValue: Long) {
diff --git a/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Size.kt b/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Size.kt
index 3ce5619..9b68ada 100644
--- a/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Size.kt
+++ b/compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Size.kt
@@ -37,7 +37,7 @@
*
* You can think of this as an [Offset] from the origin.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class Size internal constructor(@PublishedApi internal val packedValue: Long) {
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Color.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Color.kt
index 677ecb4..4988abf 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Color.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Color.kt
@@ -112,6 +112,7 @@
* [color spaces][ColorSpaces] for the exact ranges.
*/
@Immutable
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class Color(val value: ULong) {
/**
* Returns this color's color space.
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/ColorMatrix.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/ColorMatrix.kt
index ea2b871..625a571 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/ColorMatrix.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/ColorMatrix.kt
@@ -60,7 +60,7 @@
* This is often used as input for [ColorFilter.colorMatrix] and applied at draw time
* through [Paint.colorFilter]
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class ColorMatrix(
val values: FloatArray = floatArrayOf(
1f, 0f, 0f, 0f, 0f,
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Float16.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Float16.kt
index 3dae611..c46955c 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Float16.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Float16.kt
@@ -83,6 +83,7 @@
*
* This table shows that numbers higher than 1024 lose all fractional precision.
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
internal inline class Float16(val halfValue: Short) : Comparable<Float16> {
/**
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Matrix.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Matrix.kt
index f1c0982..de972a01 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Matrix.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/Matrix.kt
@@ -27,7 +27,7 @@
import kotlin.math.sin
// TODO(mount): This class needs some optimization
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class Matrix(
val values: FloatArray = floatArrayOf(
1f, 0f, 0f, 0f,
diff --git a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt b/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
index b3c2332..a6779e4 100644
--- a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
+++ b/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
@@ -75,7 +75,7 @@
)
private fun packageNameHash(packageName: String) =
- packageName.fold(0) { hash, char -> hash * 31 + char.toInt() }.absoluteValue
+ packageName.fold(0) { hash, char -> hash * 31 + char.code }.absoluteValue
/**
* Generator of a tree for the Layout Inspector.
diff --git a/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/ModifierParameterDetector.kt b/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/ModifierParameterDetector.kt
index 89159ee..962beb0 100644
--- a/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/ModifierParameterDetector.kt
+++ b/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/ModifierParameterDetector.kt
@@ -165,4 +165,5 @@
}
}
+@Suppress("DEPRECATION") // b/187985877
private val ModifierParameterName = Names.Ui.Modifier.shortName.decapitalize(Locale.ROOT)
diff --git a/compose/ui/ui-test-font/build.gradle b/compose/ui/ui-test-font/build.gradle
index 2b49397..bfd6e89 100644
--- a/compose/ui/ui-test-font/build.gradle
+++ b/compose/ui/ui-test-font/build.gradle
@@ -38,6 +38,15 @@
desktopMain.dependsOn(jvmMain)
}
}
+
+ android {
+ sourceSets {
+ main {
+ res.srcDirs += "src/commonMain/resources"
+ res.srcDirs += "src/androidMain/res"
+ }
+ }
+ }
}
androidx {
diff --git a/compose/ui/ui-text/benchmark/src/main/java/androidx/compose/ui/text/benchmark/TextBenchmarkHelper.kt b/compose/ui/ui-text/benchmark/src/main/java/androidx/compose/ui/text/benchmark/TextBenchmarkHelper.kt
index 676ee8b..b89c433 100644
--- a/compose/ui/ui-text/benchmark/src/main/java/androidx/compose/ui/text/benchmark/TextBenchmarkHelper.kt
+++ b/compose/ui/ui-text/benchmark/src/main/java/androidx/compose/ui/text/benchmark/TextBenchmarkHelper.kt
@@ -181,8 +181,8 @@
companion object {
val Latin = Alphabet(
charRanges = listOf(
- IntRange('a'.toInt(), 'z'.toInt()),
- IntRange('A'.toInt(), 'Z'.toInt())
+ IntRange('a'.code, 'z'.code),
+ IntRange('A'.code, 'Z'.code)
),
space = ' ',
name = "Latin"
diff --git a/compose/ui/ui-text/build.gradle b/compose/ui/ui-text/build.gradle
index b9523f2..3eb2f0b 100644
--- a/compose/ui/ui-text/build.gradle
+++ b/compose/ui/ui-text/build.gradle
@@ -110,6 +110,7 @@
}
desktopMain.dependsOn(jvmMain)
+ androidMain.dependsOn(jvmMain)
androidMain.dependencies {
api("androidx.annotation:annotation:1.1.0")
diff --git a/compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/StringTest.kt b/compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/StringTest.kt
index 00ecdf9..d151b1e 100644
--- a/compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/StringTest.kt
+++ b/compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/StringTest.kt
@@ -54,15 +54,15 @@
@Test
fun LocaleDependent_uppercase() {
- val upperI = "i".toUpperCase(Locale.forLanguageTag("tr"))
+ val upperI = "i".uppercase(Locale.forLanguageTag("tr"))
assertThat("hijkl".toUpperCase(LocaleList("tr")))
.isEqualTo("H${upperI}JKL")
}
@Test
fun LocaleDependent_lowercase() {
- val upperI = "i".toUpperCase(Locale.forLanguageTag("tr"))
+ val upperI = "i".uppercase(Locale.forLanguageTag("tr"))
assertThat("h${upperI}jkl".toLowerCase(LocaleList("tr")))
.isEqualTo("hijkl")
}
-}
\ No newline at end of file
+}
diff --git a/compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidStringDelegate.android.kt b/compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidStringDelegate.android.kt
index 94f8ea3..c1a2b7b 100644
--- a/compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidStringDelegate.android.kt
+++ b/compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidStringDelegate.android.kt
@@ -25,15 +25,17 @@
*/
internal class AndroidStringDelegate : PlatformStringDelegate {
override fun toUpperCase(string: String, locale: PlatformLocale): String =
- string.toUpperCase((locale as AndroidLocale).javaLocale)
+ string.uppercase((locale as AndroidLocale).javaLocale)
override fun toLowerCase(string: String, locale: PlatformLocale): String =
- string.toLowerCase((locale as AndroidLocale).javaLocale)
+ string.lowercase((locale as AndroidLocale).javaLocale)
override fun capitalize(string: String, locale: PlatformLocale): String =
+ @Suppress("DEPRECATION") // b/187985877
string.capitalize((locale as AndroidLocale).javaLocale)
override fun decapitalize(string: String, locale: PlatformLocale): String =
+ @Suppress("DEPRECATION") // b/187985877
string.decapitalize((locale as AndroidLocale).javaLocale)
}
diff --git a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextRange.kt b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextRange.kt
index 6adb64a..3262fdb 100644
--- a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextRange.kt
+++ b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextRange.kt
@@ -41,7 +41,7 @@
* (exclusive). [end] can be smaller than [start] and in those cases [min] and [max] can be
* used in order to fetch the values.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class TextRange internal constructor(private val packedValue: Long) {
diff --git a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/ImeAction.kt b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/ImeAction.kt
index a4a791b..6444890 100644
--- a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/ImeAction.kt
+++ b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/ImeAction.kt
@@ -20,6 +20,7 @@
* Signals the keyboard what type of action should be displayed. It is not guaranteed if
* the keyboard will show the requested action.
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class ImeAction(val value: Int) {
override fun toString(): String {
diff --git a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/KeyboardType.kt b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/KeyboardType.kt
index 4bf8daf..32d5a94 100644
--- a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/KeyboardType.kt
+++ b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/KeyboardType.kt
@@ -19,6 +19,7 @@
/**
* Values representing the different available Keyboard Types.
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class KeyboardType(private val value: Int) {
override fun toString(): String {
diff --git a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/style/BaselineShift.kt b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/style/BaselineShift.kt
index 5d9c858..d358149 100644
--- a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/style/BaselineShift.kt
+++ b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/style/BaselineShift.kt
@@ -28,7 +28,7 @@
*
* @param multiplier shift the baseline by multiplier * (baseline - ascent)
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class BaselineShift(val multiplier: Float) {
companion object {
diff --git a/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopStringDelegate.desktop.kt b/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopStringDelegate.desktop.kt
index cd79f21..650db82 100644
--- a/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopStringDelegate.desktop.kt
+++ b/compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopStringDelegate.desktop.kt
@@ -25,15 +25,17 @@
*/
internal class DesktopStringDelegate : PlatformStringDelegate {
override fun toUpperCase(string: String, locale: PlatformLocale): String =
- string.toUpperCase((locale as DesktopLocale).locale)
+ string.uppercase((locale as DesktopLocale).locale)
override fun toLowerCase(string: String, locale: PlatformLocale): String =
- string.toLowerCase((locale as DesktopLocale).locale)
+ string.lowercase((locale as DesktopLocale).locale)
override fun capitalize(string: String, locale: PlatformLocale): String =
+ @Suppress("DEPRECATION") // b/187985877
string.capitalize((locale as DesktopLocale).locale)
override fun decapitalize(string: String, locale: PlatformLocale): String =
+ @Suppress("DEPRECATION") // b/187985877
string.decapitalize((locale as DesktopLocale).locale)
}
diff --git a/compose/ui/ui-text/src/test/java/androidx/compose/ui/text/AnnotatedStringTransformTest.kt b/compose/ui/ui-text/src/test/java/androidx/compose/ui/text/AnnotatedStringTransformTest.kt
index be45670..c55e48a 100644
--- a/compose/ui/ui-text/src/test/java/androidx/compose/ui/text/AnnotatedStringTransformTest.kt
+++ b/compose/ui/ui-text/src/test/java/androidx/compose/ui/text/AnnotatedStringTransformTest.kt
@@ -68,7 +68,7 @@
val uppercase = input.toUpperCase()
- assertThat(uppercase.text).isEqualTo(input.text.toUpperCase())
+ assertThat(uppercase.text).isEqualTo(input.text.uppercase())
}
@Test
@@ -80,7 +80,7 @@
val uppercase = input.toUpperCase()
- assertThat(uppercase.text).isEqualTo(input.text.toUpperCase())
+ assertThat(uppercase.text).isEqualTo(input.text.uppercase())
}
@Test
@@ -100,7 +100,7 @@
val uppercase = input.toUpperCase()
- assertThat(uppercase.text).isEqualTo(input.text.toUpperCase())
+ assertThat(uppercase.text).isEqualTo(input.text.uppercase())
assertThat(uppercase.spanStyles).isEqualTo(input.spanStyles)
assertThat(uppercase.paragraphStyles).isEqualTo(input.paragraphStyles)
}
@@ -122,7 +122,7 @@
val lowercase = input.toLowerCase()
- assertThat(lowercase.text).isEqualTo(input.text.toLowerCase())
+ assertThat(lowercase.text).isEqualTo(input.text.lowercase())
assertThat(lowercase.spanStyles).isEqualTo(input.spanStyles)
assertThat(lowercase.paragraphStyles).isEqualTo(input.paragraphStyles)
}
@@ -142,8 +142,10 @@
)
)
+ @Suppress("DEPRECATION") // b/187985877
val capitalized = input.capitalize()
+ @Suppress("DEPRECATION") // b/187985877
assertThat(capitalized.text).isEqualTo(input.text.capitalize())
assertThat(capitalized.spanStyles).isEqualTo(input.spanStyles)
assertThat(capitalized.paragraphStyles).isEqualTo(input.paragraphStyles)
@@ -164,8 +166,10 @@
)
)
+ @Suppress("DEPRECATION") // b/187985877
val decapitalized = input.decapitalize()
+ @Suppress("DEPRECATION") // b/187985877
assertThat(decapitalized.text).isEqualTo(input.text.decapitalize())
assertThat(decapitalized.spanStyles).isEqualTo(input.spanStyles)
assertThat(decapitalized.paragraphStyles).isEqualTo(input.paragraphStyles)
@@ -185,9 +189,10 @@
makeRange(paraStyle2, "iii hhh (jjj)")
)
)
-
+ @Suppress("DEPRECATION") // b/187985877
val capitalized = input.capitalize(LocaleList("tr"))
+ @Suppress("DEPRECATION") // b/187985877
assertThat(capitalized.text).isEqualTo(input.text.capitalize(Locale.forLanguageTag("tr")))
assertThat(capitalized.spanStyles).isEqualTo(input.spanStyles)
assertThat(capitalized.paragraphStyles).isEqualTo(input.paragraphStyles)
@@ -208,8 +213,10 @@
)
)
+ @Suppress("DEPRECATION") // b/187985877
val decapitalized = input.decapitalize(LocaleList("tr"))
+ @Suppress("DEPRECATION") // b/187985877
assertThat(decapitalized.text).isEqualTo(
input.text.decapitalize(Locale.forLanguageTag("tr"))
)
@@ -234,9 +241,9 @@
val uppercase = input.toUpperCase(LocaleList("tr"))
- assertThat(uppercase.text).isEqualTo(input.text.toUpperCase(Locale.forLanguageTag("tr")))
+ assertThat(uppercase.text).isEqualTo(input.text.uppercase(Locale.forLanguageTag("tr")))
- val upperI = "i".toUpperCase(Locale.forLanguageTag("tr"))
+ val upperI = "i".uppercase(Locale.forLanguageTag("tr"))
assertThat(uppercase.spanStyles).isEqualTo(
listOf(
@@ -271,11 +278,11 @@
val lowercase = input.toLowerCase(LocaleList("lt"))
assertThat(lowercase.text).isEqualTo(
- input.text.toLowerCase(Locale.forLanguageTag("lt"))
+ input.text.lowercase(Locale.forLanguageTag("lt"))
)
// Usually generate U+0069 U+0307 U+0300
- val lowerIDot = "Ì".toLowerCase(Locale.forLanguageTag("lt"))
+ val lowerIDot = "Ì".lowercase(Locale.forLanguageTag("lt"))
assertThat(lowercase.spanStyles).isEqualTo(
listOf(
makeRange(spanStyle1, "(hhh $lowerIDot$lowerIDot$lowerIDot yyy)"),
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt
index 98e3857c..db11a29 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt
@@ -13,7 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING")
+@file:Suppress(
+ "NOTHING_TO_INLINE",
+ "INLINE_CLASS_DEPRECATED",
+ "EXPERIMENTAL_FEATURE_WARNING"
+)
package androidx.compose.ui.unit
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
index fb94b89..4ac39f4 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
@@ -41,7 +41,7 @@
* val lineThicknessPx = lineThickness.toPx(context)
* [toPx] is normally needed only for painting operations.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class Dp(val value: Float) : Comparable<Dp> {
/**
@@ -258,7 +258,7 @@
* A two-dimensional offset using [Dp] for units
*/
@OptIn(ExperimentalUnsignedTypes::class)
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class DpOffset internal constructor(@PublishedApi internal val packedValue: Long) {
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntOffset.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntOffset.kt
index 97f0e72..749e2be 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntOffset.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntOffset.kt
@@ -14,7 +14,11 @@
* limitations under the License.
*/
-@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING")
+@file:Suppress(
+ "NOTHING_TO_INLINE",
+ "INLINE_CLASS_DEPRECATED",
+ "EXPERIMENTAL_FEATURE_WARNING"
+)
package androidx.compose.ui.unit
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntSize.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntSize.kt
index bc7880e..fae9c2d 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntSize.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/IntSize.kt
@@ -14,7 +14,11 @@
* limitations under the License.
*/
-@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING")
+@file:Suppress(
+ "NOTHING_TO_INLINE",
+ "INLINE_CLASS_DEPRECATED",
+ "EXPERIMENTAL_FEATURE_WARNING"
+)
package androidx.compose.ui.unit
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/TextUnit.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/TextUnit.kt
index 0dceaad..a3eb11b 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/TextUnit.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/TextUnit.kt
@@ -62,7 +62,7 @@
* Note that do not store this value in your persistent storage or send to another process since
* the internal representation may be changed in future.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class TextUnit internal constructor(internal val packedValue: Long) {
/**
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Velocity.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Velocity.kt
index a0ef63e..f017471 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Velocity.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Velocity.kt
@@ -34,7 +34,7 @@
/**
* A two dimensional velocity in pixels per second.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class Velocity internal constructor(private val packedValue: Long) {
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidLayoutDrawTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidLayoutDrawTest.kt
index 81fa463..6cfa06b 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidLayoutDrawTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidLayoutDrawTest.kt
@@ -3800,8 +3800,8 @@
) {
Layout(modifier = modifier, content = content) { measurables, constraints ->
val placeables = measurables.map { it.measure(constraints) }
- val width = max(placeables.maxBy { it.width }?.width ?: 0, minWidth)
- val height = max(placeables.maxBy { it.height }?.height ?: 0, minHeight)
+ val width = max(placeables.maxByOrNull { it.width }?.width ?: 0, minWidth)
+ val height = max(placeables.maxByOrNull { it.height }?.height ?: 0, minHeight)
layout(width, height) {
placeables.forEach { it.placeRelative(0, 0) }
}
@@ -3857,8 +3857,8 @@
) {
Layout(modifier = modifier, content = content) { measurables, constraints ->
val placeables = measurables.map { it.measure(constraints) }
- val width = placeables.maxBy { it.width }?.width ?: 0
- val height = placeables.maxBy { it.height }?.height ?: 0
+ val width = placeables.maxByOrNull { it.width }?.width ?: 0
+ val height = placeables.maxByOrNull { it.height }?.height ?: 0
layout(width, height) {
model.value
placeables.forEach { it.placeRelative(0, 0) }
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/SubcomposeLayoutTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/SubcomposeLayoutTest.kt
index 88cd537..a4bbbc3 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/SubcomposeLayoutTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/SubcomposeLayoutTest.kt
@@ -127,7 +127,7 @@
}
val maxWidth = placeables.maxByOrNull { it.width }!!.width
- val height = placeables.sumBy { it.height }
+ val height = placeables.sumOf { it.height }
layout(maxWidth, height) {
placeables.fold(0) { top, placeable ->
@@ -288,7 +288,7 @@
SubcomposeLayout { constraints ->
val placeables = subcompose(Unit, content).map { it.measure(constraints) }
val maxWidth = placeables.maxByOrNull { it.width }!!.width
- val height = placeables.sumBy { it.height }
+ val height = placeables.sumOf { it.height }
layout(maxWidth, height) {
placeables.forEach { it.place(0, 0) }
}
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/key/Key.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/key/Key.android.kt
index da36cb8..f2355a9 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/key/Key.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/key/Key.android.kt
@@ -28,6 +28,7 @@
*
* @param keyCode an integer code representing the key pressed.
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
actual inline class Key(val keyCode: Long) {
actual companion object {
/** Unknown key. */
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusTraversal.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusTraversal.kt
index 5523c89..f6d8ac2 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusTraversal.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusTraversal.kt
@@ -44,6 +44,7 @@
*
* @sample androidx.compose.ui.samples.MoveFocusSample
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class FocusDirection(val value: Int) {
override fun toString(): String {
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/TransformOrigin.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/TransformOrigin.kt
index 4656ae1..183af16 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/TransformOrigin.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/TransformOrigin.kt
@@ -32,7 +32,7 @@
/**
* A two-dimensional position represented as a fraction of the Layer's width and height
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@OptIn(ExperimentalUnsignedTypes::class)
@Immutable
inline class TransformOrigin internal constructor(@PublishedApi internal val packedValue: Long) {
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/ImageVector.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/ImageVector.kt
index f7ce1fc..fd8348b 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/ImageVector.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/ImageVector.kt
@@ -688,7 +688,7 @@
clearGroup()
}
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
private inline class Stack<T>(private val backing: ArrayList<T> = ArrayList<T>()) {
val size: Int get() = backing.size
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/Key.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/Key.kt
index 39da7b7..2528dd2 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/Key.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/Key.kt
@@ -22,6 +22,7 @@
* @param keyCode a Long value representing the key pressed. Note: This keycode can be used to
* uniquely identify a hardware key. It is different from the native keycode.
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
expect inline class Key(val keyCode: Long) {
companion object {
/** Unknown key. */
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyEvent.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyEvent.kt
index c14d519..bffa0ea 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyEvent.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyEvent.kt
@@ -25,7 +25,7 @@
* When a user presses a key on a hardware keyboard, a [KeyEvent] is sent to the
* [KeyInputModifier] that is currently active.
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class KeyEvent(val nativeKeyEvent: NativeKeyEvent)
/**
@@ -79,6 +79,7 @@
/**
* The type of Key Event.
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
inline class KeyEventType(val value: Int) {
override fun toString(): String {
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
index 38ac86a..4b2626a 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-@file:Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@file:Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
package androidx.compose.ui.input.pointer
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
index 0278801..1f97dcc 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
@@ -181,6 +181,7 @@
* The result of a call to [PointerInputEventProcessor.process].
*/
// TODO(shepshpard): Not sure if storing these values in a int is most efficient overall.
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
internal inline class ProcessResult(private val value: Int) {
val dispatchedToAPointerInputModifier
get() = (value and 1) != 0
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt
index f242669..9bec925 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt
@@ -33,7 +33,7 @@
/**
* Holds 2 dimensional scaling factors for horizontal and vertical axes
*/
-@Suppress("EXPERIMENTAL_FEATURE_WARNING")
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
@Immutable
inline class ScaleFactor internal constructor(@PublishedApi internal val packedValue: Long) {
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/Key.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/Key.desktop.kt
index 6693080..6335b49 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/Key.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/Key.desktop.kt
@@ -32,6 +32,7 @@
* @param keyCode an integer code representing the key pressed. Note: This keycode can be used to
* uniquely identify a hardware key. It is different from the native keycode.
*/
+@Suppress("INLINE_CLASS_DEPRECATED", "EXPERIMENTAL_FEATURE_WARNING")
actual inline class Key(val keyCode: Long) {
actual companion object {
/** Unknown key. */
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/KeyEvent.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/KeyEvent.desktop.kt
index 504ba3b..d52e212 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/KeyEvent.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/key/KeyEvent.desktop.kt
@@ -47,7 +47,7 @@
* second from the low-surrogates range (\uDC00-\uDFFF).
*/
actual val KeyEvent.utf16CodePoint: Int
- get() = nativeKeyEvent.keyChar.toInt()
+ get() = nativeKeyEvent.keyChar.code
/**
* The [type][KeyEventType] of key event.
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopPlatformInput.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopPlatformInput.desktop.kt
index a4c5c67..f32fda5 100644
--- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopPlatformInput.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopPlatformInput.desktop.kt
@@ -244,4 +244,4 @@
}
private val isMac =
- System.getProperty("os.name").toLowerCase(Locale.ENGLISH).startsWith("mac")
+ System.getProperty("os.name").lowercase(Locale.ENGLISH).startsWith("mac")
diff --git a/datastore/datastore-core/src/test/java/androidx/datastore/core/SingleProcessDataStoreStressTest.kt b/datastore/datastore-core/src/test/java/androidx/datastore/core/SingleProcessDataStoreStressTest.kt
index 182b8c1..d8f25c3 100644
--- a/datastore/datastore-core/src/test/java/androidx/datastore/core/SingleProcessDataStoreStressTest.kt
+++ b/datastore/datastore-core/src/test/java/androidx/datastore/core/SingleProcessDataStoreStressTest.kt
@@ -44,7 +44,6 @@
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import kotlin.time.ExperimentalTime
-import kotlin.time.seconds
@RunWith(JUnit4::class)
@ExperimentalTime
@@ -98,7 +97,7 @@
// There's no reason this should take more than a few seconds once writers complete and
// there's no reason writers won't complete.
- withTimeout(10.seconds) {
+ withTimeout(10000L) {
readers.awaitAll()
}
}
@@ -162,7 +161,7 @@
// There's no reason this should take more than a few seconds once writers complete and
// there's no reason writers won't complete.
- withTimeout(10.seconds) {
+ withTimeout(10000L) {
readers.awaitAll()
}
}
@@ -222,7 +221,7 @@
// There's no reason this should take more than a few seconds once writers complete and
// there's no reason writers won't complete.
- withTimeout(10.seconds) {
+ withTimeout(10000L) {
readers.awaitAll()
}
}
diff --git a/development/build_log_simplifier/messages.ignore b/development/build_log_simplifier/messages.ignore
index bac669c..dff780e 100644
--- a/development/build_log_simplifier/messages.ignore
+++ b/development/build_log_simplifier/messages.ignore
@@ -4,6 +4,8 @@
# Messages that only sometimes appear in stdout/stderr should be exempted in message-flakes.ignore, because this file (messages.ignore) may be automatically garbage collected whereas that one will not be.
# > Task :docs-runner:dokkaJavaPublicDocs
(logging: loading modules: \[java\.se.*)|(.*No file found when processing Java @sample.*)
+\$CHECKOUT/prebuilts/androidx/external/.+\.kotlin_module: error: module was compiled with an incompatible version of Kotlin\. The binary version of its metadata is [0-9]+\.[0-9]+\.[0-9]+, expected version is [0-9]+\.[0-9]+\.[0-9]+\.
+\$OUT_DIR/.+\.kotlin_module: error: module was compiled with an incompatible version of Kotlin\. The binary version of its metadata is [0-9]+\.[0-9]+\.[0-9]+, expected version is [0-9]+\.[0-9]+\.[0-9]+\.
WARN: The registry key 'java\.correct\.class\.type\.by\.place\.resolve\.scope' accessed, but not loaded yet
PROGRESS: Rendering
No docs found on supertype with \{@inheritDoc\} method .*
@@ -423,6 +425,7 @@
Html results of .* zipped into.*\.zip
# > Task :annotation:annotation-experimental-lint:test
WARNING: An illegal reflective access operation has occurred
+WARNING: Please consider reporting this to the maintainers of org\.jetbrains\.kotlin\.kapt[0-9]+\.base\.javac\.KaptJavaFileManager
WARNING: Illegal reflective access by com\.intellij\.util\.ReflectionUtil \(file:\$CHECKOUT/prebuilts/androidx/external/com/google/devsite/dackka/[0-9]+\.[0-9]+\.[0-9]+/dackka\-[0-9]+\.[0-9]+\.[0-9]+\.jar\) to method java\.util\.ResourceBundle\.setParent\(java\.util\.ResourceBundle\)
WARNING: Illegal reflective access by com\.intellij\.util\.ReflectionUtil \(file:\$OUT_DIR/androidx/compose/compiler/compiler\-hosted/integration\-tests/kotlin\-compiler\-repackaged/build/repackaged/kotlin\-compiler\-repackaged\.jar\) to method java\.util\.ResourceBundle\.setParent\(java\.util\.ResourceBundle\)
WARNING\: Illegal reflective access using Lookup on org\.gradle\.internal\.classloader\.ClassLoaderUtils\$AbstractClassLoaderLookuper \(file\:\$GRADLE_USER_HOME\/caches\/[0-9]+\.[0-9]+\.[0-9]+\/generated\-gradle\-jars\/gradle\-api\-[0-9]+\.[0-9]+\.[0-9]+\.jar\) to class java\.lang\.ClassLoader
@@ -430,9 +433,9 @@
WARNING\: Illegal reflective access by org\.robolectric\.util\.ReflectionHelpers\$[0-9]+ \(file\:\$CHECKOUT\/prebuilts\/androidx\/external\/org\/robolectric\/shadowapi\/[0-9]+\.[0-9]+\-alpha\-[0-9]+\/shadowapi\-[0-9]+\.[0-9]+\-alpha\-[0-9]+\.jar\) to method java\.lang\.ClassLoader\.getPackage\(java\.lang\.String\)
WARNING\: Please consider reporting this to the maintainers of org\.robolectric\.util\.ReflectionHelpers\$[0-9]+
WARNING\: Illegal reflective access by com\.intellij\.util\.ReflectionUtil \(file\:\$CHECKOUT\/prebuilts\/androidx\/external\/com\/android\/tools\/external\/com\-intellij\/intellij\-core\/[0-9]+\.[0-9]+\.[0-9]+\-beta[0-9]+\/intellij\-core\-[0-9]+\.[0-9]+\.[0-9]+\-beta[0-9]+\.jar\) to method java\.util\.ResourceBundle\.setParent\(java\.util\.ResourceBundle\)
-WARNING\: Illegal reflective access by org\.jetbrains\.kotlin\.com\.intellij\.util\.ReflectionUtil \(file\:\$CHECKOUT\/prebuilts\/androidx\/external\/org\/jetbrains\/kotlin\/kotlin\-compiler\-embeddable\/[0-9]+\.[0-9]+\.[0-9]+\/kotlin\-compiler\-embeddable\-[0-9]+\.[0-9]+\.[0-9]+\.jar\) to method java\.util\.ResourceBundle\.setParent\(java\.util\.ResourceBundle\)
+WARNING: Illegal reflective access by org\.jetbrains\.kotlin\.com\.intellij\.util\.ReflectionUtil \(file:\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-compiler\-embeddable/.+/kotlin\-compiler\-embeddable\-.+\.jar\) to method java\.util\.ResourceBundle\.setParent\(java\.util\.ResourceBundle\)
WARNING\: Please consider reporting this to the maintainers of org\.jetbrains\.kotlin\.com\.intellij\.util\.ReflectionUtil
-WARNING: Illegal reflective access by com\.intellij\.util\.ReflectionUtil \(file:\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-compiler/[0-9]+\.[0-9]+\.[0-9]+/kotlin\-compiler\-[0-9]+\.[0-9]+\.[0-9]+\.jar\) to method java\.util\.ResourceBundle\.setParent\(java\.util\.ResourceBundle\)
+WARNING: Illegal reflective access by com\.intellij\.util\.ReflectionUtil \(file:\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-compiler/.+/kotlin\-compiler\-.+\.jar\) to method java\.util\.ResourceBundle\.setParent\(java\.util\.ResourceBundle\)
WARNING: Please consider reporting this to the maintainers of com\.intellij\.util\.ReflectionUtil
WARNING: Use \-\-illegal\-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
@@ -454,7 +457,9 @@
w: Consider providing an explicit dependency on kotlin\-reflect [^/]* to prevent strange errors
# > Task :room:room-compiler:test
WARNING: Illegal reflective access by androidx\.room\.compiler\.processing\.javac\.JavacProcessingEnvMessager\$Companion\$isFromCompiledClass\$[0-9]+ \(file:\$OUT_DIR/androidx/room/room\-compiler\-processing/build/libs/room\-compiler\-processing\-[0-9]+\.[0-9]+\.[0-9]+(\-(alpha|beta|rc)[0-9]+)?\.jar\) to field com\.sun\.tools\.javac\.code\.Symbol\$ClassSymbol\.classfile
+WARNING: Illegal reflective access by androidx\.room\.compiler\.processing\.javac\.JavacProcessingEnvMessager\$Companion \(file:\$OUT_DIR/androidx/room/room\-compiler\-processing/build/libs/room\-compiler\-processing\-[0-9]+\.[0-9]+\.[0-9]+(\-(alpha|beta|rc)[0-9]+)?\.jar\) to field com\.sun\.tools\.javac\.code\.Symbol\$ClassSymbol\.classfile
WARNING: Please consider reporting this to the maintainers of androidx\.room\.compiler\.processing\.javac\.JavacProcessingEnvMessager\$Companion\$isFromCompiledClass\$[0-9]+
+WARNING: Please consider reporting this to the maintainers of androidx\.room\.compiler\.processing\.javac\.JavacProcessingEnvMessager\$Companion
# > Task :wear:wear-watchface-complications-rendering:compileDebugUnitTestJavaWithJavac
# > Task :wear:wear-watchface:testDebugUnitTest
System\.logW\: A resource was acquired at attached stack trace but never released\. See java\.io\.Closeable for information on avoiding resource leaks\.java\.lang\.Throwable\: Explicit termination method \'dispose\' not called
@@ -464,6 +469,10 @@
# > Task :docs-runner:dokkaJavaTipOfTreeDocs
\$CHECKOUT\/prebuilts\/androidx\/external\/org\/jetbrains\/kotlin\/kotlin\-reflect\/[0-9]+\.[0-9]+\.[0-9]+\/kotlin\-reflect\-[0-9]+\.[0-9]+\.[0-9]+\.jar \(version [0-9]+\.[0-9]+\)
\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-stdlib\-jdk[0-9]+/[0-9]+\.[0-9]+\.[0-9]+/kotlin\-stdlib\-jdk[0-9]+\-[0-9]+\.[0-9]+\.[0-9]+\.jar \(version [0-9]+\.[0-9]+\)
+\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-stdlib\-jdk[0-9]+/[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+/kotlin\-stdlib\-jdk[0-9]+\-[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+\.jar \(version [0-9]+\.[0-9]+\)
+\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-stdlib/[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+/kotlin\-stdlib\-[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+\.jar \(version [0-9]+\.[0-9]+\)
+\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-stdlib\-common/[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+/kotlin\-stdlib\-common\-[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+\.jar \(version [0-9]+\.[0-9]+\)
+\$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-reflect/[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+/kotlin\-reflect\-[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+\.jar \(version [0-9]+\.[0-9]+\)
# > Task :compose:ui:ui:processDebugAndroidTestManifest
\$OUT_DIR/androidx/compose/ui/ui/build/intermediates/tmp/manifest/androidTest/debug/tempFile[0-9]+ProcessTestManifest[0-9]+\.xml Warning:
Package name 'androidx\.compose\.ui\.test' used in: tempFile[0-9]+ProcessTestManifest[0-9]+\.xml, :compose:ui:ui\-test\.
@@ -556,9 +565,50 @@
# > Task :contentpager:contentpager:compileDebugAndroidTestJavaWithJavac
# > Task :docs-public:dokkaKotlinDocs
No documentation for .*
+Found an unresolved type in androidx\.compose\.runtime\.Updater\$set\(kotlin\.Int, kotlin\.Function[0-9]+\(\(androidx\.compose\.runtime\.Updater\.T, kotlin\.Int, kotlin\.Unit\)\)\) \(Composer\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\.Updater\$set\(androidx\.compose\.runtime\.Updater\.set\.V, kotlin\.Function[0-9]+\(\(androidx\.compose\.runtime\.Updater\.T, androidx\.compose\.runtime\.Updater\.set\.V, kotlin\.Unit\)\)\) \(Composer\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\.Updater\$update\(kotlin\.Int, kotlin\.Function[0-9]+\(\(androidx\.compose\.runtime\.Updater\.T, kotlin\.Int, kotlin\.Unit\)\)\) \(Composer\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\.Updater\$update\(androidx\.compose\.runtime\.Updater\.update\.V, kotlin\.Function[0-9]+\(\(androidx\.compose\.runtime\.Updater\.T, androidx\.compose\.runtime\.Updater\.update\.V, kotlin\.Unit\)\)\) \(Composer\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\.snapshots\.Snapshot\.Companion\$openSnapshotCount\(\) \(Snapshot\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.geometry\.Offset\$getDistance\(\) \(Offset\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.graphics\.drawscope\$rotate\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Float, androidx\.compose\.ui\.geometry\.Offset, kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Unit\)\)\) \(DrawScope\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.graphics\.drawscope\$scale\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Float, kotlin\.Float, androidx\.compose\.ui\.geometry\.Offset, kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Unit\)\)\) \(DrawScope\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.graphics\.drawscope\$scale\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Float, androidx\.compose\.ui\.geometry\.Offset, kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Unit\)\)\) \(DrawScope\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.graphics\.drawscope\$clipRect\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Float, kotlin\.Float, kotlin\.Float, kotlin\.Float, androidx\.compose\.ui\.graphics\.ClipOp, kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Unit\)\)\) \(DrawScope\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.graphics\.drawscope\$clipPath\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, androidx\.compose\.ui\.graphics\.Path, androidx\.compose\.ui\.graphics\.ClipOp, kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Unit\)\)\) \(DrawScope\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.graphics\.drawscope\$withTransform\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.drawscope\.DrawTransform, kotlin\.Unit\)\), kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.drawscope\.DrawScope, kotlin\.Unit\)\)\) \(DrawScope\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.graphics\.vector\$group\(androidx\.compose\.ui\.graphics\.vector\.ImageVector\.Builder, kotlin\.String, kotlin\.Float, kotlin\.Float, kotlin\.Float, kotlin\.Float, kotlin\.Float, kotlin\.Float, kotlin\.Float, kotlin\.collections\.List\(\(androidx\.compose\.ui\.graphics\.vector\.PathNode\)\), kotlin\.Function[0-9]+\(\(androidx\.compose\.ui\.graphics\.vector\.ImageVector\.Builder, kotlin\.Unit\)\)\) \(ImageVector\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.unit\$constrainWidth\(androidx\.compose\.ui\.unit\.Constraints, kotlin\.Int\) \(Constraints\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.ui\.unit\$constrainHeight\(androidx\.compose\.ui\.unit\.Constraints, kotlin\.Int\) \(Constraints\.kt:[0-9]+\)
+Found an unresolved type in androidx\.navigation\$ActivityNavigatorExtras\(androidx\.core\.app\.ActivityOptionsCompat, kotlin\.Int\) \(ActivityNavigatorExtras\.kt:[0-9]+\)
+Found an unresolved type in androidx\.navigation\$navigation\(androidx\.navigation\.NavigatorProvider, kotlin\.Int, kotlin\.Int, kotlin\.Function[0-9]+\(\(androidx\.navigation\.NavGraphBuilder, kotlin\.Unit\)\)\) \(NavGraphBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.navigation\.dynamicfeatures\.DynamicActivityNavigatorDestinationBuilder\$build\(\) \(DynamicActivityNavigatorDestinationBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.navigation\.dynamicfeatures\.fragment\.DynamicFragmentNavigatorDestinationBuilder\$build\(\) \(DynamicFragmentNavigatorDestinationBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.navigation\.fragment\$FragmentNavigatorExtras\(kotlin\.Array\(\(kotlin\.Pair\(\(android\.view\.View, kotlin\.String\)\)\)\)\) \(FragmentNavigatorExtras\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.RxPagedListBuilder\$setInitialLoadKey\(androidx\.paging\.RxPagedListBuilder\.Key\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.RxPagedListBuilder\$setBoundaryCallback\(androidx\.paging\.PagedList\.BoundaryCallback\(\(androidx\.paging\.RxPagedListBuilder\.Value\)\)\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.RxPagedListBuilder\$setNotifyScheduler\(io\.reactivex\.Scheduler\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.RxPagedListBuilder\$setFetchScheduler\(io\.reactivex\.Scheduler\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.security\.crypto\$EncryptedFile\(android\.content\.Context, java\.io\.File, androidx\.security\.crypto\.MasterKey, androidx\.security\.crypto\.EncryptedFile\.FileEncryptionScheme, kotlin\.String, kotlin\.String\) \(EncryptedFile\.kt:[0-9]+\)
+Found an unresolved type in androidx\.slice\.builders\$list\(android\.content\.Context, android\.net\.Uri, kotlin\.Long, kotlin\.Function[0-9]+\(\(androidx\.slice\.builders\.ListBuilderDsl, kotlin\.Unit\)\)\) \(ListBuilder\.kt:[0-9]+\)
# See b/180023439 for hiltNavGraphViewModel warning.
Found an unresolved type in androidx\.hilt\.navigation\.compose\$hiltNavGraphViewModel\(androidx\.navigation\.NavController, kotlin\.String\) \(NavHostController\.kt:[0-9]+\)
Unresolved link to .*
+Found an unresolved type in androidx\.paging\.rxjava[0-9]+\.RxPagedListBuilder\$setInitialLoadKey\(androidx\.paging\.rxjava[0-9]+\.RxPagedListBuilder\.Key\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.rxjava[0-9]+\.RxPagedListBuilder\$setBoundaryCallback\(androidx\.paging\.PagedList\.BoundaryCallback\(\(androidx\.paging\.rxjava[0-9]+\.RxPagedListBuilder\.Value\)\)\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.rxjava[0-9]+\.RxPagedListBuilder\$setNotifyScheduler\(io\.reactivex\.rxjava[0-9]+\.core\.Scheduler\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.rxjava[0-9]+\.RxPagedListBuilder\$setFetchScheduler\(io\.reactivex\.rxjava[0-9]+\.core\.Scheduler\) \(RxPagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\$mutableStateListOf\(kotlin\.Array\(\(androidx\.compose\.runtime\.mutableStateListOf\.T\)\)\) \(SnapshotState\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\$toMutableStateList\(kotlin\.collections\.Collection\(\(androidx\.compose\.runtime\.toMutableStateList\.T\)\)\) \(SnapshotState\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\$mutableStateMapOf\(kotlin\.Array\(\(kotlin\.Pair\(\(androidx\.compose\.runtime\.mutableStateMapOf\.K, androidx\.compose\.runtime\.mutableStateMapOf\.V\)\)\)\)\) \(SnapshotState\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\$toMutableStateMap\(kotlin\.collections\.Iterable\(\(kotlin\.Pair\(\(androidx\.compose\.runtime\.toMutableStateMap\.K, androidx\.compose\.runtime\.toMutableStateMap\.V\)\)\)\)\) \(SnapshotState\.kt:[0-9]+\)
+Found an unresolved type in androidx\.compose\.runtime\.collection\.MutableVector\$sortWith\(\(\(androidx\.compose\.runtime\.collection\.MutableVector\.T\)\)\) \(MutableVector\.kt:[0-9]+\)
+Found an unresolved type in androidx\.navigation\.dynamicfeatures\$navigation\(androidx\.navigation\.NavigatorProvider, kotlin\.Int, kotlin\.Int, kotlin\.Function[0-9]+\(\(androidx\.navigation\.dynamicfeatures\.DynamicNavGraphBuilder, kotlin\.Unit\)\)\) \(DynamicNavGraphBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.navigation\.dynamicfeatures\$createGraph\(androidx\.navigation\.NavController, kotlin\.Int, kotlin\.Int, kotlin\.Function[0-9]+\(\(androidx\.navigation\.dynamicfeatures\.DynamicNavGraphBuilder, kotlin\.Unit\)\)\) \(NavController\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.LivePagedListBuilder\$setCoroutineScope\(kotlinx\.coroutines\.CoroutineScope\) \(LivePagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.LivePagedListBuilder\$setInitialLoadKey\(androidx\.paging\.LivePagedListBuilder\.Key\) \(LivePagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.LivePagedListBuilder\$setBoundaryCallback\(androidx\.paging\.PagedList\.BoundaryCallback\(\(androidx\.paging\.LivePagedListBuilder\.Value\)\)\) \(LivePagedListBuilder\.kt:[0-9]+\)
+Found an unresolved type in androidx\.paging\.LivePagedListBuilder\$setFetchExecutor\(java\.util\.concurrent\.Executor\) \(LivePagedListBuilder\.kt:[0-9]+\)
Unresolved function .*
# > Task :compose:ui:ui-inspection:externalNativeBuildDebug
Build compose_inspection_jni_.*
@@ -1021,7 +1071,6 @@
WARNING: Please consider reporting this to the maintainers of org\.codehaus\.groovy\.vmplugin\.v7\.Java7\$1
# https://youtrack.jetbrains.com/issue/KT-30589
WARNING: Illegal reflective access by org\.jetbrains\.kotlin\.kapt3\.base\.javac\.KaptJavaFileManager .* to method com\.sun\.tools\.javac\.file\.BaseFileManager\.handleOption\(com\.sun\.tools\.javac\.main\.Option,java\.lang\.String\)
-WARNING: Please consider reporting this to the maintainers of org\.jetbrains\.kotlin\.kapt3\.base\.javac\.KaptJavaFileManager
# > Task :benchmark:benchmark-macro:compileReleaseKotlin
Execution optimizations have been disabled for task ':benchmark:benchmark\-macro:.*' to ensure correctness due to the following reasons:
\- Gradle detected a problem with the following location: '\$OUT_DIR/androidx/benchmark/benchmark\-macro/build/generated/source/wire'\. Reason: Task ':benchmark:benchmark\-macro:.*' uses this output of task ':benchmark:benchmark\-macro:.*' without declaring an explicit or implicit dependency\. This can lead to incorrect results being produced, depending on what order the tasks are executed\. Please refer to https://docs\.gradle\.org/[0-9]+\.[0-9]+/userguide/validation_problems\.html\#implicit_dependency for more details about this problem\.
@@ -1042,6 +1091,8 @@
# > Task :camera:camera-camera2-pipe:reportLibraryMetrics
Info: Stripped invalid locals information from [0-9]+ methods\.
Info: Methods with invalid locals information:
+java\.lang\.Object androidx\.wear\.watchface\.editor\.BaseEditorSession\$fetchComplicationsData\$[0-9]+\.invokeSuspend\(java\.lang\.Object\)
+java\.lang\.Object androidx\.camera\.camera[0-9]+\.pipe\.CameraDevicesKt\$find\$[0-9]+\.invokeSuspend\(java\.lang\.Object\)
java\.lang\.Object androidx\.camera\.camera[0-9]+\.pipe\.compat\.VirtualCameraManager\$requestLoop\$[0-9]+\.invokeSuspend\(java\.lang\.Object\)
Information in locals\-table is invalid with respect to the stack map table\. Local refers to non\-present stack map type for register: [0-9]+ with constraint OBJECT\.
java\.lang\.Object androidx\.camera\.camera[0-9]+\.pipe\.graph\.Controller[0-9]+A\.submit[0-9]+A\(androidx\.camera\.camera[0-9]+\.pipe\.AeMode, androidx\.camera\.camera[0-9]+\.pipe\.AfMode, androidx\.camera\.camera[0-9]+\.pipe\.AwbMode, java\.util\.List, java\.util\.List, java\.util\.List, kotlin\.coroutines\.Continuation\)
@@ -1067,3 +1118,13 @@
Package name 'androidx\.car\.app' used in: :car:app:app\-automotive, :car:app:app\.
# > Task :car:app:app-automotive:processDebugUnitTestManifest
\[:car:app:app\-automotive\] \$OUT_DIR/androidx/car/app/app\-automotive/build/intermediates/merged_manifest/debug/AndroidManifest\.xml Warning:
+# > Task :camera:camera-video:lintDebug
+Error processing \$CHECKOUT/prebuilts/androidx/external/org/jetbrains/kotlin/kotlin\-stdlib/[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+/kotlin\-stdlib\-[0-9]+\.[0-9]+\.[0-9]+\-M[0-9]+\.jar:META\-INF/versions/[0-9]+/module\-info\.class: broken class file\? \(This feature requires ASM[0-9]+\)
+# > Task :compose:foundation:foundation:androidReleaseSourcesJar
+Encountered duplicate path "android[a-zA-Z]*/.+" during copy operation configured with DuplicatesStrategy\.WARN
+# > Task :camera:camera-camera2-pipe:reportLibraryMetrics
+java\.lang\.Object androidx\.camera\.camera[0-9]+\.pipe\.compat\.Camera[0-9]+DeviceCache\$getCameras\$[0-9]+\.invokeSuspend\(java\.lang\.Object\)
+Type information in locals\-table is inconsistent\. Cannot constrain type: @Nullable androidx\.camera\.camera[0-9]+\.pipe\.core\.Debug \{\} for value: v[0-9]+\(this_\$iv\$iv\) by constraint INT\.
+# > Task :compose:foundation:foundation:integration-tests:foundation-demos:reportLibraryMetrics
+Stripped invalid locals information from [0-9]+ method\.
+java\.lang\.Object androidx\.compose\.foundation\.demos\.ListDemosKt\$ListHoistedStateDemo\$[0-9]+\$[0-9]+\$[0-9]+\$[0-9]+\$[0-9]+\.invokeSuspend\(java\.lang\.Object\)
diff --git a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt
index aff621f..5e67b91 100644
--- a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt
+++ b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UseRequireInsteadOfGet.kt
@@ -259,7 +259,7 @@
*/
internal fun String.decapitalize(locale: Locale): String {
return if (isNotEmpty() && !this[0].isLowerCase()) {
- substring(0, 1).toLowerCase(locale) + substring(1)
+ substring(0, 1).lowercase(locale) + substring(1)
} else {
this
}
@@ -274,11 +274,11 @@
val firstChar = this[0]
if (firstChar.isLowerCase()) {
return buildString {
- val titleChar = firstChar.toTitleCase()
- if (titleChar != firstChar.toUpperCase()) {
+ val titleChar = firstChar.titlecaseChar()
+ if (titleChar != firstChar.uppercaseChar()) {
append(titleChar)
} else {
- append(this@capitalize.substring(0, 1).toUpperCase(locale))
+ append(this@capitalize.substring(0, 1).uppercase(locale))
}
append(this@capitalize.substring(1))
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 60a1d2b..16b03d1 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -19,11 +19,11 @@
espresso = "3.3.0"
hilt = "2.35"
incap = "0.2"
-kotlin = "1.4.32"
+kotlin = "1.5.0"
kotlinCompileTesting = "1.3.6"
kotlinCoroutines = "1.4.3"
kotlinPoet = "1.4.0"
-ksp = "1.4.32-1.0.0-alpha08"
+ksp = "1.5.0-1.0.0-alpha09"
leakcanary = "2.2"
mockito = "2.25.0"
sqldelight = "1.3.0"
@@ -103,6 +103,7 @@
kotlinPoetMetadata = { module = "com.squareup:kotlinpoet-metadata", version.ref = "kotlinPoet" }
kotlinPoetMetadataSpecs = { module = "com.squareup:kotlinpoet-metadata-specs", version.ref = "kotlinPoet" }
kotlinPoetClassinspector = { module = "com.squareup:kotlinpoet-classinspector-elements", version.ref = "kotlinPoet" }
+kgpLeakPatcher = { module = "dev.zacsweers:kgp-150-leak-patcher", version="1.1.0" }
ksp = { module = "com.google.devtools.ksp:symbol-processing", version.ref = "ksp" }
kspApi = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
kspGradlePlugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
diff --git a/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/AGPExtensions.kt b/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/AGPExtensions.kt
index 32b5f04..e36d8bd 100644
--- a/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/AGPExtensions.kt
+++ b/inspection/inspection-gradle-plugin/src/main/kotlin/androidx/inspection/gradle/AGPExtensions.kt
@@ -21,8 +21,6 @@
import java.io.File
import java.util.Locale
-// String.capitalize(Locale) is currently experimental.
-@ExperimentalStdlibApi
internal fun BaseVariant.taskName(baseName: String) = "$baseName${name.capitalize(Locale.ENGLISH)}"
internal fun Project.taskWorkingDir(variant: BaseVariant, baseName: String): File {
diff --git a/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/TopOfTreeBuilder.kt b/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/TopOfTreeBuilder.kt
index b431873..018eb76 100644
--- a/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/TopOfTreeBuilder.kt
+++ b/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/TopOfTreeBuilder.kt
@@ -115,7 +115,7 @@
val result = md.digest(file.data)
return ArchiveFile(
Paths.get(
- file.relativePath.toString() + "." + hashType.toLowerCase()
+ file.relativePath.toString() + "." + hashType.lowercase()
),
result
)
diff --git a/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt b/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt
index 269e504..5090f51 100644
--- a/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt
+++ b/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt
@@ -710,7 +710,7 @@
// Neither of these should be null if we're looking at Java code.
val containingClass = method.containingClass ?: return null
val hostType = containingClass.name ?: return null
- val hostVar = hostType[0].toLowerCase() + hostType.substring(1)
+ val hostVar = hostType[0].lowercaseChar() + hostType.substring(1)
val hostParam = if (isStatic || isConstructor) { null } else { "$hostType $hostVar" }
diff --git a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
index 088c60e..2e42425 100644
--- a/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
+++ b/navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
@@ -1057,7 +1057,7 @@
val id = 2
val matchArgs = deepLink.getMatchingArguments(
- Uri.parse("${DEEP_LINK_EXACT_HTTPS.toUpperCase()}/users/$id/posts"),
+ Uri.parse("${DEEP_LINK_EXACT_HTTPS.uppercase()}/users/$id/posts"),
mapOf("id" to intArgument())
)
assertWithMessage("Args should not be null")
diff --git a/navigation/navigation-dynamic-features-fragment/build.gradle b/navigation/navigation-dynamic-features-fragment/build.gradle
index 596d055..708a89b 100644
--- a/navigation/navigation-dynamic-features-fragment/build.gradle
+++ b/navigation/navigation-dynamic-features-fragment/build.gradle
@@ -56,6 +56,13 @@
androidTestImplementation(project(":internal-testutils-runtime"), {
exclude group: "androidx.fragment", module: "fragment"
})
+ androidTestImplementation(MULTIDEX)
+}
+
+android {
+ defaultConfig {
+ multiDexEnabled = true
+ }
}
androidx {
diff --git a/navigation/navigation-dynamic-features-fragment/src/androidTest/AndroidManifest.xml b/navigation/navigation-dynamic-features-fragment/src/androidTest/AndroidManifest.xml
index e33a872..f5345eb 100644
--- a/navigation/navigation-dynamic-features-fragment/src/androidTest/AndroidManifest.xml
+++ b/navigation/navigation-dynamic-features-fragment/src/androidTest/AndroidManifest.xml
@@ -17,7 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.navigation.dynamicfeatures.fragment">
- <application>
+ <application android:name="androidx.multidex.MultiDexApplication">
<activity android:name="androidx.navigation.dynamicfeatures.fragment.NavigationActivity" />
<activity android:name="androidx.navigation.dynamicfeatures.fragment.TestActivity" />
</application>
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
index fbfb48a..1b5539c 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
@@ -19,6 +19,7 @@
fun String.toCamelCase(): String {
val split = this.split("_")
if (split.size == 0) return ""
+ @Suppress("DEPRECATION") // b/187985877
if (split.size == 1) return split[0].capitalize()
return split.joinToCamelCase()
}
diff --git a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
index c718b7e..f121c0b 100644
--- a/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
+++ b/navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
@@ -362,6 +362,7 @@
).initializer("new $T()", HASHMAP_CLASSNAME).build()
fun setters(thisClassName: ClassName) = args.map { arg ->
+ @Suppress("DEPRECATION") // b/187985877
MethodSpec.methodBuilder("set${arg.sanitizedName.capitalize()}").apply {
addAnnotation(androidAnnotations.NONNULL_CLASSNAME)
addAnnotation(suppressAnnotationSpec)
@@ -516,6 +517,7 @@
}.build()
private fun getterFromArgName(sanitizedName: String, suffix: String = "") =
+ @Suppress("DEPRECATION") // b/187985877
"get${sanitizedName.capitalize()}$suffix"
fun hashCodeMethod(
diff --git a/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt
index b9c2d88..7a1f67d 100644
--- a/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt
+++ b/navigation/navigation-safe-args-generator/src/test/kotlin/androidx/navigation/safe/args/generator/NavArgumentResolverTest.kt
@@ -34,6 +34,7 @@
private fun id(id: String) = ResReference("a.b", "id", id)
private fun createTemplateDestination(name: String) =
+ @Suppress("DEPRECATION") // b/187985877
Destination(
id(name), ClassName.get("foo", "Fragment${name.capitalize()}"), "test",
listOf(
diff --git a/navigation/navigation-ui/src/androidTest/AndroidManifest.xml b/navigation/navigation-ui/src/androidTest/AndroidManifest.xml
index 40d9eb7..59d8580a 100644
--- a/navigation/navigation-ui/src/androidTest/AndroidManifest.xml
+++ b/navigation/navigation-ui/src/androidTest/AndroidManifest.xml
@@ -16,5 +16,5 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.navigation.ui">
-
+ <application android:name="androidx.multidex.MultiDexApplication" />
</manifest>
diff --git a/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt b/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt
index d180fff..b27e1b8 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshotState.kt
@@ -48,7 +48,7 @@
private set
internal val storageCount
- get() = pages.sumBy { it.data.size }
+ get() = pages.sumOf { it.data.size }
private var _placeholdersBefore = 0
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagePresenter.kt b/paging/common/src/main/kotlin/androidx/paging/PagePresenter.kt
index 699c539..a0c76f1 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagePresenter.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagePresenter.kt
@@ -90,7 +90,7 @@
override val size: Int
get() = placeholdersBefore + storageCount + placeholdersAfter
- private fun List<TransformablePage<T>>.fullCount() = sumBy { it.data.size }
+ private fun List<TransformablePage<T>>.fullCount() = sumOf { it.data.size }
fun processEvent(pageEvent: PageEvent<T>, callback: ProcessPageEventCallback) {
when (pageEvent) {
diff --git a/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt b/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt
index 1be0d19..3852c54 100644
--- a/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/CachingTest.kt
@@ -324,7 +324,7 @@
ViewportHint.Access(
pageOffset = loadedPageCount - 1,
indexInPage = it.pages.last().data.size - 1,
- presentedItemsBefore = it.pages.sumBy { it.data.size } - 1,
+ presentedItemsBefore = it.pages.sumOf { it.data.size } - 1,
presentedItemsAfter = 0,
originalPageOffsetFirst =
it.pages.first().originalPageOffsets.minOrNull()!!,
diff --git a/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt b/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
index 16dd201..8320485 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
@@ -3504,7 +3504,7 @@
internal suspend fun <T : Any> PageFetcher<*, T>.assertEventByGeneration(
expected: List<List<PageEvent<T>>>
) {
- val total = expected.sumBy { it.size }
+ val total = expected.sumOf { it.size }
val actual = collectEvents {
awaitEventCount(total)
stop()
diff --git a/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt b/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt
index 1e2c44c..bd88141 100644
--- a/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt
@@ -2090,7 +2090,7 @@
if (after == null) {
"END"
} else if (before == null || before.first() != after.first()) {
- after.first().toUpperCase().toString()
+ after.first().uppercaseChar().toString()
} else null
}
}
diff --git a/paging/runtime/src/androidTest/java/androidx/paging/ListUpdateCallbackFake.kt b/paging/runtime/src/androidTest/java/androidx/paging/ListUpdateCallbackFake.kt
index ab82af6..ff71697 100644
--- a/paging/runtime/src/androidTest/java/androidx/paging/ListUpdateCallbackFake.kt
+++ b/paging/runtime/src/androidTest/java/androidx/paging/ListUpdateCallbackFake.kt
@@ -28,7 +28,7 @@
val interactions
get() = allEvents.size
- fun itemCountFromEvents() = allEvents.sumBy {
+ fun itemCountFromEvents() = allEvents.sumOf {
when (it) {
is OnInsertedEvent -> it.count
is OnRemovedEvent -> -it.count
diff --git a/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsSample.kt b/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsSample.kt
index 145160c..71a5a41 100644
--- a/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsSample.kt
+++ b/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsSample.kt
@@ -51,7 +51,7 @@
pagingData.insertSeparators { before: String?, after: String? ->
if (after != null && before?.first() != after.first()) {
// separator - after is first item that starts with its first letter
- after.first().toUpperCase().toString()
+ after.first().uppercaseChar().toString()
} else {
// no separator - either end of list, or first letters of before/after are the same
null
@@ -77,7 +77,7 @@
Maybe.fromCallable<String> {
if (after != null && before?.first() != after.first()) {
// separator - after is first item that starts with its first letter
- after.first().toUpperCase().toString()
+ after.first().uppercaseChar().toString()
} else {
// no separator - either end of list, or first letters of before/after are the same
null
@@ -110,7 +110,7 @@
val (before, after) = it!!
if (after != null && before?.first() != after.first()) {
// separator - after is first item that starts with its first letter
- after.first().toUpperCase().toString()
+ after.first().uppercaseChar().toString()
} else {
// no separator - either end of list, or first letters of before/after are the same
null
diff --git a/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsUiModelSample.kt b/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsUiModelSample.kt
index 76b6c6c..040f6f3 100644
--- a/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsUiModelSample.kt
+++ b/paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsUiModelSample.kt
@@ -67,7 +67,7 @@
.insertSeparators<ItemUiModel, UiModel> { before: ItemUiModel?, after: ItemUiModel? ->
if (after != null && before?.item?.label?.first() != after.item.label.first()) {
// separator - after is first item that starts with its first letter
- SeparatorUiModel(after.item.label.first().toUpperCase())
+ SeparatorUiModel(after.item.label.first().uppercaseChar())
} else {
// no separator - either end of list, or first letters of before/after are the same
null
@@ -101,7 +101,7 @@
Maybe.fromCallable<UiModel> {
if (after != null && before?.item?.label?.first() != after.item.label.first()) {
// separator - after is first item that starts with its first letter
- SeparatorUiModel(after.item.label.first().toUpperCase())
+ SeparatorUiModel(after.item.label.first().uppercaseChar())
} else {
// no separator - either end of list, or first letters of before/after are the same
null
@@ -144,7 +144,7 @@
before?.item?.label?.first() != after.item.label.first()
) {
// separator - after is first item that starts with its first letter
- SeparatorUiModel(after.item.label.first().toUpperCase())
+ SeparatorUiModel(after.item.label.first().uppercaseChar())
} else {
// no separator - either end of list, or first letters of before/after are the same
null
diff --git a/playground-common/playground-build.gradle b/playground-common/playground-build.gradle
index fde3496..f17257b9 100644
--- a/playground-common/playground-build.gradle
+++ b/playground-common/playground-build.gradle
@@ -55,6 +55,7 @@
dependencies {
classpath(libs.androidGradlePlugin)
classpath(libs.kotlinGradlePlugin)
+ classpath(libs.kgpLeakPatcher)
classpath(libs.kspGradlePlugin)
classpath "androidx.build:gradle-plugin:0.1.0"
classpath(libs.shadow)
diff --git a/recyclerview/recyclerview/build.gradle b/recyclerview/recyclerview/build.gradle
index ab0a17a..c1cf417 100644
--- a/recyclerview/recyclerview/build.gradle
+++ b/recyclerview/recyclerview/build.gradle
@@ -28,6 +28,7 @@
androidTestImplementation(project(":internal-testutils-espresso"))
androidTestImplementation(project(":internal-testutils-runtime"))
androidTestImplementation(project(":internal-testutils-common"))
+ androidTestImplementation(MULTIDEX)
testImplementation(JUNIT)
testImplementation(MOCKITO_CORE)
@@ -45,6 +46,7 @@
}
defaultConfig {
+ multiDexEnabled = true
testInstrumentationRunner "androidx.testutils.ActivityRecyclingAndroidJUnitRunner"
}
}
diff --git a/recyclerview/recyclerview/src/androidTest/AndroidManifest.xml b/recyclerview/recyclerview/src/androidTest/AndroidManifest.xml
index bb77728..881938c 100644
--- a/recyclerview/recyclerview/src/androidTest/AndroidManifest.xml
+++ b/recyclerview/recyclerview/src/androidTest/AndroidManifest.xml
@@ -17,7 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.recyclerview.test">
- <application android:supportsRtl="true">
+ <application android:name="androidx.multidex.MultiDexApplication" android:supportsRtl="true">
<activity android:name="androidx.recyclerview.test.RecyclerViewTestActivity"/>
<activity android:name="androidx.recyclerview.widget.TestActivity"/>
<activity android:name="androidx.recyclerview.widget.TestContentViewActivity"/>
diff --git a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt
index 77b6d72..3789325 100644
--- a/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt
+++ b/resourceinspection/resourceinspection-processor/src/main/kotlin/androidx/resourceinspection/processor/InspectionCompanionGeneration.kt
@@ -57,6 +57,7 @@
val attributeIdNames = NameAllocator().apply {
for (attribute in view.attributes) {
+ @Suppress("DEPRECATION") // b/187985877
newName("m${attribute.name.capitalize(Locale.US)}Id", attribute)
}
}
@@ -102,6 +103,7 @@
addMethod(
MethodSpec.methodBuilder("readProperties").apply {
// Make sure the view parameter name doesn't conflict with anything
+ @Suppress("DEPRECATION") // b/187985877
val viewParameter = attributeIdNames.clone()
.apply { newName("propertyReader") }
.newName(view.className.simpleName().decapitalize(Locale.US))
diff --git a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacElement.kt b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacElement.kt
index 47eb36b..ba502a5 100644
--- a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacElement.kt
+++ b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacElement.kt
@@ -78,7 +78,7 @@
}
override fun kindName(): String {
- return element.kind.name.toLowerCase(Locale.US)
+ return element.kind.name.lowercase(Locale.US)
}
override fun hasAnnotationWithPackage(pkg: String): Boolean {
diff --git a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt
index e6ca777..e1df846 100644
--- a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt
+++ b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt
@@ -264,7 +264,7 @@
val PRIMITIVE_TYPES = TypeKind.values().filter {
it.isPrimitive
}.associateBy {
- it.name.toLowerCase(Locale.US)
+ it.name.lowercase(Locale.US)
}
}
}
diff --git a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspElement.kt b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspElement.kt
index 22fa748..82fef86 100644
--- a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspElement.kt
+++ b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspElement.kt
@@ -33,7 +33,7 @@
return when (declaration) {
is KSClassDeclaration ->
(declaration as KSClassDeclaration).classKind.name
- .toLowerCase(Locale.US)
+ .lowercase(Locale.US)
is KSPropertyDeclaration -> "property"
is KSFunctionDeclaration -> "function"
else -> declaration::class.simpleName ?: "unknown"
diff --git a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
index 7ad376f..6789fe3 100644
--- a/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
+++ b/room/compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/synthetic/KspSyntheticPropertyMethodElement.kt
@@ -148,6 +148,7 @@
return if (propName.startsWith("is")) {
propName
} else {
+ @Suppress("DEPRECATION") // b/187985877
"get${propName.capitalize(Locale.US)}"
}
}
@@ -237,6 +238,7 @@
return if (propName.startsWith("is")) {
"set${propName.substring(2)}"
} else {
+ @Suppress("DEPRECATION") // b/187985877
"set${propName.capitalize(Locale.US)}"
}
}
diff --git a/room/compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt b/room/compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
index dae5e5a..a961ffd 100644
--- a/room/compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
+++ b/room/compiler-processing/src/test/java/androidx/room/compiler/processing/XProcessingStepTest.kt
@@ -20,6 +20,7 @@
import androidx.room.compiler.processing.XProcessingStep.Companion.executeInKsp
import androidx.room.compiler.processing.testcode.MainAnnotation
import androidx.room.compiler.processing.testcode.OtherAnnotation
+import androidx.room.compiler.processing.util.CompilationTestCapabilities
import com.google.auto.common.BasicAnnotationProcessor
import com.google.common.truth.Truth.assertAbout
import com.google.common.truth.Truth.assertThat
@@ -297,6 +298,7 @@
@Test
fun kspReturnsUnprocessed() {
+ CompilationTestCapabilities.assumeKspIsEnabled()
val processingStep = object : XProcessingStep {
override fun process(
env: XProcessingEnv,
diff --git a/room/compiler/build.gradle b/room/compiler/build.gradle
index 26115ea..64b72f3 100644
--- a/room/compiler/build.gradle
+++ b/room/compiler/build.gradle
@@ -120,6 +120,7 @@
testImplementation(JUNIT)
testImplementation(JSR250)
testImplementation(MOCKITO_CORE)
+ testImplementation(ANTLR)
testImplementation(fileTree(
dir: "${SdkHelperKt.getSdkPath(project)}/platforms/$SupportConfig.COMPILE_SDK_VERSION/",
include : "android.jar"
diff --git a/room/compiler/src/main/kotlin/androidx/room/ext/string_ext.kt b/room/compiler/src/main/kotlin/androidx/room/ext/string_ext.kt
index 7ef60c4..f107bad 100644
--- a/room/compiler/src/main/kotlin/androidx/room/ext/string_ext.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/ext/string_ext.kt
@@ -51,14 +51,14 @@
// TODO: Replace this with the function from the Kotlin stdlib once the API becomes stable
fun String.capitalize(locale: Locale): String = if (isNotEmpty() && this[0].isLowerCase()) {
- substring(0, 1).toUpperCase(locale) + substring(1)
+ substring(0, 1).uppercase(locale) + substring(1)
} else {
this
}
// TODO: Replace this with the function from the Kotlin stdlib once the API becomes stable
fun String.decapitalize(locale: Locale): String = if (isNotEmpty() && this[0].isUpperCase()) {
- substring(0, 1).toLowerCase(locale) + substring(1)
+ substring(0, 1).lowercase(locale) + substring(1)
} else {
this
}
diff --git a/room/compiler/src/main/kotlin/androidx/room/parser/SqlParser.kt b/room/compiler/src/main/kotlin/androidx/room/parser/SqlParser.kt
index 4a150d6..cfce26f 100644
--- a/room/compiler/src/main/kotlin/androidx/room/parser/SqlParser.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/parser/SqlParser.kt
@@ -95,7 +95,7 @@
if (ctx.parent is SQLiteParser.ExprContext) {
val parentExpr = ctx.parent as SQLiteParser.ExprContext
val functionName = parentExpr.function_name() ?: return false
- return fixedParamFunctions.contains(functionName.text.toLowerCase(Locale.US))
+ return fixedParamFunctions.contains(functionName.text.lowercase(Locale.US))
} else {
return false
}
diff --git a/room/compiler/src/main/kotlin/androidx/room/parser/expansion/ProjectionExpander.kt b/room/compiler/src/main/kotlin/androidx/room/parser/expansion/ProjectionExpander.kt
index 52a8504..94f8ff3 100644
--- a/room/compiler/src/main/kotlin/androidx/room/parser/expansion/ProjectionExpander.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/parser/expansion/ProjectionExpander.kt
@@ -42,11 +42,11 @@
private class IdentifierMap<V> : HashMap<String, V>() {
override fun put(key: String, value: V): V? {
- return super.put(key.toLowerCase(Locale.ENGLISH), value)
+ return super.put(key.lowercase(Locale.ENGLISH), value)
}
override fun get(key: String): V? {
- return super.get(key.toLowerCase(Locale.ENGLISH))
+ return super.get(key.lowercase(Locale.ENGLISH))
}
}
@@ -116,7 +116,7 @@
.map { (name, alias) -> alias to name }
.toMap(IdentifierMap())
val nameToAlias = query.tables
- .groupBy { it.name.toLowerCase(Locale.ENGLISH) }
+ .groupBy { it.name.lowercase(Locale.ENGLISH) }
.filter { (_, pairs) -> pairs.size == 1 }
.map { (name, pairs) -> name to pairs.first().alias }
.toMap(IdentifierMap())
@@ -195,7 +195,7 @@
}.map { field ->
if (table != null && table is Entity) {
// Should not happen when defining a view
- val tableAlias = nameToAlias[table.tableName.toLowerCase(Locale.ENGLISH)]
+ val tableAlias = nameToAlias[table.tableName.lowercase(Locale.ENGLISH)]
?: table.tableName
"`$tableAlias`.`${field.columnName}` AS `${field.columnName}`"
} else {
diff --git a/room/compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt b/room/compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
index 855dc4d..a95dc14 100644
--- a/room/compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
@@ -378,10 +378,10 @@
views: List<DatabaseView>
) {
val entitiesInfo = entities.map {
- Triple(it.tableName.toLowerCase(Locale.US), it.typeName.toString(), it.element)
+ Triple(it.tableName.lowercase(Locale.US), it.typeName.toString(), it.element)
}
val viewsInfo = views.map {
- Triple(it.viewName.toLowerCase(Locale.US), it.typeName.toString(), it.element)
+ Triple(it.viewName.lowercase(Locale.US), it.typeName.toString(), it.element)
}
(entitiesInfo + viewsInfo)
.groupBy { (name, _, _) -> name }
diff --git a/room/compiler/src/main/kotlin/androidx/room/processor/FieldProcessor.kt b/room/compiler/src/main/kotlin/androidx/room/processor/FieldProcessor.kt
index f436016..37213b3 100644
--- a/room/compiler/src/main/kotlin/androidx/room/processor/FieldProcessor.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/processor/FieldProcessor.kt
@@ -119,7 +119,7 @@
if (value == null) {
return null
}
- val trimmed = value.trim().toLowerCase(Locale.ENGLISH)
+ val trimmed = value.trim().lowercase(Locale.ENGLISH)
val defaultValue = if (affinity == SQLTypeAffinity.TEXT) {
if (value == ColumnInfo.VALUE_UNSPECIFIED) {
null
diff --git a/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt b/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt
index 2738ca5..1116845 100644
--- a/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt
@@ -66,7 +66,7 @@
}
if (matchInfo != MatchInfo.FTS4) {
- add("matchinfo=${matchInfo.name.toLowerCase(Locale.US)}")
+ add("matchinfo=${matchInfo.name.lowercase(Locale.US)}")
}
notIndexedColumns.forEach {
diff --git a/room/compiler/src/main/kotlin/androidx/room/vo/SchemaIdentityKey.kt b/room/compiler/src/main/kotlin/androidx/room/vo/SchemaIdentityKey.kt
index 9a241fa..007ea5d 100644
--- a/room/compiler/src/main/kotlin/androidx/room/vo/SchemaIdentityKey.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/vo/SchemaIdentityKey.kt
@@ -30,7 +30,7 @@
companion object {
private val SEPARATOR = "?:?"
private val ENGLISH_SORT = Comparator<String> { o1, o2 ->
- o1.toLowerCase(Locale.ENGLISH).compareTo(o2.toLowerCase(Locale.ENGLISH))
+ o1.lowercase(Locale.ENGLISH).compareTo(o2.lowercase(Locale.ENGLISH))
}
}
diff --git a/room/compiler/src/main/kotlin/androidx/room/vo/Warning.kt b/room/compiler/src/main/kotlin/androidx/room/vo/Warning.kt
index 82ca796..e825f29 100644
--- a/room/compiler/src/main/kotlin/androidx/room/vo/Warning.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/vo/Warning.kt
@@ -50,7 +50,7 @@
companion object {
val PUBLIC_KEY_MAP = values().associateBy { it.publicKey }
fun fromPublicKey(publicKey: String): Warning? {
- return PUBLIC_KEY_MAP[publicKey.toUpperCase(Locale.US)]
+ return PUBLIC_KEY_MAP[publicKey.uppercase(Locale.US)]
}
}
}
diff --git a/room/compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt b/room/compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
index 1f75228..16dc991 100644
--- a/room/compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
@@ -277,7 +277,7 @@
}
addStatement(
"$L.put($S, $L)", viewTablesVar,
- view.viewName.toLowerCase(Locale.US), tablesVar
+ view.viewName.lowercase(Locale.US), tablesVar
)
}
addStatement(
diff --git a/room/compiler/src/test/kotlin/androidx/room/processor/FieldProcessorTest.kt b/room/compiler/src/test/kotlin/androidx/room/processor/FieldProcessorTest.kt
index d4462a6..a4a393c 100644
--- a/room/compiler/src/test/kotlin/androidx/room/processor/FieldProcessorTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/processor/FieldProcessorTest.kt
@@ -235,7 +235,7 @@
ALL_PRIMITIVES.forEach { primitive ->
singleEntity(
"@TypeConverters(foo.bar.MyConverter.class) @NonNull " +
- "${primitive.toString().toLowerCase(Locale.US)}[] arr;"
+ "${primitive.toString().lowercase(Locale.US)}[] arr;"
) { field, invocation ->
assertThat(
field,
diff --git a/test/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt b/test/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt
index dcc63d34..16a5f45 100644
--- a/test/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt
+++ b/test/screenshot/src/main/java/androidx/test/screenshot/ScreenshotTestRule.kt
@@ -332,7 +332,7 @@
}
private fun getDeviceModel(): String {
- var model = android.os.Build.MODEL.toLowerCase()
+ var model = android.os.Build.MODEL.lowercase()
arrayOf("phone", "x86", "x64", "gms").forEach {
model = model.replace(it, "")
}
diff --git a/work/workmanager-inspection/build.gradle b/work/workmanager-inspection/build.gradle
index 72f6cd2..95268ff 100644
--- a/work/workmanager-inspection/build.gradle
+++ b/work/workmanager-inspection/build.gradle
@@ -63,6 +63,8 @@
// Allow usage of Kotlin's @OptIn.
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
- freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
+ freeCompilerArgs += [
+ "-Xopt-in=kotlin.RequiresOptIn"
+ ]
}
}
diff --git a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt b/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt
index 26c2af0..5a46fc0 100644
--- a/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt
+++ b/work/workmanager-inspection/src/androidTest/java/androidx/work/inspection/WorkInfoTest.kt
@@ -156,13 +156,17 @@
testEnvironment.receiveEvent().let { event ->
val workInfo = event.workAdded.work
- val topCallStack = workInfo.callStack.framesList[0]
- assertThat(topCallStack.className)
- .startsWith("androidx.work.inspection.WorkManagerInspector")
- assertThat(topCallStack.fileName)
- .isEqualTo("WorkManagerInspector.kt")
- assertThat(topCallStack.methodName)
- .isEqualTo("onEntry")
+ // onEntry is a SAM lambda and therefore the Kotlin compiler
+ // can use invoke-dynamic to generate the lambda class. When
+ // that happens the top stack frame is not
+ // `WorkManagerInspector.onEntry`, instead it is a randomly named
+ // lambda method. Therefore, we just check that there is a frame
+ // on the stack with the method name `onEntry`. That can be
+ // on a synthetic lambda class generated by D8 desugaring.
+ val hasOnEntryStackFrame = workInfo.callStack.framesList.any {
+ it.methodName.equals("onEntry")
+ }
+ assertThat(hasOnEntryStackFrame).isTrue()
}
}