From 6c18b25d5d9c37c03ddb63230d7ed89c29c39fe0 Mon Sep 17 00:00:00 2001 From: Maximillian Leonov <91663102+MaximillianLeonov@users.noreply.github.com> Date: Tue, 25 Apr 2023 09:31:57 +0400 Subject: [PATCH 01/12] Replace `if` condition with AnimatedVisibility component --- .../feature/settings/SettingsDialog.kt | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt b/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt index 847493a83..504fee4fe 100644 --- a/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt +++ b/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt @@ -18,8 +18,10 @@ package com.google.samples.apps.nowinandroid.feature.settings import android.content.Intent import android.net.Uri +import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth @@ -149,7 +151,7 @@ fun SettingsDialog( } @Composable -private fun SettingsPanel( +private fun ColumnScope.SettingsPanel( settings: UserEditableSettings, supportDynamicColor: Boolean, onChangeThemeBrand: (themeBrand: ThemeBrand) -> Unit, @@ -169,19 +171,21 @@ private fun SettingsPanel( onClick = { onChangeThemeBrand(ANDROID) }, ) } - if (settings.brand == DEFAULT && supportDynamicColor) { - SettingsDialogSectionTitle(text = stringResource(R.string.dynamic_color_preference)) - Column(Modifier.selectableGroup()) { - SettingsDialogThemeChooserRow( - text = stringResource(string.dynamic_color_yes), - selected = settings.useDynamicColor, - onClick = { onChangeDynamicColorPreference(true) }, - ) - SettingsDialogThemeChooserRow( - text = stringResource(string.dynamic_color_no), - selected = !settings.useDynamicColor, - onClick = { onChangeDynamicColorPreference(false) }, - ) + AnimatedVisibility(visible = settings.brand == DEFAULT && supportDynamicColor) { + Column { + SettingsDialogSectionTitle(text = stringResource(R.string.dynamic_color_preference)) + Column(Modifier.selectableGroup()) { + SettingsDialogThemeChooserRow( + text = stringResource(string.dynamic_color_yes), + selected = settings.useDynamicColor, + onClick = { onChangeDynamicColorPreference(true) }, + ) + SettingsDialogThemeChooserRow( + text = stringResource(string.dynamic_color_no), + selected = !settings.useDynamicColor, + onClick = { onChangeDynamicColorPreference(false) }, + ) + } } } SettingsDialogSectionTitle(text = stringResource(R.string.dark_mode_preference)) From 7dadf033c153e1706bb48c839ef3149762e2d229 Mon Sep 17 00:00:00 2001 From: Maximillian Leonov Date: Thu, 1 Jun 2023 11:14:04 +0400 Subject: [PATCH 02/12] Add comment for ColumnScope usage --- .../samples/apps/nowinandroid/feature/settings/SettingsDialog.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt b/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt index 504fee4fe..959d17797 100644 --- a/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt +++ b/feature/settings/src/main/java/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt @@ -150,6 +150,7 @@ fun SettingsDialog( ) } +// [ColumnScope] is used for using the [ColumnScope.AnimatedVisibility] extension overload composable. @Composable private fun ColumnScope.SettingsPanel( settings: UserEditableSettings, From 4a8a43551af8e77c49130e3caaf320cd9fd4ed9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Wed, 14 Jun 2023 10:23:22 +0200 Subject: [PATCH 03/12] Add contentType to news feed Before ScrollForYouFeedBenchmark_scrollFeedCompilationFull frameDurationCpuMs P50 4.9, P90 6.9, P95 7.6, P99 9.5 frameOverrunMs P50 -10.3, P90 -6.8, P95 -2.8, P99 -2.1 Traces: Iteration 0 1 2 3 4 5 6 7 8 9 After ScrollForYouFeedBenchmark_scrollFeedCompilationFull frameDurationCpuMs P50 4.6, P90 6.3, P95 7.2, P99 9.2 frameOverrunMs P50 -10.6, P90 -8.7, P95 -7.8, P99 -4.7 Traces: Iteration 0 1 2 3 4 5 6 7 8 9 Change-Id: I5589776f9627c27154873529c9ca9dd055a8a8ef --- .../google/samples/apps/nowinandroid/core/ui/NewsFeed.kt | 6 +++++- .../apps/nowinandroid/feature/foryou/ForYouScreen.kt | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt index 58ec216fd..22783abc1 100644 --- a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt +++ b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt @@ -57,7 +57,11 @@ fun LazyGridScope.newsFeed( when (feedState) { NewsFeedUiState.Loading -> Unit is NewsFeedUiState.Success -> { - items(feedState.feed, key = { it.id }) { userNewsResource -> + items( + feedState.feed, + key = { it.id }, + contentType = { "newsFeedItem" }, + ) { userNewsResource -> val resourceUrl by remember { mutableStateOf(Uri.parse(userNewsResource.url)) } diff --git a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt index 70cc7e541..0c6aa40e1 100644 --- a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt +++ b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt @@ -182,7 +182,7 @@ internal fun ForYouScreen( onTopicClick = onTopicClick, ) - item(span = { GridItemSpan(maxLineSpan) }) { + item(span = { GridItemSpan(maxLineSpan) }, contentType = { "bottomSpacing" }) { Column { Spacer(modifier = Modifier.height(8.dp)) // Add space for the content to clear the "offline" snackbar. @@ -240,7 +240,7 @@ private fun LazyGridScope.onboarding( -> Unit is OnboardingUiState.Shown -> { - item(span = { GridItemSpan(maxLineSpan) }) { + item(span = { GridItemSpan(maxLineSpan) }, contentType = "onboarding") { Column(modifier = interestsItemModifier) { Text( text = stringResource(R.string.onboarding_guidance_title), From 19ffb53150dba254f071c34f3223061f58b1ee23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Thu, 15 Jun 2023 09:59:19 +0200 Subject: [PATCH 04/12] Don't use lambda contentType for a single item Change-Id: I0588c031428d523707463c5f0f0b6c586ea5e2c3 --- .../samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt index 0c6aa40e1..eaa0c58fa 100644 --- a/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt +++ b/feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt @@ -182,7 +182,7 @@ internal fun ForYouScreen( onTopicClick = onTopicClick, ) - item(span = { GridItemSpan(maxLineSpan) }, contentType = { "bottomSpacing" }) { + item(span = { GridItemSpan(maxLineSpan) }, contentType = "bottomSpacing") { Column { Spacer(modifier = Modifier.height(8.dp)) // Add space for the content to clear the "offline" snackbar. From 8e1e994bb10bbd0b2305a9203315b138dbb3a676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Thu, 15 Jun 2023 09:59:25 +0200 Subject: [PATCH 05/12] Add named arguments Change-Id: Ic91ae4fc04bf8eb92c3e5845c7e984475526ec91 --- .../com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt index 22783abc1..16cd3edf7 100644 --- a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt +++ b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt @@ -58,7 +58,7 @@ fun LazyGridScope.newsFeed( NewsFeedUiState.Loading -> Unit is NewsFeedUiState.Success -> { items( - feedState.feed, + items = feedState.feed, key = { it.id }, contentType = { "newsFeedItem" }, ) { userNewsResource -> From 5767d38d2162573e013355a5d6c9bc8cd8f25620 Mon Sep 17 00:00:00 2001 From: wiryadev Date: Sat, 17 Jun 2023 16:55:12 +0700 Subject: [PATCH 06/12] remove M1 Mac Rosetta caution in README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 9aca22cbd..1b1fb795e 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,6 @@ understanding of which libraries and tools are being used, the reasoning behind UI, testing, architecture and more, and how all of these different pieces of the project fit together to create a complete app. -NOTE: Building the app using an M1 Mac will require the use of -[Rosetta](https://support.apple.com/en-gb/HT211861). See -[the following bug](https://github.com/protocolbuffers/protobuf/issues/9397#issuecomment-1086138036) -for more details. - # Architecture The **Now in Android** app follows the From a753427af0c59d012018eccf89b6cecd63615d5c Mon Sep 17 00:00:00 2001 From: tsumuchan Date: Tue, 20 Jun 2023 07:01:58 +0900 Subject: [PATCH 07/12] fix: close tag --- docs/ModularizationLearningJourney.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ModularizationLearningJourney.md b/docs/ModularizationLearningJourney.md index 8cee53672..a9766c68d 100644 --- a/docs/ModularizationLearningJourney.md +++ b/docs/ModularizationLearningJourney.md @@ -171,7 +171,7 @@ Using the above modularization strategy, the Now in Android app has the followin core:ui - Composite UI components and resources used by feature modules, such as the news feed. Unlike the designsystem module, it is dependent on the data layer since it renders models, like news resources. + Composite UI components and resources used by feature modules, such as the news feed. Unlike the designsystem module, it is dependent on the data layer since it renders models, like news resources. NewsFeed NewsResourceCardExpanded From a41e6c2f3599daf7d6affb0a20b32f9570368582 Mon Sep 17 00:00:00 2001 From: Murat Yener Date: Tue, 20 Jun 2023 16:22:31 -0700 Subject: [PATCH 08/12] Baseline Profiles API change 'collectStableBaselineProfile()' is changed to 'collect()' --- .../nowinandroid/baselineprofile/BaselineProfileGenerator.kt | 2 +- gradle/libs.versions.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt b/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt index 5abf7db4a..c4343bbba 100644 --- a/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt +++ b/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt @@ -37,7 +37,7 @@ class BaselineProfileGenerator { @Test fun generate() = - baselineProfileRule.collectBaselineProfile(PACKAGE_NAME) { + baselineProfileRule.collect(PACKAGE_NAME) { // This block defines the app's critical user journey. Here we are interested in // optimizing for app startup. But you can also navigate and scroll // through your most important UI. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fd37438cb..b0046ff66 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ androidxDataStore = "1.0.0" androidxEspresso = "3.5.0" androidxHiltNavigationCompose = "1.0.0" androidxLifecycle = "2.6.0-alpha05" -androidxMacroBenchmark = "1.1.1" +androidxMacroBenchmark = "1.2.0-alpha16" androidxMetrics = "1.0.0-alpha03" androidxNavigation = "2.5.3" androidxProfileinstaller = "1.2.1" From 93f94017c7f0ff09b29880610d564ab93e214d6d Mon Sep 17 00:00:00 2001 From: Murat Yener Date: Tue, 20 Jun 2023 16:22:31 -0700 Subject: [PATCH 09/12] Baseline Profiles API change 'collectStableBaselineProfile()' is changed to 'collect()' --- .../nowinandroid/baselineprofile/BaselineProfileGenerator.kt | 4 +--- gradle/libs.versions.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt b/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt index 5abf7db4a..b544fbde1 100644 --- a/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt +++ b/benchmarks/src/main/java/com/google/samples/apps/nowinandroid/baselineprofile/BaselineProfileGenerator.kt @@ -16,7 +16,6 @@ package com.google.samples.apps.nowinandroid.baselineprofile -import androidx.benchmark.macro.ExperimentalBaselineProfilesApi import androidx.benchmark.macro.junit4.BaselineProfileRule import com.google.samples.apps.nowinandroid.PACKAGE_NAME import com.google.samples.apps.nowinandroid.bookmarks.goToBookmarksScreen @@ -31,13 +30,12 @@ import org.junit.Test /** * Generates a baseline profile which can be copied to `app/src/main/baseline-prof.txt`. */ -@ExperimentalBaselineProfilesApi class BaselineProfileGenerator { @get:Rule val baselineProfileRule = BaselineProfileRule() @Test fun generate() = - baselineProfileRule.collectBaselineProfile(PACKAGE_NAME) { + baselineProfileRule.collect(PACKAGE_NAME) { // This block defines the app's critical user journey. Here we are interested in // optimizing for app startup. But you can also navigate and scroll // through your most important UI. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fd37438cb..b0046ff66 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ androidxDataStore = "1.0.0" androidxEspresso = "3.5.0" androidxHiltNavigationCompose = "1.0.0" androidxLifecycle = "2.6.0-alpha05" -androidxMacroBenchmark = "1.1.1" +androidxMacroBenchmark = "1.2.0-alpha16" androidxMetrics = "1.0.0-alpha03" androidxNavigation = "2.5.3" androidxProfileinstaller = "1.2.1" From 7b5c0f2be887fa827a400cbe17e5f518db517c0d Mon Sep 17 00:00:00 2001 From: Murat Yener Date: Wed, 28 Jun 2023 11:27:16 -0700 Subject: [PATCH 10/12] Adds ProfileViewer to log the app's Baseline Profile Compilation Status --- .../samples/apps/nowinandroid/MainActivity.kt | 42 +++++++++++++++++++ gradle/libs.versions.toml | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt index 79d556f73..6fc795d8c 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt @@ -17,6 +17,7 @@ package com.google.samples.apps.nowinandroid import android.os.Bundle +import android.util.Log import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.viewModels @@ -35,6 +36,7 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import androidx.metrics.performance.JankStats +import androidx.profileinstaller.ProfileVerifier import com.google.accompanist.systemuicontroller.rememberSystemUiController import com.google.samples.apps.nowinandroid.MainActivityUiState.Loading import com.google.samples.apps.nowinandroid.MainActivityUiState.Success @@ -47,11 +49,15 @@ import com.google.samples.apps.nowinandroid.core.model.data.DarkThemeConfig import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand import com.google.samples.apps.nowinandroid.ui.NiaApp import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import javax.inject.Inject +private const val TAG = "MainActivity" + @OptIn(ExperimentalMaterial3WindowSizeClassApi::class) @AndroidEntryPoint class MainActivity : ComponentActivity() { @@ -133,12 +139,48 @@ class MainActivity : ComponentActivity() { override fun onResume() { super.onResume() lazyStats.get().isTrackingEnabled = true + lifecycleScope.launch { + logCompilationStatus() + } } override fun onPause() { super.onPause() lazyStats.get().isTrackingEnabled = false } + + /** + * Logs the app's Baseline Profile Compilation Status using [ProfileVerifier]. + */ + private suspend fun logCompilationStatus() { + /* + When delivering through Google Play, the baseline profile is compiled during installation. + In this case you will see the correct state logged without any further action necessary. + To verify baseline profile installation locally, you need to manually trigger baseline + profile installation. + For immediate compilation, call: + `adb shell cmd package compile -f -m speed-profile com.example.macrobenchmark.target` + You can also trigger background optimizations: + `adb shell pm bg-dexopt-job` + Both jobs run asynchronously and might take some time complete. + To see quick turnaround of the ProfileVerifier, we recommend using `speed-profile`. + If you don't do either of these steps, you might only see the profile status reported as + "enqueued for compilation" when running the sample locally. + */ + withContext(Dispatchers.IO) { + val status = ProfileVerifier.getCompilationStatusAsync().get() + Log.d(TAG, "ProfileInstaller status code: ${status.profileInstallResultCode}") + Log.d( + TAG, + when { + status.isCompiledWithProfile -> "ProfileInstaller: is compiled with profile" + status.hasProfileEnqueuedForCompilation() -> + "ProfileInstaller: Enqueued for compilation" + else -> "Profile not compiled or enqueued" + } + ) + } + } } /** diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b0046ff66..d3262ab9c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ androidxLifecycle = "2.6.0-alpha05" androidxMacroBenchmark = "1.2.0-alpha16" androidxMetrics = "1.0.0-alpha03" androidxNavigation = "2.5.3" -androidxProfileinstaller = "1.2.1" +androidxProfileinstaller = "1.3.1" androidxStartup = "1.1.1" androidxTestCore = "1.5.0" androidxTestExt = "1.1.4" From 78ed9adca2302b881414c374220f5b71f23da878 Mon Sep 17 00:00:00 2001 From: Murat Yener Date: Wed, 28 Jun 2023 11:31:38 -0700 Subject: [PATCH 11/12] spotless fix --- .../java/com/google/samples/apps/nowinandroid/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt index 6fc795d8c..ecc800904 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt @@ -177,7 +177,7 @@ class MainActivity : ComponentActivity() { status.hasProfileEnqueuedForCompilation() -> "ProfileInstaller: Enqueued for compilation" else -> "Profile not compiled or enqueued" - } + }, ) } } From e96dac39b22ee5e7096f2ce3a56e7a0449486b38 Mon Sep 17 00:00:00 2001 From: Murat Yener Date: Wed, 28 Jun 2023 14:31:58 -0700 Subject: [PATCH 12/12] changed from ListenableFuture.get() to ListenableFuture.await() --- app/build.gradle.kts | 1 + .../java/com/google/samples/apps/nowinandroid/MainActivity.kt | 3 ++- gradle/libs.versions.toml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0c6e3eeb9..cb18b33d6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -119,6 +119,7 @@ dependencies { implementation(libs.androidx.navigation.compose) implementation(libs.androidx.window.manager) implementation(libs.androidx.profileinstaller) + implementation(libs.kotlinx.coroutines.guava) implementation(libs.coil.kt) } diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt index ecc800904..e107fd88c 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt @@ -52,6 +52,7 @@ import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.guava.await import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import javax.inject.Inject @@ -168,7 +169,7 @@ class MainActivity : ComponentActivity() { "enqueued for compilation" when running the sample locally. */ withContext(Dispatchers.IO) { - val status = ProfileVerifier.getCompilationStatusAsync().get() + val status = ProfileVerifier.getCompilationStatusAsync().await() Log.d(TAG, "ProfileInstaller status code: ${status.profileInstallResultCode}") Log.d( TAG, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d3262ab9c..3be086b09 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -117,6 +117,7 @@ hilt-ext-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hi junit4 = { group = "junit", name = "junit", version.ref = "junit4" } kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" } kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" } +kotlinx-coroutines-guava = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-guava", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinxDatetime" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }