!10560 CR问题整改

Merge pull request !10560 from chenxinzhan/cr_modify
This commit is contained in:
openharmony_ci
2024-09-24 03:48:24 +00:00
committed by Gitee
12 changed files with 16 additions and 66 deletions
@@ -31,11 +31,6 @@
namespace OHOS {
using AbilityRuntime::FreezeUtil;
namespace AppExecFwk {
namespace {
const std::string PERMISSION_KEY = "ohos.user.grant.permission";
const std::string GRANTED_RESULT_KEY = "ohos.user.grant.permission.result";
}
void AbilityImpl::Init(const std::shared_ptr<OHOSApplication> &application,
const std::shared_ptr<AbilityLocalRecord> &record,
std::shared_ptr<Ability> &ability,
@@ -25,13 +25,6 @@ namespace OHOS {
using AbilityRuntime::FreezeUtil;
namespace AppExecFwk {
using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient;
/**
* @brief Handling the life cycle switching of NewAbility.
*
* @param want Indicates the structure containing information about the ability.
* @param targetState The life cycle state to switch to.
*
*/
void NewAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState,
sptr<AAFwk::SessionInfo> sessionInfo)
@@ -72,10 +65,10 @@ void NewAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Lif
void NewAbilityImpl::HandleShareData(const int32_t &uniqueId)
{
TAG_LOGI(AAFwkTag::ABILITY, "begin sourceState:%{public}d", lifecycleState_);
WantParams wantParam;
int32_t resultCode = Share(wantParam);
TAG_LOGI(AAFwkTag::ABILITY, "wantParam size: %{public}d", wantParam.Size());
TAG_LOGI(AAFwkTag::ABILITY, "begin sourceState:%{public}d, wantParam size:%{public}d",
lifecycleState_, wantParam.Size());
AbilityManagerClient::GetInstance()->ShareDataDone(token_, resultCode, uniqueId, wantParam);
}
@@ -89,15 +82,6 @@ void NewAbilityImpl::AbilityTransactionCallback(const AbilityLifeCycleState &sta
}
}
/**
* @brief Handling the life cycle switching of NewAbility in switch.
*
* @param want Indicates the structure containing information about the ability.
* @param targetState The life cycle state to switch to.
*
* @return return true if need notify ams, otherwise return false.
*
*/
bool NewAbilityImpl::AbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState)
{
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
+2 -2
View File
@@ -1370,7 +1370,7 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con
std::vector<std::string> localPaths;
ChangeToLocalPath(bundleName, appInfo.moduleSourceDirs, localPaths);
LoadAbilityLibrary(localPaths);
LoadNativeLiabrary(bundleInfo, appInfo.nativeLibraryPath);
LoadNativeLibrary(bundleInfo, appInfo.nativeLibraryPath);
#ifdef SUPPORT_SCREEN
} else if (Ace::AceForwardCompatibility::PipelineChanged()) {
std::vector<std::string> localPaths;
@@ -1817,7 +1817,7 @@ void MainThread::CalcNativeLiabraryEntries(const BundleInfo &bundleInfo, std::st
}
}
void MainThread::LoadNativeLiabrary(const BundleInfo &bundleInfo, std::string &nativeLibraryPath)
void MainThread::LoadNativeLibrary(const BundleInfo &bundleInfo, std::string &nativeLibraryPath)
{
CalcNativeLiabraryEntries(bundleInfo, nativeLibraryPath);
if (nativeFileEntries_.empty()) {
@@ -29,10 +29,6 @@
#endif
namespace OHOS {
namespace AppExecFwk {
class Ability;
class AbilityHandler;
class ApplicationImpl;
class AbilityLocalRecord;
class AbilityLifecycleCallbacks;
class OHOSApplication;
class AbilityImpl : public std::enable_shared_from_this<AbilityImpl> {
@@ -491,15 +487,6 @@ protected:
std::mutex notifyForegroundLock_;
private:
typedef enum {
START,
INACTIVE,
ACTIVE,
BACKGROUND,
FOREGROUND,
STOP,
} Action;
std::shared_ptr<ApplicationImpl> applicationImpl_;
std::shared_ptr<ContextDeal> contextDeal_;
bool hasSaveData_ = false;
@@ -20,10 +20,6 @@
namespace OHOS {
namespace AppExecFwk {
class Ability;
class AbilityHandler;
class AbilityLocalRecord;
class AbilityImpl;
class NewAbilityImpl final : public AbilityImpl {
public:
/**
@@ -674,7 +674,7 @@ private:
void LoadAceAbilityLibrary();
void CalcNativeLiabraryEntries(const BundleInfo &bundleInfo, std::string &nativeLibraryPath);
void LoadNativeLiabrary(const BundleInfo &bundleInfo, std::string &nativeLibraryPath);
void LoadNativeLibrary(const BundleInfo &bundleInfo, std::string &nativeLibraryPath);
void LoadAppDetailAbilityLibrary(std::string &nativeLibraryPath);
@@ -85,7 +85,6 @@ constexpr int32_t U0_USER_ID = 0;
constexpr int32_t INVALID_USER_ID = -1;
constexpr const char* KEY_SESSION_ID = "com.ohos.param.sessionId";
using OHOS::AppExecFwk::IAbilityController;
class PendingWantManager;
struct StartAbilityInfo;
class WindowFocusChangedListener;
@@ -2305,7 +2304,6 @@ private:
void ShowDeveloperModeDialog(const std::string &bundleName, const std::string &abilityName);
constexpr static int REPOLL_TIME_MICRO_SECONDS = 1000000;
constexpr static int WAITING_BOOT_ANIMATION_TIMER = 5;
std::shared_ptr<TaskHandlerWrap> taskHandler_;
std::shared_ptr<AbilityEventHandler> eventHandler_;
@@ -128,12 +128,9 @@ constexpr const char* PREPARE_TERMINATE_ENABLE_PARAMETER = "persist.sys.prepare_
// UIExtension type
constexpr const char* UIEXTENSION_TYPE_KEY = "ability.want.params.uiExtensionType";
constexpr const char* UIEXTENSION_TARGET_TYPE_KEY = "ability.want.params.uiExtensionTargetType";
constexpr const char* SYSTEM_SHARE = "share";
constexpr const char* SYSTEM_SHARE_TYPE = "sysPicker/share";
// Share picker params
constexpr char SHARE_PICKER_DIALOG_BUNDLE_NAME_KEY[] = "const.system.sharePicker.bundleName";
constexpr char SHARE_PICKER_DIALOG_ABILITY_NAME_KEY[] = "const.system.sharePicker.abilityName";
constexpr char SHARE_PICKER_UIEXTENSION_NAME_KEY[] = "const.system.sharePicker.UIExtensionAbilityName";
constexpr char SHARE_PICKER_DIALOG_DEFAULY_BUNDLE_NAME[] = "com.ohos.sharepickerdialog";
constexpr char SHARE_PICKER_DIALOG_DEFAULY_ABILITY_NAME[] = "PickerDialog";
constexpr char TOKEN_KEY[] = "ohos.ability.params.token";
@@ -153,8 +150,8 @@ constexpr const char* DMS_PERSISTENT_ID = "ohos.dms.persistentId";
constexpr const char* DEBUG_APP = "debugApp";
constexpr const char* NATIVE_DEBUG = "nativeDebug";
constexpr const char* AUTO_FILL_PASSWORD_TPYE = "autoFill/password";
constexpr const char* AUTO_FILL_SMART_TPYE = "autoFill/smart";
constexpr const char* AUTO_FILL_PASSWORD_TYPE = "autoFill/password";
constexpr const char* AUTO_FILL_SMART_TYPE = "autoFill/smart";
constexpr size_t INDEX_ZERO = 0;
constexpr size_t INDEX_ONE = 1;
constexpr size_t INDEX_TWO = 2;
@@ -2952,9 +2949,9 @@ void AbilityManagerService::SetAutoFillElementName(const sptr<SessionInfo> &exte
TAG_LOGD(AAFwkTag::ABILITYMGR, "called");
CHECK_POINTER_IS_NULLPTR(extensionSessionInfo);
std::vector<std::string> argList;
if (extensionSessionInfo->want.GetStringParam(UIEXTENSION_TYPE_KEY) == AUTO_FILL_PASSWORD_TPYE) {
if (extensionSessionInfo->want.GetStringParam(UIEXTENSION_TYPE_KEY) == AUTO_FILL_PASSWORD_TYPE) {
SplitStr(KEY_AUTO_FILL_ABILITY, "/", argList);
} else if (extensionSessionInfo->want.GetStringParam(UIEXTENSION_TYPE_KEY) == AUTO_FILL_SMART_TPYE) {
} else if (extensionSessionInfo->want.GetStringParam(UIEXTENSION_TYPE_KEY) == AUTO_FILL_SMART_TYPE) {
SplitStr(KEY_SMART_AUTO_FILL_ABILITY, "/", argList);
} else {
TAG_LOGW(AAFwkTag::ABILITYMGR, "not autofill");
@@ -3040,6 +3037,8 @@ int AbilityManagerService::StartUIExtensionAbility(const sptr<SessionInfo> &exte
int32_t result = DelayedSingleton<InsightIntentExecuteManager>::GetInstance()->CheckAndUpdateWant(
extensionSessionInfo->want, AppExecFwk::ExecuteMode::UI_EXTENSION_ABILITY);
if (result != ERR_OK) {
eventInfo.errCode = ERR_INVALID_VALUE;
EventReport::SendExtensionEvent(EventName::START_EXTENSION_ERROR, HiSysEventType::FAULT, eventInfo);
return result;
}
}
@@ -6274,11 +6273,9 @@ int32_t AbilityManagerService::InitialAbilityRequest(AbilityRequest &request,
request.appInfo = request.abilityInfo.applicationInfo;
request.uid = request.appInfo.uid;
TAG_LOGD(AAFwkTag::ABILITYMGR,
"GenerateExtensionAbilityRequest end, app name: %{public}s, bundle name: %{public}s, uid: %{public}d.",
request.appInfo.name.c_str(), request.appInfo.bundleName.c_str(), request.uid);
"GenerateExtensionAbilityRequest end, app name:%{public}s, bundle name:%{public}s, uid:%{public}d, moduleName:%{public}s",
request.appInfo.name.c_str(), request.appInfo.bundleName.c_str(), request.uid, request.abilityInfo.moduleName.c_str());
TAG_LOGD(AAFwkTag::ABILITYMGR,
"GenerateExtensionAbilityRequest, moduleName: %{public}s.", request.abilityInfo.moduleName.c_str());
request.want.SetModuleName(request.abilityInfo.moduleName);
return ERR_OK;
@@ -9535,9 +9532,8 @@ int AbilityManagerService::CheckCallOtherExtensionPermission(const AbilityReques
return ERR_OK;
}
const std::string fileAccessPermission = "ohos.permission.FILE_ACCESS_MANAGER";
if (extensionType == AppExecFwk::ExtensionAbilityType::FILEACCESS_EXTENSION &&
AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission(fileAccessPermission)) {
AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission(PermissionConstants::PERMISSION_FILE_ACCESS_MANAGER)) {
TAG_LOGD(AAFwkTag::ABILITYMGR, "Temporary, FILEACCESS_EXTENSION use serviceExtension start-up rule.");
return CheckCallServiceExtensionPermission(abilityRequest);
}
@@ -930,7 +930,6 @@ private:
std::shared_ptr<ApplicationInfo> appInfo_ = nullptr; // the application's info of this process
int32_t appRecordId_ = 0;
std::string appName_;
std::string processName_; // the name of this process
std::string specifiedProcessFlag_; // the flag of specified Process
int64_t eventId_ = 0;
-2
View File
@@ -60,8 +60,6 @@ constexpr const char* TASK_APPLICATION_FOREGROUNDED = "ApplicationForegroundedTa
constexpr const char* TASK_APPLICATION_BACKGROUNDED = "ApplicationBackgroundedTask";
constexpr const char* TASK_APPLICATION_TERMINATED = "ApplicationTerminatedTask";
constexpr const char* TASK_ABILITY_CLEANED = "AbilityCleanedTask";
constexpr const char* TASK_ADD_APP_DEATH_RECIPIENT = "AddAppRecipientTask";
constexpr const char* TASK_CLEAR_UP_APPLICATION_DATA = "ClearUpApplicationDataTask";
constexpr const char* TASK_STARTUP_RESIDENT_PROCESS = "StartupResidentProcess";
constexpr const char* TASK_ADD_ABILITY_STAGE_DONE = "AddAbilityStageDone";
constexpr const char* TASK_START_USER_TEST_PROCESS = "StartUserTestProcess";
@@ -16,9 +16,6 @@
#ifndef ABILITY_ABILITY_RUNTIME_UPMS_POLICY_INFO_H
#define ABILITY_ABILITY_RUNTIME_UPMS_POLICY_INFO_H
#include <sys/types.h>
#include <string>
namespace OHOS {
namespace AAFwk {
struct PolicyInfo final {
@@ -1532,10 +1532,10 @@ HWTEST_F(MainThreadTest, LoadNativeLiabrary_0100, TestSize.Level1)
std::string nativeLibraryPath = "";
ASSERT_NE(mainThread_, nullptr);
BundleInfo bundleInfo;
mainThread_->LoadNativeLiabrary(bundleInfo, nativeLibraryPath);
mainThread_->LoadNativeLibrary(bundleInfo, nativeLibraryPath);
nativeLibraryPath = "test/";
mainThread_->LoadNativeLiabrary(bundleInfo, nativeLibraryPath);
mainThread_->LoadNativeLibrary(bundleInfo, nativeLibraryPath);
TAG_LOGI(AAFwkTag::TEST, "%{public}s end.", __func__);
}
#endif