Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various typos #3206

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/appMain/smartDeviceLink.ini
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ AudioDataStoppedTimeout = 1000
VideoDataStoppedTimeout = 1000

[GLOBAL PROPERTIES]
; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
; HelpPrompt and TimeOutPrompt is a vector of strings separated by comma
; Delimiter, which will be appended to each TTS chunk, e.g. helpPrompt/timeoutPrompt
TTSDelimiter = ,
; Default prompt items, separated by comma
HelpPromt = Please speak one of the following commands,Please say a command
HelpPrompt = Please speak one of the following commands,Please say a command
; Default prompt items, separated by comma
TimeOutPromt = Please speak one of the following commands,Please say a command
TimeOutPrompt = Please speak one of the following commands,Please say a command
HelpTitle = Available Vr Commands List
; In case mobile app didn't send global properties default global properties will be sent after this timeout in seconds
; max value TTSGlobalPropertiesTimeout 64K
Expand Down Expand Up @@ -233,7 +233,7 @@ MaximumPayloadSize = 131072
FrequencyCount = 1000
FrequencyTime = 1000
; Enable filtering transport data stream
; On #MalformedMessageFiltering disable SDl disconnect with the first
; On #MalformedMessageFiltering disable SDL disconnect with the first
; malformed message detection
MalformedMessageFiltering = true
; Boundary values of malformed message detection for connection close
Expand Down Expand Up @@ -272,7 +272,7 @@ AppIconsAmountToRemove = 1
; Audio service packet with payload bigger than this value will be marked as a malformed,
; if not specified, this value will default to MaxPayloadSize
;MaximumAudioPayloadSize = 131072
; Video service packet with payloadbigger than this value will be marked as a malformed,
; Video service packet with payload bigger than this value will be marked as a malformed,
; if not specified, this value will default to MaxPayloadSize
;MaximumVideoPayloadSize = 131072

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,24 @@ class ResetGlobalPropertiesRequest

private:
/*
* @brief Sets default value of the HELPPROMT global property
* @brief Sets default value of the HELPPROMPT global property
* to the first vrCommand of each Command Menu registered in application
*
* @param app Registered application
* @param is_timeout_promp Flag indicating that timeout prompt
* should be reset
*
* @return TRUE on success, otherwise FALSE
*/
bool ResetHelpPromt(app_mngr::ApplicationSharedPtr app);
bool ResetHelpPrompt(app_mngr::ApplicationSharedPtr app);

/*
* @brief Sets default value of the TIMEOUTPROMT global property
* @brief Sets default value of the TIMEOUTPROMPT global property
* to the first vrCommand of each Command Menu registered in application
*
* @param app Registered application
*
* @return TRUE on success, otherwise FALSE
*/
bool ResetTimeoutPromt(application_manager::ApplicationSharedPtr const app);
bool ResetTimeoutPrompt(application_manager::ApplicationSharedPtr const app);

