mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
signal integration kinda works
This commit is contained in:
parent
ff281b6c39
commit
0b646dcab7
2 changed files with 8 additions and 24 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue