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

Commit ad841236 authored by Xiang Wang's avatar Xiang Wang
Browse files

Update gui fuzzer lib to use power ndk

Bug: 280438886
Test: mm
Change-Id: Iba0cb96d9c3b7001cc505f71d1c8cbf1f021576f
parent d9af4b8f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ cc_defaults {
        "android.hardware.configstore-utils",
        "android.hardware.graphics.bufferqueue@1.0",
        "android.hardware.graphics.bufferqueue@2.0",
        "android.hardware.power-V4-cpp",
        "android.hardware.power-V4-ndk",
        "android.hidl.token@1.0",
        "libSurfaceFlingerProp",
        "libgui",
+9 −6
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <android/hardware/power/Boost.h>
#include <aidl/android/hardware/power/Boost.h>
#include <fuzzbinder/libbinder_driver.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
@@ -39,10 +39,13 @@ constexpr ui::ColorMode kColormodes[] = {ui::ColorMode::NATIVE,
                                         ui::ColorMode::BT2100_HLG,
                                         ui::ColorMode::DISPLAY_BT2020};

constexpr hardware::power::Boost kBoost[] = {
        hardware::power::Boost::INTERACTION,   hardware::power::Boost::DISPLAY_UPDATE_IMMINENT,
        hardware::power::Boost::ML_ACC,        hardware::power::Boost::AUDIO_LAUNCH,
        hardware::power::Boost::CAMERA_LAUNCH, hardware::power::Boost::CAMERA_SHOT,
constexpr aidl::android::hardware::power::Boost kBoost[] = {
        aidl::android::hardware::power::Boost::INTERACTION,
        aidl::android::hardware::power::Boost::DISPLAY_UPDATE_IMMINENT,
        aidl::android::hardware::power::Boost::ML_ACC,
        aidl::android::hardware::power::Boost::AUDIO_LAUNCH,
        aidl::android::hardware::power::Boost::CAMERA_LAUNCH,
        aidl::android::hardware::power::Boost::CAMERA_SHOT,
};

constexpr gui::TouchOcclusionMode kMode[] = {
@@ -284,7 +287,7 @@ void SurfaceComposerClientFuzzer::invokeSurfaceComposerClient() {
    SurfaceComposerClient::doUncacheBufferTransaction(mFdp.ConsumeIntegral<uint64_t>());

    SurfaceComposerClient::setDisplayBrightness(displayToken, getBrightness(&mFdp));
    hardware::power::Boost boostId = mFdp.PickValueInArray(kBoost);
    aidl::android::hardware::power::Boost boostId = mFdp.PickValueInArray(kBoost);
    SurfaceComposerClient::notifyPowerBoost((int32_t)boostId);

    String8 surfaceName((mFdp.ConsumeRandomLengthString(kRandomStringMaxBytes)).c_str());