2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_NSFramework
19 /// \brief Framework wrapper over the service directory interface APIs
23 ///////////////////////////////////////////////////////////////////////////////
25 #include <native_service/frameworkunified_framework_if.h>
26 #include <native_service/frameworkunified_framework_types.h>
27 #include <native_service/frameworkunified_service_protocol.h>
28 #include <native_service/ns_logger_if.h>
29 #include "frameworkunified_framework_core.h"
30 #include "frameworkunified_framework_internal.h"
32 /// This is a library method in System Services....
33 /// Note: Special care has been taken so that Native Services
34 /// binaries don't have any circular dependence on System services.
35 extern EFrameworkunifiedStatus SendSystemErrorToSystemManager(EFrameworkunifiedSystemError eSystemError) __attribute__((weak));
38 EFrameworkunifiedStatus FrameworkunifiedAttachSystemCallbacksDispatcher(HANDLE hApp) {
39 FRAMEWORKUNIFIEDLOG0(ZONE_NS_INFO, __FUNCTION__, "+"); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h"
41 EFrameworkunifiedStatus eStatus = FrameworkunifiedSSFrameworkInterfaceInternal(hApp);
43 FRAMEWORKUNIFIEDLOG0(ZONE_NS_INFO, __FUNCTION__, "-"); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h"
48 ///////////////////////////////////////////////////////////////////////////////////////////
49 /// FrameworkunifiedSendSystemErrMessage
50 /// Sends a request to system manager for hard reset using function SendHardResetRequestToSystemManager
51 /// which is defined in SystemServices library.
54 /// HANDLE - Application handle
56 /// \param [in] eResetReason
57 /// EFrameworkunifiedSystemError - Error Type
59 /// \return EFrameworkunifiedStatus
60 /// EFrameworkunifiedStatus - Returns status of operation
62 ///////////////////////////////////////////////////////////////////////////////////////////
63 // LCOV_EXCL_START 200: System Error can't be tested for UT.
64 EFrameworkunifiedStatus FrameworkunifiedSendSystemErrMessage(HANDLE hApp, EFrameworkunifiedSystemError eSystemError) {
65 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
66 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusFail;
67 FRAMEWORKUNIFIEDLOG(ZONE_NS_INFO, __FUNCTION__, "+");
69 if (SendSystemErrorToSystemManager) {
70 l_eStatus = SendSystemErrorToSystemManager(eSystemError);
73 FRAMEWORKUNIFIEDLOG(ZONE_NS_INFO, __FUNCTION__, "-");