Merge "Hold onto linked binder." am: 5e343ea8db am: 6915a76f1d am: 6b40b59d99
am: 590fe30730
Change-Id: I2bbee3b22b1c23f113e84ef9e87ca6082ca0b8dc
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index f53d3fa..140eb4f 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -533,9 +533,9 @@
// wait patiently for the window manager death
const String16 name("window");
- sp<IBinder> window(defaultServiceManager()->getService(name));
- if (window != 0) {
- window->linkToDeath(static_cast<IBinder::DeathRecipient*>(this));
+ mWindowManager = defaultServiceManager()->getService(name);
+ if (mWindowManager != 0) {
+ mWindowManager->linkToDeath(static_cast<IBinder::DeathRecipient*>(this));
}
sp<IBinder> input(defaultServiceManager()->getService(
String16("inputflinger")));
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index aee0ed6..f7b7410 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -1096,6 +1096,9 @@
// either AID_GRAPHICS or AID_SYSTEM.
status_t CheckTransactCodeCredentials(uint32_t code);
+ // to linkToDeath
+ sp<IBinder> mWindowManager;
+
std::unique_ptr<dvr::VrFlinger> mVrFlinger;
std::atomic<bool> mVrFlingerRequestsDisplay = false;
static bool useVrFlinger;