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

Commit ce167788 authored by Matt Buckley's avatar Matt Buckley Committed by Android (Google) Code Review
Browse files

Merge "Update mock classes to reflect powerhal changes" into main

parents b067fdcf 104f53ac
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -29,9 +29,12 @@
#include <thread>

using aidl::android::hardware::power::Boost;
using aidl::android::hardware::power::ChannelConfig;
using aidl::android::hardware::power::IPower;
using aidl::android::hardware::power::IPowerHintSession;
using aidl::android::hardware::power::Mode;
using aidl::android::hardware::power::SessionConfig;
using aidl::android::hardware::power::SessionTag;
using android::binder::Status;

using namespace android;
@@ -53,6 +56,14 @@ public:
                (int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds,
                 int64_t durationNanos, std::shared_ptr<IPowerHintSession>* session),
                (override));
    MOCK_METHOD(ndk::ScopedAStatus, createHintSessionWithConfig,
                (int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds,
                 int64_t durationNanos, SessionTag tag, SessionConfig* config,
                 std::shared_ptr<IPowerHintSession>* _aidl_return),
                (override));
    MOCK_METHOD(ndk::ScopedAStatus, getSessionChannel,
                (int32_t tgid, int32_t uid, ChannelConfig* _aidl_return), (override));
    MOCK_METHOD(ndk::ScopedAStatus, closeSessionChannel, (int32_t tgid, int32_t uid), (override));
    MOCK_METHOD(ndk::ScopedAStatus, getHintSessionPreferredRate, (int64_t * rate), (override));
    MOCK_METHOD(ndk::ScopedAStatus, getInterfaceVersion, (int32_t * version), (override));
    MOCK_METHOD(ndk::ScopedAStatus, getInterfaceHash, (std::string * hash), (override));
+0 −4
Original line number Diff line number Diff line
@@ -31,10 +31,6 @@
#include <utils/Mutex.h>
#include <utils/Trace.h>

#include <aidl/android/hardware/power/IPower.h>
#include <aidl/android/hardware/power/IPowerHintSession.h>
#include <aidl/android/hardware/power/WorkDuration.h>

#include <binder/IServiceManager.h>

#include "../SurfaceFlingerProperties.h"
+6 −1
Original line number Diff line number Diff line
@@ -25,9 +25,14 @@
#include <ui/FenceTime.h>
#include <utils/Mutex.h>

// FMQ library in IPower does questionable conversions
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#include <aidl/android/hardware/power/IPower.h>
#include <compositionengine/impl/OutputCompositionState.h>
#include <powermanager/PowerHalController.h>
#pragma clang diagnostic pop

#include <compositionengine/impl/OutputCompositionState.h>
#include <scheduler/Time.h>
#include <ui/DisplayIdentification.h>
#include "../Scheduler/OneShotTimer.h"
+17 −0
Original line number Diff line number Diff line
@@ -18,12 +18,21 @@

#include "binder/Status.h"

// FMQ library in IPower does questionable conversions
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#include <aidl/android/hardware/power/IPower.h>
#pragma clang diagnostic pop

#include <gmock/gmock.h>

using aidl::android::hardware::power::Boost;
using aidl::android::hardware::power::ChannelConfig;
using aidl::android::hardware::power::IPower;
using aidl::android::hardware::power::IPowerHintSession;
using aidl::android::hardware::power::SessionConfig;
using aidl::android::hardware::power::SessionTag;

using aidl::android::hardware::power::Mode;
using android::binder::Status;

@@ -42,6 +51,14 @@ public:
                 int64_t durationNanos, std::shared_ptr<IPowerHintSession>* session),
                (override));
    MOCK_METHOD(ndk::ScopedAStatus, getHintSessionPreferredRate, (int64_t * rate), (override));
    MOCK_METHOD(ndk::ScopedAStatus, createHintSessionWithConfig,
                (int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds,
                 int64_t durationNanos, SessionTag tag, SessionConfig* config,
                 std::shared_ptr<IPowerHintSession>* _aidl_return),
                (override));
    MOCK_METHOD(ndk::ScopedAStatus, getSessionChannel,
                (int32_t tgid, int32_t uid, ChannelConfig* _aidl_return), (override));
    MOCK_METHOD(ndk::ScopedAStatus, closeSessionChannel, (int32_t tgid, int32_t uid), (override));
    MOCK_METHOD(ndk::ScopedAStatus, getInterfaceVersion, (int32_t * version), (override));
    MOCK_METHOD(ndk::ScopedAStatus, getInterfaceHash, (std::string * hash), (override));
    MOCK_METHOD(ndk::SpAIBinder, asBinder, (), (override));
+6 −0
Original line number Diff line number Diff line
@@ -18,10 +18,15 @@

#include "binder/Status.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#include <aidl/android/hardware/power/IPower.h>
#pragma clang diagnostic pop

#include <gmock/gmock.h>

using aidl::android::hardware::power::IPowerHintSession;
using aidl::android::hardware::power::SessionConfig;
using aidl::android::hardware::power::SessionHint;
using aidl::android::hardware::power::SessionMode;
using android::binder::Status;
@@ -47,6 +52,7 @@ public:
    MOCK_METHOD(ndk::ScopedAStatus, sendHint, (SessionHint), (override));
    MOCK_METHOD(ndk::ScopedAStatus, setThreads, (const ::std::vector<int32_t>&), (override));
    MOCK_METHOD(ndk::ScopedAStatus, setMode, (SessionMode, bool), (override));
    MOCK_METHOD(ndk::ScopedAStatus, getSessionConfig, (SessionConfig * _aidl_return), (override));
};

} // namespace android::Hwc2::mock
Loading