Skip to content

Commit

Permalink
accuradio: inspect bigContentView and tickerView
Browse files Browse the repository at this point in the history
Apart from contentView, also inspect bigContentView and tickerView.
  • Loading branch information
abertschi committed Dec 7, 2023
1 parent 51ceb5f commit 5f1c7d3
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ class AccuradioDetector : AdDetectable, AnkoLogger, AbstractNotificationDetector
}
}

override fun flagAsAdvertisement(payload: AdPayload): Boolean {

private fun inspectContentViews(contentView: RemoteViews?): Boolean {
try {
val contentView = payload.statusbarNotification?.notification?.contentView
info(payload)
if (contentView != null) {
val actions = extractObject(contentView, "mActions") as List<*>?
if (actions != null) {
Expand Down Expand Up @@ -88,4 +87,18 @@ class AccuradioDetector : AdDetectable, AnkoLogger, AbstractNotificationDetector
}
return false
}

override fun flagAsAdvertisement(payload: AdPayload): Boolean {
info(payload)
val contentView = payload.statusbarNotification?.notification?.contentView
val bigView = payload.statusbarNotification?.notification?.bigContentView
val tickerView = payload.statusbarNotification?.notification?.tickerView

for (v in listOf(contentView, bigView, tickerView)) {
if (inspectContentViews(v)) {
return true;
}
}
return false;
}
}

0 comments on commit 5f1c7d3

Please sign in to comment.