Loading libs/vr/libpdx/private/pdx/service.h +8 −0 Original line number Diff line number Diff line Loading @@ -588,6 +588,14 @@ class Service : public std::enable_shared_from_this<Service> { ForEachChannelUnlocked(action); } /* * Return true if a channel with the given ID exists in the Channel map. */ bool HasChannelId(int channel_id) const { std::lock_guard<std::mutex> autolock(channels_mutex_); return channels_.find(channel_id) != channels_.end(); } /* * Subclasses of Service may override this method to provide a text string * describing the state of the service. This method is called by Loading libs/vr/libvrflinger/display_manager_service.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,14 @@ std::shared_ptr<pdx::Channel> DisplayManagerService::OnChannelOpen( const int user_id = message.GetEffectiveUserId(); const bool trusted = user_id == AID_ROOT || IsTrustedUid(user_id); // Check if the display_manager_ has a defunct channel. if (display_manager_ && !HasChannelId(display_manager_->channel_id())) { ALOGE("DisplayManagerService::OnChannelOpen: Found defunct channel %d with " "no OnChannelClose, clearing prior display manager.", display_manager_->channel_id()); display_manager_ = nullptr; } // Prevent more than one display manager from registering at a time or // untrusted UIDs from connecting. if (display_manager_ || !trusted) { Loading Loading
libs/vr/libpdx/private/pdx/service.h +8 −0 Original line number Diff line number Diff line Loading @@ -588,6 +588,14 @@ class Service : public std::enable_shared_from_this<Service> { ForEachChannelUnlocked(action); } /* * Return true if a channel with the given ID exists in the Channel map. */ bool HasChannelId(int channel_id) const { std::lock_guard<std::mutex> autolock(channels_mutex_); return channels_.find(channel_id) != channels_.end(); } /* * Subclasses of Service may override this method to provide a text string * describing the state of the service. This method is called by Loading
libs/vr/libvrflinger/display_manager_service.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,14 @@ std::shared_ptr<pdx::Channel> DisplayManagerService::OnChannelOpen( const int user_id = message.GetEffectiveUserId(); const bool trusted = user_id == AID_ROOT || IsTrustedUid(user_id); // Check if the display_manager_ has a defunct channel. if (display_manager_ && !HasChannelId(display_manager_->channel_id())) { ALOGE("DisplayManagerService::OnChannelOpen: Found defunct channel %d with " "no OnChannelClose, clearing prior display manager.", display_manager_->channel_id()); display_manager_ = nullptr; } // Prevent more than one display manager from registering at a time or // untrusted UIDs from connecting. if (display_manager_ || !trusted) { Loading