mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 02:25:50 +01:00
Intent API: Add debug action for test new function
This commit is contained in:
parent
0378f48798
commit
577ee27c14
@ -54,6 +54,7 @@ public class IntentApiReceiver extends BroadcastReceiver {
|
||||
public static final String COMMAND_DEBUG_SEND_NOTIFICATION = "nodomain.freeyourgadget.gadgetbridge.command.DEBUG_SEND_NOTIFICATION";
|
||||
public static final String COMMAND_DEBUG_INCOMING_CALL = "nodomain.freeyourgadget.gadgetbridge.command.DEBUG_INCOMING_CALL";
|
||||
public static final String COMMAND_DEBUG_SET_DEVICE_ADDRESS = "nodomain.freeyourgadget.gadgetbridge.command.DEBUG_SET_DEVICE_ADDRESS";
|
||||
public static final String COMMAND_DEBUG_TEST_NEW_FUNCTION = "nodomain.freeyourgadget.gadgetbridge.command.DEBUG_TEST_NEW_FUNCTION";
|
||||
|
||||
private static final String MAC_ADDR_PATTERN = "^([0-9A-F]{2}:){5}[0-9A-F]{2}$";
|
||||
|
||||
@ -174,6 +175,15 @@ public class IntentApiReceiver extends BroadcastReceiver {
|
||||
}
|
||||
setDeviceAddress(intent);
|
||||
break;
|
||||
|
||||
case COMMAND_DEBUG_TEST_NEW_FUNCTION:
|
||||
if (!prefs.getBoolean("intent_api_allow_debug_commands", false)) {
|
||||
LOG.warn(msgDebugNotAllowed);
|
||||
return;
|
||||
}
|
||||
LOG.info("Triggering Debug Test New Function");
|
||||
GBApplication.deviceService().onTestNewFunction();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,6 +194,7 @@ public class IntentApiReceiver extends BroadcastReceiver {
|
||||
intentFilter.addAction(COMMAND_DEBUG_SEND_NOTIFICATION);
|
||||
intentFilter.addAction(COMMAND_DEBUG_INCOMING_CALL);
|
||||
intentFilter.addAction(COMMAND_DEBUG_SET_DEVICE_ADDRESS);
|
||||
intentFilter.addAction(COMMAND_DEBUG_TEST_NEW_FUNCTION);
|
||||
return intentFilter;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user