Skip to content

Commit

Permalink
Fix handling of reposted notifs on API 30-
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Sep 18, 2024
1 parent 20d65d7 commit 8e91dd1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
applicationId = "be.mygod.pogoplusplus"
minSdk = 28
targetSdk = 35
versionCode = 34
versionCode = 35
versionName = "1.3.7"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class GameNotificationService : NotificationListenerService() {
if (BluetoothPairingService.instance?.onNotification(sbn.notification, sbn.packageName) == true ||
!isInterested(sbn)) return
val text = sbn.notification.extras.getString(Notification.EXTRA_TEXT)
Timber.d("PGP notification updated @ ${sbn.postTime}: $text")
Timber.d("PGP notification updated @ ${sbn.postTime} (${sbn.notification.flags}): $text")
if (text.isNullOrEmpty()) {
updateConnectionStatus(SfidaSessionManager.onConnect())
return setTimeoutIfEnabled()
Expand All @@ -200,10 +200,10 @@ class GameNotificationService : NotificationListenerService() {
if (text == resources.findString("Disconnecting_Companion_Device", sbn.packageName)) {
return onAuxiliaryDisconnected()
}
val shouldUpdate = (Build.VERSION.SDK_INT >= 31 || sbn.notification.flags and
Notification.FLAG_FOREGROUND_SERVICE == Notification.FLAG_FOREGROUND_SERVICE) &&
SfidaManager.isConnected != false
val shouldUpdate = SfidaManager.isConnected != false
if (shouldUpdate) setTimeoutIfEnabled()
if (Build.VERSION.SDK_INT < 31 && sbn.notification.flags and Notification.FLAG_FOREGROUND_SERVICE !=
Notification.FLAG_FOREGROUND_SERVICE) return // ignore reposted notification
var str = resources.findString("Item_Inventory_Full", sbn.packageName)
if (text == str) return pushNotification(NOTIFICATION_ITEM_FULL, CHANNEL_ITEM_FULL, str,
R.drawable.ic_action_shopping_bag, sbn.packageName) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("com.android.application") version "8.6.0" apply false
id("com.android.application") version "8.6.1" apply false
id("com.github.ben-manes.versions") version "0.51.0"
id("com.google.firebase.crashlytics") version "3.0.2" apply false
id("com.google.gms.google-services") version "4.4.2" apply false
Expand Down

0 comments on commit 8e91dd1

Please sign in to comment.