Skip to content

Commit

Permalink
Merge pull request #3949 from smartdevicelink/release/8.2.0
Browse files Browse the repository at this point in the history
Release 8.2.0
  • Loading branch information
ShobhitAd authored Oct 26, 2022
2 parents 65947fd + fb05c08 commit 7343fc7
Show file tree
Hide file tree
Showing 71 changed files with 1,024 additions and 470 deletions.
7 changes: 6 additions & 1 deletion src/appMain/sample_policy_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@


def http_header(data):
# The Content-Length to be sent in the HTTP Request header should be
# adjusted for additional escape characters added for newline strings
# The mobile proxy will remove the escape characters after receiving this request.
content_length = len(data) - data.count('\\')

header = {}
header["HTTPRequest"] = {}
header["HTTPRequest"]["headers"] = {
"ConnectTimeout": 60,
"ContentType": "application/json",
"Content-Length": len(data),
"Content-Length": content_length,
"DoInput": True,
"DoOutput": True,
"InstanceFollowRedirects": False,
Expand Down
14 changes: 7 additions & 7 deletions src/appMain/sdl_preloaded_pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,13 @@
"LIMITED"
]
},
"OnTBTClientState": {
"hmi_levels": [
"BACKGROUND",
"FULL",
"LIMITED"
]
},
"UpdateTurnList": {
"hmi_levels": [
"BACKGROUND",
Expand Down Expand Up @@ -1269,13 +1276,6 @@
"NONE"
]
},
"OnTBTClientState": {
"hmi_levels": [
"BACKGROUND",
"FULL",
"LIMITED"
]
},
"PerformAudioPassThru": {
"hmi_levels": [
"FULL",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,8 @@ class Application : public virtual InitialApplicationData,
* @brief Get list of available application extensions
* @return application extensions
*/
virtual const std::list<AppExtensionPtr>& Extensions() const = 0;
virtual const DataAccessor<std::list<AppExtensionPtr> > Extensions()
const = 0;

/**
* @brief Get cloud app endpoint for websocket connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ class ApplicationImpl : public virtual Application,
*/
bool RemoveExtension(AppExtensionUID uid) OVERRIDE;

const std::list<AppExtensionPtr>& Extensions() const OVERRIDE;
const DataAccessor<std::list<AppExtensionPtr> > Extensions() const OVERRIDE;

std::string hash_val_;
uint32_t grammar_id_;
Expand Down Expand Up @@ -617,6 +617,7 @@ class ApplicationImpl : public virtual Application,
Timer audio_stream_suspend_timer_;

std::list<AppExtensionPtr> extensions_;
mutable std::shared_ptr<sync_primitives::RecursiveLock> extensions_lock_;

// Cloud app properties
std::string endpoint_;
Expand Down Expand Up @@ -644,7 +645,6 @@ class ApplicationImpl : public virtual Application,
CommandSoftButtonID cmd_softbuttonid_;
// Lock for command soft button id
sync_primitives::Lock cmd_softbuttonid_lock_;
mutable std::shared_ptr<sync_primitives::Lock> vi_lock_ptr_;
mutable std::shared_ptr<sync_primitives::Lock> button_lock_ptr_;
std::string folder_name_;
ApplicationManager& application_manager_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,6 @@ class ApplicationManagerImpl
rpc_service_ = std::move(rpc_service);
}

bool is_stopping() const OVERRIDE;

bool is_audio_pass_thru_active() const OVERRIDE;
/*
* @brief Function Should be called when Low Voltage is occured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ class Command {
*/
virtual void SetAllowedToTerminate(const bool allowed) = 0;

virtual const ApplicationManager& GetApplicationManager() const = 0;

enum CommandSource {
SOURCE_SDL,
SOURCE_MOBILE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ class CommandImpl : public Command {
*/
void SetAllowedToTerminate(const bool allowed) OVERRIDE;

const ApplicationManager& GetApplicationManager() const OVERRIDE;

void OnUpdateTimeOut() OVERRIDE;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ class HelpPromptManager {
virtual void OnSetGlobalPropertiesReceived(
const smart_objects::SmartObject& msg, const bool is_response) = 0;

/**
* @brief Triggered when ResetGlobalProperties request is received from an
* application. Reset sending_type_ based on which global properties are reset
* @param msg containing GlobalProperties
*/
virtual void OnResetGlobalPropertiesReceived(
const smart_objects::SmartObject& msg) = 0;

/**
* @brief Requests sending type behavior
*/
Expand All @@ -89,6 +97,16 @@ class HelpPromptManager {
* @return current sending type
*/
virtual SendingType GetSendingType() const = 0;

/**
* @brief Construct the helpPrompt parameter
*/
virtual void CreatePromptMsg(smart_objects::SmartObject& out_msg_params) = 0;

/**
* @brief Construct the vrHelp parameter
*/
virtual void CreateVRMsg(smart_objects::SmartObject& out_msg_params) = 0;
};

} // namespace application_manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,30 @@ class HelpPromptManagerImpl : public HelpPromptManager {
void OnSetGlobalPropertiesReceived(const smart_objects::SmartObject& msg,
const bool is_response) OVERRIDE;

/**
* @brief Triggered when ResetGlobalProperties request is received from an
* application. Reset sending_type_ based on which global properties are reset
* @param msg containing GlobalProperties
*/
void OnResetGlobalPropertiesReceived(
const smart_objects::SmartObject& msg) OVERRIDE;

/**
* @brief Get current sending type
* @return current sending type
*/
SendingType GetSendingType() const OVERRIDE;

/**
* @brief Construct the helpPrompt parameter
*/
void CreatePromptMsg(smart_objects::SmartObject& out_msg_params);

/**
* @brief Construct the vrHelp parameter
*/
void CreateVRMsg(smart_objects::SmartObject& out_msg_params);

private:
DISALLOW_COPY_AND_ASSIGN(HelpPromptManagerImpl);

Expand Down Expand Up @@ -149,16 +167,6 @@ class HelpPromptManagerImpl : public HelpPromptManager {
*/
void SendRequests();

/**
* @brief Construct the helpPrompt parameter
*/
void CreatePromptMsg(smart_objects::SmartObject& out_msg_params);

/**
* @brief Construct the vrHelp parameter
*/
void CreateVRMsg(smart_objects::SmartObject& out_msg_params);

/**
* @brief Setting request type to send HMI
* @param msg containing request or response for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <list>
#include <memory>
#include "interfaces/MOBILE_API.h"
#include "utils/atomic_object.h"
#include "utils/macro.h"

namespace application_manager {
Expand Down Expand Up @@ -116,13 +117,13 @@ class HmiState {
* @return return hmi level member
*/
virtual mobile_apis::HMILevel::eType hmi_level() const {
if (parent_) {
if (parent()) {
if (mobile_apis::HMILevel::INVALID_ENUM == hmi_level_) {
return parent_->hmi_level();
return parent()->hmi_level();
}
// Higher values correlate to lower states
// (FULL = 0, LIMITED = 1, etc.)
return std::max(parent_->max_hmi_level(), hmi_level_);
return std::max(parent()->max_hmi_level(), hmi_level_);
}
return hmi_level_;
}
Expand All @@ -132,8 +133,8 @@ class HmiState {
* @return return maximum hmi level for app
*/
virtual mobile_apis::HMILevel::eType max_hmi_level() const {
if (parent_) {
return parent_->max_hmi_level();
if (parent()) {
return parent()->max_hmi_level();
}
return mobile_apis::HMILevel::HMI_FULL;
}
Expand All @@ -152,14 +153,14 @@ class HmiState {
*/
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const {
if (parent_) {
if (parent()) {
if (mobile_apis::AudioStreamingState::INVALID_ENUM ==
audio_streaming_state_) {
return parent_->audio_streaming_state();
return parent()->audio_streaming_state();
}
// Higher values correlate to lower states
// (AUDIBLE = 0, ATTENUATED = 1, etc.)
return std::max(parent_->max_audio_streaming_state(),
return std::max(parent()->max_audio_streaming_state(),
audio_streaming_state_);
}
return audio_streaming_state_;
Expand All @@ -171,8 +172,8 @@ class HmiState {
*/
virtual mobile_apis::AudioStreamingState::eType max_audio_streaming_state()
const {
if (parent_) {
return parent_->max_audio_streaming_state();
if (parent()) {
return parent()->max_audio_streaming_state();
}
return mobile_apis::AudioStreamingState::AUDIBLE;
}
Expand All @@ -183,14 +184,14 @@ class HmiState {
*/
virtual mobile_apis::VideoStreamingState::eType video_streaming_state()
const {
if (parent_) {
if (parent()) {
if (mobile_apis::VideoStreamingState::INVALID_ENUM ==
video_streaming_state_) {
return parent_->video_streaming_state();
return parent()->video_streaming_state();
}
// Higher values correlate to lower states
// (STREAMABLE = 0, NOT_STREAMABLE = 1)
return std::max(parent_->max_video_streaming_state(),
return std::max(parent()->max_video_streaming_state(),
video_streaming_state_);
}
return video_streaming_state_;
Expand All @@ -202,8 +203,8 @@ class HmiState {
*/
virtual mobile_apis::VideoStreamingState::eType max_video_streaming_state()
const {
if (parent_) {
return parent_->max_video_streaming_state();
if (parent()) {
return parent()->max_video_streaming_state();
}
return mobile_apis::VideoStreamingState::STREAMABLE;
}
Expand Down Expand Up @@ -232,9 +233,9 @@ class HmiState {
*/
virtual mobile_apis::SystemContext::eType system_context() const {
// Parent's context should be used if not available for current state
if (parent_ &&
if (parent() &&
system_context_ == mobile_apis::SystemContext::INVALID_ENUM) {
return parent_->system_context();
return parent()->system_context();
}
return system_context_;
}
Expand Down Expand Up @@ -280,7 +281,7 @@ class HmiState {
uint32_t hmi_app_id_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
sync_primitives::Atomic<HmiStatePtr> parent_;
mobile_apis::WindowType::eType window_type_;
mobile_apis::HMILevel::eType hmi_level_;
mobile_apis::AudioStreamingState::eType audio_streaming_state_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,6 @@ class MessageHelper {
static smart_objects::SmartObjectList CreateGlobalPropertiesRequestsToHMI(
ApplicationConstSharedPtr app, ApplicationManager& app_mngr);

static smart_objects::SmartObjectSPtr CreateAppVrHelp(
ApplicationConstSharedPtr app);

static smart_objects::SmartObjectList CreateShowRequestToHMI(
ApplicationConstSharedPtr app, const uint32_t correlation_id);
static void SendShowRequestToHMI(ApplicationConstSharedPtr app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class ResumptionData {
* @brief Get the last ignition off time from LastState
* @return the last ignition off time from LastState
*/
virtual uint32_t GetIgnOffTime() const = 0;
virtual int64_t GetIgnOffTime() const = 0;

/**
* @brief Checks if saved data have application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class ResumptionDataDB : public ResumptionData {
* @brief Get the last ignition off time from LastState
* @return the last ignition off time from LastState
*/
virtual uint32_t GetIgnOffTime() const;
virtual int64_t GetIgnOffTime() const;

/**
* @brief Checks if saved data have application
Expand Down Expand Up @@ -289,7 +289,7 @@ class ResumptionDataDB : public ResumptionData {
* @brief Select Ign off time
* @return Ign off time from saved data
*/
uint32_t SelectIgnOffTime() const;
int64_t SelectIgnOffTime() const;

/**
* @brief Checks existence application in DB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ResumptionDataJson : public ResumptionData {
* @brief Get the last ignition off time from LastState
* @return the last ignition off time from LastState
*/
virtual uint32_t GetIgnOffTime() const;
virtual int64_t GetIgnOffTime() const;

void IncrementGlobalIgnOnCounter() OVERRIDE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ class ResumptionDataProcessorImpl
* requests
* @param app_id ID of application, related to event
* @param found_request reference to found request
* @return true, if request is found and erased
*/
void EraseProcessedRequest(const uint32_t app_id,
bool EraseProcessedRequest(const uint32_t app_id,
const ResumptionRequest& found_request);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ class StateControllerImpl : public event_engine::EventObserver,
PostponedActivationController& GetPostponedActivationController() OVERRIDE;

private:
int64_t RequestHMIStateChange(ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority);
void RequestHMIStateChange(ApplicationConstSharedPtr app,
HmiStatePtr resolved_state,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority);

/**
* @brief The HmiLevelConflictResolver struct
Expand Down
Loading

0 comments on commit 7343fc7

Please sign in to comment.