RF Sentinel (RFSentinel): free, open-source police detector app for Android. Spots police body cams, Flock ALPR cameras, AirTag trackers, Remote ID drones, smart glasses and fake cell towers from Bluetooth LE and WiFi. No root.
Kotlin airtagalprandroidandroid-autoanti-surveillancebluetooth-low-energybody-cameracounter-surveillancedrone-detectionflock-safetyimsi-catcher-detectorpolice-detectorpolice-scannerprivacyremote-idrtl-sdrsdrsurveillance-detectiontracker-detectionwifi
Ignore trackers that change their address (AirTag and other tags)
CIS-C012663e57fb7d
diff --git a/app/src/main/java/com/rfsentinel/app/RFSentinelApp.kt b/app/src/main/java/com/rfsentinel/app/RFSentinelApp.ktindex 19ddd06..9e3bcc2 100644--- a/app/src/main/java/com/rfsentinel/app/RFSentinelApp.kt+++ b/app/src/main/java/com/rfsentinel/app/RFSentinelApp.kt@@ -40,6 +40,7 @@ class RFSentinelApp : Application() {NotificationHelper.clearStaleCameraDownload(this)OuiWatchlist.load(this)WhitelistCache.start(this, appScope)+ appScope.launch(Dispatchers.IO) { com.rfsentinel.app.data.TrackerMutes.load(this@RFSentinelApp) }CarState.start(this)// ~60k vendor rows: load off the main thread; lookups return null until ready.// A trace left "recording" by a crash / force-stop gets closed.diff --git a/app/src/main/java/com/rfsentinel/app/car/DeviceDetailScreen.kt b/app/src/main/java/com/rfsentinel/app/car/DeviceDetailScreen.ktindex 022f6e0..3517ab4 100644--- a/app/src/main/java/com/rfsentinel/app/car/DeviceDetailScreen.kt+++ b/app/src/main/java/com/rfsentinel/app/car/DeviceDetailScreen.kt@@ -83,11 +83,25 @@ class DeviceDetailScreen(carContext: CarContext, private val mac: String) : Liverows.take(CarUi.paneLimit(carContext)).forEach { pane.addRow(it) }// Primary buttons (a pane allows two).- val whitelisted = WhitelistCache.contains(mac)+ val whitelisted = WhitelistCache.inTable(mac)+ val ignored = com.rfsentinel.app.data.TrackerMutes.isMuted(mac)+ val tracker = best?.category == com.rfsentinel.app.detect.Category.TRACKER &&+ s.addressType != com.rfsentinel.app.detect.AddressType.PUBLICpane.addAction(Action.Builder()- .setTitle(if (whitelisted) "Un-whitelist" else "Whitelist")- .setOnClickListener { toggleWhitelist(whitelisted, best?.label ?: s.name ?: "") }+ .setTitle(when { ignored -> "Stop ignoring"; whitelisted -> "Un-whitelist"; tracker -> "Ignore today"; else -> "Whitelist" })+ .setOnClickListener {+ when {+ ignored -> com.rfsentinel.app.data.TrackerMutes.unmute(carContext, mac)+ tracker && !whitelisted -> {+ // Address changes daily: ignore until then (the phone offers "it's mine").+ com.rfsentinel.app.data.TrackerMutes.mute(carContext, mac, best!!.label, s.rssi, follow = false)+ toast("Ignored until its address changes (at most 24 h)")+ }+ else -> toggleWhitelist(whitelisted, best?.label ?: s.name ?: "")+ }+ invalidate()+ }.build())val watched = OuiWatchlist.customEntry(mac) != nulldiff --git a/app/src/main/java/com/rfsentinel/app/data/TrackerMutes.kt b/app/src/main/java/com/rfsentinel/app/data/TrackerMutes.ktnew file mode 100644index 0000000..2ed7650--- /dev/null+++ b/app/src/main/java/com/rfsentinel/app/data/TrackerMutes.kt@@ -0,0 +1,141 @@+package com.rfsentinel.app.data++import android.content.Context+import com.google.gson.Gson+import com.google.gson.reflect.TypeToken++/**+ * Trackers the user chose to ignore. AirTags and other Find My / Find Hub tags+ * change their Bluetooth address (about once a day away from their owner), so+ * the ordinary MAC whitelist can't hold them.+ *+ * - "Just today": ignored until the address changes (at most 24 h).+ * - "It's mine": followed through its address changes. When an ignored tag+ * falls silent and, within a few minutes, a tag of the same kind appears at a+ * similar signal strength, the new address inherits the mute. This is a best+ * effort, so the setting is shown with a clear warning.+ *+ * Pure logic in [Store] (unit-tested); this object persists it.+ */+object TrackerMutes {++ data class Mute(+ val mac: String,+ /** The match label, e.g. "Apple Find My tracker away from its owner (AirTag or compatible)". */+ val kind: String,+ /** Epoch ms, or Long.MAX_VALUE for "it's mine". */+ val until: Long,+ val follow: Boolean,+ val lastSeen: Long,+ val lastRssi: Int+ )++ /** In-memory rules; no Android types. */+ class Store(var mutes: List<Mute> = emptyList()) {++ fun isMuted(mac: String, now: Long): Boolean = mutes.any { it.mac == mac && it.until > now }++ fun mute(mac: String, kind: String, rssi: Int, now: Long, follow: Boolean) {+ val until = if (follow) Long.MAX_VALUE else now + DAY_MS+ mutes = mutes.filterNot { it.mac == mac } + Mute(mac, kind, until, follow, now, rssi)+ }++ fun unmute(mac: String) { mutes = mutes.filterNot { it.mac == mac } }++ /**+ * A tracker of [kind] was heard. Returns true when it's muted - possibly+ * because it just inherited the mute of a "mine" tag whose address changed.+ * Returns whether the stored list changed through [changed].+ */+ fun onSeen(mac: String, kind: String, rssi: Int, now: Long, changed: (Boolean) -> Unit = {}): Boolean {+ mutes = mutes.filter { it.until > now }+ val own = mutes.firstOrNull { it.mac == mac }+ if (own != null) {+ // Keep "last seen" fresh, but don't rewrite storage on every packet.+ if (now - own.lastSeen > 30_000) {+ mutes = mutes.map { if (it.mac == mac) it.copy(lastSeen = now, lastRssi = rssi) else it }+ changed(true)+ }+ return true+ }+ val candidates = mutes.filter {+ it.follow && it.kind == kind &&+ now - it.lastSeen in SILENT_MS..CARRY_WINDOW_MS &&+ kotlin.math.abs(it.lastRssi - rssi) <= RSSI_TOLERANCE_DB+ }+ val prev = candidates.singleOrNull() ?: return false+ mutes = mutes.map { if (it === prev) it.copy(mac = mac, lastSeen = now, lastRssi = rssi) else it }+ changed(true)+ return true+ }+ }++ const val DAY_MS = 24 * 3600_000L+ /** The old address must have been silent at least this long... */+ const val SILENT_MS = 10_000L+ /** ...and the new one must show up within this window. */+ const val CARRY_WINDOW_MS = 5 * 60_000L+ const val RSSI_TOLERANCE_DB = 12++ private const val PREFS = "tracker_mutes"+ private const val KEY = "mutes"+ private val gson = Gson()+ private val type = object : TypeToken<List<Mute>>() {}.type+ private val store = Store()+ @Volatile private var loaded = false++ @Synchronized+ private fun ensure(context: Context) {+ if (loaded) return+ store.mutes = runCatching {+ gson.fromJson<List<Mute>>(context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getString(KEY, null), type)+ }.getOrNull().orEmpty()+ loaded = true+ }++ @Synchronized+ private fun save(context: Context) {+ context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putString(KEY, gson.toJson(store.mutes)).apply()+ }++ /** Fast check for the UI (no disk access once loaded). */+ fun isMuted(mac: String): Boolean = loaded && synchronized(this) { store.isMuted(mac, System.currentTimeMillis()) }++ fun load(context: Context) = ensure(context)++ @Synchronized+ fun onSeen(context: Context, mac: String, kind: String, rssi: Int, now: Long = System.currentTimeMillis()): Boolean {+ ensure(context)+ var dirty = false+ val muted = store.onSeen(mac, kind, rssi, now) { dirty = it }+ if (dirty) save(context)+ return muted+ }++ @Synchronized+ fun mute(context: Context, mac: String, kind: String, rssi: Int, follow: Boolean) {+ ensure(context)+ store.mute(mac, kind, rssi, System.currentTimeMillis(), follow)+ save(context)+ }++ @Synchronized+ fun unmute(context: Context, mac: String) {+ ensure(context)+ store.unmute(mac)+ save(context)+ }++ @Synchronized+ fun count(context: Context): Int {+ ensure(context)+ return store.mutes.count { it.until > System.currentTimeMillis() }+ }++ @Synchronized+ fun clear(context: Context) {+ ensure(context)+ store.mutes = emptyList()+ save(context)+ }+}diff --git a/app/src/main/java/com/rfsentinel/app/data/WhitelistCache.kt b/app/src/main/java/com/rfsentinel/app/data/WhitelistCache.ktindex 1623fd3..43c7489 100644--- a/app/src/main/java/com/rfsentinel/app/data/WhitelistCache.kt+++ b/app/src/main/java/com/rfsentinel/app/data/WhitelistCache.kt@@ -13,7 +13,11 @@ object WhitelistCache {@Volatileprivate var macs: Set<String> = emptySet()- fun contains(mac: String): Boolean = mac in macs+ /** Trusted devices, plus trackers the user chose to ignore (see [TrackerMutes]). */+ fun contains(mac: String): Boolean = mac in macs || TrackerMutes.isMuted(mac)++ /** Only the user's whitelist table (not ignored trackers). */+ fun inTable(mac: String): Boolean = mac in macs/** Starts mirroring the table for the lifetime of [scope]. */fun start(context: Context, scope: CoroutineScope) {diff --git a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.ktindex 33c8fd0..ecce9fc 100644--- a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt+++ b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt@@ -416,12 +416,16 @@ class ScanForegroundService : Service() {remoteId?.let { info -> if (loc != null) maybeAlertDroneOverhead(a, info, loc, now) }val best = c.hits.firstOrNull() ?: return+ // Ignored trackers (their address changes, so they can't be whitelisted); this is+ // also where an ignored "it's mine" tag carries its mute over to a new address.+ if (best.category == Category.TRACKER && com.rfsentinel.app.data.TrackerMutes.onSeen(this, mac, best.label, a.rssi, now)) returnif (WhitelistCache.contains(mac)) returnmaybeLog(a, best, c.vendor, loc, now)maybeAlert(a, best, now)- if (loc != null && Prefs.followerAlerts(this) &&+ val trackerPaused = best.category == Category.TRACKER && now < Prefs.trackerFollowPausedUntil(this)+ if (loc != null && Prefs.followerAlerts(this) && !trackerPaused &&DeviceRegistry.checkFollowing(mac,Prefs.followMinMinutes(this) * 60_000L,diff --git a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.ktindex 9886d3d..f5e8305 100644--- a/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/settings/SettingsActivity.kt@@ -98,6 +98,20 @@ class SettingsActivity : AppCompatActivity() {else "Car: " + names.joinToString() + ". Android Auto also starts it."}+ /** Ignored trackers (long-press a tracker > Ignore this tracker) and a paused follow warning. */+ private fun updateTrackerIgnoreText() {+ val n = com.rfsentinel.app.data.TrackerMutes.count(this)+ val until = Prefs.trackerFollowPausedUntil(this)+ val paused = until > System.currentTimeMillis()+ val parts = buildList {+ add(if (n == 0) "No ignored trackers (long-press a tracker to ignore your own tag)" else "$n ignored tracker${if (n == 1) "" else "s"}")+ if (paused) add("tracker follow warnings paused until " ++ java.text.DateFormat.getTimeInstance(java.text.DateFormat.SHORT).format(java.util.Date(until)))+ }+ binding.trackerIgnoreText.text = parts.joinToString("; ")+ binding.trackerIgnoreButton.visibility = if (n > 0 || paused) android.view.View.VISIBLE else android.view.View.GONE+ }+private fun updateBannerButtons() {binding.bannerClearButton.isEnabled = ThemeManager.hasBanner(this)}@@ -228,6 +242,13 @@ class SettingsActivity : AppCompatActivity() {// Locationbinding.followSwitch.isChecked = Prefs.followerAlerts(this)+ updateTrackerIgnoreText()+ binding.trackerIgnoreButton.setOnClickListener {+ com.rfsentinel.app.data.TrackerMutes.clear(this)+ Prefs.setTrackerFollowPausedUntil(this, 0L)+ updateTrackerIgnoreText()+ Toast.makeText(this, "Tracker warnings back to normal", Toast.LENGTH_SHORT).show()+ }binding.followMinutesInput.setText(Prefs.followMinMinutes(this).toString())binding.followMetersInput.setText(Prefs.followMinMeters(this).toString())binding.gpsSwitch.isChecked = Prefs.gpsTaggingEnabled(this)diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceActions.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceActions.ktindex de0824e..828af39 100644--- a/app/src/main/java/com/rfsentinel/app/ui/DeviceActions.kt+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceActions.kt@@ -39,7 +39,11 @@ object DeviceActions {fun showQuickActions(activity: AppCompatActivity, mac: String) {val snap = DeviceRegistry.get(mac)val custom = OuiWatchlist.customEntry(mac) ?: OuiWatchlist.customEntry(MacUtil.oui(mac))- val whitelisted = WhitelistCache.contains(mac)+ val whitelisted = WhitelistCache.inTable(mac)+ val ignoredTracker = com.rfsentinel.app.data.TrackerMutes.isMuted(mac)+ // Trackers that change their address can't be whitelisted: offer ignoring instead.+ val rotatingTracker = snap?.best?.category == com.rfsentinel.app.detect.Category.TRACKER &&+ snap.addressType != com.rfsentinel.app.detect.AddressType.PUBLICval favorite = Favorites.contains(mac)val items = mutableListOf<Pair<String, () -> Unit>>()items += "Show details" to { openDetails(activity, mac) }@@ -51,8 +55,15 @@ object DeviceActions {} else {items += "Add to watchlist..." to { addToWatchlist(activity, mac, snap?.name) }}- items += (if (whitelisted) "Remove from whitelist" else "Whitelist (trust & ignore)") to {- if (whitelisted) unwhitelist(activity, mac) else whitelist(activity, mac, snap?.best?.label ?: snap?.name ?: "")+ when {+ ignoredTracker -> items += "Stop ignoring this tracker" to {+ com.rfsentinel.app.data.TrackerMutes.unmute(activity, mac)+ toast(activity, "Tracker no longer ignored")+ }+ rotatingTracker && !whitelisted -> items += "Ignore this tracker..." to { ignoreTracker(activity, mac) }+ else -> items += (if (whitelisted) "Remove from whitelist" else "Whitelist (trust & ignore)") to {+ if (whitelisted) unwhitelist(activity, mac) else whitelist(activity, mac, snap?.best?.label ?: snap?.name ?: "")+ }}items += (if (favorite) "Remove from favorites" else "Add to favorites ★") to {activity.lifecycleScope.launch {@@ -149,6 +160,49 @@ object DeviceActions {.show()}+ /**+ * AirTags and other Find My / Find Hub tags change their address (about daily+ * away from their owner), so a MAC whitelist can't hold them. Offers ignoring+ * it as your own tag (followed through address changes), for today, or+ * pausing tracker follow warnings.+ */+ fun ignoreTracker(activity: AppCompatActivity, mac: String) {+ val snap = DeviceRegistry.get(mac) ?: run { toast(activity, "Tracker no longer in range"); return }+ val kind = snap.best?.label ?: return+ val choices = arrayOf(+ "It's mine - keep ignoring it\n(follows it when its address changes; best effort)",+ "Ignore it today only\n(until its address changes, at most 24 h)",+ "Pause all tracker follow warnings for 24 h"+ )+ val title = android.widget.TextView(activity).apply {+ val d = resources.displayMetrics.density+ setPadding((24 * d).toInt(), (20 * d).toInt(), (24 * d).toInt(), (8 * d).toInt())+ textSize = 15f+ text = "Ignore this tracker?\n\nIts Bluetooth address changes about once a day, so it can't be " ++ "whitelisted like other devices. Only ignore a tag you know - a hidden tracker would stay silent too."+ }+ AlertDialog.Builder(activity)+ .setCustomTitle(title)+ .setItems(choices) { _, which ->+ when (which) {+ 0 -> {+ com.rfsentinel.app.data.TrackerMutes.mute(activity, mac, kind, snap.rssi, follow = true)+ toast(activity, "Ignored - RF Sentinel follows it when its address changes")+ }+ 1 -> {+ com.rfsentinel.app.data.TrackerMutes.mute(activity, mac, kind, snap.rssi, follow = false)+ toast(activity, "Ignored until its address changes (at most 24 h)")+ }+ else -> {+ com.rfsentinel.app.util.Prefs.setTrackerFollowPausedUntil(activity, System.currentTimeMillis() + 24 * 3600_000L)+ toast(activity, "Tracker follow warnings paused for 24 hours")+ }+ }+ }+ .setNegativeButton("Cancel", null)+ .show()+ }+fun whitelist(activity: AppCompatActivity, mac: String, label: String) {AlertDialog.Builder(activity).setTitle("Whitelist this device?")diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.ktindex 575c5ff..2a14f6b 100644--- a/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceDetailActivity.kt@@ -74,8 +74,13 @@ class DeviceDetailActivity : AppCompatActivity() {binding.locateButton.setOnClickListener { toggleLocate() }binding.actionWatchlist.setOnClickListener { onWatchlistAction() }binding.actionWhitelist.setOnClickListener {- if (WhitelistCache.contains(mac)) DeviceActions.unwhitelist(this, mac)- else DeviceActions.whitelist(this, mac, DeviceRegistry.get(mac)?.let { it.best?.label ?: it.name } ?: "")+ val s = DeviceRegistry.get(mac)+ when {+ com.rfsentinel.app.data.TrackerMutes.isMuted(mac) -> com.rfsentinel.app.data.TrackerMutes.unmute(this, mac)+ WhitelistCache.inTable(mac) -> DeviceActions.unwhitelist(this, mac)+ isRotatingTracker(s) -> DeviceActions.ignoreTracker(this, mac)+ else -> DeviceActions.whitelist(this, mac, s?.let { it.best?.label ?: it.name } ?: "")+ }}binding.actionFavorite.setOnClickListener {val s = DeviceRegistry.get(mac)@@ -117,6 +122,10 @@ class DeviceDetailActivity : AppCompatActivity() {// ---- Rendering ------------------------------------------------------------+ private fun isRotatingTracker(s: DeviceRegistry.Snapshot?) =+ s?.best?.category == com.rfsentinel.app.detect.Category.TRACKER &&+ s.addressType != com.rfsentinel.app.detect.AddressType.PUBLIC+private fun refresh() {val s = DeviceRegistry.get(mac)val now = System.currentTimeMillis()@@ -170,7 +179,12 @@ class DeviceDetailActivity : AppCompatActivity() {// Action labelsval custom = OuiWatchlist.customEntry(mac) ?: OuiWatchlist.customEntry(MacUtil.oui(mac))binding.actionWatchlist.text = if (custom != null) "Remove from watchlist" else "Add to watchlist"- binding.actionWhitelist.text = if (whitelisted) "Un-whitelist" else "Whitelist"+ binding.actionWhitelist.text = when {+ com.rfsentinel.app.data.TrackerMutes.isMuted(mac) -> "Stop ignoring"+ whitelisted -> "Un-whitelist"+ isRotatingTracker(s) -> "Ignore tracker"+ else -> "Whitelist"+ }binding.actionFavorite.text = if (Favorites.contains(mac)) "★ Favorite" else "☆ Favorite"// Sections: rebuilt only when their content changes (keeps scroll & selection stable).diff --git a/app/src/main/java/com/rfsentinel/app/util/Prefs.kt b/app/src/main/java/com/rfsentinel/app/util/Prefs.ktindex e7acd84..46b9909 100644--- a/app/src/main/java/com/rfsentinel/app/util/Prefs.kt+++ b/app/src/main/java/com/rfsentinel/app/util/Prefs.kt@@ -111,6 +111,9 @@ object Prefs {sp(context).edit { putString("recent_destinations", com.google.gson.Gson().toJson(list)) }}fun clearRecentDestinations(context: Context) = sp(context).edit { remove("recent_destinations") }+ /** Tracker "following you" warnings paused until this time (epoch ms). */+ fun trackerFollowPausedUntil(context: Context): Long = sp(context).getLong("tracker_follow_paused_until", 0L)+ fun setTrackerFollowPausedUntil(context: Context, value: Long) = sp(context).edit { putLong("tracker_follow_paused_until", value) }fun showKnownAlpr(context: Context): Boolean = bool(context, "show_known_alpr", true)fun setShowKnownAlpr(context: Context, value: Boolean) = setBool(context, "show_known_alpr", value)diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xmlindex 4b5de2e..c8581c8 100644--- a/app/src/main/res/layout/activity_settings.xml+++ b/app/src/main/res/layout/activity_settings.xml@@ -303,6 +303,19 @@</LinearLayout></LinearLayout>+ <TextView+ android:id="@+id/trackerIgnoreText"+ style="@style/SettingsLabel"+ android:paddingTop="4dp"+ android:textSize="12sp" />++ <Button+ android:id="@+id/trackerIgnoreButton"+ style="@style/Widget.MaterialComponents.Button.TextButton"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:text="Clear ignored trackers" />+<com.google.android.material.switchmaterial.SwitchMaterialandroid:id="@+id/knownAlprSwitch"android:layout_width="match_parent"diff --git a/app/src/test/java/com/rfsentinel/app/data/TrackerMutesTest.kt b/app/src/test/java/com/rfsentinel/app/data/TrackerMutesTest.ktnew file mode 100644index 0000000..91e2159--- /dev/null+++ b/app/src/test/java/com/rfsentinel/app/data/TrackerMutesTest.kt@@ -0,0 +1,51 @@+package com.rfsentinel.app.data++import org.junit.Assert.assertEquals+import org.junit.Assert.assertFalse+import org.junit.Assert.assertTrue+import org.junit.Test++class TrackerMutesTest {++ private val airtag = "Apple Find My tracker away from its owner (AirTag or compatible)"+ private val t0 = 1_000_000_000L++ @Test+ fun todayOnlyExpiresAfterADay() {+ val s = TrackerMutes.Store()+ s.mute("AA:00:00:00:00:01", airtag, -50, t0, follow = false)+ assertTrue(s.isMuted("AA:00:00:00:00:01", t0 + 3600_000))+ assertFalse(s.isMuted("AA:00:00:00:00:01", t0 + TrackerMutes.DAY_MS + 1))+ // Not followed to a new address.+ assertFalse(s.onSeen("AA:00:00:00:00:02", airtag, -50, t0 + 60_000))+ }++ @Test+ fun mineFollowsTheDailyAddressChange() {+ val s = TrackerMutes.Store()+ s.mute("AA:00:00:00:00:01", airtag, -50, t0, follow = true)+ // Old address silent for 30 s, a new one appears at a similar strength: same tag.+ assertTrue(s.onSeen("AA:00:00:00:00:02", airtag, -55, t0 + 30_000))+ assertTrue(s.isMuted("AA:00:00:00:00:02", t0 + 31_000))+ assertFalse(s.isMuted("AA:00:00:00:00:01", t0 + 31_000))+ // ...and again the next day.+ assertTrue(s.onSeen("AA:00:00:00:00:02", airtag, -52, t0 + 2 * 3600_000))+ assertTrue(s.onSeen("AA:00:00:00:00:03", airtag, -50, t0 + 2 * 3600_000 + 40_000))+ assertEquals(1, s.mutes.size)+ }++ @Test+ fun aDifferentTagIsNotSilenced() {+ val s = TrackerMutes.Store()+ s.mute("AA:00:00:00:00:01", airtag, -50, t0, follow = true)+ // Much weaker: likely another tag, not yours.+ assertFalse(s.onSeen("BB:00:00:00:00:01", airtag, -85, t0 + 30_000))+ // Yours still around (not silent): a second tag doesn't steal the mute.+ assertTrue(s.onSeen("AA:00:00:00:00:01", airtag, -50, t0 + 40_000))+ assertFalse(s.onSeen("BB:00:00:00:00:02", airtag, -50, t0 + 45_000))+ // Too long after it went quiet.+ assertFalse(s.onSeen("BB:00:00:00:00:03", airtag, -50, t0 + 40_000 + TrackerMutes.CARRY_WINDOW_MS + 1))+ // Another kind of tracker.+ assertFalse(s.onSeen("BB:00:00:00:00:04", "Tile tracker", -50, t0 + 70_000))+ }+}