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

Commit 9831f5cb authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4453288 from eddb1d9a to pi-release

Change-Id: Iddb9ffdb07bd04c5aedcd1e519ca2ccd556b7614
parents 670e8edd eddb1d9a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ dc7e6d4f537b9943e27edc4f86c5a03bb643b18f18f866f8c3c71c0ac4ea8cbc android.hardwar
78589343d8ee2e1b155acad3fbdc7fcbb6af94491aee968b2383c21627264f8b android.hardware.radio@1.0::IRadioResponse # Available in Android O, b/68061860
e822cb7f4a1bdd45689c5e92ccd19a2201c20b771bd4b2ec1ae627e324591f9d android.hardware.radio@1.0::IRadioResponse
6e69adb24d7c0b0ca3a54a38c49a5625b161b3f5d5f7d6fda0befdbbfc8e9e06 android.hardware.radio@1.0::IRadioResponse
c2c50ec74c87a583c683b4493f8f9f2e454a8d41c57af5b3eb88823a999f0ea4 android.hardware.radio@1.0::IRadioResponse # Added for b/65230472 for Android O
28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
bfd81bcafa3c97519cd56ad29e9fa48e23d1d323b89dbcc85899282a8c628194 android.hardware.automotive.vehicle@2.0::types
df1d7b27e644bfed0a4f606a8c44d35d45cafce82c7c648494c8a25c7cd4a949 android.hardware.wifi@1.0::types
+29 −35
Original line number Diff line number Diff line
@@ -89,10 +89,6 @@ static const uint8_t kInvalidUUID[16] = {
    0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80,
    0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80};

static const uint32_t k256SubSampleByteCount = 256;
static const uint32_t k512SubSampleClearBytes = 512;
static const uint32_t k512SubSampleEncryptedBytes = 512;

