Loading system/binder/android/os/parcel_file_descriptor.cc +8 −6 Original line number Diff line number Diff line Loading @@ -25,11 +25,8 @@ namespace android { namespace os { status_t ParcelFileDescriptor::writeToParcel(Parcel* parcel) const { status_t status = parcel->writeInt32(0); if (status != OK) return status; status = parcel->writeDupFileDescriptor(fd); return status; CHECK(fd_ >= 0); return parcel->writeParcelFileDescriptor(fd_, takeOwnership_); } status_t ParcelFileDescriptor::readFromParcel(const Parcel* parcel) { Loading @@ -37,5 +34,10 @@ status_t ParcelFileDescriptor::readFromParcel(const Parcel* parcel) { return OK; } void ParcelFileDescriptor::setFileDescriptor(int fd, bool takeOwnership) { fd_ = fd; takeOwnership_ = takeOwnership; } } // namespace os } // namespace android system/binder/android/os/parcel_file_descriptor.h +6 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ namespace os { class ParcelFileDescriptor : public android::Parcelable { public: ParcelFileDescriptor() = default; ParcelFileDescriptor() : fd_(-1), takeOwnership_(false) {} ~ParcelFileDescriptor() = default; // Write |this| parcelable to the given |parcel|. Keep in mind that Loading @@ -41,7 +41,11 @@ class ParcelFileDescriptor : public android::Parcelable { // Returns android::OK on success and an appropriate error otherwise. android::status_t readFromParcel(const android::Parcel* parcel) override; int fd; void setFileDescriptor(int fd, bool takeOwnership); private: int fd_; bool takeOwnership_; }; } // namespace os Loading Loading
system/binder/android/os/parcel_file_descriptor.cc +8 −6 Original line number Diff line number Diff line Loading @@ -25,11 +25,8 @@ namespace android { namespace os { status_t ParcelFileDescriptor::writeToParcel(Parcel* parcel) const { status_t status = parcel->writeInt32(0); if (status != OK) return status; status = parcel->writeDupFileDescriptor(fd); return status; CHECK(fd_ >= 0); return parcel->writeParcelFileDescriptor(fd_, takeOwnership_); } status_t ParcelFileDescriptor::readFromParcel(const Parcel* parcel) { Loading @@ -37,5 +34,10 @@ status_t ParcelFileDescriptor::readFromParcel(const Parcel* parcel) { return OK; } void ParcelFileDescriptor::setFileDescriptor(int fd, bool takeOwnership) { fd_ = fd; takeOwnership_ = takeOwnership; } } // namespace os } // namespace android
system/binder/android/os/parcel_file_descriptor.h +6 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ namespace os { class ParcelFileDescriptor : public android::Parcelable { public: ParcelFileDescriptor() = default; ParcelFileDescriptor() : fd_(-1), takeOwnership_(false) {} ~ParcelFileDescriptor() = default; // Write |this| parcelable to the given |parcel|. Keep in mind that Loading @@ -41,7 +41,11 @@ class ParcelFileDescriptor : public android::Parcelable { // Returns android::OK on success and an appropriate error otherwise. android::status_t readFromParcel(const android::Parcel* parcel) override; int fd; void setFileDescriptor(int fd, bool takeOwnership); private: int fd_; bool takeOwnership_; }; } // namespace os Loading