From 0b646dcab7653a41c260031b74ef2497e72b8372 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 26 Jan 2020 12:18:49 -0800 Subject: [PATCH] signal integration kinda works --- TODO.md | 11 +++++++--- .../java/com/geeksville/mesh/MeshService.kt | 21 ------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/TODO.md b/TODO.md index 4efbb883f..4bf261cb8 100644 --- a/TODO.md +++ b/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) diff --git a/app/src/main/java/com/geeksville/mesh/MeshService.kt b/app/src/main/java/com/geeksville/mesh/MeshService.kt index 2bda3418e..814ae5fc3 100644 --- a/app/src/main/java/com/geeksville/mesh/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/MeshService.kt @@ -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 }