From d6016c2f6ff314963795f7e763d25710f7f8b15f Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:38:51 -0700 Subject: [PATCH] Fix the AOSP (Soong) build: library wiring and API 36 skew - Android.bp: pull in coil-compose from prebuilts/application_libs and a Soong-only BuildConfig stub under soong-stubs/ (Gradle generates its own, so the stub stays out of the Gradle source set). - onNewIntent takes a non-null Intent on API 36. - Region/Locale wizard pages: the screens report the chosen value to their onContinue callback; the wizard only advances, so adapt the lambda. - SetupCompleteScreen: drawContent() needs the explicit drawWithContent receiver inside clipPath since the Compose receiver-scoping change. --- Android.bp | 15 +++++++++------ .../main/java/dev/oxmc/setupwizard/entryPoint.kt | 2 +- .../dev/oxmc/setupwizard/lib/WizardRegistry.kt | 5 +++-- .../ui/screens/wizard/SetupCompleteScreen.kt | 2 +- soong-stubs/me/pawlet/setupwizard/BuildConfig.kt | 15 +++++++++++++++ 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 soong-stubs/me/pawlet/setupwizard/BuildConfig.kt diff --git a/Android.bp b/Android.bp index d4c8533..aee2399 100644 --- a/Android.bp +++ b/Android.bp @@ -10,7 +10,11 @@ android_library_import { android_app { name: "PawletSetupWizard", - srcs: ["app/src/main/java/**/*.kt"], + srcs: [ + "app/src/main/java/**/*.kt", + // Soong-only BuildConfig stand-in (Gradle generates its own). + "soong-stubs/**/*.kt", + ], resource_dirs: ["app/src/main/res"], @@ -63,10 +67,9 @@ android_app { // Device info library (local prebuilt) "android-device-info", - ], - // OkHttp and Coil are not available as AOSP static_libs. - // Add them as android_library_import entries pointing to AARs in app/libs/ - // once prebuilts are sourced from the Gradle dependency cache. - // See: https://git.oxmc.me/PawletOS/android_packages_apps_SetupWizard + // Images — prebuilts/application_libs/coil (pulls okhttp3/okio/ + // coroutines transitively via the import's static_libs) + "coil-compose", + ], } diff --git a/app/src/main/java/dev/oxmc/setupwizard/entryPoint.kt b/app/src/main/java/dev/oxmc/setupwizard/entryPoint.kt index 0b30a1d..6a4a597 100644 --- a/app/src/main/java/dev/oxmc/setupwizard/entryPoint.kt +++ b/app/src/main/java/dev/oxmc/setupwizard/entryPoint.kt @@ -76,7 +76,7 @@ class EntryPoint : BaseKioskActivity() { } } - override fun onNewIntent(intent: Intent?) { + override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) uriHandler.handleIntent(intent) } diff --git a/app/src/main/java/dev/oxmc/setupwizard/lib/WizardRegistry.kt b/app/src/main/java/dev/oxmc/setupwizard/lib/WizardRegistry.kt index 32e61ed..db00ae0 100644 --- a/app/src/main/java/dev/oxmc/setupwizard/lib/WizardRegistry.kt +++ b/app/src/main/java/dev/oxmc/setupwizard/lib/WizardRegistry.kt @@ -21,14 +21,15 @@ fun buildBuiltinPages( id = "region", order = 10, content = { onNext, onBack -> - RegionSelectionScreen(onBack = onBack, onContinue = onNext) + // The screen persists the chosen region itself; the wizard only advances. + RegionSelectionScreen(onBack = onBack, onContinue = { onNext() }) } ), WizardPage( id = "locale", order = 20, content = { onNext, onBack -> - LocaleSelectionScreen(onBack = onBack, onContinue = onNext) + LocaleSelectionScreen(onBack = onBack, onContinue = { onNext() }) } ), WizardPage( diff --git a/app/src/main/java/dev/oxmc/setupwizard/ui/screens/wizard/SetupCompleteScreen.kt b/app/src/main/java/dev/oxmc/setupwizard/ui/screens/wizard/SetupCompleteScreen.kt index 9cca0e4..7aa128c 100644 --- a/app/src/main/java/dev/oxmc/setupwizard/ui/screens/wizard/SetupCompleteScreen.kt +++ b/app/src/main/java/dev/oxmc/setupwizard/ui/screens/wizard/SetupCompleteScreen.kt @@ -87,7 +87,7 @@ fun SetupCompleteScreen( ) ) } - clipPath(path) { drawContent() } + clipPath(path) { this@drawWithContent.drawContent() } } ) { Surface( diff --git a/soong-stubs/me/pawlet/setupwizard/BuildConfig.kt b/soong-stubs/me/pawlet/setupwizard/BuildConfig.kt new file mode 100644 index 0000000..3fb81ec --- /dev/null +++ b/soong-stubs/me/pawlet/setupwizard/BuildConfig.kt @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: The PawletOS Project +// SPDX-License-Identifier: Apache-2.0 +// +// Soong-only stand-in for the Gradle-generated BuildConfig. This directory is +// listed in Android.bp srcs but is NOT part of the Gradle source set, so the +// two build systems never both define the class. +package me.pawlet.setupwizard + +object BuildConfig { + const val DEBUG = false + const val APPLICATION_ID = "me.pawlet.setupwizard" + const val BUILD_TYPE = "release" + const val VERSION_CODE = 1 + const val VERSION_NAME = "1.0.0" +}