Signed-off-by: tantingting <tantingting5@huawei.com>
This commit is contained in:
tantingting
2024-08-31 16:40:59 +08:00
parent 447329b2d3
commit 0cfe33b366
8 changed files with 50 additions and 50 deletions
+24 -24
View File
@@ -207,7 +207,7 @@ void AmsMgrScheduler::KillProcessByAbilityToken(const sptr<IRemoteObject> &token
}
if (amsMgrServiceInner_->VerifyKillProcessPermission(token) != ERR_OK) {
TAG_LOGE(AAFwkTag::APPMGR, "%{public}s: verification failed", __func__);
TAG_LOGE(AAFwkTag::APPMGR, "verification failed");
return;
}
@@ -233,7 +233,7 @@ void AmsMgrScheduler::KillProcessesByUserId(int32_t userId)
auto permission = AAFwk::PermissionConstants::PERMISSION_CLEAN_BACKGROUND_PROCESSES;
if (!isCallingFromFoundation &&
amsMgrServiceInner_->VerifyAccountPermission(permission, userId) == ERR_PERMISSION_DENIED) {
TAG_LOGE(AAFwkTag::APPMGR, "%{public}s: verification failed", __func__);
TAG_LOGE(AAFwkTag::APPMGR, "verification failed");
return;
}
@@ -294,7 +294,7 @@ int32_t AmsMgrScheduler::KillProcessWithAccount(
void AmsMgrScheduler::AbilityAttachTimeOut(const sptr<IRemoteObject> &token)
{
TAG_LOGI(AAFwkTag::APPMGR, "AttachTimeOut begin");
TAG_LOGI(AAFwkTag::APPMGR, "call");
if (!IsReady()) {
return;
}
@@ -493,7 +493,7 @@ int32_t AmsMgrScheduler::GetBundleNameByPid(const int pid, std::string &bundleNa
int32_t AmsMgrScheduler::RegisterAppDebugListener(const sptr<IAppDebugListener> &listener)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->RegisterAppDebugListener(listener);
@@ -502,7 +502,7 @@ int32_t AmsMgrScheduler::RegisterAppDebugListener(const sptr<IAppDebugListener>
int32_t AmsMgrScheduler::UnregisterAppDebugListener(const sptr<IAppDebugListener> &listener)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->UnregisterAppDebugListener(listener);
@@ -511,7 +511,7 @@ int32_t AmsMgrScheduler::UnregisterAppDebugListener(const sptr<IAppDebugListener
int32_t AmsMgrScheduler::AttachAppDebug(const std::string &bundleName)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->AttachAppDebug(bundleName);
@@ -520,7 +520,7 @@ int32_t AmsMgrScheduler::AttachAppDebug(const std::string &bundleName)
int32_t AmsMgrScheduler::DetachAppDebug(const std::string &bundleName)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->DetachAppDebug(bundleName);
@@ -529,7 +529,7 @@ int32_t AmsMgrScheduler::DetachAppDebug(const std::string &bundleName)
int32_t AmsMgrScheduler::SetAppWaitingDebug(const std::string &bundleName, bool isPersist)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->SetAppWaitingDebug(bundleName, isPersist);
@@ -538,7 +538,7 @@ int32_t AmsMgrScheduler::SetAppWaitingDebug(const std::string &bundleName, bool
int32_t AmsMgrScheduler::CancelAppWaitingDebug()
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->CancelAppWaitingDebug();
@@ -547,7 +547,7 @@ int32_t AmsMgrScheduler::CancelAppWaitingDebug()
int32_t AmsMgrScheduler::GetWaitingDebugApp(std::vector<std::string> &debugInfoList)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->GetWaitingDebugApp(debugInfoList);
@@ -556,7 +556,7 @@ int32_t AmsMgrScheduler::GetWaitingDebugApp(std::vector<std::string> &debugInfoL
bool AmsMgrScheduler::IsWaitingDebugApp(const std::string &bundleName)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return false;
}
return amsMgrServiceInner_->IsWaitingDebugApp(bundleName);
@@ -565,7 +565,7 @@ bool AmsMgrScheduler::IsWaitingDebugApp(const std::string &bundleName)
void AmsMgrScheduler::ClearNonPersistWaitingDebugFlag()
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return;
}
amsMgrServiceInner_->ClearNonPersistWaitingDebugFlag();
@@ -574,7 +574,7 @@ void AmsMgrScheduler::ClearNonPersistWaitingDebugFlag()
int32_t AmsMgrScheduler::RegisterAbilityDebugResponse(const sptr<IAbilityDebugResponse> &response)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
return amsMgrServiceInner_->RegisterAbilityDebugResponse(response);
@@ -583,7 +583,7 @@ int32_t AmsMgrScheduler::RegisterAbilityDebugResponse(const sptr<IAbilityDebugRe
bool AmsMgrScheduler::IsAttachDebug(const std::string &bundleName)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return false;
}
return amsMgrServiceInner_->IsAttachDebug(bundleName);
@@ -592,7 +592,7 @@ bool AmsMgrScheduler::IsAttachDebug(const std::string &bundleName)
void AmsMgrScheduler::SetKeepAliveEnableState(const std::string &bundleName, bool enable)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return;
}
amsMgrServiceInner_->SetKeepAliveEnableState(bundleName, enable);
@@ -621,7 +621,7 @@ void AmsMgrScheduler::ClearProcessByToken(sptr<IRemoteObject> token)
bool AmsMgrScheduler::IsMemorySizeSufficent()
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return true;
}
if (amsMgrServiceInner_->VerifyRequestPermission() != ERR_OK) {
@@ -634,7 +634,7 @@ bool AmsMgrScheduler::IsMemorySizeSufficent()
void AmsMgrScheduler::AttachedToStatusBar(const sptr<IRemoteObject> &token)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return;
}
auto callerTokenId = IPCSkeleton::GetCallingTokenID();
@@ -658,7 +658,7 @@ void AmsMgrScheduler::BlockProcessCacheByPids(const std::vector<int32_t> &pids)
pid_t callingPid = IPCSkeleton::GetCallingPid();
pid_t pid = getprocpid();
if (callingPid != pid) {
TAG_LOGE(AAFwkTag::APPMGR, "Not allow other process to call");
TAG_LOGE(AAFwkTag::APPMGR, "not allow other process to call");
return;
}
@@ -671,12 +671,12 @@ void AmsMgrScheduler::BlockProcessCacheByPids(const std::vector<int32_t> &pids)
bool AmsMgrScheduler::CleanAbilityByUserRequest(const sptr<IRemoteObject> &token)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return false;
}
if (IPCSkeleton::GetCallingPid() != getprocpid()) {
TAG_LOGE(AAFwkTag::APPMGR, "Not allow other process to call");
TAG_LOGE(AAFwkTag::APPMGR, "not allow other process to call");
return false;
}
return amsMgrServiceInner_->CleanAbilityByUserRequest(token);
@@ -685,7 +685,7 @@ bool AmsMgrScheduler::CleanAbilityByUserRequest(const sptr<IRemoteObject> &token
bool AmsMgrScheduler::IsKilledForUpgradeWeb(const std::string &bundleName)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return false;
}
return amsMgrServiceInner_->IsKilledForUpgradeWeb(bundleName);
@@ -693,13 +693,13 @@ bool AmsMgrScheduler::IsKilledForUpgradeWeb(const std::string &bundleName)
bool AmsMgrScheduler::IsProcessContainsOnlyUIAbility(const pid_t pid)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return false;
}
pid_t callingPid = IPCSkeleton::GetCallingPid();
pid_t procPid = getprocpid();
if (callingPid != procPid) {
TAG_LOGE(AAFwkTag::APPMGR, "Not allow other process to call");
TAG_LOGE(AAFwkTag::APPMGR, "not allow other process to call");
return false;
}
return amsMgrServiceInner_->IsProcessContainsOnlyUIAbility(pid);
@@ -708,7 +708,7 @@ bool AmsMgrScheduler::IsProcessContainsOnlyUIAbility(const pid_t pid)
bool AmsMgrScheduler::IsProcessAttached(sptr<IRemoteObject> token)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AmsMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return false;
}
return amsMgrServiceInner_->IsProcessAttached(token);
@@ -55,7 +55,7 @@ DistributedKv::Status AppConfigDataManager::GetKvStore()
DistributedKv::Status status = dataManager_.GetSingleKvStore(options, APP_ID, STORE_ID, kvStorePtr_);
if (status != DistributedKv::Status::SUCCESS) {
TAG_LOGE(AAFwkTag::APPMGR, "return error is %{public}d", status);
TAG_LOGE(AAFwkTag::APPMGR, "error is %{public}d", status);
return status;
}
@@ -106,7 +106,7 @@ int32_t AppConfigDataManager::SetAppWaitingDebugInfo(const std::string &bundleNa
}
if (status != DistributedKv::Status::SUCCESS) {
TAG_LOGE(AAFwkTag::APPMGR, "insert error is %{public}d", status);
TAG_LOGE(AAFwkTag::APPMGR, "error is %{public}d", status);
return ERR_INVALID_OPERATION;
}
return ERR_OK;
@@ -131,7 +131,7 @@ int32_t AppConfigDataManager::ClearAppWaitingDebugInfo()
}
if (status != DistributedKv::Status::SUCCESS) {
TAG_LOGE(AAFwkTag::APPMGR, "delete error is %{public}d", status);
TAG_LOGE(AAFwkTag::APPMGR, "error is %{public}d", status);
return ERR_INVALID_OPERATION;
}
return ERR_OK;
@@ -156,7 +156,7 @@ int32_t AppConfigDataManager::GetAppWaitingDebugList(std::vector<std::string> &b
}
if (status != DistributedKv::Status::SUCCESS) {
TAG_LOGE(AAFwkTag::APPMGR, "get error is %{public}d", status);
TAG_LOGE(AAFwkTag::APPMGR, "error is %{public}d", status);
return ERR_INVALID_OPERATION;
}
+6 -6
View File
@@ -185,7 +185,7 @@ void AppMgrService::AttachApplication(const sptr<IRemoteObject> &app)
pid_t pid = IPCSkeleton::GetCallingPid();
auto appScheduler = iface_cast<IAppScheduler>(app);
if (appScheduler == nullptr) {
TAG_LOGE(AAFwkTag::APPMGR, "null appScheduler");
TAG_LOGE(AAFwkTag::APPMGR, "appScheduler null");
}
std::function<void()> attachApplicationFunc = [appMgrServiceInner = appMgrServiceInner_, pid, appScheduler]() {
appMgrServiceInner->AttachApplication(pid, appScheduler);
@@ -425,7 +425,7 @@ int AppMgrService::GetAllChildrenProcesses(std::vector<ChildProcessInfo> &info)
int32_t AppMgrService::JudgeSandboxByPid(pid_t pid, bool &isSandbox)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AppMgrService is unready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
bool isCallingPermission =
@@ -618,7 +618,7 @@ int AppMgrService::FinishUserTest(const std::string &msg, const int64_t &resultC
return ERR_INVALID_OPERATION;
}
} else {
TAG_LOGE(AAFwkTag::APPMGR, "GetBundleName failed: %{public}d", result);
TAG_LOGE(AAFwkTag::APPMGR, "fail: %{public}d", result);
return ERR_INVALID_OPERATION;
}
pid_t callingPid = IPCSkeleton::GetCallingPid();
@@ -935,7 +935,7 @@ int32_t AppMgrService::PreStartNWebSpawnProcess()
{
TAG_LOGI(AAFwkTag::APPMGR, "PreStartNWebSpawnProcess");
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AppMgrService not ready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
@@ -946,7 +946,7 @@ int32_t AppMgrService::StartRenderProcess(const std::string &renderParam, int32_
int32_t sharedFd, int32_t crashFd, pid_t &renderPid, bool isGPU)
{
if (!IsReady()) {
TAG_LOGE(AAFwkTag::APPMGR, "AppMgrService not ready");
TAG_LOGE(AAFwkTag::APPMGR, "not ready");
return ERR_INVALID_OPERATION;
}
@@ -1457,7 +1457,7 @@ int32_t AppMgrService::SignRestartAppFlag(const std::string &bundleName)
bool isCallingPermission =
AAFwk::PermissionVerification::GetInstance()->CheckSpecificSystemAbilityAccessPermission(FOUNDATION_PROCESS);
if (!isCallingPermission) {
TAG_LOGE(AAFwkTag::APPMGR, "verificationAllToken failed");
TAG_LOGE(AAFwkTag::APPMGR, "verification failed");
return ERR_PERMISSION_DENIED;
}
return appMgrServiceInner_->SignRestartAppFlag(bundleName);
+1 -1
View File
@@ -100,7 +100,7 @@ bool AppPreloader::GetLaunchWant(const std::string &bundleName, int32_t userId,
auto errCode = IN_PROCESS_CALL(bundleMgrHelper->GetLaunchWantForBundle(bundleName, launchWant, userId));
if (errCode != ERR_OK) {
TAG_LOGE(AAFwkTag::APPMGR, "GetLaunchWantForBundle failed, errCode: %{public}d", errCode);
TAG_LOGE(AAFwkTag::APPMGR, "errCode: %{public}d", errCode);
return false;
}
return true;
+7 -7
View File
@@ -421,7 +421,7 @@ std::shared_ptr<AppRunningRecord> AppRunningManager::OnRemoteDied(const wptr<IRe
return false;
});
if (iter == appRunningRecordMap_.end()) {
TAG_LOGE(AAFwkTag::APPMGR, "remote is not exist");
TAG_LOGE(AAFwkTag::APPMGR, "remote not in map");
return nullptr;
}
appRecord = iter->second;
@@ -434,7 +434,7 @@ std::shared_ptr<AppRunningRecord> AppRunningManager::OnRemoteDied(const wptr<IRe
}
appRecord->RemoveAppDeathRecipient();
appRecord->SetApplicationClient(nullptr);
TAG_LOGI(AAFwkTag::APPMGR, "processName: %{public}s", appRecord->GetProcessName().c_str());
TAG_LOGI(AAFwkTag::APPMGR, "pname: %{public}s", appRecord->GetProcessName().c_str());
auto priorityObject = appRecord->GetPriorityObject();
if (priorityObject != nullptr) {
TAG_LOGI(AAFwkTag::APPMGR, "pid: %{public}d", priorityObject->GetPid());
@@ -705,7 +705,7 @@ int32_t AppRunningManager::AssignRunningProcessInfoByAppRecord(
{
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
if (!appRecord) {
TAG_LOGE(AAFwkTag::APPMGR, "null appRecord");
TAG_LOGE(AAFwkTag::APPMGR, "null");
return ERR_INVALID_OPERATION;
}
@@ -852,12 +852,12 @@ int32_t AppRunningManager::NotifyMemoryLevel(int32_t level)
for (const auto &item : appRunningMap) {
const auto &appRecord = item.second;
if (!appRecord) {
TAG_LOGE(AAFwkTag::APPMGR, "null appRecord");
TAG_LOGE(AAFwkTag::APPMGR, "appRecord null");
continue;
}
auto priorityObject = appRecord->GetPriorityObject();
if (!priorityObject) {
TAG_LOGW(AAFwkTag::APPMGR, "null priorityObject");
TAG_LOGW(AAFwkTag::APPMGR, "priorityObject null");
continue;
}
auto pid = priorityObject->GetPid();
@@ -879,12 +879,12 @@ int32_t AppRunningManager::NotifyProcMemoryLevel(const std::map<pid_t, MemoryLev
for (const auto &item : appRunningMap) {
const auto &appRecord = item.second;
if (!appRecord) {
TAG_LOGE(AAFwkTag::APPMGR, "null appRecord");
TAG_LOGE(AAFwkTag::APPMGR, "appRecord null");
continue;
}
auto priorityObject = appRecord->GetPriorityObject();
if (!priorityObject) {
TAG_LOGW(AAFwkTag::APPMGR, "null priorityObject");
TAG_LOGW(AAFwkTag::APPMGR, "priorityObject null");
continue;
}
auto pid = priorityObject->GetPid();
+3 -3
View File
@@ -849,7 +849,7 @@ void AppRunningRecord::StateChangedNotifyObserver(const std::shared_ptr<AbilityR
}
if (isAbility && abilityInfo->type == AbilityType::EXTENSION &&
abilityInfo->extensionAbilityType != ExtensionAbilityType::UI) {
TAG_LOGD(AAFwkTag::APPMGR, "extensionType:%{public}d, not notify any more.", abilityInfo->extensionAbilityType);
TAG_LOGD(AAFwkTag::APPMGR, "extensionType:%{public}d, not notify", abilityInfo->extensionAbilityType);
return;
}
auto serviceInner = appMgrServiceInner_.lock();
@@ -1740,7 +1740,7 @@ void AppRunningRecord::AddRenderRecord(const std::shared_ptr<RenderRecord> &reco
void AppRunningRecord::RemoveRenderRecord(const std::shared_ptr<RenderRecord> &record)
{
if (!record) {
TAG_LOGD(AAFwkTag::APPMGR, "RemoveRenderRecord: record is null");
TAG_LOGD(AAFwkTag::APPMGR, "RemoveRenderRecord: record null");
return;
}
std::lock_guard renderRecordMapLock(renderRecordMapLock_);
@@ -1973,7 +1973,7 @@ void AppRunningRecord::OnWindowVisibilityChanged(
const std::vector<sptr<OHOS::Rosen::WindowVisibilityInfo>> &windowVisibilityInfos)
{
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
TAG_LOGI(AAFwkTag::APPMGR, "call");
TAG_LOGD(AAFwkTag::APPMGR, "called");
if (windowVisibilityInfos.empty()) {
TAG_LOGW(AAFwkTag::APPMGR, "empty info");
return;
+3 -3
View File
@@ -337,7 +337,7 @@ int32_t AppSpawnClient::AppspawnSetExtMsgMore(const AppSpawnStartMsg &startMsg,
TAG_LOGE(AAFwkTag::APPMGR, "fail, ret: %{public}d", ret);
return ret;
}
TAG_LOGI(AAFwkTag::APPMGR, "Send maxChildProcess %{public}s success", maxChildProcessStr.c_str());
TAG_LOGD(AAFwkTag::APPMGR, "Send maxChildProcess %{public}s success", maxChildProcessStr.c_str());
if (!startMsg.fds.empty()) {
ret = SetExtMsgFds(reqHandle, startMsg.fds);
@@ -493,7 +493,7 @@ int32_t AppSpawnClient::StartProcess(const AppSpawnStartMsg &startMsg, pid_t &pi
AppSpawnResult result = {0};
ret = AppSpawnClientSendMsg(handle_, reqHandle, &result);
if (ret != 0) {
TAG_LOGE(AAFwkTag::APPMGR, "AppSpawnClientSendMsg failed");
TAG_LOGE(AAFwkTag::APPMGR, "appspawn send msg fail");
return ret;
}
if (result.pid <= 0) {
@@ -533,7 +533,7 @@ int32_t AppSpawnClient::GetRenderProcessTerminationStatus(const AppSpawnStartMsg
ret = AppSpawnClientSendMsg(handle_, reqHandle, &result);
status = result.result;
if (ret != 0) {
TAG_LOGE(AAFwkTag::APPMGR, "AppSpawnClientSendMsg failed");
TAG_LOGE(AAFwkTag::APPMGR, "appspawn send msg fail");
return ret;
}
TAG_LOGI(AAFwkTag::APPMGR, "status = [%{public}d]", status);
@@ -379,8 +379,8 @@ void CacheProcessManager::RemoveCacheRecord(const std::shared_ptr<AppRunningReco
void CacheProcessManager::ShrinkAndKillCache()
{
TAG_LOGD(AAFwkTag::APPMGR, "Called");
if (maxProcCacheNum_ <= 0) {
TAG_LOGI(AAFwkTag::APPMGR, "Cache disabled");
if (maxProcCacheNum_ <= 0 && !resourceCacheProcessEnable_) {
TAG_LOGI(AAFwkTag::APPMGR, "Cache disabled.");
return;
}
std::vector<std::shared_ptr<AppRunningRecord>> cleanList;