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

Commit 70e58336 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11257657 from 308393e6 to 24Q2-release

Change-Id: Ib8547c3054a54e59f67100e54b3a00fc053965a8
parents 257e0701 308393e6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -125,8 +125,10 @@ void RenderEngineThreaded::threadMain(CreateInstanceFactory factory) NO_THREAD_S
}

void RenderEngineThreaded::waitUntilInitialized() const {
    if (!mIsInitialized) {
        std::unique_lock<std::mutex> lock(mInitializedMutex);
    mInitializedCondition.wait(lock, [=] { return mIsInitialized; });
        mInitializedCondition.wait(lock, [this] { return mIsInitialized.load(); });
    }
}

std::future<void> RenderEngineThreaded::primeCache(bool shouldPrimeUltraHDR) {
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ private:

    // Used to allow select thread safe methods to be accessed without requiring the
    // method to be invoked on the RenderEngine thread
    bool mIsInitialized = false;
    std::atomic_bool mIsInitialized = false;
    mutable std::mutex mInitializedMutex;
    mutable std::condition_variable mInitializedCondition;

+18 −11
Original line number Diff line number Diff line
@@ -52,15 +52,15 @@ InputFilter::InputFilter(InputListenerInterface& listener, IInputFlingerRust& ru
}

void InputFilter::notifyInputDevicesChanged(const NotifyInputDevicesChangedArgs& args) {
    if (isFilterEnabled()) {
        std::vector<AidlDeviceInfo> deviceInfos;
    mDeviceInfos.clear();
    mDeviceInfos.reserve(args.inputDeviceInfos.size());
    for (auto info : args.inputDeviceInfos) {
            AidlDeviceInfo aidlInfo;
        AidlDeviceInfo& aidlInfo = mDeviceInfos.emplace_back();
        aidlInfo.deviceId = info.getId();
        aidlInfo.external = info.isExternal();
            deviceInfos.push_back(aidlInfo);
    }
        LOG_ALWAYS_FATAL_IF(!mInputFilterRust->notifyInputDevicesChanged(deviceInfos).isOk());
    if (isFilterEnabled()) {
        LOG_ALWAYS_FATAL_IF(!mInputFilterRust->notifyInputDevicesChanged(mDeviceInfos).isOk());
    }
    mNextListener.notify(args);
}
@@ -74,7 +74,7 @@ void InputFilter::notifyKey(const NotifyKeyArgs& args) {
        LOG_ALWAYS_FATAL_IF(!mInputFilterRust->notifyKey(notifyKeyArgsToKeyEvent(args)).isOk());
        return;
    }
    mNextListener.notifyKey(args);
    mNextListener.notify(args);
}

void InputFilter::notifyMotion(const NotifyMotionArgs& args) {
@@ -112,7 +112,7 @@ void InputFilter::setAccessibilityBounceKeysThreshold(nsecs_t threshold) {

    if (mConfig.bounceKeysThresholdNs != threshold) {
        mConfig.bounceKeysThresholdNs = threshold;
        LOG_ALWAYS_FATAL_IF(!mInputFilterRust->notifyConfigurationChanged(mConfig).isOk());
        notifyConfigurationChangedLocked();
    }
}

@@ -121,7 +121,14 @@ void InputFilter::setAccessibilityStickyKeysEnabled(bool enabled) {

    if (mConfig.stickyKeysEnabled != enabled) {
        mConfig.stickyKeysEnabled = enabled;
        notifyConfigurationChangedLocked();
    }
}

void InputFilter::notifyConfigurationChangedLocked() {
    LOG_ALWAYS_FATAL_IF(!mInputFilterRust->notifyConfigurationChanged(mConfig).isOk());
    if (isFilterEnabled()) {
        LOG_ALWAYS_FATAL_IF(!mInputFilterRust->notifyInputDevicesChanged(mDeviceInfos).isOk());
    }
}

+5 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public:
            aidl::com::android::server::inputflinger::IInputFilter::IInputFilterCallbacks;
    using InputFilterConfiguration =
            aidl::com::android::server::inputflinger::InputFilterConfiguration;
    using AidlDeviceInfo = aidl::com::android::server::inputflinger::DeviceInfo;

    explicit InputFilter(InputListenerInterface& listener, IInputFlingerRust&);
    ~InputFilter() override = default;
@@ -65,10 +66,14 @@ private:
    InputListenerInterface& mNextListener;
    std::shared_ptr<InputFilterCallbacks> mCallbacks;
    std::shared_ptr<IInputFilter> mInputFilterRust;
    // Keep track of connected peripherals, so that if filters are enabled later, we can pass that
    // info to the filters
    std::vector<AidlDeviceInfo> mDeviceInfos;
    mutable std::mutex mLock;
    InputFilterConfiguration mConfig GUARDED_BY(mLock);

    bool isFilterEnabled();
    void notifyConfigurationChangedLocked() REQUIRES(mLock);
};

} // namespace android
+7 −3
Original line number Diff line number Diff line
@@ -1121,8 +1121,11 @@ void InputDispatcher::dispatchOnceInnerLocked(nsecs_t* nextWakeupTime) {
                }
            }
            if (dropReason == DropReason::NOT_DROPPED && mNextUnblockedEvent) {
                if (!isFromSource(motionEntry->source, AINPUT_SOURCE_CLASS_POINTER)) {
                    // Only drop events that are focus-dispatched.
                    dropReason = DropReason::BLOCKED;
                }
            }
            done = dispatchMotionLocked(currentTime, motionEntry, &dropReason, nextWakeupTime);
            break;
        }
@@ -1392,8 +1395,9 @@ void InputDispatcher::dropInboundEventLocked(const EventEntry& entry, DropReason
            reason = "inbound event was dropped because of pending overdue app switch";
            break;
        case DropReason::BLOCKED:
            ALOGI("Dropped event because the current application is not responding and the user "
                  "has started interacting with a different application.");
            LOG(INFO) << "Dropping because the current application is not responding and the user "
                         "has started interacting with a different application: "
                      << entry.getDescription();
            reason = "inbound event was dropped because the current application is not responding "
                     "and the user has started interacting with a different application";
            break;
Loading