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

Commit c3cf1a29 authored by Liana Kazanova's avatar Liana Kazanova Committed by Android (Google) Code Review
Browse files

Revert "Remove notifyConfigurationChanged listener and policy calls"

Revert submission 28338641-remove_notify_configuration_changed

Reason for revert: Droidmonitor created revert due to http://b/353980868 - verifying through ABTD before submission.  

Reverted changes: /q/submissionid:28338641-remove_notify_configuration_changed

Change-Id: I06b37a72b5cb67e377a2deb79c14d266afdcf81f
parent bffa940e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -133,6 +133,15 @@ void InputDeviceMetricsCollector::notifyInputDevicesChanged(
    mNextListener.notify(args);
}

void InputDeviceMetricsCollector::notifyConfigurationChanged(
        const NotifyConfigurationChangedArgs& args) {
    {
        std::scoped_lock lock(mLock);
        reportCompletedSessions();
    }
    mNextListener.notify(args);
}

void InputDeviceMetricsCollector::notifyKey(const NotifyKeyArgs& args) {
    {
        std::scoped_lock lock(mLock);
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ public:
                                std::chrono::nanoseconds usageSessionTimeout);

    void notifyInputDevicesChanged(const NotifyInputDevicesChangedArgs& args) override;
    void notifyConfigurationChanged(const NotifyConfigurationChangedArgs& args) override;
    void notifyKey(const NotifyKeyArgs& args) override;
    void notifyMotion(const NotifyMotionArgs& args) override;
    void notifySwitch(const NotifySwitchArgs& args) override;
+4 −0
Original line number Diff line number Diff line
@@ -67,6 +67,10 @@ void InputFilter::notifyInputDevicesChanged(const NotifyInputDevicesChangedArgs&
    mNextListener.notify(args);
}

void InputFilter::notifyConfigurationChanged(const NotifyConfigurationChangedArgs& args) {
    mNextListener.notify(args);
}

void InputFilter::notifyKey(const NotifyKeyArgs& args) {
    if (isFilterEnabled()) {
        LOG_ALWAYS_FATAL_IF(!mInputFilterRust->notifyKey(notifyKeyArgsToKeyEvent(args)).isOk());
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public:
                         InputFilterPolicyInterface& policy);
    ~InputFilter() override = default;
    void notifyInputDevicesChanged(const NotifyInputDevicesChangedArgs& args) override;
    void notifyConfigurationChanged(const NotifyConfigurationChangedArgs& args) override;
    void notifyKey(const NotifyKeyArgs& args) override;
    void notifyMotion(const NotifyMotionArgs& args) override;
    void notifySwitch(const NotifySwitchArgs& args) override;
+12 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ Visitor(V...) -> Visitor<V...>;
void InputListenerInterface::notify(const NotifyArgs& generalArgs) {
    Visitor v{
            [&](const NotifyInputDevicesChangedArgs& args) { notifyInputDevicesChanged(args); },
            [&](const NotifyConfigurationChangedArgs& args) { notifyConfigurationChanged(args); },
            [&](const NotifyKeyArgs& args) { notifyKey(args); },
            [&](const NotifyMotionArgs& args) { notifyMotion(args); },
            [&](const NotifySwitchArgs& args) { notifySwitch(args); },
@@ -67,6 +68,10 @@ void QueuedInputListener::notifyInputDevicesChanged(const NotifyInputDevicesChan
    mArgsQueue.emplace_back(args);
}

void QueuedInputListener::notifyConfigurationChanged(const NotifyConfigurationChangedArgs& args) {
    mArgsQueue.emplace_back(args);
}

void QueuedInputListener::notifyKey(const NotifyKeyArgs& args) {
    mArgsQueue.emplace_back(args);
}
@@ -114,6 +119,13 @@ void TracedInputListener::notifyInputDevicesChanged(const NotifyInputDevicesChan
    mInnerListener.notify(args);
}

void TracedInputListener::notifyConfigurationChanged(const NotifyConfigurationChangedArgs& args) {
    constexpr static auto& fnName = __func__;
    ATRACE_NAME_IF(ATRACE_ENABLED(),
                   StringPrintf("%s::%s(id=0x%" PRIx32 ")", mName, fnName, args.id));
    mInnerListener.notify(args);
}

void TracedInputListener::notifyKey(const NotifyKeyArgs& args) {
    constexpr static auto& fnName = __func__;
    ATRACE_NAME_IF(ATRACE_ENABLED(),
Loading