Loading libs/vr/libdisplay/display_client.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,12 @@ std::unique_ptr<BufferConsumer> DisplayClient::GetPoseBuffer() { 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 libs/vr/libdisplay/include/private/dvr/display_client.h +3 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,9 @@ class DisplayClient : public pdx::ClientBase<DisplayClient> { std::unique_ptr<BufferConsumer> GetPoseBuffer(); // Temporary query for current VR status. Will be removed later. bool IsVrAppRunning(); private: friend BASE; Loading libs/vr/libdisplay/include/private/dvr/display_rpc.h +2 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,7 @@ struct DisplayRPC { kOpVideoMeshSurfaceCreateProducerQueue, kOpSetViewerParams, kOpGetPoseBuffer, kOpIsVrAppRunning, }; // Aliases. Loading Loading @@ -248,6 +249,7 @@ struct DisplayRPC { void(const ViewerParams& viewer_params)); PDX_REMOTE_METHOD(GetPoseBuffer, kOpGetPoseBuffer, LocalChannelHandle(Void)); PDX_REMOTE_METHOD(IsVrAppRunning, kOpIsVrAppRunning, int(Void)); }; struct DisplayManagerRPC { Loading libs/vr/libvrflinger/display_service.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ int DisplayService::HandleMessage(pdx::Message& message) { *this, &DisplayService::OnGetPoseBuffer, message); return 0; case DisplayRPC::IsVrAppRunning::Opcode: DispatchRemoteMethod<DisplayRPC::IsVrAppRunning>( *this, &DisplayService::IsVrAppRunning, message); return 0; // Direct the surface specific messages to the surface instance. case DisplayRPC::CreateBufferQueue::Opcode: case DisplayRPC::SetAttributes::Opcode: Loading Loading @@ -355,5 +360,15 @@ void DisplayService::NotifyDisplayConfigurationUpdate() { update_notifier_(); } int DisplayService::IsVrAppRunning(pdx::Message& message) { bool visible = true; ForEachDisplaySurface([&visible](const std::shared_ptr<DisplaySurface>& surface) { if (surface->client_z_order() == 0 && !surface->IsVisible()) visible = false; }); REPLY_SUCCESS_RETURN(message, visible, 0); } } // namespace dvr } // namespace android libs/vr/libvrflinger/display_service.h +3 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,9 @@ class DisplayService : public pdx::ServiceBase<DisplayService> { const ViewerParams& view_params); pdx::LocalChannelHandle OnGetPoseBuffer(pdx::Message& message); // Temporary query for current VR status. Will be removed later. int IsVrAppRunning(pdx::Message& message); // Called by DisplaySurface to signal that a surface property has changed and // the display manager should be notified. void NotifyDisplayConfigurationUpdate(); Loading Loading
libs/vr/libdisplay/display_client.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,12 @@ std::unique_ptr<BufferConsumer> DisplayClient::GetPoseBuffer() { 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
libs/vr/libdisplay/include/private/dvr/display_client.h +3 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,9 @@ class DisplayClient : public pdx::ClientBase<DisplayClient> { std::unique_ptr<BufferConsumer> GetPoseBuffer(); // Temporary query for current VR status. Will be removed later. bool IsVrAppRunning(); private: friend BASE; Loading
libs/vr/libdisplay/include/private/dvr/display_rpc.h +2 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,7 @@ struct DisplayRPC { kOpVideoMeshSurfaceCreateProducerQueue, kOpSetViewerParams, kOpGetPoseBuffer, kOpIsVrAppRunning, }; // Aliases. Loading Loading @@ -248,6 +249,7 @@ struct DisplayRPC { void(const ViewerParams& viewer_params)); PDX_REMOTE_METHOD(GetPoseBuffer, kOpGetPoseBuffer, LocalChannelHandle(Void)); PDX_REMOTE_METHOD(IsVrAppRunning, kOpIsVrAppRunning, int(Void)); }; struct DisplayManagerRPC { Loading
libs/vr/libvrflinger/display_service.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ int DisplayService::HandleMessage(pdx::Message& message) { *this, &DisplayService::OnGetPoseBuffer, message); return 0; case DisplayRPC::IsVrAppRunning::Opcode: DispatchRemoteMethod<DisplayRPC::IsVrAppRunning>( *this, &DisplayService::IsVrAppRunning, message); return 0; // Direct the surface specific messages to the surface instance. case DisplayRPC::CreateBufferQueue::Opcode: case DisplayRPC::SetAttributes::Opcode: Loading Loading @@ -355,5 +360,15 @@ void DisplayService::NotifyDisplayConfigurationUpdate() { update_notifier_(); } int DisplayService::IsVrAppRunning(pdx::Message& message) { bool visible = true; ForEachDisplaySurface([&visible](const std::shared_ptr<DisplaySurface>& surface) { if (surface->client_z_order() == 0 && !surface->IsVisible()) visible = false; }); REPLY_SUCCESS_RETURN(message, visible, 0); } } // namespace dvr } // namespace android
libs/vr/libvrflinger/display_service.h +3 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,9 @@ class DisplayService : public pdx::ServiceBase<DisplayService> { const ViewerParams& view_params); pdx::LocalChannelHandle OnGetPoseBuffer(pdx::Message& message); // Temporary query for current VR status. Will be removed later. int IsVrAppRunning(pdx::Message& message); // Called by DisplaySurface to signal that a surface property has changed and // the display manager should be notified. void NotifyDisplayConfigurationUpdate(); Loading