When the loader process is preparing, the request will be pended.
In this case, the OnLoaderPrepared() method has to be called.
Unfortunately, there was a bug about that. If the loader manager does
not set the timer, the method cannot be called.
Change-Id: I330974ce62f761b01f5ac09116927f31aaf43b22
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
}
}
-void LoaderContext::SetTimer(LoaderContext::IEvent* listener) {
- listener_ = listener;
- SetTimer();
-}
-
void LoaderContext::SetTimer() {
if (timer_ > 0) {
_W("Already registered");
return pending_;
}
+void LoaderContext::SetEventListener(IEvent* listener) {
+ listener_ = listener;
+}
+
void LoaderContext::SetLiveTimer() {
_W("type(%d), loader_name(%s), deactivation_method(%d)",
GetType(), GetLoaderName().c_str(),
pid_ = peer_cred->GetPid();
prepared_ = true;
- if (listener_!= nullptr)
+ if (listener_ != nullptr)
listener_->OnLoaderPrepared(this);
SECURE_LOGI("Type %d loader was connected. pid: %d", GetType(), pid_);
bool IsAppInstalled() const;
CPUChecker* GetCPUChecker() const;
void UnsetTimer();
- void SetTimer(IEvent* listener);
+ void SetTimer();
void SetOnBootTimer(int timeout);
bool ShouldWaitForFileCreation();
int IncreaseCPUCheckCount();
bool IsLaunchable();
void SetPending(bool pending);
bool IsPending() const;
+ void SetEventListener(IEvent* listener);
protected:
void SetPrepared(bool prepared);
void Activate();
void Deactivate();
bool CanDeactivate(LoaderMethod method) const;
- void SetTimer();
void SetLiveTimer();
void HandleLoaderEvent();
void HandleLoaderClientEvent(int condition);
for (auto& info : loader_info_manager_->GetLoaderInfoList()) {
auto context = LoaderFactory::GetInst().CreateLoaderContext(info);
- if (context != nullptr)
+ if (context != nullptr) {
+ context->SetEventListener(this);
loader_contexts_.push_back(std::move(context));
+ }
}
ActivateLoaderContexts(LoaderMethod::None);
if (context == nullptr)
return nullptr;
- context->SetTimer(this);
+ context->SetEventListener(this);
+ context->SetTimer();
loader_contexts_.push_back(context);
return context;
}
context->UnsetTimer();
context->UpdateState(LoaderMethod::Request, true);
- context->SetTimer(this);
+ context->SetTimer();
}
void LoaderManager::UpdateAppInstallationStatus(const std::string& app_type,