mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-24 08:43:27 -04:00
signal integration kinda works
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
package com.geeksville.mesh
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.ActivityManager
|
||||
import android.app.Service
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.Binder
|
||||
import android.os.IBinder
|
||||
import com.geeksville.android.Logging
|
||||
import com.geeksville.mesh.MeshProtos.MeshPacket
|
||||
@@ -83,24 +80,6 @@ class MeshService : Service(), Logging {
|
||||
RadioInterfaceService.sendToRadio(this, p.build().toByteArray())
|
||||
}
|
||||
|
||||
/**
|
||||
* We track everyone who has bound to us, so when we can explicitly broadcast to them
|
||||
* per new restrictions in android api 26 https://developer.android.com/guide/components/broadcasts#receiving-broadcasts
|
||||
*/
|
||||
private fun recordNewClient() {
|
||||
val pid = Binder.getCallingPid()
|
||||
|
||||
val activityManager = getSystemService(Activity.ACTIVITY_SERVICE) as ActivityManager
|
||||
val procs = activityManager.runningAppProcesses.filter {
|
||||
it.pid == pid
|
||||
}
|
||||
val packages = procs.flatMap {
|
||||
it.pkgList.asList()
|
||||
}
|
||||
|
||||
clientPackages.addAll(packages)
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
return binder
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user