Re-enable debug application IDs (#3607)

This commit is contained in:
Phil Oliver 2025-11-03 21:32:17 -05:00 committed by GitHub
parent e9bc9c9b15
commit 78a10118a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 14 deletions

View file

@ -61,6 +61,8 @@ You can generate the documentation locally to preview your changes.
You can help translate the app into your native language using [Crowdin](https://crowdin.meshtastic.org/android).
## Building the Android App
> [!WARNING]
> Debug and release builds can be installed concurrently. This is solely to enable smoother development, and you should avoid running both apps simultaneously. To ensure proper function, force quit the app not in use.
https://meshtastic.org/docs/development/android/

View file

@ -173,16 +173,15 @@ secrets {
// workaround for https://github.com/google/ksp/issues/1590
androidComponents {
/** Disabling until this works w/ bluetooth */
// onVariants(selector().all()) { variant ->
// if (variant.name == "fdroidDebug") {
// variant.applicationId = "com.geeksville.mesh.fdroid.debug"
// }
//
// if (variant.name == "googleDebug") {
// variant.applicationId = "com.geeksville.mesh.google.debug"
// }
// }
onVariants(selector().all()) { variant ->
if (variant.name == "fdroidDebug") {
variant.applicationId = "com.geeksville.mesh.fdroid.debug"
}
if (variant.name == "googleDebug") {
variant.applicationId = "com.geeksville.mesh.google.debug"
}
}
onVariants(selector().withBuildType("release")) { variant ->
if (variant.flavorName == "google") {
val variantNameCapped = variant.name.replaceFirstChar { it.uppercase() }

View file

@ -111,6 +111,6 @@ constructor(
Timber.e("Failed to start service from activity - but ignoring because bind will work: ${ex.message}")
}
connect(activity, MeshService.createIntent(), BIND_AUTO_CREATE + BIND_ABOVE_CLIENT)
connect(activity, MeshService.createIntent(activity), BIND_AUTO_CREATE + BIND_ABOVE_CLIENT)
}
}

View file

@ -197,7 +197,7 @@ class MeshService : Service() {
startService(context)
}
fun createIntent() = Intent().setClassName("com.geeksville.mesh", "com.geeksville.mesh.service.MeshService")
fun createIntent(context: Context) = Intent(context, MeshService::class.java)
/**
* The minimum firmware version we know how to talk to. We'll still be able to talk to 2.0 firmwares but only

View file

@ -38,7 +38,7 @@ class ServiceStarter(appContext: Context, workerParams: WorkerParameters) : Work
// Indicate whether the task finished successfully with the Result
Result.success()
} catch (ex: Exception) {
Timber.e("failure starting service, will retry", ex)
Timber.e(ex, "failure starting service, will retry")
Result.retry()
}
}
@ -72,7 +72,7 @@ fun MeshService.Companion.startService(context: Context) {
// to Signal or whatever.
Timber.i("Trying to start service debug=${BuildConfig.DEBUG}")
val intent = createIntent()
val intent = createIntent(context)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
try {
context.startForegroundService(intent)