if (self->switch_added_cb) {
auto switches = setting_accessibility_universal_switch_dbus_config_get_switches(
&self->context_.config, ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN_SWITCH_PROVIDER);
- PRINT_ERROR_MESSAGE_IF(switches.size() < 1, "Screen switch not found");
+ ASSERT(!switches.empty(), "Screen switch not found");
auto screen_switch = switches[0];
self->switch_added_cb(self->switch_added_cb_data, screen_switch->id, action, ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN);
}
void UniversalSwitchSettingsPage::feedbackVoiceSpeechVolumeChangedCb(size_t item_id)
{
- PRINT_ERROR_MESSAGE_IF(item_id >= mediaLevel.size(), "Invalid item_id");
+ ASSERT(item_id < mediaLevel.size(), "Invalid item_id");
double media_level = mediaLevel[item_id].second / 100.0;
context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->setSecondValue(media_level);
void UniversalSwitchSettingsPage::feedbackVoiceSpeechRateChangedCb(size_t item_id)
{
- PRINT_ERROR_MESSAGE_IF(item_id >= mediaLevel.size(), "Invalid item_id");
+ ASSERT(item_id < mediaLevel.size(), "Invalid item_id");
double media_level = mediaLevel[item_id].second / 100.0;
context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_VOICE)->setFirstValue(media_level);
void UniversalSwitchSettingsPage::feedbackSoundVolumeChangedCb(size_t item_id)
{
- PRINT_ERROR_MESSAGE_IF(item_id >= mediaLevel.size(), "Invalid item_id");
+ ASSERT(item_id < mediaLevel.size(), "Invalid item_id");
double media_level = mediaLevel[item_id].second / 100.0;
context_.usScanningProperties.getScanningProperty(Property::FEEDBACK_SOUND)->setFirstValue(media_level);
void UniversalSwitchSettingsPage::cursorColorListItemChangedCb(size_t item_id)
{
- PRINT_ERROR_MESSAGE_IF(item_id >= cursorColors.size(), "Invalid cursor color id");
+ ASSERT(item_id < cursorColors.size(), "Invalid cursor color id");
context_.usScanningProperties.getScanningProperty(Property::CURSOR_COLOR)->setFirstValue<int>(cursorColors[item_id].second);
cursorColor_->setDescription(cursorColors[item_id].first);
}
return "Undefined";
-}
\ No newline at end of file
+}
} while (0)
#endif
-#define PRINT_ERROR_MESSAGE_IF(condition, errorMessage, arg...) \
- do { \
- if (condition) \
- ERROR(errorMessage, ##arg); \
- } while (0)
-
#define RETURN_IF(condition, errorMessage, arg...) \
do { \
if (condition) { \