mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-02-17 21:06:48 +01:00
Mi Band 3: Also fix diplay of SMS and EMAIL
We have to send a fake app source that is never displayed to make the text appear... :P
This commit is contained in:
parent
3d70314e8c
commit
ffc6bd5a73
@ -110,9 +110,10 @@ public class AmazfitBipSupport extends HuamiSupport {
|
|||||||
int maxLength = 230;
|
int maxLength = 230;
|
||||||
if (characteristicChunked != null) {
|
if (characteristicChunked != null) {
|
||||||
int prefixlength = 2;
|
int prefixlength = 2;
|
||||||
int suffixlength = 0;
|
|
||||||
|
|
||||||
byte[] appSuffix = null;
|
// We also need a (fake) source name for Mi Band 3 for SMS/EMAIL, else the message is not displayed
|
||||||
|
byte[] appSuffix = "\0 \0".getBytes();
|
||||||
|
int suffixlength = appSuffix.length;
|
||||||
|
|
||||||
if (alertCategory == AlertCategory.CustomHuami) {
|
if (alertCategory == AlertCategory.CustomHuami) {
|
||||||
String appName;
|
String appName;
|
||||||
@ -127,7 +128,7 @@ public class AmazfitBipSupport extends HuamiSupport {
|
|||||||
if (ai != null) {
|
if (ai != null) {
|
||||||
appName = "\0" + pm.getApplicationLabel(ai) + "\0";
|
appName = "\0" + pm.getApplicationLabel(ai) + "\0";
|
||||||
} else {
|
} else {
|
||||||
appName = "\0" + "unknown app" + "\0";
|
appName = "\0" + "UNKNOWN" + "\0";
|
||||||
}
|
}
|
||||||
appSuffix = appName.getBytes();
|
appSuffix = appName.getBytes();
|
||||||
suffixlength = appSuffix.length;
|
suffixlength = appSuffix.length;
|
||||||
@ -145,9 +146,7 @@ public class AmazfitBipSupport extends HuamiSupport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
System.arraycopy(rawmessage, 0, command, prefixlength, length);
|
System.arraycopy(rawmessage, 0, command, prefixlength, length);
|
||||||
if (appSuffix != null) {
|
System.arraycopy(appSuffix, 0, command, prefixlength + length, appSuffix.length);
|
||||||
System.arraycopy(appSuffix, 0, command, prefixlength + length, appSuffix.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
writeToChunked(builder, 0, command);
|
writeToChunked(builder, 0, command);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user