Skip to content

Commit 7f7fcbb

Browse files
authored
Merge pull request smartdevicelink#2133 from smartdevicelink/release/4.5.1
Release/4.5.1
2 parents 61fd83f + 11ffe20 commit 7f7fcbb

32 files changed

+290
-45
lines changed

src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <stdlib.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719
#include <log4cxx/logstring.h>
1820
#include <log4cxx/helpers/charsetdecoder.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719
#include <log4cxx/logstring.h>
1820
#include <log4cxx/helpers/charsetencoder.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <string.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <log4cxx/spi/location/locationinfo.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <log4cxx/logstring.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <log4cxx/spi/loggingevent.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <log4cxx/helpers/serversocket.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719
#if defined(_MSC_VER)
1820
#pragma warning ( disable: 4231 4251 4275 4786 )

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <string.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#include <log4cxx/logstring.h>

src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#ifndef _LOG4CXX_LOGGER_H

src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#ifndef _LOG4CXX_SPI_LOCATION_LOCATIONINFO_H

src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
16+
*
17+
* Note: This file has been modified from its original form.
1618
*/
1719

1820
#ifndef _LOG4CXX_SPI_LOGGING_EVENT_H

src/components/application_manager/include/application_manager/application_manager_impl.h

+25
Original file line numberDiff line numberDiff line change
@@ -478,18 +478,35 @@ class ApplicationManagerImpl
478478
uint32_t GetNextHMICorrelationID() OVERRIDE;
479479

480480
/* @brief Starts audio passthru process
481+
* @deprecated Use BeginAudioPassThru(uint32_t app_id) instead
481482
*
482483
* @return true on success, false if passthru is already in process
483484
*/
484485
bool BeginAudioPassThrough() OVERRIDE;
485486

487+
/**
488+
* @brief Starts AudioPassThru process by given application
489+
* @param app_id ID of the application which starts the process
490+
* @return true if AudioPassThru can be started, false otherwise
491+
*/
492+
bool BeginAudioPassThru(uint32_t app_id) OVERRIDE;
493+
486494
/*
487495
* @brief Finishes already started audio passthru process
496+
* @deprecated Use EndAudioPassThru(uint32_t app_id) instead
488497
*
489498
* @return true on success, false if passthru is not active
490499
*/
491500
bool EndAudioPassThrough() OVERRIDE;
492501

502+
/**
503+
* @brief Finishes already started AudioPassThru process by given application
504+
* @param app_id ID of the application which started the process
505+
* @return true if AudioPassThru process has been started with given
506+
* application and thus it can be stopped, false otherwise
507+
*/
508+
bool EndAudioPassThru(uint32_t app_id) OVERRIDE;
509+
493510
/*
494511
* @brief Retrieves driver distraction state
495512
*
@@ -1702,6 +1719,7 @@ class ApplicationManagerImpl
17021719
std::map<uint32_t, TimevalStruct> tts_global_properties_app_list_;
17031720

17041721
bool audio_pass_thru_active_;
1722+
uint32_t audio_pass_thru_app_id_;
17051723
sync_primitives::Lock audio_pass_thru_lock_;
17061724
sync_primitives::Lock tts_global_properties_app_list_lock_;
17071725
hmi_apis::Common_DriverDistractionState::eType driver_distraction_state_;
@@ -1820,6 +1838,13 @@ class ApplicationManagerImpl
18201838
*/
18211839
void AddMockApplication(ApplicationSharedPtr mock_app);
18221840

1841+
/**
1842+
* @brief set a mock media manager without running Init(). Only for unit
1843+
* testing.
1844+
* @param mock_app the mock app to be registered
1845+
*/
1846+
void SetMockMediaManager(media_manager::MediaManager* mock_media_manager);
1847+
18231848
private:
18241849
#endif
18251850

src/components/application_manager/src/application_manager_impl.cc

+29-2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
143143
: settings_(am_settings)
144144
, applications_list_lock_(true)
145145
, audio_pass_thru_active_(false)
146+
, audio_pass_thru_app_id_(0)
146147
, driver_distraction_state_(
147148
hmi_apis::Common_DriverDistractionState::INVALID_ENUM)
148149
, is_vr_session_strated_(false)
@@ -784,6 +785,17 @@ bool ApplicationManagerImpl::BeginAudioPassThrough() {
784785
}
785786
}
786787