class DrmHalClearkeyFactoryTest : public ::testing::VtsHalHidlTargetTestBase {
   public:
    virtual void SetUp() override {
@@ -349,8 +345,7 @@ SessionId DrmHalClearkeyPluginTest::openSession() {
 * Helper method to close a session
 */
void DrmHalClearkeyPluginTest::closeSession(const SessionId& sessionId) {
    auto result = drmPlugin->closeSession(sessionId);
    EXPECT_EQ(Status::OK, result);
    EXPECT_TRUE(drmPlugin->closeSession(sessionId).isOk());
}

/**
@@ -793,7 +788,7 @@ TEST_F(DrmHalClearkeyPluginTest, SetMacAlgorithmNoSession) {
 */
TEST_F(DrmHalClearkeyPluginTest, GenericEncryptNotSupported) {
    SessionId session = openSession();
    ;

    hidl_vec<uint8_t> keyId = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
    hidl_vec<uint8_t> input = {1, 2, 3, 4, 5};
    hidl_vec<uint8_t> iv = std::vector<uint8_t>(AES_BLOCK_SIZE, 0);
@@ -822,7 +817,7 @@ TEST_F(DrmHalClearkeyPluginTest, GenericDecryptNotSupported) {

TEST_F(DrmHalClearkeyPluginTest, GenericSignNotSupported) {
    SessionId session = openSession();
    ;

    hidl_vec<uint8_t> keyId = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
    hidl_vec<uint8_t> message = {1, 2, 3, 4, 5};
    auto res = drmPlugin->sign(session, keyId, message,
@@ -836,7 +831,7 @@ TEST_F(DrmHalClearkeyPluginTest, GenericSignNotSupported) {

TEST_F(DrmHalClearkeyPluginTest, GenericVerifyNotSupported) {
    SessionId session = openSession();
    ;

    hidl_vec<uint8_t> keyId = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
    hidl_vec<uint8_t> message = {1, 2, 3, 4, 5};
    hidl_vec<uint8_t> signature = {0, 0, 0, 0, 0, 0, 0, 0,
@@ -926,8 +921,7 @@ sp<IMemory> DrmHalClearkeyPluginTest::getDecryptMemory(size_t size,
 */
TEST_F(DrmHalClearkeyPluginTest, SetMediaDrmSession) {
    auto sessionId = openSession();
    Status status = cryptoPlugin->setMediaDrmSession(sessionId);
    EXPECT_EQ(Status::OK, status);
    EXPECT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());
    closeSession(sessionId);
}

@@ -948,8 +942,7 @@ TEST_F(DrmHalClearkeyPluginTest, SetMediaDrmSessionClosedSession) {
 */
TEST_F(DrmHalClearkeyPluginTest, SetMediaDrmSessionEmptySession) {
    SessionId sessionId;
    Status status = cryptoPlugin->setMediaDrmSession(sessionId);
    EXPECT_EQ(Status::OK, status);
    EXPECT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());
}

/**
@@ -1131,18 +1124,17 @@ TEST_F(DrmHalClearkeyDecryptTest, TestQueryKeyStatus) {
TEST_F(DrmHalClearkeyDecryptTest, ClearSegmentTest) {
    vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
    const Pattern noPattern = {0, 0};
    const uint32_t kByteCount = 256;
    const vector<SubSample> subSamples = {
        {.numBytesOfClearData = k256SubSampleByteCount,
        {.numBytesOfClearData = kByteCount,
         .numBytesOfEncryptedData = 0}};
    auto sessionId = openSession();
    loadKeys(sessionId);

    Status status = cryptoPlugin->setMediaDrmSession(sessionId);
    EXPECT_EQ(Status::OK, status);
    EXPECT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());

    uint32_t byteCount = decrypt(Mode::UNENCRYPTED, &iv[0], subSamples,
            noPattern, Status::OK);
    EXPECT_EQ(k256SubSampleByteCount, byteCount);
    EXPECT_EQ(kByteCount, byteCount);

    closeSession(sessionId);
}
@@ -1154,18 +1146,18 @@ TEST_F(DrmHalClearkeyDecryptTest, ClearSegmentTest) {
TEST_F(DrmHalClearkeyDecryptTest, EncryptedAesCtrSegmentTest) {
    vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
    const Pattern noPattern = {0, 0};
    const uint32_t kClearBytes = 512;
    const uint32_t kEncryptedBytes = 512;
    const vector<SubSample> subSamples = {
        {.numBytesOfClearData = k512SubSampleClearBytes,
         .numBytesOfEncryptedData = k512SubSampleEncryptedBytes}};
        {.numBytesOfClearData = kClearBytes,
         .numBytesOfEncryptedData = kEncryptedBytes}};
    auto sessionId = openSession();
    loadKeys(sessionId);

    Status status = cryptoPlugin->setMediaDrmSession(sessionId);
    EXPECT_EQ(Status::OK, status);
    EXPECT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());

    uint32_t byteCount = decrypt(Mode::AES_CTR, &iv[0], subSamples,
            noPattern, Status::OK);
    EXPECT_EQ(k512SubSampleClearBytes + k512SubSampleEncryptedBytes, byteCount);
    EXPECT_EQ(kClearBytes + kEncryptedBytes, byteCount);

    closeSession(sessionId);
}
@@ -1177,12 +1169,10 @@ TEST_F(DrmHalClearkeyDecryptTest, EncryptedAesCtrSegmentTestNoKeys) {
    vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
    const Pattern noPattern = {0, 0};
    const vector<SubSample> subSamples = {
        {.numBytesOfClearData = k256SubSampleByteCount,
         .numBytesOfEncryptedData = k256SubSampleByteCount}};
        {.numBytesOfClearData = 256,
         .numBytesOfEncryptedData = 256}};
    auto sessionId = openSession();

    Status status = cryptoPlugin->setMediaDrmSession(sessionId);
    EXPECT_EQ(Status::OK, status);
    EXPECT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());

    uint32_t byteCount = decrypt(Mode::AES_CTR, &iv[0], subSamples,
            noPattern, Status::ERROR_DRM_NO_LICENSE);
@@ -1207,9 +1197,9 @@ void DrmHalClearkeyDecryptTest::decryptWithInvalidKeys(
            EXPECT_EQ(Status::OK, status);
            EXPECT_EQ(0u, myKeySetId.size());
        });
    ASSERT_OK(res);
    EXPECT_OK(res);

    ASSERT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());
    EXPECT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());

    uint32_t byteCount = decrypt(Mode::AES_CTR, &iv[0], subSamples,
            noPattern, Status::ERROR_DRM_NO_LICENSE);
@@ -1224,9 +1214,11 @@ void DrmHalClearkeyDecryptTest::decryptWithInvalidKeys(
TEST_F(DrmHalClearkeyDecryptTest, DecryptWithEmptyKey) {
    vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
    const Pattern noPattern = {0, 0};
    const uint32_t kClearBytes = 512;
    const uint32_t kEncryptedBytes = 512;
    const vector<SubSample> subSamples = {
        {.numBytesOfClearData = k512SubSampleClearBytes,
         .numBytesOfEncryptedData = k512SubSampleEncryptedBytes}};
        {.numBytesOfClearData = kClearBytes,
         .numBytesOfEncryptedData = kEncryptedBytes}};

    // base 64 encoded JSON response string, must not contain padding character '='
    const hidl_string emptyKeyResponse =
@@ -1259,9 +1251,11 @@ TEST_F(DrmHalClearkeyDecryptTest, DecryptWithEmptyKey) {
TEST_F(DrmHalClearkeyDecryptTest, DecryptWithKeyTooLong) {
    vector<uint8_t> iv(AES_BLOCK_SIZE, 0);
    const Pattern noPattern = {0, 0};
    const uint32_t kClearBytes = 512;
    const uint32_t kEncryptedBytes = 512;
    const vector<SubSample> subSamples = {
        {.numBytesOfClearData = k512SubSampleClearBytes,
         .numBytesOfEncryptedData = k512SubSampleEncryptedBytes}};
        {.numBytesOfClearData = kClearBytes,
         .numBytesOfEncryptedData = kEncryptedBytes}};

    // base 64 encoded JSON response string, must not contain padding character '='
    const hidl_string keyTooLongResponse =
+4 −2
Original line number Diff line number Diff line
@@ -30,10 +30,12 @@ Gralloc::Gralloc() {
}

void Gralloc::init() {
    mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>();
    mAllocator = ::testing::VtsHalHidlTargetTestBase::getService<IAllocator>(
        GraphicsMapperHidlEnvironment::Instance()->getServiceName<IAllocator>());
    ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service";

    mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>();
    mMapper = ::testing::VtsHalHidlTargetTestBase::getService<IMapper>(
        GraphicsMapperHidlEnvironment::Instance()->getServiceName<IMapper>());
    ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service";
    ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode";
}
+16 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

#include <unordered_set>

#include <VtsHalHidlTargetTestEnvBase.h>
#include <android/hardware/graphics/allocator/2.0/IAllocator.h>
#include <android/hardware/graphics/mapper/2.0/IMapper.h>
#include <utils/StrongPointer.h>
@@ -88,6 +89,21 @@ class Gralloc {
    std::unordered_set<const native_handle_t*> mImportedBuffers;
};

// Test environment for graphics.mapper.
class GraphicsMapperHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
   public:
    // get the test environment singleton
    static GraphicsMapperHidlEnvironment* Instance() {
        static GraphicsMapperHidlEnvironment* instance = new GraphicsMapperHidlEnvironment;
        return instance;
    }

    virtual void registerTestServices() override {
        registerTestService<IAllocator>();
        registerTestService<IMapper>();
    }
};

}  // namespace tests
}  // namespace V2_0
}  // namespace mapper
+7 −6
Original line number Diff line number Diff line
@@ -403,10 +403,11 @@ TEST_F(GraphicsMapperHidlTest, UnlockNegative) {
}  // namespace android

int main(int argc, char** argv) {
    using android::hardware::graphics::mapper::V2_0::tests::GraphicsMapperHidlEnvironment;
    ::testing::AddGlobalTestEnvironment(GraphicsMapperHidlEnvironment::Instance());
    ::testing::InitGoogleTest(&argc, argv);

    GraphicsMapperHidlEnvironment::Instance()->init(&argc, argv);
    int status = RUN_ALL_TESTS();
    LOG(INFO) << "Test result = " << status;

    return status;
}
Loading