* Copyright (c) 2024 Huawei Device Co., Ltd.
* 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.
*/
#ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_PROXY_H
#define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_PROXY_H
#include <string>
#include <vector>
#include "iremote_broker.h"
#include "iremote_object.h"
#include "iremote_proxy.h"
namespace OHOS {
namespace AppExecFwk {
enum class GetBundleInfoFlag {
GET_BUNDLE_INFO_DEFAULT = 0x00000000,
GET_BUNDLE_INFO_WITH_APPLICATION = 0x00000001,
GET_BUNDLE_INFO_WITH_HAP_MODULE = 0x00000002,
GET_BUNDLE_INFO_WITH_ABILITY = 0x00000004,
GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY = 0x00000008,
GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION = 0x00000010,
GET_BUNDLE_INFO_WITH_METADATA = 0x00000020,
GET_BUNDLE_INFO_WITH_DISABLE = 0x00000040,
GET_BUNDLE_INFO_WITH_SIGNATURE_INFO = 0x00000080,
GET_BUNDLE_INFO_WITH_MENU = 0x00000100,
GET_BUNDLE_INFO_WITH_ROUTER_MAP = 0x00000200,
GET_BUNDLE_INFO_WITH_SKILL = 0x00000800,
GET_BUNDLE_INFO_ONLY_WITH_LAUNCHER_ABILITY = 0x00001000,
};
struct BundleInfo {
uint32_t targetVersion = 0;
};
class IBundleMgr : public IRemoteBroker {
public:
DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.BundleMgr");
virtual ErrCode GetBundleInfoForSelf(int32_t flags, BundleInfo& bundleInfo)
{
return 0;
}
};
class BundleMgrProxy : public IRemoteProxy<IBundleMgr> {
public:
explicit BundleMgrProxy(const sptr<IRemoteObject>& impl);
virtual ~BundleMgrProxy() override;
virtual ErrCode GetBundleInfoForSelf(int32_t flags, BundleInfo& bundleInfo) override;
};
}
}
#endif