mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-03 17:02:13 +01:00
Pixoo: Add setting to disable notifications
This commit is contained in:
parent
4a7a201971
commit
1cfd00c924
@ -83,6 +83,8 @@ public class PixooCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
R.xml.devicesettings_screen_brightness,
|
R.xml.devicesettings_screen_brightness,
|
||||||
R.xml.devicesettings_header_time,
|
R.xml.devicesettings_header_time,
|
||||||
R.xml.devicesettings_timeformat,
|
R.xml.devicesettings_timeformat,
|
||||||
|
R.xml.devicesettings_header_notifications,
|
||||||
|
R.xml.devicesettings_send_app_notifications,
|
||||||
R.xml.devicesettings_header_other,
|
R.xml.devicesettings_header_other,
|
||||||
R.xml.devicesettings_pixoo,
|
R.xml.devicesettings_pixoo,
|
||||||
R.xml.devicesettings_header_connection,
|
R.xml.devicesettings_header_connection,
|
||||||
|
@ -216,6 +216,11 @@ public class PixooProtocol extends GBDeviceProtocol {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] encodeNotification(NotificationSpec notificationSpec) {
|
public byte[] encodeNotification(NotificationSpec notificationSpec) {
|
||||||
|
if (!getDevicePrefs().getBoolean(DeviceSettingsPreferenceConst.PREF_SEND_APP_NOTIFICATIONS, true)) {
|
||||||
|
LOG.debug("App notifications disabled - ignoring");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
byte iconID;
|
byte iconID;
|
||||||
switch (notificationSpec.type) {
|
switch (notificationSpec.type) {
|
||||||
case KAKAO_TALK:
|
case KAKAO_TALK:
|
||||||
|
@ -22,6 +22,7 @@ import android.location.Location;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent;
|
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
|
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
|
||||||
@ -31,6 +32,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
|
import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
|
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||||
|
|
||||||
public abstract class GBDeviceProtocol {
|
public abstract class GBDeviceProtocol {
|
||||||
|
|
||||||
@ -178,4 +180,8 @@ public abstract class GBDeviceProtocol {
|
|||||||
public byte[] encodeGpsLocation(Location location) {
|
public byte[] encodeGpsLocation(Location location) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Prefs getDevicePrefs() {
|
||||||
|
return new Prefs(GBApplication.getDeviceSpecificSharedPrefs(getDevice().getAddress()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user