Merge branch 'master' into chat-date-169

This commit is contained in:
Kevin Hester 2020-09-27 13:05:13 -07:00 committed by GitHub
commit 33f2a126ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -22,7 +22,7 @@ The intent you use to reach the service should look like this:
Once you have bound to the service you should register your broadcast receivers per https://developer.android.com/guide/components/broadcasts#context-registered-receivers
// com.geeksville.com.geeksville.mesh.x broadcast intents, where x is:
// com.geeksville.mesh.x broadcast intents, where x is:
// RECEIVED_DATA for data received from other nodes. payload will contain a DataPacket
// NODE_CHANGE for new IDs appearing or disappearing
// CONNECTION_CHANGED for losing/gaining connection to the packet radio

View file

@ -28,7 +28,7 @@ fun getInitials(nameIn: String): String {
val initials = when (words.size) {
in 0..minchars - 1 -> {
val nm = name.filterNot { c -> c.toLowerCase() in "aeiou" }
val nm = name.first() + name.drop(1).filterNot { c -> c.toLowerCase() in "aeiou" }
if (nm.length >= nchars) nm else name
}
else -> words.map { it.first() }.joinToString("")

View file

@ -5,6 +5,7 @@ import android.content.Context
import android.os.Build
import android.os.DeadObjectException
import android.os.Handler
import android.os.Looper
import com.geeksville.android.GeeksvilleApplication
import com.geeksville.android.Logging
import com.geeksville.concurrent.CallbackContinuation
@ -97,7 +98,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
* skanky hack to restart BLE if it says it is hosed
* https://stackoverflow.com/questions/35103701/ble-android-onconnectionstatechange-not-being-called
*/
private val mHandler: Handler = Handler()
private val mHandler: Handler = Handler(Looper.getMainLooper())
fun restartBle() {
GeeksvilleApplication.analytics.track("ble_restart") // record # of times we needed to use this nasty hack