Skip to content

Commit

Permalink
fixed bug where notifications would not update properly in the app
Browse files Browse the repository at this point in the history
  • Loading branch information
Bellafaire committed Feb 4, 2021
1 parent ba2153f commit 8c43a18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState
}

//update the status text on the home screen of the app.
MainActivity.updateNotifications();
// MainActivity.updateNotifications();
MainActivity.updateStatusText();
}

Expand Down Expand Up @@ -262,6 +262,7 @@ public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteris
currentMessage = new MessageClipper(" ", mtuSize);
currentUUID = MainActivity.COMMAND_UUID;
}else{
Log.v(TAG, "Sending Notification data: \n" + MainActivity.notificationData);
currentMessage = new MessageClipper(MainActivity.notificationData, mtuSize);
currentUUID = MainActivity.COMMAND_UUID;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ public static void checkPermission(String permission, int requestCode) {
}

public static void updateNotifications() {
notificationData = "";
Log.e(TAG, "Updating Notifications");
Intent i = new Intent(NLService.GET_NOTIFICATION_INTENT);
i.putExtra("command", "list");
reference.sendBroadcast(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void onNotificationPosted(StatusBarNotification sbn) {
i.putExtra("notification_event", "");
sendBroadcast(i);

MainActivity.updateNotifications();
}

@Override
Expand All @@ -70,6 +71,8 @@ public void onNotificationRemoved(StatusBarNotification sbn) {
i.putExtra("notification_event", "onNotificationRemoved :" + sbn.getPackageName() + "n");
i.putExtra("notification_event", "");
sendBroadcast(i);

MainActivity.updateNotifications();
}


Expand Down

0 comments on commit 8c43a18

Please sign in to comment.