mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
change the position
Signed-off-by: zhangzezhong <zhangzezhong8@huawei-partners.com>
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
namespace OHOS {
|
||||
namespace AbilityRuntime {
|
||||
|
||||
constexpr double DPI_BASE = 160.0; // convert density to the base of dpi
|
||||
constexpr double DPI_BASE = 160.0;
|
||||
|
||||
Global::Resource::ColorMode ConvertColorMode(const std::string &colormode);
|
||||
Global::Resource::Direction ConvertDirection(const std::string &direction);
|
||||
|
||||
@@ -1584,6 +1584,12 @@ public:
|
||||
*/
|
||||
ErrCode UnregisterIAbilityManagerCollaborator(int32_t type);
|
||||
|
||||
/**
|
||||
* @brief get ability manager collaborator.
|
||||
* @return Returns object pointer on success, others on null.
|
||||
*/
|
||||
sptr<IAbilityManagerCollaborator> GetAbilityManagerCollaborator();
|
||||
|
||||
/**
|
||||
* @brief Register session handler.
|
||||
* @param object The handler.
|
||||
@@ -1606,12 +1612,6 @@ public:
|
||||
*/
|
||||
ErrCode UnregisterAppDebugListener(sptr<AppExecFwk::IAppDebugListener> listener);
|
||||
|
||||
/**
|
||||
* @brief get ability manager collaborator.
|
||||
* @return Returns object pointer on success, others on null.
|
||||
*/
|
||||
sptr<IAbilityManagerCollaborator> GetAbilityManagerCollaborator();
|
||||
|
||||
/**
|
||||
* @brief Attach app debug.
|
||||
* @param bundleName The application bundle name.
|
||||
|
||||
@@ -2365,18 +2365,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* StartAbilityWithWait, send want and abilityStartWithWaitObserver to abms.
|
||||
*
|
||||
* @param want Ability want.
|
||||
* @param observer ability foreground notify observer for aa tool.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t StartAbilityWithWait(Want &want, sptr<IAbilityStartWithWaitObserver> &observer)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all insight intent infos.
|
||||
* @param flag, the get type.
|
||||
@@ -2427,11 +2415,44 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* StartAbilityWithWait, send want and abilityStartWithWaitObserver to abms.
|
||||
*
|
||||
* @param want Ability want.
|
||||
* @param observer ability foreground notify observer for aa tool.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t StartAbilityWithWait(Want &want, sptr<IAbilityStartWithWaitObserver> &observer)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set keep-alive flag for app service extension under u1 user.
|
||||
* @param bundleName Bundle name.
|
||||
* @param flag Keep-alive flag.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t SetAppServiceExtensionKeepAlive(const std::string &bundleName, bool flag)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int32_t UpdateKioskApplicationList(const std::vector<std::string> &appList)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get keep-alive app service extensions.
|
||||
* @param list List of Keep-alive information.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t QueryKeepAliveAppServiceExtensions(std::vector<KeepAliveInfo> &list)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int32_t EnterKioskMode(sptr<IRemoteObject> callerToken)
|
||||
{
|
||||
return 0;
|
||||
@@ -2457,27 +2478,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set keep-alive flag for app service extension under u1 user.
|
||||
* @param bundleName Bundle name.
|
||||
* @param flag Keep-alive flag.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t SetAppServiceExtensionKeepAlive(const std::string &bundleName, bool flag)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get keep-alive app service extensions.
|
||||
* @param list List of Keep-alive information.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t QueryKeepAliveAppServiceExtensions(std::vector<KeepAliveInfo> &list)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int32_t SetOnNewWantSkipScenarios(sptr<IRemoteObject> callerToken, int32_t scenarios)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -244,10 +244,10 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Notify collaborator grant uri permission started.
|
||||
* @brief Notify collaborator start grantUriPermission.
|
||||
* @param uris The uri list to grant permission.
|
||||
* @param flag Want::FLAG_AUTH_READ_URI_PERMISSION or Want::FLAG_AUTH_WRITE_URI_PERMISSION.
|
||||
* @param userId The user id of target application.
|
||||
* @param userId the user id of target application.
|
||||
* @return 0 when on success or else failed.
|
||||
*/
|
||||
virtual int32_t NotifyGrantUriPermissionStart(const std::vector<std::string> &uris, uint32_t flag, int32_t userId)
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Notify collaborator grant uri Permission finished.
|
||||
* @brief Notify collaborator start grantUriPermission.
|
||||
* @param uris The uri list to grant permission.
|
||||
* @param flag Want::FLAG_AUTH_READ_URI_PERMISSION or Want::FLAG_AUTH_WRITE_URI_PERMISSION.
|
||||
* @param userId The user id of target application.
|
||||
|
||||
@@ -111,7 +111,6 @@ public:
|
||||
*
|
||||
* @param userId, the user id.
|
||||
* @param isNeedSendAppSpawnMsg, true send appSpawn message otherwise not send.
|
||||
* @param callback, callback function for logout user.
|
||||
* @return
|
||||
*/
|
||||
virtual void KillProcessesByUserId(int32_t userId, bool isNeedSendAppSpawnMsg = false,
|
||||
|
||||
@@ -890,8 +890,8 @@ public:
|
||||
bool IsMemorySizeSufficient() const;
|
||||
|
||||
/**
|
||||
* whether or not requier a big memory
|
||||
* @return Returens true is no big memory, others return false.
|
||||
* whether or not require a big memory
|
||||
* @return Return true if no big memory required, otherwise return false.
|
||||
*/
|
||||
bool IsNoRequireBigMemory() const;
|
||||
|
||||
|
||||
@@ -1939,7 +1939,7 @@ int32_t AppMgrStub::HandleCheckCallingIsUserTestMode(MessageParcel &data, Messag
|
||||
#ifdef SUPPORT_CHILD_PROCESS
|
||||
int32_t AppMgrStub::HandleCreateNativeChildProcess(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::APPMGR, "called");
|
||||
TAG_LOGD(AAFwkTag::APPMGR, "Called");
|
||||
std::string libName = data.ReadString();
|
||||
sptr<IRemoteObject> callback = data.ReadRemoteObject();
|
||||
std::unique_ptr<ChildProcessRequest> request(data.ReadParcelable<ChildProcessRequest>());
|
||||
|
||||
@@ -56,10 +56,9 @@ public:
|
||||
|
||||
/**
|
||||
* @brief Connect the Extension. and Calling information back to Extension.
|
||||
*
|
||||
* @param want The Want object to connect to.
|
||||
* @param targetState The terget state.
|
||||
* @param sessionInfo Indicates the sessionInfo.
|
||||
* @param sessionInfo Indicates the sessionInfo.
|
||||
*
|
||||
*/
|
||||
virtual void HandleExtensionTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2026 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
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2026 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
|
||||
|
||||
@@ -1289,15 +1289,15 @@ int AbilityManagerProxy::CloseUIAbilityBySCB(const sptr<SessionInfo> &sessionInf
|
||||
return INNER_ERR;
|
||||
}
|
||||
}
|
||||
if (!data.WriteBool(isUserRequestedExit)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "isUserRequestedExit write fail");
|
||||
return ERR_IPC_PROXY_WRITE_FAILED;
|
||||
}
|
||||
if (!data.WriteUint32(sceneFlag)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "sceneFlag write fail");
|
||||
return INNER_ERR;
|
||||
}
|
||||
|
||||
if (!data.WriteBool(isUserRequestedExit)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "isUserRequestedExit write fail");
|
||||
return ERR_IPC_PROXY_WRITE_FAILED;
|
||||
}
|
||||
error = SendRequest(AbilityManagerInterfaceCode::CLOSE_UI_ABILITY_BY_SCB, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "request error:%{public}d", error);
|
||||
@@ -6206,14 +6206,14 @@ int AbilityManagerProxy::CleanUIAbilityBySCB(const sptr<SessionInfo> &sessionInf
|
||||
return INNER_ERR;
|
||||
}
|
||||
}
|
||||
if (!data.WriteUint32(sceneFlag)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "sceneFlag write fail");
|
||||
return INNER_ERR;
|
||||
}
|
||||
if (!data.WriteBool(isUserRequestedExit)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "write isUserRequestedExit fail");
|
||||
return ERR_IPC_PROXY_WRITE_FAILED;
|
||||
}
|
||||
if (!data.WriteUint32(sceneFlag)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "sceneFlag write fail");
|
||||
return INNER_ERR;
|
||||
}
|
||||
|
||||
error = SendRequest(AbilityManagerInterfaceCode::CLEAN_UI_ABILITY_BY_SCB, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
@@ -6964,33 +6964,6 @@ int32_t AbilityManagerProxy::RevokeDelegator(sptr<IRemoteObject> token)
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::StartAbilityWithWait(Want &want, sptr<IAbilityStartWithWaitObserver> &observer)
|
||||
{
|
||||
if (AppUtils::GetInstance().IsForbidStart()) {
|
||||
TAG_LOGW(AAFwkTag::ABILITYMGR, "forbid start: %{public}s", want.GetElement().GetBundleName().c_str());
|
||||
return INNER_ERR;
|
||||
}
|
||||
CHECK_POINTER_AND_RETURN_LOG(observer, ERR_NULL_OBJECT, "null observer");
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "writeInterfaceToken failed");
|
||||
return INNER_ERR;
|
||||
}
|
||||
|
||||
PROXY_WRITE_PARCEL_AND_RETURN_IF_FAIL(data, Parcelable, &want);
|
||||
PROXY_WRITE_PARCEL_AND_RETURN_IF_FAIL(data, RemoteObject, observer->AsObject());
|
||||
int32_t error = SendRequest(AbilityManagerInterfaceCode::START_ABILITY_WITH_WAIT, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "send err:%{public}d", error);
|
||||
return error;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::GetAllInsightIntentInfo(
|
||||
AbilityRuntime::GetInsightIntentFlag flag,
|
||||
std::vector<InsightIntentInfoForQuery> &infos,
|
||||
@@ -7148,6 +7121,32 @@ int32_t AbilityManagerProxy::GetInsightIntentInfoByIntentName(
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::StartAbilityWithWait(Want &want, sptr<IAbilityStartWithWaitObserver> &observer)
|
||||
{
|
||||
if (AppUtils::GetInstance().IsForbidStart()) {
|
||||
TAG_LOGW(AAFwkTag::ABILITYMGR, "forbid start: %{public}s", want.GetElement().GetBundleName().c_str());
|
||||
return INNER_ERR;
|
||||
}
|
||||
CHECK_POINTER_AND_RETURN_LOG(observer, ERR_NULL_OBJECT, "null observer");
|
||||
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "writeInterfaceToken failed");
|
||||
return INNER_ERR;
|
||||
}
|
||||
|
||||
PROXY_WRITE_PARCEL_AND_RETURN_IF_FAIL(data, Parcelable, &want);
|
||||
PROXY_WRITE_PARCEL_AND_RETURN_IF_FAIL(data, RemoteObject, observer->AsObject());
|
||||
int32_t error = SendRequest(AbilityManagerInterfaceCode::START_ABILITY_WITH_WAIT, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "send err:%{public}d", error);
|
||||
return error;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::SuspendExtensionAbility(sptr<IAbilityConnection> connect)
|
||||
{
|
||||
@@ -7227,6 +7226,35 @@ int32_t AbilityManagerProxy::RestartSelfAtomicService(sptr<IRemoteObject> caller
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::SetAppServiceExtensionKeepAlive(const std::string &bundleName, bool flag)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "writeInterfaceToken fail");
|
||||
return INNER_ERR;
|
||||
}
|
||||
|
||||
if (!data.WriteString(bundleName)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "failed to write bundleName");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (!data.WriteBool(flag)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "failed to write flag");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
auto ret = SendRequest(AbilityManagerInterfaceCode::SET_APP_SERVICE_EXTENSION_KEEP_ALIVE,
|
||||
data, reply, option);
|
||||
if (ret != NO_ERROR) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "request error: %{public}d", ret);
|
||||
return ret;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::UpdateKioskApplicationList(const std::vector<std::string> &appList)
|
||||
{
|
||||
MessageParcel data;
|
||||
@@ -7372,35 +7400,6 @@ ErrCode AbilityManagerProxy::RegisterSAInterceptor(sptr<AbilityRuntime::ISAInter
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::SetAppServiceExtensionKeepAlive(const std::string &bundleName, bool flag)
|
||||
{
|
||||
MessageParcel data;
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "writeInterfaceToken fail");
|
||||
return INNER_ERR;
|
||||
}
|
||||
|
||||
if (!data.WriteString(bundleName)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "failed to write bundleName");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (!data.WriteBool(flag)) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "failed to write flag");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
auto ret = SendRequest(AbilityManagerInterfaceCode::SET_APP_SERVICE_EXTENSION_KEEP_ALIVE,
|
||||
data, reply, option);
|
||||
if (ret != NO_ERROR) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "request error: %{public}d", ret);
|
||||
return ret;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int32_t AbilityManagerProxy::QueryKeepAliveAppServiceExtensions(std::vector<KeepAliveInfo> &list)
|
||||
{
|
||||
MessageParcel data;
|
||||
|
||||
Reference in New Issue
Block a user