Merge "Don't retain IGsiService pointers for process lifetime." into main
diff --git a/libgsid.cpp b/libgsid.cpp
index fc75c90..73ef9bd 100644
--- a/libgsid.cpp
+++ b/libgsid.cpp
@@ -27,8 +27,7 @@
sp<IGsiService> GetGsiService() {
auto sm = android::defaultServiceManager();
auto name = android::String16(kGsiServiceName);
- static android::sp<android::IBinder> res = sm->waitForService(name);
- if (res) {
+ if (android::sp<android::IBinder> res = sm->waitForService(name)) {
return android::interface_cast<IGsiService>(res);
}
LOG(ERROR) << "Unable to GetGsiService";