788+
bool ApplicationManagerImpl::BeginAudioPassThru(uint32_t app_id) {
789+
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
790+
if (audio_pass_thru_active_) {
791+
return false;
792+
} else {
793+
audio_pass_thru_active_ = true;
794+
audio_pass_thru_app_id_ = app_id;
795+
return true;
796+
}
797+
}
798+
787799
bool ApplicationManagerImpl::EndAudioPassThrough() {
788800
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
789801
if (audio_pass_thru_active_) {
@@ -794,6 +806,17 @@ bool ApplicationManagerImpl::EndAudioPassThrough() {
794806
}
795807
}
796808

809+
bool ApplicationManagerImpl::EndAudioPassThru(uint32_t app_id) {
810+
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
811+
if (audio_pass_thru_active_ && audio_pass_thru_app_id_ == app_id) {
812+
audio_pass_thru_active_ = false;
813+
audio_pass_thru_app_id_ = 0;
814+
return true;
815+
} else {
816+
return false;
817+
}
818+
}
819+
797820
hmi_apis::Common_DriverDistractionState::eType
798821
ApplicationManagerImpl::driver_distraction_state() const {
799822
return driver_distraction_state_;
@@ -3222,9 +3245,8 @@ void ApplicationManagerImpl::UnregisterApplication(
32223245

32233246
commands_holder_->Clear(app_to_remove);
32243247

3225-
if (audio_pass_thru_active_) {
3248+
if (EndAudioPassThru(app_id)) {
32263249
// May be better to put this code in MessageHelper?
3227-
EndAudioPassThrough();
32283250
StopAudioPassThru(app_id);
32293251
MessageHelper::SendStopAudioPathThru(*this);
32303252
}
@@ -4441,6 +4463,11 @@ void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) {
44414463
apps_size_ = applications_.size();
44424464
applications_list_lock_.Release();
44434465
}
4466+
4467+
void ApplicationManagerImpl::SetMockMediaManager(
4468+
media_manager::MediaManager* mock_media_manager) {
4469+
media_manager_ = mock_media_manager;
4470+
}
44444471
#endif // BUILD_TESTS
44454472
#ifdef SDL_REMOTE_CONTROL
44464473
struct MobileAppIdPredicate {

src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
6666
const bool result = PrepareResultForMobileResponse(
6767
result_code, HmiInterfaces::HMI_INTERFACE_UI);
6868
if (result) {
69-
bool ended_successfully = application_manager_.EndAudioPassThrough();
69+
uint32_t app_id = connection_key();
70+
bool ended_successfully = application_manager_.EndAudioPassThru(app_id);
7071
if (ended_successfully) {
71-
application_manager_.StopAudioPassThru(connection_key());
72+
application_manager_.StopAudioPassThru(app_id);
7273
}
7374
}
7475

src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ void PerformAudioPassThruRequest::SendRecordStartNotification() {
311311
void PerformAudioPassThruRequest::StartMicrophoneRecording() {
312312
LOG4CXX_AUTO_TRACE(logger_);
313313

314-
application_manager_.BeginAudioPassThrough();
314+
uint32_t app_id = connection_key();
315+
application_manager_.BeginAudioPassThru(app_id);
315316

316317
application_manager_.StartAudioPassThruThread(
317318
connection_key(),
@@ -370,9 +371,10 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() {
370371

371372
void PerformAudioPassThruRequest::FinishTTSSpeak() {
372373
LOG4CXX_AUTO_TRACE(logger_);
373-
if (application_manager_.EndAudioPassThrough()) {
374+
uint32_t app_id = connection_key();
375+
if (application_manager_.EndAudioPassThru(app_id)) {
374376
LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
375-
application_manager_.StopAudioPassThru(connection_key());
377+
application_manager_.StopAudioPassThru(app_id);
376378
}
377379
if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) {
378380
LOG4CXX_WARN(logger_, "TTS Speak is inactive.");

src/components/application_manager/src/policies/policy_handler.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1091,8 +1091,7 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
10911091
MessageHelper::CreateGetVehicleDataRequest(
10921092
correlation_id, vehicle_data_args, application_manager_);
10931093
} else {
1094-
LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one.");
1095-
policy_manager_->ForcePTExchange();
1094+
LOG4CXX_WARN(logger_, "Exchange wasn't successful");
10961095
}
10971096
OnPTUFinished(ret);
10981097
return ret;

0 commit comments

Comments
 (0)