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

Commit 218de238 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6302218 from 3b0e4e73 to mainline-release

Change-Id: I4e6e93a7540d6177caa068e64859fb694b28f6dd
parents d4f4cec5 3b0e4e73
Loading
Loading
Loading
Loading
+16 −2
Original line number Original line Diff line number Diff line
@@ -44,8 +44,15 @@ apex_defaults {


    // Use a custom AndroidManifest.xml used for API targeting.
    // Use a custom AndroidManifest.xml used for API targeting.
    androidManifest: ":com.android.media-androidManifest",
    androidManifest: ":com.android.media-androidManifest",

    // IMPORTANT: For the APEX to be installed on Android 10 (API 29),
    // min_sdk_version should be 29. This enables the build system to make
    // sure the package compatible to Android 10 in two ways:
    // - build the APEX package compatible to Android 10
    //   so that the package can be installed.
    // - build artifacts (lib/javalib/bin) against Android 10 SDK
    //   so that the artifacts can run.
    min_sdk_version: "29",
    min_sdk_version: "29",
    legacy_android10_support: true,
}
}


apex {
apex {
@@ -84,8 +91,15 @@ apex_defaults {


    // Use a custom AndroidManifest.xml used for API targeting.
    // Use a custom AndroidManifest.xml used for API targeting.
    androidManifest: ":com.android.media.swcodec-androidManifest",
    androidManifest: ":com.android.media.swcodec-androidManifest",

    // IMPORTANT: For the APEX to be installed on Android 10 (API 29),
    // min_sdk_version should be 29. This enables the build system to make
    // sure the package compatible to Android 10 in two ways:
    // - build the APEX package compatible to Android 10
    //   so that the package can be installed.
    // - build artifacts (lib/javalib/bin) against Android 10 SDK
    //   so that the artifacts can run.
    min_sdk_version: "29",
    min_sdk_version: "29",
    legacy_android10_support: true,
}
}


prebuilt_etc {
prebuilt_etc {
+9 −1
Original line number Original line Diff line number Diff line
@@ -139,12 +139,20 @@ ACameraMetadata::filterDurations(uint32_t tag) {
    const int STREAM_WIDTH_OFFSET = 1;
    const int STREAM_WIDTH_OFFSET = 1;
    const int STREAM_HEIGHT_OFFSET = 2;
    const int STREAM_HEIGHT_OFFSET = 2;
    const int STREAM_DURATION_OFFSET = 3;
    const int STREAM_DURATION_OFFSET = 3;

    camera_metadata_entry entry = mData->find(tag);
    camera_metadata_entry entry = mData->find(tag);
    if (entry.count == 0 || entry.count % 4 || entry.type != TYPE_INT64) {

    if (entry.count == 0) {
        // Duration keys can be missing when corresponding capture feature is not supported
        return;
    }

    if (entry.count % 4 || entry.type != TYPE_INT64) {
        ALOGE("%s: malformed duration key %d! count %zu, type %d",
        ALOGE("%s: malformed duration key %d! count %zu, type %d",
                __FUNCTION__, tag, entry.count, entry.type);
                __FUNCTION__, tag, entry.count, entry.type);
        return;
        return;
    }
    }

    Vector<int64_t> filteredDurations;
    Vector<int64_t> filteredDurations;
    filteredDurations.setCapacity(entry.count * 2);
    filteredDurations.setCapacity(entry.count * 2);


+2 −7
Original line number Original line Diff line number Diff line
@@ -18,22 +18,17 @@


#include "FixedBlockAdapter.h"
#include "FixedBlockAdapter.h"


FixedBlockAdapter::~FixedBlockAdapter() {
    close();
}

int32_t FixedBlockAdapter::open(int32_t bytesPerFixedBlock)
int32_t FixedBlockAdapter::open(int32_t bytesPerFixedBlock)
{
{
    mSize = bytesPerFixedBlock;
    mSize = bytesPerFixedBlock;
    mStorage = new uint8_t[bytesPerFixedBlock];
    mStorage = std::make_unique<uint8_t[]>(bytesPerFixedBlock);
    mPosition = 0;
    mPosition = 0;
    return 0;
    return 0;
}
}


int32_t FixedBlockAdapter::close()
int32_t FixedBlockAdapter::close()
{
{
    delete[] mStorage;
    mStorage.reset();
    mStorage = nullptr;
    mSize = 0;
    mSize = 0;
    mPosition = 0;
    mPosition = 0;
    return 0;
    return 0;
+3 −2
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
#ifndef AAUDIO_FIXED_BLOCK_ADAPTER_H
#ifndef AAUDIO_FIXED_BLOCK_ADAPTER_H
#define AAUDIO_FIXED_BLOCK_ADAPTER_H
#define AAUDIO_FIXED_BLOCK_ADAPTER_H


#include <memory>
#include <stdio.h>
#include <stdio.h>


/**
/**
@@ -37,7 +38,7 @@ public:
    FixedBlockAdapter(FixedBlockProcessor &fixedBlockProcessor)
    FixedBlockAdapter(FixedBlockProcessor &fixedBlockProcessor)
    : mFixedBlockProcessor(fixedBlockProcessor) {}
    : mFixedBlockProcessor(fixedBlockProcessor) {}


    virtual ~FixedBlockAdapter();
    virtual ~FixedBlockAdapter() = default;


    /**
    /**
     * Allocate internal resources needed for buffering data.
     * Allocate internal resources needed for buffering data.
@@ -63,7 +64,7 @@ public:


protected:
protected:
    FixedBlockProcessor  &mFixedBlockProcessor;
    FixedBlockProcessor  &mFixedBlockProcessor;
    uint8_t              *mStorage = nullptr;    // Store data here while assembling buffers.
    std::unique_ptr<uint8_t[]> mStorage;         // Store data here while assembling buffers.
    int32_t               mSize = 0;             // Size in bytes of the fixed size buffer.
    int32_t               mSize = 0;             // Size in bytes of the fixed size buffer.
    int32_t               mPosition = 0;         // Offset of the last byte read or written.
    int32_t               mPosition = 0;         // Offset of the last byte read or written.
};
};
+2 −2
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ int32_t FixedBlockReader::readFromStorage(uint8_t *buffer, int32_t numBytes) {
    if (bytesToRead > dataAvailable) {
    if (bytesToRead > dataAvailable) {
        bytesToRead = dataAvailable;
        bytesToRead = dataAvailable;
    }
    }
    memcpy(buffer, mStorage + mPosition, bytesToRead);
    memcpy(buffer, &mStorage[mPosition], bytesToRead);
    mPosition += bytesToRead;
    mPosition += bytesToRead;
    return bytesToRead;
    return bytesToRead;
}
}
@@ -60,7 +60,7 @@ int32_t FixedBlockReader::processVariableBlock(uint8_t *buffer, int32_t numBytes
            bytesLeft -= mSize;
            bytesLeft -= mSize;
        } else {
        } else {
            // Just need a partial block so we have to use storage.
            // Just need a partial block so we have to use storage.
            result = mFixedBlockProcessor.onProcessFixedBlock(mStorage, mSize);
            result = mFixedBlockProcessor.onProcessFixedBlock(mStorage.get(), mSize);
            mPosition = 0;
            mPosition = 0;
        }
        }
    }
    }
Loading