mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-27 01:10:52 +00:00
commit
166bc48b09
@ -79,19 +79,21 @@ void ApplicationCleaner::ClearTempData()
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "Get root dir error");
|
||||
return;
|
||||
}
|
||||
auto cleanTemp = [self = shared_from_this(), rootDir]() {
|
||||
if (self == nullptr || self->context_ == nullptr) {
|
||||
auto weakThis = weak_from_this();
|
||||
auto cleanTemp = [weakThis, rootDir]() {
|
||||
auto sharedThis = weakThis.lock();
|
||||
if (sharedThis == nullptr || sharedThis->context_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "Invalid shared pointer");
|
||||
return;
|
||||
}
|
||||
std::vector<std::string> temps;
|
||||
if (self->GetObsoleteBundleTempPath(rootDir, temps) != RESULT_OK) {
|
||||
if (sharedThis->GetObsoleteBundleTempPath(rootDir, temps) != RESULT_OK) {
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "Get bundle temp file list is false");
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto &temp : temps) {
|
||||
if (self->RemoveDir(temp) == false) {
|
||||
if (sharedThis->RemoveDir(temp) == false) {
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "Clean bundle data dir failed, path: %{private}s", temp.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,6 @@ AAFwk::UserStatus AssertFaultTaskThread::HandleAssertCallback(const std::string
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "Invalid client object");
|
||||
break;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lockAssertResult(assertResultMutex_);
|
||||
AAFwk::WantParams wantParams;
|
||||
wantParams.SetParam(ASSERT_FAULT_DETAIL, AAFwk::String::Box(exprStr));
|
||||
@ -158,7 +157,6 @@ AAFwk::UserStatus AssertFaultTaskThread::HandleAssertCallback(const std::string
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "Request assert fault dialog failed");
|
||||
break;
|
||||
}
|
||||
|
||||
assertResultCV_.wait(lockAssertResult);
|
||||
assertResult = assertFaultCallback->GetAssertResult();
|
||||
} while (false);
|
||||
@ -175,4 +173,4 @@ void AssertFaultTaskThread::NotifyReleaseLongWaiting()
|
||||
assertResultCV_.notify_one();
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
} // namespace OHOS
|
||||
|
@ -213,7 +213,7 @@ std::string ContextContainer::GetAppType()
|
||||
}
|
||||
}
|
||||
|
||||
void ContextContainer::SetPattern(int patternId)
|
||||
void ContextContainer::SetPattern(int32_t patternId)
|
||||
{
|
||||
if (baseContext_ != nullptr) {
|
||||
baseContext_->SetPattern(patternId);
|
||||
|
@ -132,17 +132,19 @@ bool IdleTime::GetNeedStop()
|
||||
|
||||
IdleNotifyStatusCallback IdleTime::GetIdleNotifyFunc()
|
||||
{
|
||||
IdleNotifyStatusCallback cb = [this](bool needStop) {
|
||||
if (this->GetNeedStop() == needStop) {
|
||||
auto weakThis = weak_from_this();
|
||||
IdleNotifyStatusCallback cb = [weakThis](bool needStop) {
|
||||
auto sharedThis = weakThis.lock();
|
||||
if (sharedThis == nullptr || sharedThis->GetNeedStop() == needStop) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->SetNeedStop(needStop);
|
||||
sharedThis->SetNeedStop(needStop);
|
||||
if (needStop == false) {
|
||||
this->Start();
|
||||
sharedThis->Start();
|
||||
}
|
||||
};
|
||||
return cb;
|
||||
}
|
||||
} // AppExecFwk
|
||||
} // namespace OHOS
|
||||
} // namespace OHOS
|
||||
|
@ -180,7 +180,7 @@ public:
|
||||
*
|
||||
* @param patternId Indicates the resource ID of the pattern to set.
|
||||
*/
|
||||
void SetPattern(int patternId) override;
|
||||
void SetPattern(int32_t patternId) override;
|
||||
|
||||
/**
|
||||
* @brief Obtains the HapModuleInfo object of the application.
|
||||
|
Loading…
Reference in New Issue
Block a user