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

Commit 9538cc53 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7183400 from 96e73df1 to sc-release

Change-Id: I1caf6956907eccb22fbe286c86e4b0e00d5867a3
parents 82589f21 96e73df1
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -181,21 +181,6 @@ struct InputMessage {
    bool isValid(size_t actualSize) const;
    size_t size() const;
    void getSanitizedCopy(InputMessage* msg) const;

    static const char* typeToString(Type type) {
        switch (type) {
            case Type::KEY:
                return "KEY";
            case Type::MOTION:
                return "MOTION";
            case Type::FINISHED:
                return "FINISHED";
            case Type::FOCUS:
                return "FOCUS";
            case Type::CAPTURE:
                return "CAPTURE";
        }
    }
};

/*
+3 −3
Original line number Diff line number Diff line
@@ -83,13 +83,13 @@ cc_library {
                "InputWindow.cpp",
                "android/FocusRequest.aidl",
                "android/InputApplicationInfo.aidl",
                "android/os/BlockUntrustedTouchesMode.aidl",
                "android/os/IInputConstants.aidl",
                "android/os/IInputFlinger.aidl",
                "android/os/InputEventInjectionResult.aidl",
                "android/os/InputEventInjectionSync.aidl",
                "android/os/TouchOcclusionMode.aidl",
                "android/os/BlockUntrustedTouchesMode.aidl",
                "android/os/IInputFlinger.aidl",
                "android/os/ISetInputWindowsListener.aidl",
                "android/os/TouchOcclusionMode.aidl",
            ],

            export_shared_lib_headers: ["libbinder"],
+8 −6
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ static constexpr bool DEBUG_TRANSPORT_ACTIONS = false;
#include <utils/Trace.h>

#include <input/InputTransport.h>
#include <input/NamedEnum.h>

using android::base::StringPrintf;

@@ -610,8 +611,8 @@ status_t InputPublisher::receiveFinishedSignal(
        return result;
    }
    if (msg.header.type != InputMessage::Type::FINISHED) {
        ALOGE("channel '%s' publisher ~ Received unexpected message of type %d from consumer",
                mChannel->getName().c_str(), msg.header.type);
        ALOGE("channel '%s' publisher ~ Received unexpected %s message from consumer",
              mChannel->getName().c_str(), NamedEnum::string(msg.header.type).c_str());
        return UNKNOWN_ERROR;
    }
    callback(msg.header.seq, msg.body.finished.handled == 1, msg.body.finished.consumeTime);
@@ -753,8 +754,9 @@ status_t InputConsumer::consume(InputEventFactoryInterface* factory, bool consum
            }

            case InputMessage::Type::FINISHED: {
                LOG_ALWAYS_FATAL("Consumed a FINISHED message, which should never be seen by "
                                 "InputConsumer!");
                LOG_ALWAYS_FATAL("Consumed a %s message, which should never be seen by "
                                 "InputConsumer!",
                                 NamedEnum::string(mMsg.header.type).c_str());
                break;
            }

@@ -1299,14 +1301,14 @@ std::string InputConsumer::dump() const {
    out = out + "mChannel = " + mChannel->getName() + "\n";
    out = out + "mMsgDeferred: " + toString(mMsgDeferred) + "\n";
    if (mMsgDeferred) {
        out = out + "mMsg : " + InputMessage::typeToString(mMsg.header.type) + "\n";
        out = out + "mMsg : " + NamedEnum::string(mMsg.header.type) + "\n";
    }
    out += "Batches:\n";
    for (const Batch& batch : mBatches) {
        out += "    Batch:\n";
        for (const InputMessage& msg : batch.samples) {
            out += android::base::StringPrintf("        Message %" PRIu32 ": %s ", msg.header.seq,
                                               InputMessage::typeToString(msg.header.type));
                                               NamedEnum::string(msg.header.type).c_str());
            switch (msg.header.type) {
                case InputMessage::Type::KEY: {
                    out += android::base::StringPrintf("action=%s keycode=%" PRId32,
+6 −6
Original line number Diff line number Diff line
@@ -43,19 +43,19 @@ public:

    InputFlinger() ANDROID_API;

    virtual status_t dump(int fd, const Vector<String16>& args);
    status_t dump(int fd, const Vector<String16>& args) override;
    binder::Status setInputWindows(const std::vector<InputWindowInfo>&,
                                   const sp<ISetInputWindowsListener>&) {
                                   const sp<ISetInputWindowsListener>&) override {
        return binder::Status::ok();
    }
    binder::Status createInputChannel(const std::string&, InputChannel*) {
    binder::Status createInputChannel(const std::string&, InputChannel*) override {
        return binder::Status::ok();
    }
    binder::Status removeInputChannel(const sp<IBinder>&) { return binder::Status::ok(); }
    binder::Status setFocusedWindow(const FocusRequest&) { return binder::Status::ok(); }
    binder::Status removeInputChannel(const sp<IBinder>&) override { return binder::Status::ok(); }
    binder::Status setFocusedWindow(const FocusRequest&) override { return binder::Status::ok(); }

private:
    virtual ~InputFlinger();
    ~InputFlinger() override;

    void dumpInternal(String8& result);

+8 −7
Original line number Diff line number Diff line
@@ -145,9 +145,9 @@ bool DisplayDevice::isPoweredOn() const {
}

void DisplayDevice::setActiveMode(DisplayModeId id) {
    LOG_FATAL_IF(id.value() >= mSupportedModes.size(),
                 "Cannot set active mode which is not supported.");
    mActiveModeId = id;
    const auto mode = getMode(id);
    LOG_FATAL_IF(!mode, "Cannot set active mode which is not supported.");
    mActiveMode = mode;
}

status_t DisplayDevice::initiateModeChange(DisplayModeId modeId,
@@ -164,7 +164,7 @@ status_t DisplayDevice::initiateModeChange(DisplayModeId modeId,
}

const DisplayModePtr& DisplayDevice::getActiveMode() const {
    return mSupportedModes[mActiveModeId.value()];
    return mActiveMode;
}

const DisplayModes& DisplayDevice::getSupportedModes() const {
@@ -172,9 +172,10 @@ const DisplayModes& DisplayDevice::getSupportedModes() const {
}

DisplayModePtr DisplayDevice::getMode(DisplayModeId modeId) const {
    const auto id = modeId.value();
    if (static_cast<size_t>(id) < mSupportedModes.size()) {
        return mSupportedModes[id];
    const auto it = std::find_if(mSupportedModes.begin(), mSupportedModes.end(),
                                 [&](DisplayModePtr mode) { return mode->getId() == modeId; });
    if (it != mSupportedModes.end()) {
        return *it;
    }
    return nullptr;
}
Loading