mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-09-12 01:06:35 +02:00
Improve notification removal
This commit is contained in:
parent
4ad8eaab89
commit
5edac523f0
@ -68,6 +68,7 @@ public class CasioGBX100DeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
private MusicStateSpec mBufferMusicStateSpec = null;
|
private MusicStateSpec mBufferMusicStateSpec = null;
|
||||||
private BluetoothGatt mBtGatt = null;
|
private BluetoothGatt mBtGatt = null;
|
||||||
private boolean mFirstConnect = false;
|
private boolean mFirstConnect = false;
|
||||||
|
private ArrayList<Integer> mSyncedNotificationIDs = new ArrayList<>();
|
||||||
|
|
||||||
public CasioGBX100DeviceSupport() {
|
public CasioGBX100DeviceSupport() {
|
||||||
super(LOG);
|
super(LOG);
|
||||||
@ -237,12 +238,17 @@ public class CasioGBX100DeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
}
|
}
|
||||||
LOG.info("onNotification id=" + notificationSpec.getId());
|
LOG.info("onNotification id=" + notificationSpec.getId());
|
||||||
showNotification(icon, notificationSpec.sender, notificationSpec.title, notificationSpec.body, notificationSpec.getId(), false);
|
showNotification(icon, notificationSpec.sender, notificationSpec.title, notificationSpec.body, notificationSpec.getId(), false);
|
||||||
|
mSyncedNotificationIDs.add(new Integer(notificationSpec.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDeleteNotification(int id) {
|
public void onDeleteNotification(int id) {
|
||||||
LOG.info("onDeleteNofication id=" + id);
|
LOG.info("onDeleteNofication id=" + id);
|
||||||
showNotification(CasioConstants.CATEGORY_OTHER, null, null, null, id, true);
|
Integer idInt = new Integer(id);
|
||||||
|
if(mSyncedNotificationIDs.contains(idInt)) {
|
||||||
|
showNotification(CasioConstants.CATEGORY_OTHER, null, null, null, id, true);
|
||||||
|
mSyncedNotificationIDs.remove(idInt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeCurrentTime(TransactionBuilder builder) {
|
public void writeCurrentTime(TransactionBuilder builder) {
|
||||||
|
Loading…
Reference in New Issue
Block a user