Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa607958 authored by Matthew Maurer's avatar Matthew Maurer Committed by Automerger Merge Worker
Browse files

Merge "Implement Debug for a few Binder Rust types" am: 5defed6e am:...

Merge "Implement Debug for a few Binder Rust types" am: 5defed6e am: 9fc032aa am: 70e475a5 am: 473e260a

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1397072

Change-Id: I12786548210bae05b5bc18623356677da7ac95de
parents b8a4702d 473e260a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -581,5 +581,11 @@ macro_rules! declare_binder_interface {
                parcel.write(&this.map($crate::Interface::as_binder))
            }
        }

        impl std::fmt::Debug for dyn $interface {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                f.pad(stringify!($interface))
            }
        }
    };
}
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ use std::fs::File;
use std::os::unix::io::{AsRawFd, FromRawFd};

/// Rust version of the Java class android.os.ParcelFileDescriptor
#[derive(Debug)]
pub struct ParcelFileDescriptor(File);

impl ParcelFileDescriptor {
+7 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ use crate::sys;

use std::convert::TryInto;
use std::ffi::{c_void, CString};
use std::fmt;
use std::os::unix::io::AsRawFd;
use std::ptr;

@@ -37,6 +38,12 @@ use std::ptr;
/// is untyped; typed interface access is implemented by the AIDL compiler.
pub struct SpIBinder(*mut sys::AIBinder);

impl fmt::Debug for SpIBinder {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.pad("SpIBinder")
    }
}

/// # Safety
///
/// An `SpIBinder` is a handle to a C++ IBinder, which is thread-safe