Implement an API for vrwm to query if the current vr app is active
The API returns if the client_order 0 layer is visible or not. This
aids in 2D app detection
Bug: None
Test: Manual with permissionsgen & calculator
Change-Id: Id988e61a9f93885e93c28ed83ffaffd84f3bdf15
diff --git a/libs/vr/libdisplay/display_client.cpp b/libs/vr/libdisplay/display_client.cpp
index 50d95f7..9952e59 100644
--- a/libs/vr/libdisplay/display_client.cpp
+++ b/libs/vr/libdisplay/display_client.cpp
@@ -265,6 +265,12 @@
return BufferConsumer::Import(std::move(status));
}
+bool DisplayClient::IsVrAppRunning() {
+ auto status = InvokeRemoteMethod<DisplayRPC::IsVrAppRunning>();
+ if (!status)
+ return 0;
+ return static_cast<bool>(status.get());
+}
} // namespace dvr
} // namespace android