diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java index 7b983be07..a86b4b508 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java @@ -186,7 +186,11 @@ public class DebugActivity extends AbstractGBActivity { notificationSpec.body = testString; notificationSpec.sender = testString; notificationSpec.subject = testString; - notificationSpec.sourceAppId = BuildConfig.APPLICATION_ID; + if (notificationSpec.type != NotificationType.GENERIC_SMS) { + // SMS notifications don't have a source app ID when sent by the SMSReceiver, + // so let's not set it here as well for consistency + notificationSpec.sourceAppId = BuildConfig.APPLICATION_ID; + } notificationSpec.sourceName = getApplicationContext().getApplicationInfo() .loadLabel(getApplicationContext().getPackageManager()) .toString(); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Support.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Support.java index a2c364712..4a8ced8b3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Support.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/Huami2021Support.java @@ -76,6 +76,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; +import nodomain.freeyourgadget.gadgetbridge.BuildConfig; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.database.DBHelper; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventCallControl; @@ -646,6 +647,10 @@ public abstract class Huami2021Support extends HuamiSupport { // app package if (notificationSpec.sourceAppId != null) { baos.write(notificationSpec.sourceAppId.getBytes(StandardCharsets.UTF_8)); + } else { + // Send the GB package name, otherwise the last notification icon will + // be used wrongly (eg. when receiving an SMS) + baos.write(BuildConfig.APPLICATION_ID.getBytes(StandardCharsets.UTF_8)); } baos.write(0);