Skip to content

Commit

Permalink
UIBased: filter improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Aug 27, 2023
1 parent 379a670 commit 3200ff1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class UiBasedCollector extends NotificationListenerService {
private static final String ACTION_NOTIFICATION_LISTENER_SETTINGS = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";

private static final HashSet<String> coOptedPackages = new HashSet<>();
private static final HashSet<String> coOptedPackagesAll = new HashSet<>();
private static final HashSet<String> companionAppIoBPackages = new HashSet<>();
private static final HashSet<Pattern> companionAppIoBRegexes = new HashSet<>();
private static boolean debug = false;
Expand All @@ -87,6 +88,9 @@ public class UiBasedCollector extends NotificationListenerService {
coOptedPackages.add("com.medtronic.diabetes.minimedmobile.eu");
coOptedPackages.add("com.medtronic.diabetes.minimedmobile.us");

coOptedPackagesAll.add("com.dexcom.dexcomone");
coOptedPackagesAll.add("com.medtronic.diabetes.guardian");

companionAppIoBPackages.add("com.insulet.myblue.pdm");

// The IoB value should be captured into the first match group.
Expand All @@ -100,7 +104,7 @@ public void onNotificationPosted(final StatusBarNotification sbn) {
if (coOptedPackages.contains(fromPackage)) {
if (getDexCollectionType() == UiBased) {
UserError.Log.d(TAG, "Notification from: " + fromPackage);
if (sbn.isOngoing() || fromPackage.endsWith("e")) {
if (sbn.isOngoing() || coOptedPackagesAll.contains(fromPackage)) {
lastPackage = fromPackage;
processNotification(sbn.getNotification());
BlueTails.immortality();
Expand Down

0 comments on commit 3200ff1

Please sign in to comment.