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

Commit dccdd773 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge changes I562f7fd1,I0ab1ed86 am: a9a7a838

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If97c87ad8dc50d726496d1ae8551b5b7b31bf488
parents b62e56e4 a9a7a838
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -597,13 +597,6 @@ binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) {
        return STATUS_INVALID_OPERATION;
    }

    if (!binder->isRemote()) {
        LOG(WARNING) << "A binder object at " << binder
                     << " is being transacted on, however, this object is in the same process as "
                        "its proxy. Transacting with this binder is expensive compared to just "
                        "calling the corresponding functionality in the same process.";
    }

    *in = new AParcel(binder);
    status_t status = (*in)->get()->writeInterfaceToken(clazz->getInterfaceDescriptor());
    binder_status_t ret = PruneStatusT(status);
+3 −17
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ use binder::{
use binder::parcel::ParcelFileDescriptor;

use std::ffi::{c_void, CStr, CString};
use std::panic::{self, AssertUnwindSafe};
use std::sync::Once;

#[allow(
@@ -73,22 +72,9 @@ impl ReadParcelTest for BpReadParcelTest {}

impl ReadParcelTest for () {}

fn on_transact(
    _service: &dyn ReadParcelTest,
    code: TransactionCode,
    parcel: &Parcel,
    reply: &mut Parcel,
) -> Result<()> {
    panic::catch_unwind(AssertUnwindSafe(|| transact_inner(code, parcel, reply))).unwrap_or_else(
        |e| {
            eprintln!("Failure in Rust: {:?}", e.downcast_ref::<String>());
            Err(StatusCode::FAILED_TRANSACTION)
        },
    )
}

#[allow(clippy::float_cmp)]
fn transact_inner(code: TransactionCode, parcel: &Parcel, reply: &mut Parcel) -> Result<()> {
fn on_transact(_service: &dyn ReadParcelTest, code: TransactionCode,
               parcel: &Parcel, reply: &mut Parcel) -> Result<()> {
    match code {
        bindings::Transaction_TEST_BOOL => {
            assert_eq!(parcel.read::<bool>()?, true);
@@ -296,7 +282,7 @@ fn transact_inner(code: TransactionCode, parcel: &Parcel, reply: &mut Parcel) ->
            ))?;
        }
        bindings::Transaction_TEST_FAIL => {
            panic!("Testing expected failure");
            return Err(StatusCode::FAILED_TRANSACTION)
        }
        _ => return Err(StatusCode::UNKNOWN_TRANSACTION),
    }