1 /** 2 * Copyright (c) 2022, The Android Open Source Project 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 #pragma once 18 19 #include "WatchdogInternalHandler.h" 20 21 #include <android-base/result.h> 22 #include <gmock/gmock.h> 23 #include <utils/String16.h> 24 #include <utils/Vector.h> 25 26 namespace android { 27 namespace automotive { 28 namespace watchdog { 29 30 class MockWatchdogInternalHandler : public WatchdogInternalHandlerInterface { 31 public: 32 MOCK_METHOD(android::base::Result<void>, init, (), (override)); 33 MOCK_METHOD(binder_status_t, dump, (int, const char**, uint32_t), (override)); 34 MOCK_METHOD( 35 ndk::ScopedAStatus, registerCarWatchdogService, 36 (const std::shared_ptr< 37 aidl::android::automotive::watchdog::internal::ICarWatchdogServiceForSystem>&), 38 (override)); 39 MOCK_METHOD( 40 ndk::ScopedAStatus, unregisterCarWatchdogService, 41 (const std::shared_ptr< 42 aidl::android::automotive::watchdog::internal::ICarWatchdogServiceForSystem>&), 43 (override)); 44 MOCK_METHOD(ndk::ScopedAStatus, registerMonitor, 45 (const std::shared_ptr< 46 aidl::android::automotive::watchdog::internal::ICarWatchdogMonitor>&), 47 (override)); 48 MOCK_METHOD(ndk::ScopedAStatus, unregisterMonitor, 49 (const std::shared_ptr< 50 aidl::android::automotive::watchdog::internal::ICarWatchdogMonitor>&), 51 (override)); 52 MOCK_METHOD( 53 ndk::ScopedAStatus, tellCarWatchdogServiceAlive, 54 (const std::shared_ptr< 55 aidl::android::automotive::watchdog::internal::ICarWatchdogServiceForSystem>&, 56 const std::vector<aidl::android::automotive::watchdog::internal::ProcessIdentifier>&, 57 int32_t), 58 (override)); 59 MOCK_METHOD( 60 ndk::ScopedAStatus, tellDumpFinished, 61 (const std::shared_ptr< 62 aidl::android::automotive::watchdog::internal::ICarWatchdogMonitor>&, 63 const std::vector<aidl::android::automotive::watchdog::internal::ProcessIdentifier>&), 64 (override)); 65 MOCK_METHOD(ndk::ScopedAStatus, notifySystemStateChange, 66 (aidl::android::automotive::watchdog::internal::StateType, int32_t, int32_t), 67 (override)); 68 MOCK_METHOD( 69 ndk::ScopedAStatus, updateResourceOveruseConfigurations, 70 (const std::vector< 71 aidl::android::automotive::watchdog::internal::ResourceOveruseConfiguration>&), 72 (override)); 73 MOCK_METHOD( 74 ndk::ScopedAStatus, getResourceOveruseConfigurations, 75 (std::vector< 76 aidl::android::automotive::watchdog::internal::ResourceOveruseConfiguration>*), 77 (override)); 78 MOCK_METHOD(ndk::ScopedAStatus, controlProcessHealthCheck, (bool), (override)); 79 MOCK_METHOD(ndk::ScopedAStatus, setThreadPriority, (int, int, int, int, int), (override)); 80 MOCK_METHOD(ndk::ScopedAStatus, getThreadPriority, 81 (int, int, int, 82 aidl::android::automotive::watchdog::internal::ThreadPolicyWithPriority*), 83 (override)); 84 MOCK_METHOD(ndk::ScopedAStatus, onAidlVhalPidFetched, (int32_t), (override)); 85 MOCK_METHOD(ndk::ScopedAStatus, onTodayIoUsageStatsFetched, 86 (const std::vector< 87 aidl::android::automotive::watchdog::internal::UserPackageIoUsageStats>&), 88 (override)); 89 MOCK_METHOD(void, terminate, (), (override)); 90 }; 91 92 } // namespace watchdog 93 } // namespace automotive 94 } // namespace android 95