From 356bc37719bb748346a79935e1979e264c81c296 Mon Sep 17 00:00:00 2001 From: Albert Chaulk Date: Wed, 5 Apr 2017 18:01:58 -0400 Subject: Check if a visible layer exists instead of an invisible layer exists Multiple layers may exist at index 0 and what we really want to know is if any of them are active, not if any aren't. Bug: 36867186, 36036583 Test: Launch ithaca then youtube Change-Id: I5881a838c7df8670fa42eece558717140d4cb021 --- libs/vr/libvrflinger/display_service.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/vr/libvrflinger/display_service.cpp b/libs/vr/libvrflinger/display_service.cpp index 3750ea37a4..bb8613cb5b 100644 --- a/libs/vr/libvrflinger/display_service.cpp +++ b/libs/vr/libvrflinger/display_service.cpp @@ -361,10 +361,10 @@ void DisplayService::NotifyDisplayConfigurationUpdate() { } int DisplayService::IsVrAppRunning(pdx::Message& message) { - bool visible = true; + bool visible = false; ForEachDisplaySurface([&visible](const std::shared_ptr& surface) { - if (surface->client_z_order() == 0 && !surface->IsVisible()) - visible = false; + if (surface->client_z_order() == 0 && surface->IsVisible()) + visible = true; }); REPLY_SUCCESS_RETURN(message, visible, 0); -- cgit v1.2.3-59-g8ed1b