Remove application launcher when its android counterpart is removed

This commit is contained in:
Simon Fels 2017-02-22 17:08:19 +01:00
commit 69631a1bfc
10 changed files with 131 additions and 22 deletions

View file

@ -88,6 +88,12 @@ void PlatformApiStub::update_application_list(const ApplicationListUpdate &updat
app->set_icon(a.icon.data(), a.icon.size());
}
for (const auto &package : update.removed_applications) {
auto app = event->add_removed_applications();
app->set_name("unknown");
app->set_package(package);
}
rpc_channel_->send_event(seq);
}

View file

@ -79,6 +79,7 @@ public:
std::vector<int8_t> icon;
};
std::vector<Application> applications;
std::vector<std::string> removed_applications;
};
void update_application_list(const ApplicationListUpdate &update);

View file

@ -120,6 +120,12 @@ status_t PlatformService::update_application_list(const Parcel &data) {
update.applications.push_back(p);
}
const auto num_removed_packages = data.readInt32();
for (auto n = 0; n < num_removed_packages; n++) {
String8 package_name(data.readString16());
update.removed_applications.push_back(package_name.string());
}
platform_api_stub_->update_application_list(update);
return OK;