Merge "libfs_mgr_binder: Cleanup GetGsiService()" am: 133df17ea1
Change-Id: Ibb4c01a854c8c762e93188be7ff7d66d7894e1e9
This commit is contained in:
commit
30f22b376f
2 changed files with 3 additions and 12 deletions
|
|
@ -45,6 +45,7 @@ cc_defaults {
|
||||||
whole_static_libs: [
|
whole_static_libs: [
|
||||||
"gsi_aidl_interface-cpp",
|
"gsi_aidl_interface-cpp",
|
||||||
"libgsi",
|
"libgsi",
|
||||||
|
"libgsid",
|
||||||
],
|
],
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
"libbinder",
|
"libbinder",
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@
|
||||||
#include <android-base/properties.h>
|
#include <android-base/properties.h>
|
||||||
#include <android/gsi/BnProgressCallback.h>
|
#include <android/gsi/BnProgressCallback.h>
|
||||||
#include <android/gsi/IGsiService.h>
|
#include <android/gsi/IGsiService.h>
|
||||||
#include <binder/IServiceManager.h>
|
|
||||||
#include <libfiemap/image_manager.h>
|
#include <libfiemap/image_manager.h>
|
||||||
#include <libgsi/libgsi.h>
|
#include <libgsi/libgsi.h>
|
||||||
|
#include <libgsi/libgsid.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace fiemap {
|
namespace fiemap {
|
||||||
|
|
@ -224,19 +224,9 @@ bool ImageManagerBinder::MapAllImages(const std::function<bool(std::set<std::str
|
||||||
return false;
|
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(
|
std::unique_ptr<IImageManager> IImageManager::Open(
|
||||||
const std::string& dir, const std::chrono::milliseconds& /*timeout_ms*/) {
|
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;
|
android::sp<IImageService> manager;
|
||||||
|
|
||||||
auto status = service->openImageService(dir, &manager);
|
auto status = service->openImageService(dir, &manager);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue