/* * Copyright (c) 2023 Fancy Code. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "AppMonitorMock.h" #include "IAppManager.h" #include "ILog.h" #include "StatusCode.h" #include #include StatusCode AppMonitorTest::GetProductInfo(AppGetProductInfo ¶m) { LogInfo("AppMonitorTest::GetProductInfo\n"); StatusCode code = GetProductInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetProductInfo(param); } return code; } StatusCode AppMonitorTrace::GetProductInfoTrace(AppGetProductInfo ¶m) { LogInfo("AppMonitorTrace::GetProductInfoTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetDeviceAttr(AppGetDeviceAttr ¶m) { LogInfo("AppMonitorTest::GetDeviceAttr\n"); StatusCode code = GetDeviceAttrTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetDeviceAttr(param); } return code; } StatusCode AppMonitorTrace::GetDeviceAttrTrace(AppGetDeviceAttr ¶m) { LogInfo("AppMonitorTrace::GetDeviceAttrTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetMediaInfo(AppGetMediaInfo ¶m) { LogInfo("AppMonitorTest::GetMediaInfo\n"); StatusCode code = GetMediaInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetMediaInfo(param); } return code; } StatusCode AppMonitorTrace::GetMediaInfoTrace(AppGetMediaInfo ¶m) { LogInfo("AppMonitorTrace::GetMediaInfoTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetSdCardInfo(AppGetSdCardInfo ¶m) { LogInfo("AppMonitorTest::GetSdCardInfo\n"); StatusCode code = GetSdCardInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetSdCardInfo(param); } return code; } StatusCode AppMonitorTrace::GetSdCardInfoTrace(AppGetSdCardInfo ¶m) { LogInfo("AppMonitorTrace::GetSdCardInfoTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetBatteryInfo(AppGetBatteryInfo ¶m) { LogInfo("AppMonitorTest::GetBatteryInfo\n"); StatusCode code = GetBatteryInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetBatteryInfo(param); } return code; } StatusCode AppMonitorTrace::GetBatteryInfoTrace(AppGetBatteryInfo ¶m) { LogInfo("AppMonitorTrace::GetBatteryInfoTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetParamValue(AppParamValue ¶m) { LogInfo("AppMonitorTest::GetParamValue\n"); StatusCode code = GetParamValueTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetParamValue(param); } return code; } StatusCode AppMonitorTrace::GetParamValueTrace(AppParamValue ¶m) { LogInfo("AppMonitorTrace::GetParamValueTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetCapability(AppGetCapability ¶m) { LogInfo("AppMonitorTest::GetCapability\n"); StatusCode code = GetCapabilityTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetCapability(param); } return code; } StatusCode AppMonitorTrace::GetCapabilityTrace(AppGetCapability ¶m) { LogInfo("AppMonitorTrace::GetCapabilityTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetLockVideoStatus(LockVideoStatus ¶m) { LogInfo("AppMonitorTest::GetLockVideoStatus\n"); StatusCode code = GetLockVideoStatusTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetLockVideoStatus(param); } return code; } StatusCode AppMonitorTrace::GetLockVideoStatusTrace(LockVideoStatus ¶m) { LogInfo("AppMonitorTrace::GetLockVideoStatusTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetStorageInfo(std::vector ¶m) { LogInfo("AppMonitorTest::GetStorageInfo\n"); StatusCode code = GetStorageInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetStorageInfo(param); } return code; } StatusCode AppMonitorTrace::GetStorageInfoTrace(std::vector ¶m) { LogInfo("AppMonitorTrace::GetStorageInfoTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetStorageFileList(const AppGetFileInfo &fileInfo, std::vector ¶m) { LogInfo("AppMonitorTest::GetStorageFileList\n"); StatusCode code = GetStorageFileListTrace(fileInfo, param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetStorageFileList(fileInfo, param); } return code; } StatusCode AppMonitorTrace::GetStorageFileListTrace(const AppGetFileInfo &fileInfo, std::vector ¶m) { LogInfo("AppMonitorTrace::GetStorageFileListTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::SetDateTime(const AppSetDateTime ¶m) { LogInfo("AppMonitorTest::SetDateTime\n"); LogInfo("mYear = %u\n", param.mYear); LogInfo("mMonth = %02u\n", param.mMonth); LogInfo("mDay = %02u\n", param.mDay); LogInfo("mHour = %02u\n", param.mHour); LogInfo("mMinute = %02u\n", param.mMinute); LogInfo("mSecond = %02u\n", param.mSecond); StatusCode code = SetDateTimeTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::SetDateTime(param); } return code; } StatusCode AppMonitorTrace::SetDateTimeTrace(const AppSetDateTime ¶m) { LogInfo("AppMonitorTrace::SetDateTimeTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::SetTimeZone(const unsigned int &zone) { LogInfo("AppMonitorTest::SetTimeZone = %u\n", zone); StatusCode code = SetTimeZoneTrace(zone); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::SetTimeZone(zone); } return code; } StatusCode AppMonitorTrace::SetTimeZoneTrace(const unsigned int &zone) { LogInfo("AppMonitorTrace::SetTimeZoneTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::SetParamValue(const AppSetParamValue ¶m) { LogInfo("AppMonitorTest::SetParamValue\n"); StatusCode code = SetParamValueTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::SetParamValue(param); } return code; } StatusCode AppMonitorTrace::SetParamValueTrace(const AppSetParamValue ¶m) { LogInfo("AppMonitorTrace::SetParamValueTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::EnterRecorder(void) { LogInfo("AppMonitorTest::EnterRecorder\n"); StatusCode code = EnterRecorderTrace(); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::EnterRecorder(); } return code; } StatusCode AppMonitorTrace::EnterRecorderTrace(void) { LogInfo("AppMonitorTrace::EnterRecorderTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::AppPlayback(const PlayBackEvent &event) { LogInfo("AppMonitorTest::AppPlayback\n"); StatusCode code = AppPlaybackTrace(event); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::AppPlayback(event); } return code; } StatusCode AppMonitorTrace::AppPlaybackTrace(const PlayBackEvent &event) { LogInfo("AppMonitorTrace::AppPlaybackTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::UploadFile(AppUploadFile ¶m) { LogInfo("AppMonitorTest::UploadFile\n"); StatusCode code = UploadFileTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::UploadFile(param); } return code; } StatusCode AppMonitorTrace::UploadFileTrace(AppUploadFile ¶m) { LogInfo("AppMonitorTrace::UploadFileTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::GetThumbnail(AppGetThumbnail ¶m) { LogInfo("AppMonitorTest::GetThumbnail\n"); StatusCode code = GetThumbnailTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::GetThumbnail(param); } return code; } StatusCode AppMonitorTrace::GetThumbnailTrace(AppGetThumbnail ¶m) { LogInfo("AppMonitorTrace::UploadFileTrace\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); } StatusCode AppMonitorTest::AppClientConnected(std::shared_ptr &client) { LogInfo("AppMonitorTest::AppClientConnected\n"); StatusCode code = AppClientConnectedTrace(client); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return VAppMonitor::AppClientConnected(client); } return code; } StatusCode AppMonitorTrace::AppClientConnectedTrace(std::shared_ptr &client) { LogInfo("AppMonitorTrace::AppClientConnected\n"); return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); }