Skip to content

Commit

Permalink
Send updates with icons separately to not overflow protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
morphis committed May 18, 2018
1 parent 31c64f0 commit 14774c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion android/service/platform_api_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ void PlatformApiStub::update_application_list(const ApplicationListUpdate &updat
*c = category;
}

app->set_icon(a.icon.data(), a.icon.size());
if (a.icon.size() > 0)
app->set_icon(a.icon.data(), a.icon.size());
}

for (const auto &package : update.removed_applications) {
Expand Down
9 changes: 8 additions & 1 deletion android/service/platform_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ status_t PlatformService::update_application_list(const Parcel &data) {

data.readByteVector(&p.icon);

update.applications.push_back(p);
// 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);
}
}

const auto num_removed_packages = data.readInt32();
Expand Down

0 comments on commit 14774c0

Please sign in to comment.