[U] Update usage
This commit is contained in:
@@ -13,7 +13,6 @@ import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.influxdb.client.kotlin.InfluxDBClientKotlin
|
||||
import kotlinx.coroutines.*
|
||||
import org.hydev.wearsync.ActivityPermissions.Companion.hasPermissions
|
||||
import org.hydev.wearsync.databinding.ActivityMainBinding
|
||||
@@ -24,7 +23,6 @@ class MainActivity : AppCompatActivity()
|
||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
|
||||
lateinit var binding: ActivityMainBinding
|
||||
lateinit var influx: InfluxDBClientKotlin
|
||||
|
||||
var log = true
|
||||
|
||||
@@ -77,9 +75,6 @@ class MainActivity : AppCompatActivity()
|
||||
fun afterSettings() {
|
||||
addRecord("InfluxDB settings checked")
|
||||
|
||||
// Create client
|
||||
influx = prefs.createInflux()
|
||||
|
||||
// Scan for devices
|
||||
if (prefs.chosenDevice == null) pairCallback.launch(intent<ActivityScan>())
|
||||
else afterPair()
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.BatteryManager
|
||||
import androidx.core.app.NotificationCompat
|
||||
import com.influxdb.client.kotlin.InfluxDBClientKotlin
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
@@ -25,7 +24,7 @@ import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
class MyService : Service()
|
||||
{
|
||||
private lateinit var influx: InfluxDBClientKotlin
|
||||
private lateinit var influx: Influx
|
||||
private val bm by lazy { getSysServ<BatteryManager>() }
|
||||
|
||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
@@ -62,7 +61,7 @@ class MyService : Service()
|
||||
runCatching {
|
||||
val clas = it.javaClass.simpleName
|
||||
Timber.d("+$clas")
|
||||
influx add it
|
||||
influx += it
|
||||
|
||||
notif(text = "Recorded ${count.addAndGet(1)} events!\n+$clas")
|
||||
}.orTrace()
|
||||
|
||||
Reference in New Issue
Block a user