mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Huawei: fixes related to replies
This commit is contained in:
parent
0429c2f3c8
commit
86e32f0713
@ -282,11 +282,15 @@ public class HuaweiCoordinator {
|
|||||||
// Notifications
|
// Notifications
|
||||||
final List<Integer> notifications = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.NOTIFICATIONS);
|
final List<Integer> notifications = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.NOTIFICATIONS);
|
||||||
notifications.add(R.xml.devicesettings_notifications_enable);
|
notifications.add(R.xml.devicesettings_notifications_enable);
|
||||||
|
if (supportsNotificationsRepeatedNotify() || supportsNotificationsRemoveSingle()){
|
||||||
|
notifications.add(R.xml.devicesettings_autoremove_notifications);
|
||||||
|
}
|
||||||
if (supportsNotificationOnBluetoothLoss())
|
if (supportsNotificationOnBluetoothLoss())
|
||||||
notifications.add(R.xml.devicesettings_disconnectnotification_noshed);
|
notifications.add(R.xml.devicesettings_disconnectnotification_noshed);
|
||||||
if (supportsDoNotDisturb(device))
|
if (supportsDoNotDisturb(device))
|
||||||
notifications.add(R.xml.devicesettings_donotdisturb_allday_liftwirst_notwear);
|
notifications.add(R.xml.devicesettings_donotdisturb_allday_liftwirst_notwear);
|
||||||
|
|
||||||
|
|
||||||
// Workout
|
// Workout
|
||||||
if (supportsSendingGps())
|
if (supportsSendingGps())
|
||||||
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.WORKOUT, R.xml.devicesettings_workout_send_gps_to_band);
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.WORKOUT, R.xml.devicesettings_workout_send_gps_to_band);
|
||||||
|
@ -48,8 +48,7 @@ public class Notifications {
|
|||||||
public String channelId = "";
|
public String channelId = "";
|
||||||
public byte subscriptionId = 0;
|
public byte subscriptionId = 0;
|
||||||
public String address = "";
|
public String address = "";
|
||||||
|
public String category = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: support other types of notifications
|
// TODO: support other types of notifications
|
||||||
@ -129,7 +128,9 @@ public class Notifications {
|
|||||||
if (addParams.supportsSyncKey)
|
if (addParams.supportsSyncKey)
|
||||||
this.tlv.put(0x18, (addParams.notificationKey != null) ? addParams.notificationKey : "");
|
this.tlv.put(0x18, (addParams.notificationKey != null) ? addParams.notificationKey : "");
|
||||||
|
|
||||||
//this.tlv.put(0x12, "msg"); //"msg" or "imcall", maybe other - category, if not empty and productType>=34
|
if(!TextUtils.isEmpty(addParams.category)) { //TODO: device type >=34
|
||||||
|
this.tlv.put(0x12, addParams.category); // "imcall" also possible value, not standard for android
|
||||||
|
}
|
||||||
|
|
||||||
//if(addParams.repeatedNotifySupports) {
|
//if(addParams.repeatedNotifySupports) {
|
||||||
// this.tlv.put(0x13, 0); // 0x13 - reminder 15 = vibrate, 0 - default
|
// this.tlv.put(0x13, 0); // 0x13 - reminder 15 = vibrate, 0 - default
|
||||||
@ -142,8 +143,8 @@ public class Notifications {
|
|||||||
|
|
||||||
if (addParams.supportsRepeatedNotify || addParams.supportsRemoveSingle) {
|
if (addParams.supportsRepeatedNotify || addParams.supportsRemoveSingle) {
|
||||||
this.tlv.put(0x19, (addParams.notificationKey != null) ? addParams.notificationKey : "");
|
this.tlv.put(0x19, (addParams.notificationKey != null) ? addParams.notificationKey : "");
|
||||||
this.tlv.put(0x20, addParams.notificationId);
|
this.tlv.put(0x1a, addParams.notificationId);
|
||||||
this.tlv.put(0x1d, (addParams.channelId != null) ? addParams.channelId : "");
|
this.tlv.put(0x1b, (addParams.channelId != null) ? addParams.channelId : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addParams.supportsTimestamp) {
|
if (addParams.supportsTimestamp) {
|
||||||
@ -347,8 +348,8 @@ public class Notifications {
|
|||||||
.put(0x03, notificationKey)
|
.put(0x03, notificationKey)
|
||||||
.put(0x04, notificationId)
|
.put(0x04, notificationId)
|
||||||
.put(0x05, notificationChannelId);
|
.put(0x05, notificationChannelId);
|
||||||
if (notificationCategory != null && !TextUtils.isEmpty(notificationCategory))
|
if (!TextUtils.isEmpty(notificationCategory))
|
||||||
this.tlv.put(0x06, notificationCategory); // category
|
this.tlv.put(0x06, notificationCategory);
|
||||||
|
|
||||||
this.complete = true;
|
this.complete = true;
|
||||||
}
|
}
|
||||||
|
@ -81,8 +81,8 @@ public class HuaweiNotificationsManager {
|
|||||||
notificationSpec.sourceAppId,
|
notificationSpec.sourceAppId,
|
||||||
notificationSpec.key,
|
notificationSpec.key,
|
||||||
id,
|
id,
|
||||||
"", // TODO:
|
notificationSpec.channelId,
|
||||||
null);
|
notificationSpec.category);
|
||||||
sendNotificationReq.doPerform();
|
sendNotificationReq.doPerform();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error("Sending notification remove failed", e);
|
LOG.error("Sending notification remove failed", e);
|
||||||
|
@ -76,6 +76,8 @@ public class SendNotificationRequest extends Request {
|
|||||||
|
|
||||||
params.notificationId = notificationSpec.getId();
|
params.notificationId = notificationSpec.getId();
|
||||||
params.notificationKey = notificationSpec.key;
|
params.notificationKey = notificationSpec.key;
|
||||||
|
params.channelId = notificationSpec.channelId;
|
||||||
|
params.category = notificationSpec.category;
|
||||||
|
|
||||||
|
|
||||||
this.packet = new Notifications.NotificationActionRequest(
|
this.packet = new Notifications.NotificationActionRequest(
|
||||||
@ -92,7 +94,6 @@ public class SendNotificationRequest extends Request {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void buildNotificationTLVFromCallSpec(CallSpec callSpec) {
|
public void buildNotificationTLVFromCallSpec(CallSpec callSpec) {
|
||||||
|
|
||||||
this.packet = new Notifications.NotificationActionRequest(
|
this.packet = new Notifications.NotificationActionRequest(
|
||||||
paramsProvider,
|
paramsProvider,
|
||||||
supportProvider.getNotificationId(),
|
supportProvider.getNotificationId(),
|
||||||
|
Loading…
Reference in New Issue
Block a user