同步代码到interface_sdk_c仓

Signed-off-by: huangdongting <huangdongting3@huawei.com>
This commit is contained in:
huangdongting
2023-08-03 20:31:01 +08:00
parent 8d73a1802a
commit 5733835c23
446 changed files with 146243 additions and 0 deletions
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2022 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_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_BUNDLE_MGR_PROXY_NATIVE_H
#define FOUNDATION_APPEXECFWK_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_BUNDLE_MGR_PROXY_NATIVE_H
#include <string>
#include "application_info.h"
#include "bundle_info.h"
#include "iremote_broker.h"
#include "iremote_object.h"
namespace OHOS {
namespace AppExecFwk {
class BundleMgrProxyNative {
public:
BundleMgrProxyNative() = default;
virtual ~BundleMgrProxyNative() = default;
/**
* @brief Obtains the BundleInfo based on calling uid.
* @param bundleName Indicates the application bundle name to be queried.
* @param flags Indicates the information contained in the BundleInfo object to be returned.
* @param bundleInfo Indicates the obtained BundleInfo object.
* @param userId Indicates the user ID.
* @return Returns true if the BundleInfo is successfully obtained; returns false otherwise.
*/
bool GetBundleInfoForSelf(int32_t flags, BundleInfo &bundleInfo);
enum {
GET_BUNDLE_INFO_FOR_SELF_NATIVE = 98
};
private:
sptr<IRemoteObject> GetBmsProxy();
template <typename T>
bool GetParcelableInfo(uint32_t code, MessageParcel &data, T &parcelableInfo);
bool SendTransactCmd(uint32_t code, MessageParcel &data, MessageParcel &reply);
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // FOUNDATION_APPEXECFWK_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_BUNDLE_MGR_PROXY_NATIVE_H
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2022 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.
*/
/**
* @addtogroup Native_Bundle
* @{
*
* @brief Describes the Native Bundle.
*
* @since 9
* @version 1.0
*/
/**
* @file native_interface_bundle.h
*
* @brief Declares the <b>Bundle</b>-specific function, including function for obtaining application info.
*
* @since 9
* @version 1.0
*/
#ifndef FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H
#define FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H
#ifdef __cplusplus
extern "C" {
#endif
struct OH_NativeBundle_ApplicationInfo {
char* bundleName;
char* fingerprint;
};
/**
* @brief Obtains the application info based on the The current bundle.
*
* @return Returns the application info.
* @since 9
* @version 1.0
*/
OH_NativeBundle_ApplicationInfo OH_NativeBundle_GetCurrentApplicationInfo();
#ifdef __cplusplus
};
#endif
#endif // FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H