1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 20:36:51 +01:00

Fossil Hybrid HR: Request custom menu config on watchface initialization

This commit is contained in:
Arjan Schrijver 2022-06-15 11:59:33 +02:00 committed by Gitea
parent 7f026edbd0
commit 820bcf258d
3 changed files with 13 additions and 1 deletions

View File

@ -1584,6 +1584,18 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
);
queueWrite(new JsonPutRequest(responseObject, this));
}
} else if (request.optString("custom_menu").equals("request_config")) {
// watchface requests custom menu data to be initialized
LOG.info("Got custom_menu config request, sending intent to HR Menu Companion app...");
Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("d.d.hrmenucompanion", "d.d.hrmenucompanion.MainActivity");
intent.putExtra("SEND_CONFIG", true);
try {
getContext().startActivity(intent);
} catch (Exception e) {
LOG.info("Couldn't send intent to Fossil-HR-Menu-Companion app, is it installed?");
}
} else {
LOG.warn("Unhandled request from watch: " + requestJson.toString());
}

@ -1 +1 @@
Subproject commit f07ed376e9046dbcc9c5d7821117c80b2d79ffd1
Subproject commit 6a0c2bdad14e58d4cf4359e5f573c60aa89bca53