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

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

Snap for 10161738 from d26747bc to udc-qpr1-release

Change-Id: I577b6c311f78e8893d19b6234392ce28b9b68f98
parents 5b4a9a82 d26747bc
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -80,7 +80,13 @@ string get_imei(int slot) {
        return "";
    }

    return ::android::base::Trim(out[0]);
    string imei = ::android::base::Trim(out[0]);
    if (imei.compare("null") == 0) {
        LOG(ERROR) << "Error in getting IMEI from Telephony service: value is null. Cmd: " << cmd;
        return "";
    }

    return imei;
}

}  // namespace
@@ -972,7 +978,7 @@ TEST_P(AttestKeyTest, SecondIMEIAttestationIDSuccess) {

    // Skip the test if there is no second IMEI exists.
    string second_imei = get_imei(1);
    if (second_imei.empty() || second_imei.compare("null") == 0) {
    if (second_imei.empty()) {
        GTEST_SKIP() << "Test not applicable as there is no second IMEI";
    }

@@ -1050,13 +1056,13 @@ TEST_P(AttestKeyTest, MultipleIMEIAttestationIDSuccess) {

    // Skip the test if there is no first IMEI exists.
    string imei = get_imei(0);
    if (imei.empty() || imei.compare("null") == 0) {
    if (imei.empty()) {
        GTEST_SKIP() << "Test not applicable as there is no first IMEI";
    }

    // Skip the test if there is no second IMEI exists.
    string second_imei = get_imei(1);
    if (second_imei.empty() || second_imei.compare("null") == 0) {
    if (second_imei.empty()) {
        GTEST_SKIP() << "Test not applicable as there is no second IMEI";
    }

+4 −1
Original line number Diff line number Diff line
@@ -82,7 +82,10 @@ void TvInput::init() {
        MQDescriptor<int8_t, SynchronizedReadWrite>* out_queue, int32_t in_deviceId,
        int32_t in_streamId) {
    ALOGV("%s", __FUNCTION__);
    // TODO: Implement this
    if (mStreamConfigs.count(in_deviceId) == 0) {
        ALOGW("Device with id %d isn't available", in_deviceId);
        return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS);
    }
    return ::ndk::ScopedAStatus::ok();
}

+0 −1
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ class TvInput : public BnTvInput {
    ::ndk::ScopedAStatus openStream(int32_t in_deviceId, int32_t in_streamId,
                                    NativeHandle* _aidl_return) override;
    ::ndk::ScopedAStatus closeStream(int32_t in_deviceId, int32_t in_streamId) override;

    void init();

  private:
+47 −3
Original line number Diff line number Diff line
@@ -259,8 +259,11 @@ TEST_P(TvInputAidlTest, OpenAnOpenedStreamsTest) {
        return;
    }
    int32_t device_id = stream_config_.keyAt(indices[0]);
    int32_t stream_id = stream_config_.valueAt(indices[0])[0].streamId;

    vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
    if (streamConfigs.empty()) {
        return;
    }
    int32_t stream_id = streamConfigs[0].streamId;
    NativeHandle handle;

    ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id);
@@ -291,7 +294,11 @@ TEST_P(TvInputAidlTest, CloseStreamBeforeOpenTest) {
        return;
    }
    int32_t device_id = stream_config_.keyAt(indices[0]);
    int32_t stream_id = stream_config_.valueAt(indices[0])[0].streamId;
    vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
    if (streamConfigs.empty()) {
        return;
    }
    int32_t stream_id = streamConfigs[0].streamId;

    ALOGD("CloseStreamBeforeOpenTest: close stream, device_id=%d, stream_id=%d", device_id,
          stream_id);
@@ -299,6 +306,43 @@ TEST_P(TvInputAidlTest, CloseStreamBeforeOpenTest) {
                ITvInput::STATUS_INVALID_STATE);
}

TEST_P(TvInputAidlTest, SetTvMessageEnabledTest) {
    unique_lock<mutex> lock(mutex_);

    updateAllStreamConfigurations();
    vector<size_t> indices = getConfigIndices();
    if (indices.empty()) {
        return;
    }
    int32_t device_id = stream_config_.keyAt(indices[0]);
    vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
    if (streamConfigs.empty()) {
        return;
    }
    int32_t stream_id = streamConfigs[0].streamId;
    ALOGD("SetTvMessageEnabledTest: device_id=%d, stream_id=%d", device_id, stream_id);
    tv_input_->setTvMessageEnabled(device_id, stream_id, TvMessageEventType::WATERMARK, true);
}

TEST_P(TvInputAidlTest, GetTvMessageQueueTest) {
    unique_lock<mutex> lock(mutex_);

    updateAllStreamConfigurations();
    vector<size_t> indices = getConfigIndices();
    if (indices.empty()) {
        return;
    }
    int32_t device_id = stream_config_.keyAt(indices[0]);
    vector<TvStreamConfig> streamConfigs = stream_config_.valueAt(indices[0]);
    if (streamConfigs.empty()) {
        return;
    }
    int32_t stream_id = streamConfigs[0].streamId;
    ALOGD("GetTvMessageQueueTest: device_id=%d, stream_id=%d", device_id, stream_id);
    MQDescriptor<int8_t, SynchronizedReadWrite> queue;
    tv_input_->getTvMessageQueueDesc(&queue, device_id, stream_id);
}

INSTANTIATE_TEST_SUITE_P(PerInstance, TvInputAidlTest,
                         testing::ValuesIn(android::getAidlHalInstanceNames(ITvInput::descriptor)),
                         android::PrintInstanceNameToString);
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ using namespace aidl::android::hardware::tv::input;
using namespace std;
using ::aidl::android::hardware::common::NativeHandle;
using ::aidl::android::hardware::common::fmq::MQDescriptor;
using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
using ::android::AidlMessageQueue;

#define WAIT_FOR_EVENT_TIMEOUT 5