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

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

Snap for 11380007 from 1e801703 to 24Q2-release

Change-Id: Ifbd2eaa20303b878f1baedb2b9c97e7356ccfe52
parents 5ac125d0 1e801703
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ EffectContext::EffectContext(size_t statusDepth, const Parameter::Common& common
    ::android::status_t status =
            EventFlag::createEventFlag(mStatusMQ->getEventFlagWord(), &mEfGroup);
    LOG_ALWAYS_FATAL_IF(status != ::android::OK || !mEfGroup, " create EventFlagGroup failed ");
    mWorkBuffer.reserve(std::max(inBufferSizeInFloat, outBufferSizeInFloat));
    mWorkBuffer.resize(std::max(inBufferSizeInFloat, outBufferSizeInFloat));
}

// reset buffer status by abandon input data in FMQ
@@ -82,6 +82,10 @@ float* EffectContext::getWorkBuffer() {
    return static_cast<float*>(mWorkBuffer.data());
}

size_t EffectContext::getWorkBufferSize() const {
    return mWorkBuffer.size();
}

std::shared_ptr<EffectContext::StatusMQ> EffectContext::getStatusFmq() const {
    return mStatusMQ;
}
@@ -206,6 +210,8 @@ RetCode EffectContext::updateIOFrameSize(const Parameter::Common& common) {
    mInputFrameSize = iFrameSize;
    mOutputFrameSize = oFrameSize;
    if (needUpdateMq) {
        mWorkBuffer.resize(std::max(common.input.frameCount * mInputFrameSize / sizeof(float),
                                    common.output.frameCount * mOutputFrameSize / sizeof(float)));
        return notifyDataMqUpdate();
    }
    return RetCode::SUCCESS;
+3 −1
Original line number Diff line number Diff line
@@ -327,7 +327,9 @@ void EffectImpl::process() {
            return;
        }

        auto processSamples = inputMQ->availableToRead();
        assert(mImplContext->getWorkBufferSize() >=
               std::max(inputMQ->availableToRead(), outputMQ->availableToWrite()));
        auto processSamples = std::min(inputMQ->availableToRead(), outputMQ->availableToWrite());
        if (processSamples) {
            inputMQ->read(buffer, processSamples);
            IEffect::Status status = effectProcessImpl(buffer, buffer, processSamples);
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ class ModuleBluetooth final : public Module {
            const ::aidl::android::media::audio::common::AudioPort& audioPort, CachedProxy& proxy);

    static constexpr int kCreateProxyRetries = 5;
    static constexpr int kCreateProxyRetrySleepMs = 250;
    static constexpr int kCreateProxyRetrySleepMs = 75;
    ChildInterface<BluetoothA2dp> mBluetoothA2dp;
    ChildInterface<BluetoothLe> mBluetoothLe;
    std::map<int32_t /*instantiated device port ID*/, CachedProxy> mProxies;
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ class EffectContext {
    std::shared_ptr<DataMQ> getOutputDataFmq() const;

    float* getWorkBuffer();
    size_t getWorkBufferSize() const;

    // reset buffer status by abandon input data in FMQ
    void resetBuffer();
+27 −3
Original line number Diff line number Diff line
@@ -171,7 +171,16 @@ impl SkClient {

    /// Helper method to get a secret.
    fn get(&mut self, id: &Id) -> Result<Secret, Error> {
        let get_request = GetSecretRequest { id: id.clone(), updated_sealing_policy: None };
        self.get_update_policy(id, None)
    }

    /// Helper method to get a secret, updating the sealing policy along the way.
    fn get_update_policy(
        &mut self,
        id: &Id,
        updated_sealing_policy: Option<Vec<u8>>,
    ) -> Result<Secret, Error> {
        let get_request = GetSecretRequest { id: id.clone(), updated_sealing_policy };
        let get_request = get_request.serialize_to_packet().to_vec()?;

        let get_response = self.secret_management_request(&get_request)?;
@@ -532,8 +541,9 @@ fn secret_management_replay_protection_out_of_seq_req_not_accepted(instance: Str
#[rdroidtest(get_instances())]
fn secret_management_policy_gate(instance: String) {
    let dice_chain = make_explicit_owned_dice(/*Security version in a node */ 100);
    let mut sk_client = SkClient::with_identity(&instance, dice_chain);
    sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
    let mut sk_client_original = SkClient::with_identity(&instance, dice_chain);
    sk_client_original.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
    assert_eq!(sk_client_original.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);

    // Start a session with higher security_version & get the stored secret.
    let dice_chain_upgraded = make_explicit_owned_dice(/*Security version in a node */ 101);
@@ -547,6 +557,20 @@ fn secret_management_policy_gate(instance: String) {
        sk_client_downgraded.get(&ID_EXAMPLE).unwrap_err(),
        Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
    ));

    // Now get the secret with the later version, and upgrade the sealing policy along the way.
    let sealing_policy =
        sealing_policy(sk_client_upgraded.dice_artifacts.explicit_key_dice_chain().unwrap());
    assert_eq!(
        sk_client_upgraded.get_update_policy(&ID_EXAMPLE, Some(sealing_policy)).unwrap(),
        SECRET_EXAMPLE
    );

    // The original version of the client should no longer be able to retrieve the secret.
    assert!(matches!(
        sk_client_original.get(&ID_EXAMPLE).unwrap_err(),
        Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
    ));
}

// Helper method that constructs 3 SecretManagement requests. Callers would usually not care about
Loading