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

Commit 00c57f85 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6516174 from c669b6bd to rvc-release

Change-Id: I59d85c4cd975b917edbae440f931ffc3fdea238f
parents e7ebae7b c669b6bd
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -2527,14 +2527,21 @@ enum VehicleProperty : int32_t {
     * int32[5]: 0   // user #0  (usersInfo.existingUsers[0].userId)
     * int32[6]: 1   // flags of user #0  (usersInfo.existingUsers[0].flags)
     *
     * And if the HAL want to respond with the creation of an admin user called "Admin", the
     * And if the HAL want to respond with the creation of an admin user called "Owner", the
     * response would be:
     *
     * int32[0]: 42      // must match the request id from the request
     * int32[1]:  2      // action = InitialUserInfoResponseAction::CREATE
     * int32[2]: -1      // userToSwitchOrCreate.userId (not used as user will be created)
     * int32[3]:  8      // userToSwitchOrCreate.flags = ADMIN
     * string: "Admin" // userNameToCreate
     * string: "||Owner"  // userLocales + separator + userNameToCreate
     *
     * Notice the string value represents multiple values, separated by ||. The first value is the
     * (optional) system locales for the user to be created (in this case, it's empty, meaning it
     * will use Android's default value), while the second value is the (also optional) name of the
     * to user to be created (when the type of response is InitialUserInfoResponseAction:CREATE).
     * For example, to create the same "Owner" user with "en-US" and "pt-BR" locales, the string
     * value of the response would be "en-US,pt-BR||Owner".
     *
     * NOTE: if the HAL doesn't support user management, then it should not define this property,
     * which in turn would disable the other user-related properties (for example, the Android
@@ -4367,6 +4374,12 @@ struct InitialUserInfoResponse {
     * Name of the user that should be created.
     */
    string userNameToCreate;

    /**
     * System locales of the initial user (value will be passed as-is to
     * android.provider.Settings.System.SYSTEM_LOCALES)
     */
    string userLocales;
};

/**
+23 −6
Original line number Diff line number Diff line
@@ -82,6 +82,10 @@ TEST_P(BootHidlTest, MarkBootSuccessful) {

// Sanity check Boot::setActiveBootSlot() on good and bad inputs.
TEST_P(BootHidlTest, SetActiveBootSlot) {
    Slot curSlot = boot->getCurrentSlot();
    Slot otherSlot = curSlot ? 0 : 1;
    auto otherBootable = boot->isSlotBootable(otherSlot);

    for (Slot s = 0; s < 2; s++) {
        CommandResult cr;
        Return<void> result = boot->setActiveBootSlot(s, generate_callback(&cr));
@@ -90,7 +94,17 @@ TEST_P(BootHidlTest, SetActiveBootSlot) {
    {
        // Restore original flags to avoid problems on reboot
        CommandResult cr;
        Return<void> result = boot->markBootSuccessful(generate_callback(&cr));
        auto result = boot->setActiveBootSlot(curSlot, generate_callback(&cr));
        EXPECT_TRUE(result.isOk());
        EXPECT_TRUE(cr.success);

        if (otherBootable == BoolResult::FALSE) {
            result = boot->setSlotAsUnbootable(otherSlot, generate_callback(&cr));
            EXPECT_TRUE(result.isOk());
            EXPECT_TRUE(cr.success);
        }

        result = boot->markBootSuccessful(generate_callback(&cr));
        EXPECT_TRUE(result.isOk());
        EXPECT_TRUE(cr.success);
    }
@@ -105,19 +119,22 @@ TEST_P(BootHidlTest, SetActiveBootSlot) {

// Sanity check Boot::setSlotAsUnbootable() on good and bad inputs.
TEST_P(BootHidlTest, SetSlotAsUnbootable) {
    {
        CommandResult cr;
    Slot curSlot = boot->getCurrentSlot();
    Slot otherSlot = curSlot ? 0 : 1;
    auto otherBootable = boot->isSlotBootable(otherSlot);
    {
        CommandResult cr;
        Return<void> result = boot->setSlotAsUnbootable(otherSlot, generate_callback(&cr));
        EXPECT_TRUE(result.isOk());
        if (cr.success) {
            EXPECT_EQ(BoolResult::FALSE, boot->isSlotBootable(otherSlot));

            // Restore original flags to avoid problems on reboot
            if (otherBootable == BoolResult::TRUE) {
                result = boot->setActiveBootSlot(otherSlot, generate_callback(&cr));
                EXPECT_TRUE(result.isOk());
                EXPECT_TRUE(cr.success);
            }
            result = boot->setActiveBootSlot(curSlot, generate_callback(&cr));
            EXPECT_TRUE(result.isOk());
            EXPECT_TRUE(cr.success);
+43 −14
Original line number Diff line number Diff line
@@ -60,13 +60,7 @@ Return<void> Demux::openFilter(const DemuxFilterType& type, uint32_t bufferSize,
    ALOGV("%s", __FUNCTION__);

    uint32_t filterId;
    if (!mUnusedFilterIds.empty()) {
        filterId = *mUnusedFilterIds.begin();

        mUnusedFilterIds.erase(filterId);
    } else {
    filterId = ++mLastUsedFilterId;
    }

    mUsedFilterIds.insert(filterId);

@@ -84,6 +78,9 @@ Return<void> Demux::openFilter(const DemuxFilterType& type, uint32_t bufferSize,
    }

    mFilters[filterId] = filter;
    if (filter->isPcrFilter()) {
        mPcrFilterIds.insert(filterId);
    }
    bool result = true;
    if (mDvr != nullptr && mDvr->getType() == DvrType::PLAYBACK) {
        result = mDvr->addPlaybackFilter(filter);
@@ -102,19 +99,53 @@ Return<void> Demux::openTimeFilter(openTimeFilter_cb _hidl_cb) {
    return Void();
}

Return<void> Demux::getAvSyncHwId(const sp<IFilter>& /* filter */, getAvSyncHwId_cb _hidl_cb) {
Return<void> Demux::getAvSyncHwId(const sp<IFilter>& filter, getAvSyncHwId_cb _hidl_cb) {
    ALOGV("%s", __FUNCTION__);

    AvSyncHwId avSyncHwId = 0;
    uint32_t avSyncHwId = -1;
    int id;
    Result status;

    filter->getId([&](Result result, uint32_t filterId) {
        id = filterId;
        status = result;
    });

    if (status != Result::SUCCESS) {
        ALOGE("[Demux] Can't get filter Id.");
        _hidl_cb(Result::INVALID_STATE, avSyncHwId);
        return Void();
    }

    if (!mFilters[id]->isMediaFilter()) {
        ALOGE("[Demux] Given filter is not a media filter.");
        _hidl_cb(Result::INVALID_ARGUMENT, avSyncHwId);
        return Void();
    }

    if (!mPcrFilterIds.empty()) {
        ALOGE("[Demux] No PCR filter opened.");
        // Return the lowest pcr filter id in the default implementation as the av sync id
        _hidl_cb(Result::SUCCESS, *mPcrFilterIds.begin());
        return Void();
    }

    _hidl_cb(Result::SUCCESS, avSyncHwId);
    _hidl_cb(Result::INVALID_STATE, avSyncHwId);
    return Void();
}

Return<void> Demux::getAvSyncTime(AvSyncHwId /* avSyncHwId */, getAvSyncTime_cb _hidl_cb) {
Return<void> Demux::getAvSyncTime(AvSyncHwId avSyncHwId, getAvSyncTime_cb _hidl_cb) {
    ALOGV("%s", __FUNCTION__);

    uint64_t avSyncTime = 0;
    uint64_t avSyncTime = -1;
    if (mPcrFilterIds.empty()) {
        _hidl_cb(Result::INVALID_STATE, avSyncTime);
        return Void();
    }
    if (avSyncHwId != *mPcrFilterIds.begin()) {
        _hidl_cb(Result::INVALID_ARGUMENT, avSyncTime);
        return Void();
    }

    _hidl_cb(Result::SUCCESS, avSyncTime);
    return Void();
@@ -123,7 +154,6 @@ Return<void> Demux::getAvSyncTime(AvSyncHwId /* avSyncHwId */, getAvSyncTime_cb
Return<Result> Demux::close() {
    ALOGV("%s", __FUNCTION__);

    mUnusedFilterIds.clear();
    mUsedFilterIds.clear();
    mLastUsedFilterId = -1;

@@ -171,7 +201,6 @@ Result Demux::removeFilter(uint32_t filterId) {
    // resetFilterRecords(filterId);
    mUsedFilterIds.erase(filterId);
    mRecordFilterIds.erase(filterId);
    mUnusedFilterIds.insert(filterId);
    mFilters.erase(filterId);

    return Result::SUCCESS;
+1 −7
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ class Demux : public IDemux {

    uint32_t mDemuxId;
    uint32_t mCiCamId;
    set<uint32_t> mPcrFilterIds;
    /**
     * Record the last used filter id. Initial value is -1.
     * Filter Id starts with 0.
@@ -140,13 +141,6 @@ class Demux : public IDemux {
     * Any removed filter id should be removed from this set.
     */
    set<uint32_t> mUsedFilterIds;
    /**
     * Record all the unused filter Ids within mLastUsedFilterId.
     * Removed filter Id should be added into this set.
     * When this set is not empty, ids here should be allocated first
     * and added into usedFilterIds.
     */
    set<uint32_t> mUnusedFilterIds;
    /**
     * Record all the attached record filter Ids.
     * Any removed filter id should be removed from this set.
+26 −8
Original line number Diff line number Diff line
@@ -37,6 +37,32 @@ Filter::Filter(DemuxFilterType type, uint32_t filterId, uint32_t bufferSize,
    mBufferSize = bufferSize;
    mCallback = cb;
    mDemux = demux;

    switch (mType.mainType) {
        case DemuxFilterMainType::TS:
            if (mType.subType.tsFilterType() == DemuxTsFilterType::AUDIO ||
                mType.subType.tsFilterType() == DemuxTsFilterType::VIDEO) {
                mIsMediaFilter = true;
            }
            if (mType.subType.tsFilterType() == DemuxTsFilterType::PCR) {
                mIsPcrFilter = true;
            }
            break;
        case DemuxFilterMainType::MMTP:
            if (mType.subType.mmtpFilterType() == DemuxMmtpFilterType::AUDIO ||
                mType.subType.mmtpFilterType() == DemuxMmtpFilterType::VIDEO) {
                mIsMediaFilter = true;
            }
            break;
        case DemuxFilterMainType::IP:
            break;
        case DemuxFilterMainType::TLV:
            break;
        case DemuxFilterMainType::ALP:
            break;
        default:
            break;
    }
}

Filter::~Filter() {}
@@ -73,16 +99,8 @@ Return<Result> Filter::configure(const DemuxFilterSettings& settings) {
    switch (mType.mainType) {
        case DemuxFilterMainType::TS:
            mTpid = settings.ts().tpid;
            if (mType.subType.tsFilterType() == DemuxTsFilterType::AUDIO ||
                mType.subType.tsFilterType() == DemuxTsFilterType::VIDEO) {
                mIsMediaFilter = true;
            }
            break;
        case DemuxFilterMainType::MMTP:
            if (mType.subType.mmtpFilterType() == DemuxMmtpFilterType::AUDIO ||
                mType.subType.mmtpFilterType() == DemuxMmtpFilterType::VIDEO) {
                mIsMediaFilter = true;
            }
            break;
        case DemuxFilterMainType::IP:
            break;
Loading