/*
* @brief Sets default value of the VRHELPTITLE global property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void ResetGlobalPropertiesRequest::Run() {
LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList");
application_manager_.RemoveAppFromTTSGlobalPropertiesList(app_id);

bool helpt_promt = false;
bool help_prompt = false;
bool timeout_prompt = false;
bool vr_help_title_items = false;
bool menu_name = false;
Expand All @@ -95,9 +95,9 @@ void ResetGlobalPropertiesRequest::Run() {
(*message_)[strings::msg_params][strings::properties][i].asInt());

if (mobile_apis::GlobalProperty::HELPPROMPT == global_property) {
helpt_promt = ResetHelpPromt(app);
help_prompt = ResetHelpPrompt(app);
} else if (mobile_apis::GlobalProperty::TIMEOUTPROMPT == global_property) {
timeout_prompt = ResetTimeoutPromt(app);
timeout_prompt = ResetTimeoutPrompt(app);
} else if (((mobile_apis::GlobalProperty::VRHELPTITLE == global_property) ||
(mobile_apis::GlobalProperty::VRHELPITEMS ==
global_property)) &&
Expand All @@ -119,7 +119,7 @@ void ResetGlobalPropertiesRequest::Run() {
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
}

if (timeout_prompt || helpt_promt) {
if (timeout_prompt || help_prompt) {
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
}

Expand Down Expand Up @@ -171,12 +171,12 @@ void ResetGlobalPropertiesRequest::Run() {
hmi_apis::FunctionID::UI_SetGlobalProperties, &msg_params, true);
}

if (timeout_prompt || helpt_promt) {
if (timeout_prompt || help_prompt) {
// create ui request
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);

if (helpt_promt) {
if (help_prompt) {
msg_params[strings::help_prompt] = (*app->help_prompt());
}

Expand All @@ -191,7 +191,7 @@ void ResetGlobalPropertiesRequest::Run() {
}
}

bool ResetGlobalPropertiesRequest::ResetHelpPromt(
bool ResetGlobalPropertiesRequest::ResetHelpPrompt(
application_manager::ApplicationSharedPtr app) {
if (!app) {
LOG4CXX_ERROR(logger_, "Null pointer");
Expand All @@ -204,29 +204,29 @@ bool ResetGlobalPropertiesRequest::ResetHelpPromt(
return true;
}

bool ResetGlobalPropertiesRequest::ResetTimeoutPromt(
bool ResetGlobalPropertiesRequest::ResetTimeoutPrompt(
application_manager::ApplicationSharedPtr const app) {
if (!app) {
LOG4CXX_ERROR(logger_, "Null pointer");
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return false;
}

const std::vector<std::string>& time_out_promt =
application_manager_.get_settings().time_out_promt();
const std::vector<std::string>& time_out_prompt =
application_manager_.get_settings().time_out_prompt();

smart_objects::SmartObject so_time_out_promt =
smart_objects::SmartObject so_time_out_prompt =
smart_objects::SmartObject(smart_objects::SmartType_Array);

for (uint32_t i = 0; i < time_out_promt.size(); ++i) {
for (uint32_t i = 0; i < time_out_prompt.size(); ++i) {
smart_objects::SmartObject timeoutPrompt =
smart_objects::SmartObject(smart_objects::SmartType_Map);
timeoutPrompt[strings::text] = time_out_promt[i];
timeoutPrompt[strings::text] = time_out_prompt[i];
timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
so_time_out_promt[i] = timeoutPrompt;
so_time_out_prompt[i] = timeoutPrompt;
}

app->set_timeout_prompt(so_time_out_promt);
app->set_timeout_prompt(so_time_out_prompt);

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidVrHelp_UNSUCCESS) {

std::vector<std::string> time_out_prompt;
time_out_prompt.push_back("time_out");
EXPECT_CALL(app_mngr_settings_, time_out_promt())
EXPECT_CALL(app_mngr_settings_, time_out_prompt())
.WillOnce(ReturnRef(time_out_prompt));

smart_objects::SmartObject timeout_prompt =
Expand Down Expand Up @@ -196,7 +196,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {

std::vector<std::string> time_out_prompt;
time_out_prompt.push_back("time_out");
EXPECT_CALL(app_mngr_settings_, time_out_promt())
EXPECT_CALL(app_mngr_settings_, time_out_prompt())
.WillOnce(ReturnRef(time_out_prompt));

smart_objects::SmartObject timeout_prompt =
Expand Down Expand Up @@ -306,7 +306,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,

std::vector<std::string> time_out_prompt;
time_out_prompt.push_back("time_out");
EXPECT_CALL(app_mngr_settings_, time_out_promt())
EXPECT_CALL(app_mngr_settings_, time_out_prompt())
.WillOnce(ReturnRef(time_out_prompt));

EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
Expand Down Expand Up @@ -405,7 +405,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,

std::vector<std::string> time_out_prompt;
time_out_prompt.push_back("time_out");
EXPECT_CALL(app_mngr_settings_, time_out_promt())
EXPECT_CALL(app_mngr_settings_, time_out_prompt())
.WillOnce(ReturnRef(time_out_prompt));

EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
Expand Down Expand Up @@ -472,7 +472,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,

std::vector<std::string> time_out_prompt;
time_out_prompt.push_back("time_out");
EXPECT_CALL(app_mngr_settings_, time_out_promt())
EXPECT_CALL(app_mngr_settings_, time_out_prompt())
.WillOnce(ReturnRef(time_out_prompt));

EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
Expand Down Expand Up @@ -538,7 +538,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,

std::vector<std::string> time_out_prompt;
time_out_prompt.push_back("time_out");
EXPECT_CALL(app_mngr_settings_, time_out_promt())
EXPECT_CALL(app_mngr_settings_, time_out_prompt())
.WillOnce(ReturnRef(time_out_prompt));

EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SetGlobalPropertiesRequestTest
msg_params[am::strings::vr_help_title] = "vr_help_title";
msg_params[am::strings::vr_help][0][am::strings::text] = "vr_help";
msg_params[am::strings::vr_help][0][am::strings::position] = 1u;
msg_params[am::strings::help_prompt][0][am::strings::text] = "help_promt";
msg_params[am::strings::help_prompt][0][am::strings::text] = "help_prompt";
(*msg)[am::strings::msg_params] = msg_params;

return msg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void DeleteGlobalProperties(ApplicationSharedPtr app,
using namespace smart_objects;

const std::vector<std::string>& timeout_prompt =
app_manager.get_settings().time_out_promt();
app_manager.get_settings().time_out_prompt();

SmartObject so_default_timeout_prompt = SmartObject(SmartType_Array);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2561,7 +2561,7 @@ void MessageHelper::SendOnPermissionsChangeNotification(
uint32_t connection_key,
const policy::Permissions& permissions,
ApplicationManager& app_mngr,
const policy::EncryptionRequired encryprion_required) {
const policy::EncryptionRequired encryption_required) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject content(smart_objects::SmartType_Map);

Expand All @@ -2578,9 +2578,9 @@ void MessageHelper::SendOnPermissionsChangeNotification(
content[strings::msg_params] =
smart_objects::SmartObject(smart_objects::SmartType_Map);

if (encryprion_required.is_initialized()) {
if (encryption_required.is_initialized()) {
content[strings::msg_params][strings::require_encryption] =
static_cast<bool>(*encryprion_required);
static_cast<bool>(*encryption_required);
}
content[strings::msg_params]["permissionItem"] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
Expand Down Expand Up @@ -2637,7 +2637,7 @@ void MessageHelper::SendOnPermissionsChangeNotification(
permission_item["rpcName"] = (*it_permissions).first;
const policy::RpcPermissions& rpc_permissions = (*it_permissions).second;
auto item_require_encryption = permission_item_encryption_flag_state(
encryprion_required, rpc_permissions.require_encryption);
encryption_required, rpc_permissions.require_encryption);
if (item_require_encryption.is_initialized()) {
const bool require_encryption = *item_require_encryption;
permission_item[strings::require_encryption] = require_encryption;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ApplicationHelperTest : public testing::Test {
.WillByDefault(Return(true));
ON_CALL(mock_application_manager_settings_, stop_streaming_timeout())
.WillByDefault(Return(stop_streaming_timeout));
ON_CALL(mock_application_manager_settings_, time_out_promt())
ON_CALL(mock_application_manager_settings_, time_out_prompt())
.WillByDefault(ReturnRef(kTimeoutPrompt));

CreateApplication();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ void ResumptionDataTest::CheckMenuIcon(sm::SmartObject& res_list) {

void ResumptionDataTest::CheckHelpPrompt(sm::SmartObject& res_list) {
for (uint i = 0; i < tts_chunks_count; ++i) {
std::string promt = (*help_prompt_)[i][am::strings::help_prompt].asString();
std::string dict_promt = res_list[i][am::strings::help_prompt].asString();
EXPECT_EQ(promt, dict_promt);
std::string prompt =
(*help_prompt_)[i][am::strings::help_prompt].asString();
std::string dict_prompt = res_list[i][am::strings::help_prompt].asString();
EXPECT_EQ(prompt, dict_prompt);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::string& hmi_capabilities_file_name() const;

/**
* @brief Returns help promt vector
* @brief Returns help prompt vector
*/
const std::vector<std::string>& help_prompt() const;

