mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +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.body = testString;
|
||||||
notificationSpec.sender = testString;
|
notificationSpec.sender = testString;
|
||||||
notificationSpec.subject = 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()
|
notificationSpec.sourceName = getApplicationContext().getApplicationInfo()
|
||||||
.loadLabel(getApplicationContext().getPackageManager())
|
.loadLabel(getApplicationContext().getPackageManager())
|
||||||
.toString();
|
.toString();
|
||||||
|
@ -76,6 +76,7 @@ import java.util.Map;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventCallControl;
|
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventCallControl;
|
||||||
@ -646,6 +647,10 @@ public abstract class Huami2021Support extends HuamiSupport {
|
|||||||
// app package
|
// app package
|
||||||
if (notificationSpec.sourceAppId != null) {
|
if (notificationSpec.sourceAppId != null) {
|
||||||
baos.write(notificationSpec.sourceAppId.getBytes(StandardCharsets.UTF_8));
|
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);
|
baos.write(0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user