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

Commit 96534d5f authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6512749 from 69fcb7d8 to mainline-release

Change-Id: I3e469f7e37c3be93da6d15beb14424b3d4d9c7b8
parents be6f8762 69fcb7d8
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;
};

/**
+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;
+3 −0
Original line number Diff line number Diff line
@@ -89,6 +89,8 @@ class Filter : public IFilter {
    void attachFilterToRecord(const sp<Dvr> dvr);
    void detachFilterFromRecord();
    void freeAvHandle();
    bool isMediaFilter() { return mIsMediaFilter; };
    bool isPcrFilter() { return mIsPcrFilter; };

  private:
    // Tuner service
@@ -104,6 +106,7 @@ class Filter : public IFilter {
    uint32_t mBufferSize;
    DemuxFilterType mType;
    bool mIsMediaFilter = false;
    bool mIsPcrFilter = false;
    DemuxFilterSettings mFilterSettings;

    uint16_t mTpid;
Loading