libfs_mgr_binder: Cleanup GetGsiService()

GetGsiService() is defined in libgsid, let libfs_mgr_binder link to
libgsid instead of duplicating the logic.

Test: Build and boot
Change-Id: I28d0c92b432a53770a3bdc5f4c5cd91e3466151c
This commit is contained in:
Yo Chiang 2020-03-11 18:18:33 +08:00
parent f1e27502e4
commit bef044a46a
2 changed files with 3 additions and 12 deletions

View file

@ -45,6 +45,7 @@ cc_defaults {
whole_static_libs: [
"gsi_aidl_interface-cpp",
"libgsi",
"libgsid",
],
shared_libs: [
"libbinder",

View file

@ -19,9 +19,9 @@
#include <android-base/properties.h>
#include <android/gsi/BnProgressCallback.h>
#include <android/gsi/IGsiService.h>
#include <binder/IServiceManager.h>
#include <libfiemap/image_manager.h>
#include <libgsi/libgsi.h>
#include <libgsi/libgsid.h>
namespace android {
namespace fiemap {
@ -224,19 +224,9 @@ bool ImageManagerBinder::MapAllImages(const std::function<bool(std::set<std::str
return false;
}
static sp<IGsiService> GetGsiService() {
auto sm = android::defaultServiceManager();
auto name = android::String16(kGsiServiceName);
android::sp<android::IBinder> res = sm->waitForService(name);
if (res) {
return android::interface_cast<IGsiService>(res);
}
return nullptr;
}
std::unique_ptr<IImageManager> IImageManager::Open(
const std::string& dir, const std::chrono::milliseconds& /*timeout_ms*/) {
android::sp<IGsiService> service = GetGsiService();
android::sp<IGsiService> service = android::gsi::GetGsiService();
android::sp<IImageService> manager;
auto status = service->openImageService(dir, &manager);