1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FRAMEWORKS_VSYNC_INCLUDE_STATIC_CALL_H 17 #define FRAMEWORKS_VSYNC_INCLUDE_STATIC_CALL_H 18 19 #include <iservice_registry.h> 20 21 #include "vsync_helper_impl.h" 22 23 namespace OHOS { 24 namespace Vsync { 25 class StaticCall : public RefBase { 26 public: 27 static sptr<StaticCall> GetInstance(); 28 static void SetInstance(sptr<StaticCall>& mockInstance); 29 30 virtual sptr<ISystemAbilityManager> GetSystemAbilityManager(); 31 virtual sptr<IRemoteObject> GetSystemAbility(sptr<ISystemAbilityManager>& sm, int32_t systemAbilityId); 32 virtual sptr<IVsyncManager> GetCast(sptr<IRemoteObject>& remoteObject); 33 virtual GSError GetVsyncFrequency(sptr<IVsyncManager>& server, uint32_t &freq); 34 virtual GSError ListenVsync(sptr<IVsyncManager>& server, sptr<IVsyncCallback>& cb, int32_t &cbid); 35 virtual std::shared_ptr<AppExecFwk::EventHandler> Current(); 36 virtual void Sync(int64_t, void *data); 37 private: 38 StaticCall() = default; 39 virtual ~StaticCall() = default; 40 static inline sptr<StaticCall> instance = nullptr; 41 }; 42 } // namespace Vsync 43 } // namespace OHOS 44 45 #endif // FRAMEWORKS_WM_INCLUDE_STATIC_CALL_H 46