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
11
TODO.md
11
TODO.md
|
|
@ -1,10 +1,12 @@
|
|||
|
||||
|
||||
* use android service from Signal
|
||||
* DONE handle failures in onCharWrite, instead of logAssert - because they can happen if device goes away
|
||||
* DONE explictly broadcast towards signal https://developer.android.com/guide/components/broadcasts
|
||||
* make test implementation of android service (doesn't use bluetooth)
|
||||
* send signal message type over wire
|
||||
* fix // FIXME hack for now - throw IdNotFoundException(id) in MeshService
|
||||
* undo base64
|
||||
* optionally turn off crypto in signal
|
||||
* clean up sw update code in device side
|
||||
* change signal package ID
|
||||
* DONE add broadcasters for use by signal (node changes and packet received)
|
||||
* make compose based access show mesh state
|
||||
* add real messaging code/protobufs
|
||||
|
|
@ -54,3 +56,6 @@ Don't leave device discoverable. Don't let unpaired users do thing with device
|
|||
* receive fake packets at power on to built initial state (for debugging, pretend there are a couple of nodes out there)
|
||||
* learn our node number
|
||||
* test mesh service from activity
|
||||
* DONE handle failures in onCharWrite, instead of logAssert - because they can happen if device goes away
|
||||
* DONE explictly broadcast towards signal https://developer.android.com/guide/components/broadcasts
|
||||
* make test implementation of android service (doesn't use bluetooth)
|
||||
|
|
|
|||
|
|
@ -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