commit | e0f493b4953e84ab13b32850c41b63c562be7363 | [log] [tgz] |
---|---|---|
author | Victor Hsieh <victorhsieh@google.com> | Mon Aug 09 16:23:36 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Aug 09 16:23:36 2021 +0000 |
tree | 429c6f2f8c4be65a737e43033f13db06621bd81d | |
parent | da7ade5b509a4d78cebcb5f8232e0be167a7b442 [diff] | |
parent | 9611c5333f5a052dde500618777c957c8093768a [diff] |
Merge "Implement AsRawFd trait for ParcelFileDescriptor" am: 385a3a02d0 am: e409e87f0a am: 6f40ada09e am: 9611c5333f Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1789493 Change-Id: I949fa23d4a4cd72bf6b7aa1406569aaaf7ff16bf
diff --git a/libs/binder/rust/src/parcel/file_descriptor.rs b/libs/binder/rust/src/parcel/file_descriptor.rs index 20e9178..179b7c8 100644 --- a/libs/binder/rust/src/parcel/file_descriptor.rs +++ b/libs/binder/rust/src/parcel/file_descriptor.rs
@@ -23,7 +23,7 @@ use crate::sys; use std::fs::File; -use std::os::unix::io::{AsRawFd, FromRawFd}; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; /// Rust version of the Java class android.os.ParcelFileDescriptor #[derive(Debug)] @@ -48,6 +48,12 @@ } } +impl AsRawFd for ParcelFileDescriptor { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + impl Serialize for ParcelFileDescriptor { fn serialize(&self, parcel: &mut Parcel) -> Result<()> { let fd = self.0.as_raw_fd();