1 #ifndef ANDROID_PDX_UDS_CHANNEL_PARCELABLE_H_ 2 #define ANDROID_PDX_UDS_CHANNEL_PARCELABLE_H_ 3 4 #include <pdx/channel_parcelable.h> 5 #include <pdx/file_handle.h> 6 7 namespace android { 8 namespace pdx { 9 namespace uds { 10 11 class ChannelParcelable : public pdx::ChannelParcelable { 12 public: 13 ChannelParcelable() = default; 14 ChannelParcelable(LocalHandle data_fd, LocalHandle pollin_event_fd, 15 LocalHandle pollhup_event_fd); 16 17 // Implements pdx::ChannelParcelable interface. 18 bool IsValid() const override; 19 LocalChannelHandle TakeChannelHandle() override; 20 21 // Implements android::Parcelable interface. 22 status_t writeToParcel(Parcel* parcel) const override; 23 status_t readFromParcel(const Parcel* parcel) override; 24 25 private: 26 LocalHandle data_fd_; 27 LocalHandle pollin_event_fd_; 28 LocalHandle pollhup_event_fd_; 29 }; 30 31 } // namespace uds 32 } // namespace pdx 33 } // namespace android 34 35 #endif // ANDROID_PDX_UDS_CHANNEL_PARCELABLE_H_ 36