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

Commit 32b8a16a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11834877 from 32f704f1 to 24Q3-release

Change-Id: Iae47c914c5a40144c905542967f4a773d055c784
parents fd1d4efe 32f704f1
Loading
Loading
Loading
Loading
+0 −707

File deleted.

Preview size limit exceeded, changes collapsed.

+2 −18
Original line number Diff line number Diff line
@@ -41,13 +41,11 @@
 * Additional private constants not defined in ndk/ui/input.h.
 */
enum {
#ifdef __linux__

    /* This event was generated or modified by accessibility service. */
    AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT =
            android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT,
#else
    AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800,
#endif

    /* Signifies that the key is being predispatched */
    AKEY_EVENT_FLAG_PREDISPATCH = 0x20000000,

@@ -90,15 +88,11 @@ enum {
    AMOTION_EVENT_FLAG_NO_FOCUS_CHANGE =
            android::os::IInputConstants::MOTION_EVENT_FLAG_NO_FOCUS_CHANGE,

#if defined(__linux__)
    /**
     * This event was generated or modified by accessibility service.
     */
    AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT =
            android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT,
#else
    AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800,
#endif

    AMOTION_EVENT_FLAG_TARGET_ACCESSIBILITY_FOCUS =
            android::os::IInputConstants::MOTION_EVENT_FLAG_TARGET_ACCESSIBILITY_FOCUS,
@@ -204,9 +198,7 @@ struct AInputDevice {

namespace android {

#ifdef __linux__
class Parcel;
#endif

/*
 * Apply the given transform to the point without applying any translation/offset.
@@ -312,12 +304,8 @@ enum {

    POLICY_FLAG_RAW_MASK = 0x0000ffff,

#ifdef __linux__
    POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY =
            android::os::IInputConstants::POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY,
#else
    POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000,
#endif

    /* These flags are set by the input dispatcher. */

@@ -486,10 +474,8 @@ struct PointerCoords {

    vec2 getXYValue() const { return vec2(getX(), getY()); }

#ifdef __linux__
    status_t readFromParcel(Parcel* parcel);
    status_t writeToParcel(Parcel* parcel) const;
#endif

    bool operator==(const PointerCoords& other) const;
    inline bool operator!=(const PointerCoords& other) const {
@@ -912,10 +898,8 @@ public:
    // Matrix is in row-major form and compatible with SkMatrix.
    void applyTransform(const std::array<float, 9>& matrix);

#ifdef __linux__
    status_t readFromParcel(Parcel* parcel);
    status_t writeToParcel(Parcel* parcel) const;
#endif

    static bool isTouchEvent(uint32_t source, int32_t action);
    inline bool isTouchEvent() const {
+0 −4
Original line number Diff line number Diff line
@@ -19,9 +19,7 @@
#include <stdint.h>
#include <list>

#ifdef __linux__
#include <binder/IBinder.h>
#endif

#include <android-base/result.h>
#include <input/Input.h>
@@ -144,13 +142,11 @@ public:
    std::pair<int32_t /*keyCode*/, int32_t /*metaState*/> applyKeyBehavior(int32_t keyCode,
                                                                           int32_t metaState) const;

#ifdef __linux__
    /* Reads a key map from a parcel. */
    static std::unique_ptr<KeyCharacterMap> readFromParcel(Parcel* parcel);

    /* Writes a key map to a parcel. */
    void writeToParcel(Parcel* parcel) const;
#endif

    bool operator==(const KeyCharacterMap& other) const = default;

+27 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ use std::future::Future;

/// Retrieve an existing service for a particular interface, sleeping for a few
/// seconds if it doesn't yet exist.
#[deprecated = "this polls 5s, use wait_for_interface or check_interface"]
pub async fn get_interface<T: FromIBinder + ?Sized + 'static>(
    name: &str,
) -> Result<Strong<T>, StatusCode> {
@@ -56,6 +57,32 @@ pub async fn get_interface<T: FromIBinder + ?Sized + 'static>(
    }
}

/// Retrieve an existing service for a particular interface. Returns
/// `Err(StatusCode::NAME_NOT_FOUND)` immediately if the service is not available.
///
/// NOTE: "immediately" above does not mean the future will complete the first time it is polled.
pub async fn check_interface<T: FromIBinder + ?Sized + 'static>(
    name: &str,
) -> Result<Strong<T>, StatusCode> {
    if binder::is_handling_transaction() {
        // See comment in the BinderAsyncPool impl.
        return binder::check_interface::<T>(name);
    }

    let name = name.to_string();
    let res = tokio::task::spawn_blocking(move || binder::check_interface::<T>(&name)).await;

    // The `is_panic` branch is not actually reachable in Android as we compile
    // with `panic = abort`.
    match res {
        Ok(Ok(service)) => Ok(service),
        Ok(Err(err)) => Err(err),
        Err(e) if e.is_panic() => std::panic::resume_unwind(e.into_panic()),
        Err(e) if e.is_cancelled() => Err(StatusCode::FAILED_TRANSACTION),
        Err(_) => Err(StatusCode::UNKNOWN_ERROR),
    }
}

/// Retrieve an existing service for a particular interface, or start it if it
/// is configured as a dynamic service and isn't yet started.
pub async fn wait_for_interface<T: FromIBinder + ?Sized + 'static>(
+3 −3
Original line number Diff line number Diff line
@@ -114,9 +114,9 @@ pub use parcel::{ParcelFileDescriptor, Parcelable, ParcelableHolder};
pub use proxy::{DeathRecipient, SpIBinder, WpIBinder};
#[cfg(not(trusty))]
pub use service::{
    add_service, force_lazy_services_persist, get_declared_instances, get_interface, get_service,
    is_declared, is_handling_transaction, register_lazy_service, wait_for_interface,
    wait_for_service, LazyServiceGuard,
    add_service, check_interface, check_service, force_lazy_services_persist,
    get_declared_instances, get_interface, get_service, is_declared, is_handling_transaction,
    register_lazy_service, wait_for_interface, wait_for_service, LazyServiceGuard,
};
#[cfg(not(trusty))]
pub use state::{ProcessState, ThreadState};
Loading