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:
parent
ef50599179
commit
fffb1462c7
@ -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();
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user