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 MOCK_FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_MINI_PROXY_H 17 #define MOCK_FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_MINI_PROXY_H 18 19 #include <string> 20 #include <iostream> 21 22 #include "bundle_mgr_interface.h" 23 #include "iremote_proxy.h" 24 25 namespace OHOS { 26 const int BUNDLE_MGR_SERVICE_SYS_ABILITY_ID = 401; 27 namespace AppExecFwk { 28 29 class BundleMgrMiniProxy : public IRemoteProxy<IBundleMgr> { 30 public: BundleMgrMiniProxy(const sptr<IRemoteObject> & impl)31 explicit BundleMgrMiniProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IBundleMgr>(impl) {} ~BundleMgrMiniProxy()32 virtual ~BundleMgrMiniProxy() override {} 33 GetNameForUid(const int uid,std::string & name)34 ErrCode GetNameForUid(const int uid, std::string &name) override 35 { 36 return 0; 37 } 38 GetAppIdByBundleName(const std::string & bundleName,const int userId)39 std::string GetAppIdByBundleName(const std::string &bundleName, const int userId) override 40 { 41 return ""; 42 } 43 GetUidByBundleName(const std::string & bundleName,const int userId)44 int GetUidByBundleName(const std::string &bundleName, const int userId) override 45 { 46 return 0; 47 } 48 GetUidByBundleName(const std::string & bundleName,const int32_t userId,int32_t appIndex)49 int32_t GetUidByBundleName(const std::string &bundleName, const int32_t userId, int32_t appIndex) override 50 { 51 return 0; 52 } 53 private: 54 static inline BrokerDelegator<BundleMgrMiniProxy> delegator_; 55 }; 56 57 } // namespace AppExecFwk 58 } // namespace OHOS 59 #endif // MOCK_FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_MINI_PROXY_H 60