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

Commit ab6f49f2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Support 180-degree screen rotation for RSB."

parents ae2e69e4 ad437259
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -2897,7 +2897,7 @@ void CursorInputMapper::fadePointer() {
// --- RotaryEncoderInputMapper ---
// --- RotaryEncoderInputMapper ---


RotaryEncoderInputMapper::RotaryEncoderInputMapper(InputDevice* device) :
RotaryEncoderInputMapper::RotaryEncoderInputMapper(InputDevice* device) :
        InputMapper(device) {
        InputMapper(device), mOrientation(DISPLAY_ORIENTATION_0) {
    mSource = AINPUT_SOURCE_ROTARY_ENCODER;
    mSource = AINPUT_SOURCE_ROTARY_ENCODER;
}
}


@@ -2939,6 +2939,14 @@ void RotaryEncoderInputMapper::configure(nsecs_t when,
    if (!changes) {
    if (!changes) {
        mRotaryEncoderScrollAccumulator.configure(getDevice());
        mRotaryEncoderScrollAccumulator.configure(getDevice());
    }
    }
    if (!changes || (InputReaderConfiguration::CHANGE_DISPLAY_INFO)) {
        DisplayViewport v;
        if (config->getDisplayViewport(ViewportType::VIEWPORT_INTERNAL, NULL, &v)) {
            mOrientation = v.orientation;
        } else {
            mOrientation = DISPLAY_ORIENTATION_0;
        }
    }
}
}


void RotaryEncoderInputMapper::reset(nsecs_t when) {
void RotaryEncoderInputMapper::reset(nsecs_t when) {
@@ -2976,6 +2984,10 @@ void RotaryEncoderInputMapper::sync(nsecs_t when) {
        policyFlags |= POLICY_FLAG_WAKE;
        policyFlags |= POLICY_FLAG_WAKE;
    }
    }


    if (mOrientation == DISPLAY_ORIENTATION_180) {
        scroll = -scroll;
    }

    // Send motion event.
    // Send motion event.
    if (scrolled) {
    if (scrolled) {
        int32_t metaState = mContext->getGlobalMetaState();
        int32_t metaState = mContext->getGlobalMetaState();
+1 −0
Original line number Original line Diff line number Diff line
@@ -1226,6 +1226,7 @@ private:


    int32_t mSource;
    int32_t mSource;
    float mScalingFactor;
    float mScalingFactor;
    int32_t mOrientation;


    void sync(nsecs_t when);
    void sync(nsecs_t when);
};
};