diff options
author | Justin Dickow <jjdickow@gmail.com> | 2014-08-08 16:18:37 -0400 |
---|---|---|
committer | Justin Dickow <jjdickow@gmail.com> | 2014-08-08 16:18:37 -0400 |
commit | ff1f7044f0e4a2ed093a719cca517df97915fe59 (patch) | |
tree | f970e8c71aeb37bd92750f8662efd2339da5928c | |
parent | b39f343d99669dc27324d32919f5965310beef66 (diff) | |
download | smartdevicelink-dev/lock_screen_logo.tar.gz |
First pass at lock screen logo - bitmap received on Android is NULLdev/lock_screen_logo
Need to work this out with Mike, image exists, and appears to be transferred, but i don't have access to his code right now
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
-rw-r--r-- | src/appMain/AppIcon.jpg | bin | 0 -> 8719 bytes | |||
-rw-r--r-- | src/appMain/smartDeviceLink.ini | 1 | ||||
-rw-r--r-- | src/components/application_manager/src/commands/mobile/register_app_interface_response.cc | 21 | ||||
-rw-r--r-- | src/components/config_profile/include/config_profile/profile.h | 6 | ||||
-rw-r--r-- | src/components/config_profile/src/profile.cc | 19 |
5 files changed, 46 insertions, 1 deletions
diff --git a/src/appMain/AppIcon.jpg b/src/appMain/AppIcon.jpg Binary files differnew file mode 100644 index 000000000..00fcc6d6b --- /dev/null +++ b/src/appMain/AppIcon.jpg diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini index 50f916aaf..eb73cb03e 100644 --- a/src/appMain/smartDeviceLink.ini +++ b/src/appMain/smartDeviceLink.ini @@ -96,6 +96,7 @@ HelpCommand = Help [AppInfo] ; The path for applcations info storage. AppInfoStorage = app_info.dat +AppIconStorage = AppIcon [Policy] PolicySwitchOff = false diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc index 0f01430b0..35ffa2403 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc @@ -36,6 +36,8 @@ #include "application_manager/application_manager_impl.h" #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" +#include "config_profile/profile.h" +#include "utils/file_system.h" namespace application_manager { @@ -56,7 +58,6 @@ void RegisterAppInterfaceResponse::Run() { } } - bool close_session = false; if (last_message) { if (1 < ApplicationManagerImpl::instance()->connection_handler()->GetConnectionSessionsCount( @@ -66,6 +67,22 @@ void RegisterAppInterfaceResponse::Run() { } } + std::string logo_file = profile::Profile::instance()->app_info_logo(); + std::vector<uint8_t> binaryData; + std::vector<uint8_t>::iterator from; + std::vector<uint8_t>::iterator to; + if(!logo_file.empty()){ + if(file_system::FileExists(logo_file)){ + if (file_system::ReadBinaryFile(logo_file, binaryData)) { + if (!binaryData.empty()) { + from = binaryData.begin(); + to = binaryData.end(); + (*message_)[strings::params][strings::binary_data] = smart_objects::SmartObject(std::vector<uint8_t>(from, to)); + } + } + } + } + SendResponse(success, mobile_apis::Result::INVALID_ENUM, last_message); if (close_session) { @@ -79,6 +96,8 @@ void RegisterAppInterfaceResponse::Run() { (*message_)[strings::params][strings::connection_key].asInt()); MessageHelper::SendChangeRegistrationRequestToHMI(application); } + + binaryData.clear(); } } // namespace commands diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 417000075..64aaec1fa 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -254,6 +254,11 @@ class Profile : public utils::Singleton<Profile> { */ const std::string& app_info_storage() const; + /** + * @brief Returns file name for stored logo + */ + const std::string& app_info_logo() const; + /* * @brief Heartbeat timeout before closing connection */ @@ -440,6 +445,7 @@ class Profile : public utils::Singleton<Profile> { uint32_t delete_file_in_none_; uint32_t list_files_in_none_; std::string app_info_storage_; + std::string app_info_logo_; uint32_t heart_beat_timeout_; std::string preloaded_pt_file_; std::string policy_snapshot_file_name_; diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 986cc4e3a..41bef1afb 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -60,6 +60,7 @@ const char* kMainSection = "MAIN"; const char* kPolicySection = "Policy"; const char* kHmiSection = "HMI"; const char* kAppInfoSection = "AppInfo"; +const char* kAppLogoSection = "LogoFile"; const char* kMediaManagerSection = "MEDIA MANAGER"; const char* kGlobalPropertiesSection = "GLOBAL PROPERTIES"; const char* kVrCommandsSection = "VR COMMANDS"; @@ -72,6 +73,7 @@ const char* kPreloadedPTKey = "PreloadedPT"; const char* kPoliciesTableKey = "PoliciesTable"; const char* kServerAddressKey = "ServerAddress"; const char* kAppInfoStorageKey = "AppInfoStorage"; +const char* kAppIconStorageKey = "AppIconStorage"; const char* kAppStorageFolderKey = "AppStorageFolder"; const char* kAppResourseFolderKey = "AppResourceFolder"; const char* kAppConfigFolderKey = "AppConfigFolder"; @@ -123,6 +125,7 @@ const char* kDefaultHmiCapabilitiesFileName = "hmi_capabilities.json"; const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json"; const char* kDefaultServerAddress = "127.0.0.1"; const char* kDefaultAppInfoFileName = "app_info.dat"; +const char* kDefaultAppInfoLogoName = "AppIcon"; const char* kDefaultSystemFilesPath = "/tmp/fs/mp/images/ivsu_cache"; const char* kDefaultTtsDelimiter = ","; const char* kDefaultRecordingFileSourceName = "audio.8bit.wav"; @@ -185,6 +188,7 @@ Profile::Profile() delete_file_in_none_(kDefaultDeleteFileRequestInNone), list_files_in_none_(kDefaultListFilesRequestInNone), app_info_storage_(kDefaultAppInfoFileName), + app_info_logo_(kDefaultAppInfoLogoName), heart_beat_timeout_(kDefaultHeartBeatTimeout), policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName), policy_turn_off_(false), @@ -355,6 +359,10 @@ const uint32_t& Profile::list_files_in_none() const { return list_files_in_none_; } +const std::string& Profile::app_info_logo() const { + return app_info_logo_; +} + const std::string& Profile::app_info_storage() const { return app_info_storage_; } @@ -453,6 +461,17 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey, kAppInfoSection); + // Application info logo file name + // TODO: rename - this is the lock screen icon + ReadStringValue(&app_info_logo_, kDefaultAppInfoLogoName, + kAppInfoSection, + kAppIconStorageKey); + + app_info_logo_ = app_storage_folder_ + "/" + app_info_logo_; + + LOG_UPDATED_VALUE(app_info_logo_, kAppIconStorageKey, + kAppInfoSection); + // Server address ReadStringValue(&server_address_, kDefaultServerAddress, kHmiSection, kServerAddressKey); |