/**
* @brief Returns help promt vector
* @brief Returns help prompt vector
*/
const std::vector<std::string>& time_out_promt() const;
const std::vector<std::string>& time_out_prompt() const;

/**
* @brief Returns vr commands default for all apps
Expand Down Expand Up @@ -952,7 +952,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint16_t time_testing_port_;
std::string hmi_capabilities_file_name_;
std::vector<std::string> help_prompt_;
std::vector<std::string> time_out_promt_;
std::vector<std::string> time_out_prompt_;
std::vector<std::string> vr_commands_;
uint64_t min_tread_stack_size_;
bool is_mixing_audio_supported_;
Expand Down
14 changes: 7 additions & 7 deletions src/components/config_profile/src/profile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ const char* kBeforeUpdateHours = "UpdateBeforeHours";
const char* kAudioDataStoppedTimeoutKey = "AudioDataStoppedTimeout";
const char* kVideoDataStoppedTimeoutKey = "VideoDataStoppedTimeout";
const char* kMixingAudioSupportedKey = "MixingAudioSupported";
const char* kHelpPromptKey = "HelpPromt";
const char* kTimeoutPromptKey = "TimeOutPromt";
const char* kHelpPromptKey = "HelpPrompt";
const char* kTimeoutPromptKey = "TimeOutPrompt";
const char* kHelpTitleKey = "HelpTitle";
const char* kHelpCommandKey = "HelpCommand";
const char* kSystemFilesPathKey = "SystemFilesPath";
Expand Down Expand Up @@ -462,7 +462,7 @@ Profile::Profile()
, time_testing_port_(kDefaultTimeTestingPort)
, hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName)
, help_prompt_()
, time_out_promt_()
, time_out_prompt_()
, min_tread_stack_size_(threads::Thread::kMinStackSize)
, is_mixing_audio_supported_(false)
, is_redecoding_enabled_(false)
Expand Down Expand Up @@ -643,8 +643,8 @@ const std::vector<std::string>& Profile::help_prompt() const {
return help_prompt_;
}

const std::vector<std::string>& Profile::time_out_promt() const {
return time_out_promt_;
const std::vector<std::string>& Profile::time_out_prompt() const {
return time_out_prompt_;
}

const std::vector<std::string>& Profile::vr_commands() const {
Expand Down Expand Up @@ -1689,7 +1689,7 @@ void Profile::UpdateValues() {
}

// Timeout prompt
time_out_promt_.clear();
time_out_prompt_.clear();
std::string timeout_prompt_value;
if (ReadValue(
&timeout_prompt_value, kGlobalPropertiesSection, kTimeoutPromptKey)) {
Expand All @@ -1698,7 +1698,7 @@ void Profile::UpdateValues() {
while (str != NULL) {
// Default prompt should have delimiter included for each item
const std::string prompt_item = std::string(str) + tts_delimiter_;
time_out_promt_.push_back(prompt_item);
time_out_prompt_.push_back(prompt_item);
LOG_UPDATED_VALUE(
prompt_item, kTimeoutPromptKey, kGlobalPropertiesSection);
str = strtok(NULL, ",");
Expand Down
8 changes: 4 additions & 4 deletions src/components/config_profile/test/profile_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ TEST_F(ProfileTest, UpdateBool_ValueAppearsInFileTwice) {

TEST_F(ProfileTest, UpdateVectorOfString_ValueAppearsInFileTwice) {
// Default values
std::vector<std::string> time_out_promt;
EXPECT_EQ(time_out_promt, profile_.time_out_promt());
std::vector<std::string> time_out_prompt;
EXPECT_EQ(time_out_prompt, profile_.time_out_prompt());
// Change config file
profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Update config file
time_out_promt.push_back("Please say a command,");
EXPECT_EQ(time_out_promt, profile_.time_out_promt());
time_out_prompt.push_back("Please say a command,");
EXPECT_EQ(time_out_prompt, profile_.time_out_prompt());
}

TEST_F(ProfileTest, UpdateString_ValueAppearsInFileTwice) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/config_profile/test/smartDeviceLink.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ RecordingFileSource = audio.8bit.wav
; Recording file for audio pass thru
RecordingFileName = audio.wav

; HelpPromt and TimeOutPrompt is a vector of strings separated by comma
; HelpPrompt and TimeOutPrompt is a vector of strings separated by comma
[GLOBAL PROPERTIES]

; Delimiter, which will be appended to each TTS chunck, e.g. helpPrompt/timeoutPrompt
TTSDelimiter = ,
; Default prompt items, separated by comma
HelpPromt = Please speak one of the following commands,Please say a command
HelpPrompt = Please speak one of the following commands,Please say a command
; Default prompt items, separated by comma
TimeOutPromt = Please speak one of the following commands,Please say a command
TimeOutPrompt = Please speak one of the following commands,Please say a command
HelpTitle = Available Vr Commands List
; In case mobile app didn't send global properties default global properties will be sent after this timeout
; max value TTSGlobalPropertiesTimeout 64K
Expand Down
Loading