1 /* 2 * Copyright (c) 2024 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 VSYNC_SYSTEM_ABILITY_LISTENER_H 17 #define VSYNC_SYSTEM_ABILITY_LISTENER_H 18 19 #include "system_ability_status_change_stub.h" 20 21 namespace OHOS { 22 namespace Rosen { 23 class VSyncSystemAbilityListener : public SystemAbilityStatusChangeStub { 24 public: VSyncSystemAbilityListener(const std::string & threadName,const std::string & uid,const std::string & pid,const std::string & tid)25 VSyncSystemAbilityListener(const std::string& threadName, const std::string& uid, const std::string& pid, 26 const std::string& tid) : threadName_(threadName), uid_(uid), pid_(pid), tid_(tid) {} 27 virtual ~VSyncSystemAbilityListener() = default; 28 virtual void OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override; 29 virtual void OnRemoveSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override; 30 31 private: 32 std::string threadName_; 33 std::string uid_; 34 std::string pid_; 35 std::string tid_; 36 }; 37 } // namespace Rosen 38 } // namespace OHOS 39 #endif