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

Commit 6baae94f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update Android for Rust 1.83.0" into main am: 9c4a66c2 am: ad42d321

parents 24572ee0 ad42d321
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ unsafe impl AsNative<sys::AParcel> for Parcel {

/// Safety: The `BorrowedParcel` constructors guarantee that a `BorrowedParcel`
/// object will always contain a valid pointer to an `AParcel`.
unsafe impl<'a> AsNative<sys::AParcel> for BorrowedParcel<'a> {
unsafe impl AsNative<sys::AParcel> for BorrowedParcel<'_> {
    fn as_native(&self) -> *const sys::AParcel {
        self.ptr.as_ptr()
    }
@@ -195,7 +195,7 @@ unsafe impl<'a> AsNative<sys::AParcel> for BorrowedParcel<'a> {
}

// Data serialization methods
impl<'a> BorrowedParcel<'a> {
impl BorrowedParcel<'_> {
    /// Data written to parcelable is zero'd before being deleted or reallocated.
    #[cfg(not(android_ndk))]
    pub fn mark_sensitive(&mut self) {
@@ -334,7 +334,7 @@ impl<'a> BorrowedParcel<'a> {
/// A segment of a writable parcel, used for [`BorrowedParcel::sized_write`].
pub struct WritableSubParcel<'a>(BorrowedParcel<'a>);

impl<'a> WritableSubParcel<'a> {
impl WritableSubParcel<'_> {
    /// Write a type that implements [`Serialize`] to the sub-parcel.
    pub fn write<S: Serialize + ?Sized>(&mut self, parcelable: &S) -> Result<()> {
        parcelable.serialize(&mut self.0)
@@ -440,7 +440,7 @@ impl Parcel {
}

// Data deserialization methods
impl<'a> BorrowedParcel<'a> {
impl BorrowedParcel<'_> {
    /// Attempt to read a type that implements [`Deserialize`] from this parcel.
    pub fn read<D: Deserialize>(&self) -> Result<D> {
        D::deserialize(self)
@@ -565,7 +565,7 @@ pub struct ReadableSubParcel<'a> {
    end_position: i32,
}

impl<'a> ReadableSubParcel<'a> {
impl ReadableSubParcel<'_> {
    /// Read a type that implements [`Deserialize`] from the sub-parcel.
    pub fn read<D: Deserialize>(&self) -> Result<D> {
        D::deserialize(&self.parcel)
@@ -649,7 +649,7 @@ impl Parcel {
}

// Internal APIs
impl<'a> BorrowedParcel<'a> {
impl BorrowedParcel<'_> {
    pub(crate) fn write_binder(&mut self, binder: Option<&SpIBinder>) -> Result<()> {
        // Safety: `BorrowedParcel` always contains a valid pointer to an
        // `AParcel`. `AsNative` for `Option<SpIBinder`> will either return
@@ -702,7 +702,7 @@ impl fmt::Debug for Parcel {
    }
}

impl<'a> fmt::Debug for BorrowedParcel<'a> {
impl fmt::Debug for BorrowedParcel<'_> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.debug_struct("BorrowedParcel").finish()
    }
+4 −4
Original line number Diff line number Diff line
@@ -66,11 +66,11 @@ impl KeyboardClassifier {

    /// Get keyboard type for a tracked keyboard in KeyboardClassifier
    pub fn get_keyboard_type(&self, device_id: DeviceId) -> KeyboardType {
        return if let Some(keyboard) = self.device_map.get(&device_id) {
        if let Some(keyboard) = self.device_map.get(&device_id) {
            keyboard.keyboard_type
        } else {
            KeyboardType::None
        };
        }
    }

    /// Tells if keyboard type classification is finalized. Once finalized the classification can't
@@ -79,11 +79,11 @@ impl KeyboardClassifier {
    /// Finalized devices are either "alphabetic" keyboards or keyboards in blocklist or
    /// allowlist that are explicitly categorized and won't change with future key events
    pub fn is_finalized(&self, device_id: DeviceId) -> bool {
        return if let Some(keyboard) = self.device_map.get(&device_id) {
        if let Some(keyboard) = self.device_map.get(&device_id) {
            keyboard.is_finalized
        } else {
            false
        };
        }
    }

    /// Process a key event and change keyboard type if required.
+1 −1
Original line number Diff line number Diff line
@@ -541,7 +541,7 @@ pub struct HardwareBufferGuard<'a> {
    pub address: NonNull<c_void>,
}

impl<'a> Drop for HardwareBufferGuard<'a> {
impl Drop for HardwareBufferGuard<'_> {
    fn drop(&mut self) {
        self.buffer
            .unlock()