if (cb) {
cb(targetUid, id, i.GetPkgType().c_str(), i.GetPkgid().c_str(),
key.c_str(), val.c_str(), nullptr, data);
- } else {
+ } else if (app_cb) {
app_cb(targetUid, id, i.GetPkgType().c_str(), i.GetPkgid().c_str(),
i.GetAppid().c_str(), key.c_str(), val.c_str(), nullptr, data);
}
if (cb) {
cb(targetUid, id, i.GetPkgType().c_str(), i.GetPkgid().c_str(),
key.c_str(), val.c_str(), nullptr, data);
- } else {
+ } else if (app_cb) {
app_cb(targetUid, id, i.GetPkgType().c_str(), i.GetPkgid().c_str(),
i.GetAppid().c_str(), key.c_str(), val.c_str(), nullptr, data);
}
if (it == size_info_handlers_.end())
return;
const auto& [id, cb, pc, data] = it->second;
+ if (!cb)
+ return;
std::vector<std::string> tokens;
std::istringstream ss(val);
void SignalReceiver::OnAsyncResultForPkgUpgrade(
std::string signal, int progress) {
for (const auto& [id, cb, data] : global_pkg_upgrade_handlers_) {
- cb(progress, data);
+ if (cb)
+ cb(progress, data);
}
}
return;
const auto& [id, cb, data] = it->second;
- cb(targetUid, id, pkgid.c_str(), signal.c_str(), status.c_str(),
- static_cast<void*>(&extra), data);
+ if (cb)
+ cb(targetUid, id, pkgid.c_str(), signal.c_str(), status.c_str(),
+ static_cast<void*>(&extra), data);
}
void SignalReceiver::HandleGlobalResHandler(const std::string& signal,
int targetUid, const std::string& reqId, const std::string& pkgid,
const std::string& status, pkg_signal::ExtraData& extra) const {
for (const auto& [id, cb, data] : global_res_handlers_) {
- cb(targetUid, id, pkgid.c_str(), signal.c_str(), status.c_str(),
- static_cast<void*>(&extra), data);
+ if (cb)
+ cb(targetUid, id, pkgid.c_str(), signal.c_str(), status.c_str(),
+ static_cast<void*>(&extra), data);
}
}