mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
chore(ci): Remove GitHub Packages publishing workflow (#4368)
This commit is contained in:
parent
f9cc7080f8
commit
73c790290c
5 changed files with 38 additions and 54 deletions
|
|
@ -5,6 +5,8 @@
|
|||
<uses-permission android:name="com.geeksville.mesh.permission.BIND_MESH_SERVICE" />
|
||||
<queries>
|
||||
<package android:name="com.geeksville.mesh" />
|
||||
<package android:name="com.geeksville.mesh.google.debug" />
|
||||
<package android:name="com.geeksville.mesh.fdroid.debug" />
|
||||
</queries>
|
||||
|
||||
<application
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.ServiceConnection
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.IBinder
|
||||
|
|
@ -102,13 +103,32 @@ class MainActivity : ComponentActivity() {
|
|||
try {
|
||||
Log.i(TAG, "Attempting to bind to Mesh Service...")
|
||||
val intent = Intent("com.geeksville.mesh.Service")
|
||||
intent.setClassName("com.geeksville.mesh", "com.geeksville.mesh.service.MeshService")
|
||||
|
||||
// Query the package manager to find an app that handles this service action.
|
||||
// This is more resilient than hardcoding a package name, which might change with flavors.
|
||||
val resolveInfo =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
packageManager.queryIntentServices(intent, PackageManager.ResolveInfoFlags.of(0))
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
packageManager.queryIntentServices(intent, 0)
|
||||
}
|
||||
|
||||
if (resolveInfo.isNotEmpty()) {
|
||||
val serviceInfo = resolveInfo[0].serviceInfo
|
||||
intent.setClassName(serviceInfo.packageName, serviceInfo.name)
|
||||
Log.i(TAG, "Found service in package: ${serviceInfo.packageName}")
|
||||
} else {
|
||||
Log.w(TAG, "No service found for action com.geeksville.mesh.Service. Falling back to default.")
|
||||
intent.setClassName("com.geeksville.mesh", "com.geeksville.mesh.service.MeshService")
|
||||
}
|
||||
|
||||
val success = bindService(intent, serviceConnection, BIND_AUTO_CREATE)
|
||||
if (!success) {
|
||||
Log.e(TAG, "bindService returned false")
|
||||
}
|
||||
} catch (e: SecurityException) {
|
||||
Log.e(TAG, "SecurityException while binding", e)
|
||||
Log.e(TAG, "SecurityException while binding: ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue