Send updates with icons separately to not overflow protobuf

This commit is contained in:
Simon Fels 2018-01-13 06:59:25 +01:00
commit 14774c0177
2 changed files with 10 additions and 2 deletions

View file

@ -99,6 +99,7 @@ void PlatformApiStub::update_application_list(const ApplicationListUpdate &updat
*c = category; *c = category;
} }
if (a.icon.size() > 0)
app->set_icon(a.icon.data(), a.icon.size()); app->set_icon(a.icon.data(), a.icon.size());
} }

View file

@ -118,8 +118,15 @@ status_t PlatformService::update_application_list(const Parcel &data) {
data.readByteVector(&p.icon); data.readByteVector(&p.icon);
// Send updates with icons separately to not overflow protobuf
if (p.icon.size() > 0) {
anbox::PlatformApiStub::ApplicationListUpdate with_icon_update;
with_icon_update.applications.push_back(p);
platform_api_stub_->update_application_list(with_icon_update);
} else {
update.applications.push_back(p); update.applications.push_back(p);
} }
}
const auto num_removed_packages = data.readInt32(); const auto num_removed_packages = data.readInt32();
for (auto n = 0; n < num_removed_packages; n++) { for (auto n = 0; n < num_removed_packages; n++) {