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

Commit 038f82e5 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12319997 from 8d172f43 to 24Q4-release

Change-Id: I6a3730ce429c17d67984d464da1c0c1ab655ebcb
parents b31bccf4 8d172f43
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ cc_defaults {
    // Lists all dependencies that can *not* be expected on the device.
    static_libs: [
        "VtsHalHidlTestUtils",
        "libhidlbase",
        "libhidl-gen-utils",
    ],

@@ -64,6 +63,7 @@ cc_defaults {
        "libbase",
        // All the following are dependencies of any HAL definition library.
        "libcutils",
        "libhidlbase",
        "liblog",
        "libutils",
    ],
@@ -72,14 +72,6 @@ cc_defaults {
        "-g",
    ],

    target: {
        android: {
            shared_libs: [
                "libvndksupport",
            ],
        },
    },

    require_root: true,
}

+12 −3
Original line number Diff line number Diff line
@@ -386,14 +386,23 @@ parcelable StreamDescriptor {
         * For input streams: the moment when data at the specified stream position
         *   was acquired (i.e. capture position).
         *
         * The observable position must never be reset by the HAL module.
         * The data type of the frame counter is large enough to support
         * continuous counting for years of operation.
         * The observable position must never be reset by the HAL module,
         * providing an abstraction of continuous audio data flow. The data
         * type of the frame counter is large enough to support continuous
         * counting for years of operation.
         */
        Position observable;
        /**
         * Used only for MMap streams to provide the hardware read / write
         * position for audio data in the shared memory buffer 'audio.mmap'.
         * Similar to the observable position, the 'Position::UNKNOWN' value
         * can be returned when the HAL module is unable to retrieve the current
         * position.
         *
         * The hardware position must never be reset by the HAL module,
         * providing an abstraction of continuous audio data flow. The data
         * type of the frame counter is large enough to support continuous
         * counting for years of operation.
         */
        Position hardware;
        /**
+13 −5
Original line number Diff line number Diff line
@@ -78,6 +78,8 @@ const std::vector<float> kResonantFrequencyValues = {MIN_FLOAT, 100, MAX_FLOAT};
const std::vector<float> kQFactorValues = {MIN_FLOAT, 100, MAX_FLOAT};
const std::vector<float> kMaxAmplitude = {MIN_FLOAT, 100, MAX_FLOAT};

constexpr int HAPTIC_SCALE_FACTORS_EFFECT_MIN_VERSION = 3;

class HapticGeneratorParamTest : public ::testing::TestWithParam<HapticGeneratorParamTestParam>,
                                 public EffectHelper {
  public:
@@ -95,6 +97,7 @@ class HapticGeneratorParamTest : public ::testing::TestWithParam<HapticGenerator
    void SetUp() override {
        ASSERT_NE(nullptr, mFactory);
        ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
        EXPECT_STATUS(EX_NONE, mEffect->getInterfaceVersion(&mEffectInterfaceVersion));

        Parameter::Common common = createParamCommon(
                0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
@@ -113,6 +116,7 @@ class HapticGeneratorParamTest : public ::testing::TestWithParam<HapticGenerator
    std::shared_ptr<IFactory> mFactory;
    std::shared_ptr<IEffect> mEffect;
    Descriptor mDescriptor;
    int mEffectInterfaceVersion;
    int mParamHapticScaleId = 0;
    HapticGenerator::VibratorScale mParamVibratorScale = HapticGenerator::VibratorScale::MUTE;
    float mParamScaleFactor = HapticGenerator::HapticScale::UNDEFINED_SCALE_FACTOR;
@@ -148,11 +152,15 @@ class HapticGeneratorParamTest : public ::testing::TestWithParam<HapticGenerator
    void addHapticScaleParam(int id, HapticGenerator::VibratorScale scale, float scaleFactor,
                             float adaptiveScaleFactor) {
        HapticGenerator setHg;
        std::vector<HapticGenerator::HapticScale> hapticScales = {
                {.id = id,
        std::vector<HapticGenerator::HapticScale> hapticScales;
        if (mEffectInterfaceVersion >= HAPTIC_SCALE_FACTORS_EFFECT_MIN_VERSION) {
            hapticScales = {{.id = id,
                             .scale = scale,
                             .scaleFactor = scaleFactor,
                             .adaptiveScaleFactor = adaptiveScaleFactor}};
        } else {
            hapticScales = {{.id = id, .scale = scale}};
        }
        setHg.set<HapticGenerator::hapticScales>(hapticScales);
        mTags.push_back({HapticGenerator::hapticScales, setHg});
    }
+16 −11
Original line number Diff line number Diff line
@@ -192,16 +192,21 @@ TEST_P(filterPseTest, filterPse) {
    bpf_object__close(obj);
}

static constexpr char input0[] = "a";
static constexpr char input1[] = "abc\0SUBSYSTEM=block\0";
static constexpr char input2[] = "\0SUBSYSTEM=block";
static constexpr char input3[] = "\0SUBSYSTEM=power_supply";
static constexpr char input4[] = "\0SUBSYSTEM=power_supply\0";
static constexpr char input5[] =
        "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
        "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
        "012345678901234567890123456789012345678901234567890123456789\0SUBSYSTEM=block\0";

INSTANTIATE_TEST_SUITE_P(
        filterPse, filterPseTest,
        testing::Values(test_data{false, "a"},
                        test_data{true, std::string_view("abc\0SUBSYSTEM=block\0", 20)},
                        test_data{true, std::string_view("\0SUBSYSTEM=block", 16)},
                        test_data{true, std::string_view("\0SUBSYSTEM=power_supply", 23)},
                        test_data{false, std::string_view("\0SUBSYSTEM=power_supply\0", 24)},
                        test_data{
                                false,
                                "012345678901234567890123456789012345678901234567890123456789012345"
                                "678901234567890123456789012345678901234567890123456789012345678901"
                                "234567890123456789012345678901234567890123456789012345678901234567"
                                "890123456789012345678901234567890123456789\0SUBSYSTEM=block\0"}));
        testing::Values(test_data{false, std::string_view(input0, sizeof(input0) - 1)},
                        test_data{true, std::string_view(input1, sizeof(input1) - 1)},
                        test_data{true, std::string_view(input2, sizeof(input2) - 1)},
                        test_data{true, std::string_view(input3, sizeof(input3) - 1)},
                        test_data{false, std::string_view(input4, sizeof(input4) - 1)},
                        test_data{false, std::string_view(input5, sizeof(input5) - 1)}));