common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / NS_FrameworkCore / src / frameworkunified_framework_system.cpp
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_NSFramework
19 /// \brief    Framework wrapper over the service directory interface APIs
20 ///
21 ///
22 ///
23 ///////////////////////////////////////////////////////////////////////////////
24
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"
31
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));
36
37
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"
40
41   EFrameworkunifiedStatus eStatus = FrameworkunifiedSSFrameworkInterfaceInternal(hApp);
42
43   FRAMEWORKUNIFIEDLOG0(ZONE_NS_INFO, __FUNCTION__, "-");  // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h"
44
45   return eStatus;
46 }
47
48 ///////////////////////////////////////////////////////////////////////////////////////////
49 /// FrameworkunifiedSendSystemErrMessage
50 /// Sends a request to system manager for hard reset using function SendHardResetRequestToSystemManager
51 /// which is defined in SystemServices library.
52 ///
53 /// \param [in] hApp
54 ///     HANDLE - Application handle
55 ///
56 /// \param [in] eResetReason
57 ///     EFrameworkunifiedSystemError - Error Type
58 ///
59 /// \return EFrameworkunifiedStatus
60 ///         EFrameworkunifiedStatus - Returns status of operation
61 ///
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__, "+");
68
69   if (SendSystemErrorToSystemManager) {
70     l_eStatus = SendSystemErrorToSystemManager(eSystemError);
71   }
72
73   FRAMEWORKUNIFIEDLOG(ZONE_NS_INFO, __FUNCTION__, "-");
74   return l_eStatus;
75 }
76 // LCOV_EXCL_STOP
77