mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-04 09:17:29 +01:00
Categorized Google Voice messages as GENERIC_SMS, cleaned up some Casio support code, added portion of message text to notification title
This commit is contained in:
parent
6ef6c9be43
commit
d9d6a8dc29
@ -61,6 +61,7 @@ public class AppNotificationType extends HashMap<String, NotificationType> {
|
|||||||
put("com.google.android.talk", NotificationType.GOOGLE_HANGOUTS);
|
put("com.google.android.talk", NotificationType.GOOGLE_HANGOUTS);
|
||||||
put("com.google.android.apps.maps", NotificationType.GOOGLE_MAPS);
|
put("com.google.android.apps.maps", NotificationType.GOOGLE_MAPS);
|
||||||
put("com.google.android.apps.photos", NotificationType.GOOGLE_PHOTOS);
|
put("com.google.android.apps.photos", NotificationType.GOOGLE_PHOTOS);
|
||||||
|
put("com.google.android.apps.googlevoice", NotificationType.GENERIC_SMS);
|
||||||
|
|
||||||
// Conversations
|
// Conversations
|
||||||
put("eu.siacs.conversations", NotificationType.CONVERSATIONS);
|
put("eu.siacs.conversations", NotificationType.CONVERSATIONS);
|
||||||
|
@ -256,6 +256,9 @@ public class CasioGBX100DeviceSupport extends Casio2C2DSupport implements Shared
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showNotification(byte icon, String sender, String title, String message, int id, boolean delete) {
|
private void showNotification(byte icon, String sender, String title, String message, int id, boolean delete) {
|
||||||
|
title = title + "-" + message;
|
||||||
|
title = title.substring(0, Math.min(title.length(), 30));
|
||||||
|
title = title + "..";
|
||||||
byte[] titleBytes = new byte[0];
|
byte[] titleBytes = new byte[0];
|
||||||
if(title != null)
|
if(title != null)
|
||||||
titleBytes = title.getBytes(StandardCharsets.UTF_8);
|
titleBytes = title.getBytes(StandardCharsets.UTF_8);
|
||||||
@ -342,20 +345,23 @@ public class CasioGBX100DeviceSupport extends Casio2C2DSupport implements Shared
|
|||||||
public void onNotification(final NotificationSpec notificationSpec) {
|
public void onNotification(final NotificationSpec notificationSpec) {
|
||||||
byte icon;
|
byte icon;
|
||||||
boolean autoremove = false;
|
boolean autoremove = false;
|
||||||
switch (notificationSpec.type.getGenericType()) {
|
switch (notificationSpec.type) {
|
||||||
case "generic_calendar":
|
case GENERIC_CALENDAR:
|
||||||
icon = CasioConstants.CATEGORY_SCHEDULE_AND_ALARM;
|
icon = CasioConstants.CATEGORY_SCHEDULE_AND_ALARM;
|
||||||
break;
|
break;
|
||||||
case "generic_email":
|
case GENERIC_EMAIL:
|
||||||
icon = CasioConstants.CATEGORY_EMAIL;
|
icon = CasioConstants.CATEGORY_EMAIL;
|
||||||
break;
|
break;
|
||||||
case "generic_sms":
|
case GENERIC_SMS:
|
||||||
icon = CasioConstants.CATEGORY_SNS;
|
icon = CasioConstants.CATEGORY_SNS;
|
||||||
SharedPreferences sharedPreferences = GBApplication.getDeviceSpecificSharedPrefs(getDevice().getAddress());
|
SharedPreferences sharedPreferences = GBApplication.getDeviceSpecificSharedPrefs(getDevice().getAddress());
|
||||||
autoremove = sharedPreferences.getBoolean(PREF_AUTOREMOVE_MESSAGE, false);
|
autoremove = sharedPreferences.getBoolean(PREF_AUTOREMOVE_MESSAGE, false);
|
||||||
break;
|
break;
|
||||||
|
case GENERIC_PHONE:
|
||||||
|
icon = CasioConstants.CATEGORY_INCOMING_CALL;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
icon = CasioConstants.CATEGORY_SNS;
|
icon = CasioConstants.CATEGORY_OTHER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
LOG.info("onNotification id=" + notificationSpec.getId());
|
LOG.info("onNotification id=" + notificationSpec.getId());
|
||||||
|
Loading…
Reference in New Issue
Block a user