TrackingQualityScorer

Pure, live tracking-quality scorer. Starts at MAX and subtracts a fixed penalty per active environmental issue, applies an accuracy-tier penalty, then adds a small bonus when the fix stream is stable. Result is clamped to [MIN, MAX].

A live scorer: it rates conditions as they happen (for a tracking notification / quality chip), rather than analysing a finished journey after the fact.

No Android dependency, so it is fully covered by JVM unit tests.

Properties

Link copied to clipboard
const val MAX: Int = 100
Link copied to clipboard
const val MIN: Int = 0
Link copied to clipboard
const val PENALTY_APP_KILLED: Int = 20
Link copied to clipboard
const val PENALTY_BATTERY_OPT: Int = 15
Link copied to clipboard
const val PENALTY_GPS_OFF: Int = 20
Link copied to clipboard
const val PENALTY_MOCK: Int = 25
Link copied to clipboard
const val PENALTY_PERMISSION: Int = 30
Link copied to clipboard
const val PENALTY_POWER_SAVER: Int = 15
Link copied to clipboard
const val PENALTY_RESTART: Int = 20
Link copied to clipboard
const val STABLE_BONUS: Int = 5

Functions

Link copied to clipboard
fun score(inputs: QualityInputs): Int