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

Commit c328fab9 authored by Xin Li's avatar Xin Li Committed by Gerrit Code Review
Browse files

Merge "Merge Android 12 QPR1"

parents 4cb83a07 5bea2cc7
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -947,9 +947,10 @@ int32_t AInputEvent_getSource(const AInputEvent* event);
 * and {@link AMotionEvent_fromJava()}.
 * and {@link AMotionEvent_fromJava()}.
 * After returning, the specified AInputEvent* object becomes invalid and should no longer be used.
 * After returning, the specified AInputEvent* object becomes invalid and should no longer be used.
 * The underlying Java object remains valid and does not change its state.
 * The underlying Java object remains valid and does not change its state.
 *
 * Available since API level 31.
 */
 */

void AInputEvent_release(const AInputEvent* event) __INTRODUCED_IN(31);
void AInputEvent_release(const AInputEvent* event);


/*** Accessors for key events only. ***/
/*** Accessors for key events only. ***/


@@ -1001,8 +1002,10 @@ int64_t AKeyEvent_getEventTime(const AInputEvent* key_event);
 * Creates a native AInputEvent* object that is a copy of the specified Java android.view.KeyEvent.
 * Creates a native AInputEvent* object that is a copy of the specified Java android.view.KeyEvent.
 * The result may be used with generic and KeyEvent-specific AInputEvent_* functions. The object
 * The result may be used with generic and KeyEvent-specific AInputEvent_* functions. The object
 * returned by this function must be disposed using {@link AInputEvent_release()}.
 * returned by this function must be disposed using {@link AInputEvent_release()}.
 *
 * Available since API level 31.
 */
 */
const AInputEvent* AKeyEvent_fromJava(JNIEnv* env, jobject keyEvent);
const AInputEvent* AKeyEvent_fromJava(JNIEnv* env, jobject keyEvent) __INTRODUCED_IN(31);


/*** Accessors for motion events only. ***/
/*** Accessors for motion events only. ***/


@@ -1324,8 +1327,10 @@ float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
 * android.view.MotionEvent. The result may be used with generic and MotionEvent-specific
 * android.view.MotionEvent. The result may be used with generic and MotionEvent-specific
 * AInputEvent_* functions. The object returned by this function must be disposed using
 * AInputEvent_* functions. The object returned by this function must be disposed using
 * {@link AInputEvent_release()}.
 * {@link AInputEvent_release()}.
 *
 * Available since API level 31.
 */
 */
const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent);
const AInputEvent* AMotionEvent_fromJava(JNIEnv* env, jobject motionEvent) __INTRODUCED_IN(31);


struct AInputQueue;
struct AInputQueue;
/**
/**
+19 −0
Original line number Original line Diff line number Diff line
@@ -1015,6 +1015,25 @@ private:
    std::queue<std::unique_ptr<DragEvent>> mDragEventPool;
    std::queue<std::unique_ptr<DragEvent>> mDragEventPool;
};
};


/*
 * Describes a unique request to enable or disable Pointer Capture.
 */
struct PointerCaptureRequest {
public:
    inline PointerCaptureRequest() : enable(false), seq(0) {}
    inline PointerCaptureRequest(bool enable, uint32_t seq) : enable(enable), seq(seq) {}
    inline bool operator==(const PointerCaptureRequest& other) const {
        return enable == other.enable && seq == other.seq;
    }
    explicit inline operator bool() const { return enable; }

    // True iff this is a request to enable Pointer Capture.
    bool enable;

    // The sequence number for the request.
    uint32_t seq;
};

} // namespace android
} // namespace android


#endif // _LIBINPUT_INPUT_H
#endif // _LIBINPUT_INPUT_H
+0 −18
Original line number Original line Diff line number Diff line
@@ -1410,23 +1410,6 @@ void IPCThreadState::threadDestructor(void *st)
        }
        }
}
}


status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, bool *sync_received, bool *async_received)
{
    int ret = 0;
    binder_frozen_status_info info;
    info.pid = pid;

#if defined(__ANDROID__)
    if (ioctl(self()->mProcess->mDriverFD, BINDER_GET_FROZEN_INFO, &info) < 0)
        ret = -errno;
#endif
    *sync_received = info.sync_recv;
    *async_received = info.async_recv;

    return ret;
}

#ifndef __ANDROID_VNDK__
status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, uint32_t *sync_received,
status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, uint32_t *sync_received,
                                              uint32_t *async_received)
                                              uint32_t *async_received)
{
{
@@ -1443,7 +1426,6 @@ status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, uint32_t *sync_received


    return ret;
    return ret;
}
}
#endif


status_t IPCThreadState::freeze(pid_t pid, bool enable, uint32_t timeout_ms) {
status_t IPCThreadState::freeze(pid_t pid, bool enable, uint32_t timeout_ms) {
    struct binder_freeze_info info;
    struct binder_freeze_info info;
+1 −7
Original line number Original line Diff line number Diff line
@@ -51,14 +51,8 @@ public:
    static  status_t            freeze(pid_t pid, bool enabled, uint32_t timeout_ms);
    static  status_t            freeze(pid_t pid, bool enabled, uint32_t timeout_ms);


    // Provide information about the state of a frozen process
    // Provide information about the state of a frozen process
    static  status_t            getProcessFreezeInfo(pid_t pid, bool *sync_received,
                                                    bool *async_received);

    // TODO: Remove the above legacy duplicated function in next version
#ifndef __ANDROID_VNDK__
    static  status_t            getProcessFreezeInfo(pid_t pid, uint32_t *sync_received,
    static  status_t            getProcessFreezeInfo(pid_t pid, uint32_t *sync_received,
                                                    uint32_t *async_received);
                                                    uint32_t *async_received);
#endif


            sp<ProcessState>    process();
            sp<ProcessState>    process();


+2 −10
Original line number Original line Diff line number Diff line
@@ -496,7 +496,7 @@ TEST_F(BinderLibTest, Freeze) {
    EXPECT_EQ(NO_ERROR, IPCThreadState::self()->freeze(pid, true, 1000));
    EXPECT_EQ(NO_ERROR, IPCThreadState::self()->freeze(pid, true, 1000));
    EXPECT_EQ(FAILED_TRANSACTION, m_server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data, &reply));
    EXPECT_EQ(FAILED_TRANSACTION, m_server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data, &reply));


    bool sync_received, async_received;
    uint32_t sync_received, async_received;


    EXPECT_EQ(NO_ERROR, IPCThreadState::self()->getProcessFreezeInfo(pid, &sync_received,
    EXPECT_EQ(NO_ERROR, IPCThreadState::self()->getProcessFreezeInfo(pid, &sync_received,
                &async_received));
                &async_received));
@@ -504,15 +504,7 @@ TEST_F(BinderLibTest, Freeze) {
    EXPECT_EQ(sync_received, 1);
    EXPECT_EQ(sync_received, 1);
    EXPECT_EQ(async_received, 0);
    EXPECT_EQ(async_received, 0);


    uint32_t sync_received2, async_received2;
    EXPECT_EQ(NO_ERROR, IPCThreadState::self()->freeze(pid, false, 0));

    EXPECT_EQ(NO_ERROR, IPCThreadState::self()->getProcessFreezeInfo(pid, &sync_received2,
                &async_received2));

    EXPECT_EQ(sync_received2, 1);
    EXPECT_EQ(async_received2, 0);

    EXPECT_EQ(NO_ERROR, IPCThreadState::self()->freeze(pid, 0, 0));
    EXPECT_EQ(NO_ERROR, m_server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data, &reply));
    EXPECT_EQ(NO_ERROR, m_server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data, &reply));
}
}


Loading