mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-24 17:45:50 +01:00
increase canned replies from 8 to 16
NOTE: Total allowed bytes for all replies = 512 - (reply count - 1) TODO: - check with Firmware 2.9.1 - remove last reply that exceeds the 512 bytes limit completly (else it will be partly truncated)
This commit is contained in:
parent
87674db5f9
commit
f387f7c96b
@ -232,7 +232,7 @@ public class DeviceCommunicationService extends Service {
|
||||
// I would rather like to save that as an array in ShadredPreferences
|
||||
// this would work but I dont know how to do the same in the Settings Activity's xml
|
||||
ArrayList<String> replies = new ArrayList<>();
|
||||
for (int i = 1; i <= 8; i++) {
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
String reply = sharedPrefs.getString("canned_reply_" + i, null);
|
||||
if (reply != null && !reply.equals("")) {
|
||||
replies.add(reply);
|
||||
|
@ -581,7 +581,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
|
||||
}
|
||||
|
||||
if (cannedReplies != null) {
|
||||
if (cannedReplies != null && replies_length > 0) {
|
||||
buf.put((byte) 0x05);
|
||||
buf.put((byte) 0x03); // reply action
|
||||
buf.put((byte) 0x02); // number attributes
|
||||
@ -835,7 +835,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
buf.put(mute_string.getBytes());
|
||||
}
|
||||
|
||||
if (cannedReplies != null) {
|
||||
if (cannedReplies != null && replies_length > 0) {
|
||||
buf.put((byte) 0x05);
|
||||
buf.put((byte) 0x03); // reply action
|
||||
buf.put((byte) 0x02); // number attributes
|
||||
|
@ -93,6 +93,30 @@
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_8"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_9"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_10"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_11"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_12"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_13"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_14"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_15"
|
||||
android:maxLength="64" />
|
||||
<EditTextPreference
|
||||
android:key="canned_reply_16"
|
||||
android:maxLength="64" />
|
||||
</PreferenceScreen>
|
||||
</PreferenceCategory>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user