Updates visibility and openness of attributes and methods

More mock-friendly, better access visibility
This commit is contained in:
Ryan Haining 2023-09-14 22:02:56 -07:00
parent c6f0da396f
commit 0c1224faf6

View file

@ -5,7 +5,6 @@ import android.os.PowerManager
import info.nightscout.annotations.OpenForTesting import info.nightscout.annotations.OpenForTesting
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@ -16,12 +15,12 @@ import javax.inject.Singleton
@Singleton @Singleton
@OpenForTesting @OpenForTesting
open class WearUtil @Inject constructor( open class WearUtil @Inject constructor(
open val context: Context, private val context: Context,
open val aapsLogger: AAPSLogger private val aapsLogger: AAPSLogger,
) { ) {
private val debugWakelocks = false private val debugWakelocks = false
open val rateLimits: MutableMap<String, Long> = HashMap() private val rateLimits: MutableMap<String, Long> = HashMap()
//============================================================================================== //==============================================================================================
// Time related util methods // Time related util methods
@ -30,11 +29,11 @@ open class WearUtil @Inject constructor(
return System.currentTimeMillis() return System.currentTimeMillis()
} }
fun msSince(`when`: Long): Long { open fun msSince(`when`: Long): Long {
return timestamp() - `when` return timestamp() - `when`
} }
fun msTill(`when`: Long): Long { open fun msTill(`when`: Long): Long {
return `when` - timestamp() return `when` - timestamp()
} }