1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-24 19:06:53 +01:00

Zepp OS: Fix notification icon for SMS

This commit is contained in:
José Rebelo 2022-10-31 12:01:19 +00:00
parent ef50599179
commit fffb1462c7
2 changed files with 10 additions and 1 deletions

View File

@ -186,7 +186,11 @@ public class DebugActivity extends AbstractGBActivity {
notificationSpec.body = testString;
notificationSpec.sender = testString;
notificationSpec.subject = testString;
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();

View File

@ -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);