mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
Apps Notification can now be configured to filter notification content based on black- and whitelists
Go to notification blacklist, allow an app if blacklisted, than configure it's behavior with the menu icon on the right hand side. Should be pretty much self explanatory. Database Scheme raised to 20
This commit is contained in:
@@ -45,7 +45,7 @@ public class GBDaoGenerator {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Schema schema = new Schema(19, MAIN_PACKAGE + ".entities");
|
||||
Schema schema = new Schema(20, MAIN_PACKAGE + ".entities");
|
||||
|
||||
Entity userAttributes = addUserAttributes(schema);
|
||||
Entity user = addUserInfo(schema, userAttributes);
|
||||
@@ -75,6 +75,10 @@ public class GBDaoGenerator {
|
||||
addCalendarSyncState(schema, device);
|
||||
addAlarms(schema, user, device);
|
||||
|
||||
Entity notificationFilter = addNotificationFilters(schema);
|
||||
|
||||
addNotificationFilterEntry(schema, notificationFilter);
|
||||
|
||||
addBipActivitySummary(schema, user, device);
|
||||
|
||||
new DaoGenerator().generateAll(schema, "app/src/main/java");
|
||||
@@ -363,6 +367,30 @@ public class GBDaoGenerator {
|
||||
alarm.addToOne(device, deviceId);
|
||||
}
|
||||
|
||||
private static void addNotificationFilterEntry(Schema schema, Entity notificationFilterEntity) {
|
||||
Entity notificatonFilterEntry = addEntity(schema, "NotificationFilterEntry");
|
||||
notificatonFilterEntry.addIdProperty().autoincrement();
|
||||
Property notificationFilterId = notificatonFilterEntry.addLongProperty("notificationFilterId").notNull().getProperty();
|
||||
notificatonFilterEntry.addStringProperty("notificationFilterContent").notNull().getProperty();
|
||||
notificatonFilterEntry.addToOne(notificationFilterEntity, notificationFilterId);
|
||||
}
|
||||
|
||||
private static Entity addNotificationFilters(Schema schema) {
|
||||
Entity notificatonFilter = addEntity(schema, "NotificationFilter");
|
||||
Property appIdentifier = notificatonFilter.addStringProperty("appIdentifier").notNull().getProperty();
|
||||
|
||||
notificatonFilter.addIdProperty().autoincrement();
|
||||
|
||||
Index indexUnique = new Index();
|
||||
indexUnique.addProperty(appIdentifier);
|
||||
indexUnique.makeUnique();
|
||||
notificatonFilter.addIndex(indexUnique);
|
||||
|
||||
Property notificationFilterMode = notificatonFilter.addIntProperty("notificationFilterMode").notNull().getProperty();
|
||||
Property notificationFilterSubMode = notificatonFilter.addIntProperty("notificationFilterSubMode").notNull().getProperty();
|
||||
return notificatonFilter;
|
||||
}
|
||||
|
||||
private static void addBipActivitySummary(Schema schema, Entity user, Entity device) {
|
||||
Entity summary = addEntity(schema, "BaseActivitySummary");
|
||||
summary.implementsInterface(ACTIVITY_SUMMARY);
|
||||
|
||||
Reference in New Issue
Block a user