am 4c645d0a: Camera2: Fix metadata symbols: DO NOT MERGE
# Via Igor Murashkin
* commit '4c645d0a9bd4721fe65f1c2264fed7a5830428a2':
Camera2: Fix metadata symbols: DO NOT MERGE
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index c30ef33..391fe64 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -35,18 +35,6 @@
#define HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_1
#define HWC_API_VERSION HWC_DEVICE_API_VERSION
-/* Users of this header can define HWC_REMOVE_DEPRECATED_VERSIONS to test that
- * they still work with just the current version declared, before the
- * deprecated versions are actually removed.
- *
- * To find code that still depends on the old versions, set the #define to 1
- * here. Code that explicitly sets it to zero (rather than simply not defining
- * it) will still see the old versions.
- */
-#if !defined(HWC_REMOVE_DEPRECATED_VERSIONS)
-#define HWC_REMOVE_DEPRECATED_VERSIONS 0
-#endif
-
/*****************************************************************************/
/**
@@ -578,10 +566,6 @@
/*****************************************************************************/
-#if !HWC_REMOVE_DEPRECATED_VERSIONS
-#include <hardware/hwcomposer_v0.h>
-#endif
-
__END_DECLS
#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */
diff --git a/include/hardware/hwcomposer_defs.h b/include/hardware/hwcomposer_defs.h
index ef8fcf1..1edfd3d 100644
--- a/include/hardware/hwcomposer_defs.h
+++ b/include/hardware/hwcomposer_defs.h
@@ -32,9 +32,6 @@
#define HWC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
-#define HWC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, HWC_HEADER_VERSION)
-#define HWC_DEVICE_API_VERSION_0_2 HARDWARE_DEVICE_API_VERSION_2(0, 2, HWC_HEADER_VERSION)
-#define HWC_DEVICE_API_VERSION_0_3 HARDWARE_DEVICE_API_VERSION_2(0, 3, HWC_HEADER_VERSION)
#define HWC_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, HWC_HEADER_VERSION)
#define HWC_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, HWC_HEADER_VERSION)
#define HWC_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, HWC_HEADER_VERSION)
@@ -132,13 +129,11 @@
/* attributes queriable with query() */
enum {
/*
- * Availability: HWC_DEVICE_API_VERSION_0_2
* Must return 1 if the background layer is supported, 0 otherwise.
*/
HWC_BACKGROUND_LAYER_SUPPORTED = 0,
/*
- * Availability: HWC_DEVICE_API_VERSION_0_3
* Returns the vsync period in nanoseconds.
*
* This query is not used for HWC_DEVICE_API_VERSION_1_1 and later.
diff --git a/include/hardware/hwcomposer_v0.h b/include/hardware/hwcomposer_v0.h
deleted file mode 100644
index 473819b..0000000
--- a/include/hardware/hwcomposer_v0.h
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* This header contains deprecated HWCv0 interface declarations. Don't include
- * this header directly; it will be included by <hardware/hwcomposer.h> unless
- * HWC_REMOVE_DEPRECATED_VERSIONS is defined to non-zero.
- */
-#ifndef ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H
-#error "This header should only be included by hardware/hwcomposer.h"
-#endif
-
-#ifndef ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_V0_H
-#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_V0_H
-
-struct hwc_composer_device;
-
-/*
- * availability: HWC_DEVICE_API_VERSION_0_3
- *
- * struct hwc_methods cannot be embedded in other structures as
- * sizeof(struct hwc_methods) cannot be relied upon.
- *
- */
-typedef struct hwc_methods {
-
- /*************************************************************************
- * HWC_DEVICE_API_VERSION_0_3
- *************************************************************************/
-
- /*
- * eventControl(..., event, enabled)
- * Enables or disables h/w composer events.
- *
- * eventControl can be called from any thread and takes effect
- * immediately.
- *
- * Supported events are:
- * HWC_EVENT_VSYNC
- *
- * returns -EINVAL if the "event" parameter is not one of the value above
- * or if the "enabled" parameter is not 0 or 1.
- */
-
- int (*eventControl)(
- struct hwc_composer_device* dev, int event, int enabled);
-
-} hwc_methods_t;
-
-typedef struct hwc_layer {
- /*
- * initially set to HWC_FRAMEBUFFER or HWC_BACKGROUND.
- * HWC_FRAMEBUFFER
- * indicates the layer will be drawn into the framebuffer
- * using OpenGL ES.
- * The HWC can toggle this value to HWC_OVERLAY, to indicate
- * it will handle the layer.
- *
- * HWC_BACKGROUND
- * indicates this is a special "background" layer. The only valid
- * field is backgroundColor. HWC_BACKGROUND can only be used with
- * HWC_API_VERSION >= 0.2
- * The HWC can toggle this value to HWC_FRAMEBUFFER, to indicate
- * it CANNOT handle the background color
- *
- */
- int32_t compositionType;
-
- /* see hwc_layer_t::hints above */
- uint32_t hints;
-
- /* see hwc_layer_t::flags above */
- uint32_t flags;
-
- union {
- /* color of the background. hwc_color_t.a is ignored */
- hwc_color_t backgroundColor;
-
- struct {
- /* handle of buffer to compose. This handle is guaranteed to have been
- * allocated from gralloc using the GRALLOC_USAGE_HW_COMPOSER usage flag. If
- * the layer's handle is unchanged across two consecutive prepare calls and
- * the HWC_GEOMETRY_CHANGED flag is not set for the second call then the
- * HWComposer implementation may assume that the contents of the buffer have
- * not changed. */
- buffer_handle_t handle;
-
- /* transformation to apply to the buffer during composition */
- uint32_t transform;
-
- /* blending to apply during composition */
- int32_t blending;
-
- /* area of the source to consider, the origin is the top-left corner of
- * the buffer */
- hwc_rect_t sourceCrop;
-
- /* where to composite the sourceCrop onto the display. The sourceCrop
- * is scaled using linear filtering to the displayFrame. The origin is the
- * top-left corner of the screen.
- */
- hwc_rect_t displayFrame;
-
- /* visible region in screen space. The origin is the
- * top-left corner of the screen.
- * The visible region INCLUDES areas overlapped by a translucent layer.
- */
- hwc_region_t visibleRegionScreen;
- };
- };
-} hwc_layer_t;
-
-/*
- * List of layers.
- * The handle members of hwLayers elements must be unique.
- */
-typedef struct hwc_layer_list {
- uint32_t flags;
- size_t numHwLayers;
- hwc_layer_t hwLayers[0];
-} hwc_layer_list_t;
-
-/*****************************************************************************/
-
-typedef struct hwc_composer_device {
- struct hw_device_t common;
-
- /*
- * (*prepare)() is called for each frame before composition and is used by
- * SurfaceFlinger to determine what composition steps the HWC can handle.
- *
- * (*prepare)() can be called more than once, the last call prevails.
- *
- * The HWC responds by setting the compositionType field to either
- * HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the composition for
- * this layer is handled by SurfaceFlinger with OpenGL ES, in the later
- * case, the HWC will have to handle this layer's composition.
- *
- * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the
- * list's geometry has changed, that is, when more than just the buffer's
- * handles have been updated. Typically this happens (but is not limited to)
- * when a window is added, removed, resized or moved.
- *
- * a NULL list parameter or a numHwLayers of zero indicates that the
- * entire composition will be handled by SurfaceFlinger with OpenGL ES.
- *
- * returns: 0 on success. An negative error code on error. If an error is
- * returned, SurfaceFlinger will assume that none of the layer will be
- * handled by the HWC.
- */
- int (*prepare)(struct hwc_composer_device *dev, hwc_layer_list_t* list);
-
- /*
- * (*set)() is used in place of eglSwapBuffers(), and assumes the same
- * functionality, except it also commits the work list atomically with
- * the actual eglSwapBuffers().
- *
- * The list parameter is guaranteed to be the same as the one returned
- * from the last call to (*prepare)().
- *
- * When this call returns the caller assumes that:
- *
- * - the display will be updated in the near future with the content
- * of the work list, without artifacts during the transition from the
- * previous frame.
- *
- * - all objects are available for immediate access or destruction, in
- * particular, hwc_region_t::rects data and hwc_layer_t::layer's buffer.
- * Note that this means that immediately accessing (potentially from a
- * different process) a buffer used in this call will not result in
- * screen corruption, the driver must apply proper synchronization or
- * scheduling (eg: block the caller, such as gralloc_module_t::lock(),
- * OpenGL ES, Camera, Codecs, etc..., or schedule the caller's work
- * after the buffer is freed from the actual composition).
- *
- * a NULL list parameter or a numHwLayers of zero indicates that the
- * entire composition has been handled by SurfaceFlinger with OpenGL ES.
- * In this case, (*set)() behaves just like eglSwapBuffers().
- *
- * dpy, sur, and list are set to NULL to indicate that the screen is
- * turning off. This happens WITHOUT prepare() being called first.
- * This is a good time to free h/w resources and/or power
- * the relevant h/w blocks down.
- *
- * IMPORTANT NOTE: there is an implicit layer containing opaque black
- * pixels behind all the layers in the list.
- * It is the responsibility of the hwcomposer module to make
- * sure black pixels are output (or blended from).
- *
- * returns: 0 on success. An negative error code on error:
- * HWC_EGL_ERROR: eglGetError() will provide the proper error code
- * Another code for non EGL errors.
- *
- */
- int (*set)(struct hwc_composer_device *dev,
- hwc_display_t dpy,
- hwc_surface_t sur,
- hwc_layer_list_t* list);
-
- /*
- * This field is OPTIONAL and can be NULL.
- *
- * If non NULL it will be called by SurfaceFlinger on dumpsys
- */
- void (*dump)(struct hwc_composer_device* dev, char *buff, int buff_len);
-
- /*
- * This field is OPTIONAL and can be NULL.
- *
- * (*registerProcs)() registers a set of callbacks the h/w composer HAL
- * can later use. It is FORBIDDEN to call any of the callbacks from
- * within registerProcs(). registerProcs() must save the hwc_procs_t pointer
- * which is needed when calling a registered callback.
- * Each call to registerProcs replaces the previous set of callbacks.
- * registerProcs is called with NULL to unregister all callbacks.
- *
- * Any of the callbacks can be NULL, in which case the corresponding
- * functionality is not supported.
- */
- void (*registerProcs)(struct hwc_composer_device* dev,
- hwc_procs_t const* procs);
-
- /*
- * This field is OPTIONAL and can be NULL.
- * availability: HWC_DEVICE_API_VERSION_0_2
- *
- * Used to retrieve information about the h/w composer
- *
- * Returns 0 on success or -errno on error.
- */
- int (*query)(struct hwc_composer_device* dev, int what, int* value);
-
- /*
- * Reserved for future use. Must be NULL.
- */
- void* reserved_proc[4];
-
- /*
- * This field is OPTIONAL and can be NULL.
- * availability: HWC_DEVICE_API_VERSION_0_3
- */
- hwc_methods_t const *methods;
-
-} hwc_composer_device_t;
-
-/** convenience API for opening and closing a device */
-
-static inline int hwc_open(const struct hw_module_t* module,
- hwc_composer_device_t** device) {
- return module->methods->open(module,
- HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device);
-}
-
-static inline int hwc_close(hwc_composer_device_t* device) {
- return device->common.close(&device->common);
-}
-
-/*****************************************************************************/
-
-#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_V0_H */
diff --git a/tests/keymaster/keymaster_test.cpp b/tests/keymaster/keymaster_test.cpp
index dd24fcb..37e98d7 100644
--- a/tests/keymaster/keymaster_test.cpp
+++ b/tests/keymaster/keymaster_test.cpp
@@ -296,14 +296,14 @@
uint8_t* key_blob;
size_t key_blob_length;
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->generate_keypair(sDevice, key_type, ¶ms, &key_blob, &key_blob_length))
<< "Should generate an RSA key with 512 bit modulus size";
UniqueKey key(&sDevice, key_blob, key_blob_length);
uint8_t* x509_data = NULL;
size_t x509_data_length;
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->get_keypair_public(sDevice, key_blob, key_blob_length,
&x509_data, &x509_data_length))
<< "Should be able to retrieve RSA public key successfully";
@@ -322,10 +322,10 @@
ASSERT_FALSE(rsa.get() == NULL)
<< "Should be able to extract RSA key from EVP_PKEY";
- EXPECT_EQ(static_cast<unsigned long>(RSA_F4), BN_get_word(rsa.get()->e))
+ ASSERT_EQ(static_cast<unsigned long>(RSA_F4), BN_get_word(rsa.get()->e))
<< "Exponent should be RSA_F4";
- EXPECT_EQ(GetParam() / 8, static_cast<uint32_t>(RSA_size(rsa.get())))
+ ASSERT_EQ(GetParam() / 8, static_cast<uint32_t>(RSA_size(rsa.get())))
<< "Modulus size should be the specified parameter";
}
@@ -339,7 +339,7 @@
uint8_t* key_blob;
size_t key_blob_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->generate_keypair(sDevice, key_type, NULL, &key_blob, &key_blob_length))
<< "Should not be able to generate an RSA key with null params";
}
@@ -350,7 +350,7 @@
uint8_t* key_blob;
size_t key_blob_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->generate_keypair(sDevice, key_type, NULL, &key_blob, &key_blob_length))
<< "Should not generate an unknown key type";
}
@@ -359,7 +359,7 @@
uint8_t* key_blob;
size_t key_blob_length;
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->import_keypair(sDevice, TEST_KEY_1, sizeof(TEST_KEY_1),
&key_blob, &key_blob_length))
<< "Should successfully import an RSA key";
@@ -367,7 +367,7 @@
uint8_t* x509_data;
size_t x509_data_length;
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->get_keypair_public(sDevice, key_blob, key_blob_length,
&x509_data, &x509_data_length))
<< "Should be able to retrieve RSA public key successfully";
@@ -377,7 +377,7 @@
Unique_EVP_PKEY actual(d2i_PUBKEY((EVP_PKEY**) NULL, &tmp,
static_cast<long>(x509_blob.length())));
- EXPECT_EQ(EVP_PKEY_type(actual.get()->type), EVP_PKEY_RSA)
+ ASSERT_EQ(EVP_PKEY_type(actual.get()->type), EVP_PKEY_RSA)
<< "Generated key type should be of type RSA";
const unsigned char *expectedTmp = static_cast<const unsigned char*>(TEST_KEY_1);
@@ -387,7 +387,7 @@
Unique_EVP_PKEY expected(EVP_PKCS82PKEY(expectedPkcs8.get()));
- EXPECT_EQ(1, EVP_PKEY_cmp(expected.get(), actual.get()))
+ ASSERT_EQ(1, EVP_PKEY_cmp(expected.get(), actual.get()))
<< "Expected and actual keys should match";
}
@@ -395,7 +395,7 @@
uint8_t* key_blob;
size_t key_blob_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->import_keypair(sDevice, BOGUS_KEY_1, sizeof(BOGUS_KEY_1),
&key_blob, &key_blob_length))
<< "Should not import an unknown key type";
@@ -405,7 +405,7 @@
uint8_t* key_blob;
size_t key_blob_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->import_keypair(sDevice, NULL, 0,
&key_blob, &key_blob_length))
<< "Should not import a null key";
@@ -423,7 +423,7 @@
uint8_t* x509_data;
size_t x509_data_length;
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->get_keypair_public(sDevice, key_blob, key_blob_length,
&x509_data, &x509_data_length))
<< "Should be able to retrieve RSA public key successfully";
@@ -436,7 +436,7 @@
uint8_t* x509_data = NULL;
size_t x509_data_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->get_keypair_public(sDevice, NULL, 0,
&x509_data, &x509_data_length))
<< "Should not be able to retrieve RSA public key from null key";
@@ -453,7 +453,7 @@
<< "Should successfully import an RSA key";
UniqueKey key(&sDevice, key_blob, key_blob_length);
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->get_keypair_public(sDevice, key.get(), key.length(),
NULL, NULL))
<< "Should not be able to succeed with NULL destination blob";
@@ -463,7 +463,7 @@
uint8_t* key_blob;
size_t key_blob_length;
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->import_keypair(sDevice, TEST_KEY_1, sizeof(TEST_KEY_1),
&key_blob, &key_blob_length))
<< "Should successfully import an RSA key";
@@ -485,10 +485,10 @@
<< "Should successfully import an RSA key";
UniqueBlob blob(key_blob, key_blob_length);
- EXPECT_EQ(0, sDevice->delete_keypair(sDevice, key_blob, key_blob_length))
+ ASSERT_EQ(0, sDevice->delete_keypair(sDevice, key_blob, key_blob_length))
<< "Should delete key after import";
- EXPECT_EQ(-1, sDevice->delete_keypair(sDevice, key_blob, key_blob_length))
+ ASSERT_EQ(-1, sDevice->delete_keypair(sDevice, key_blob, key_blob_length))
<< "Should not be able to delete key twice";
}
}
@@ -499,7 +499,7 @@
* by implementing delete_keypair.
*/
if (sDevice->delete_keypair != NULL) {
- EXPECT_EQ(-1, sDevice->delete_keypair(sDevice, NULL, 0))
+ ASSERT_EQ(-1, sDevice->delete_keypair(sDevice, NULL, 0))
<< "Should not be able to delete null key";
}
}
@@ -601,7 +601,7 @@
uint8_t* sig;
size_t sig_length;
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->sign_data(sDevice, ¶ms, key_blob, key_blob_length,
TEST_SIGN_DATA_1, sizeof(TEST_SIGN_DATA_1),
&sig, &sig_length))
@@ -610,7 +610,7 @@
UniqueBlob expected_sig(TEST_SIGN_SIGNATURE_1, sizeof(TEST_SIGN_SIGNATURE_1));
- EXPECT_EQ(expected_sig, sig_blob)
+ ASSERT_EQ(expected_sig, sig_blob)
<< "Generated signature should match expected signature";
// The expected signature is actually stack data, so don't let it try to free.
@@ -635,7 +635,7 @@
uint8_t* sig;
size_t sig_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->sign_data(sDevice, ¶ms, key_blob, key_blob_length,
TEST_KEY_1, sizeof(TEST_KEY_1),
&sig, &sig_length))
@@ -651,7 +651,7 @@
uint8_t* sig;
size_t sig_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->sign_data(sDevice, ¶ms, NULL, 0,
TEST_KEY_1, sizeof(TEST_KEY_1),
&sig, &sig_length))
@@ -676,7 +676,7 @@
uint8_t* sig;
size_t sig_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->sign_data(sDevice, ¶ms, key_blob, key_blob_length,
NULL, 0,
&sig, &sig_length))
@@ -701,7 +701,7 @@
uint8_t* sig;
size_t sig_length;
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->sign_data(sDevice, ¶ms, key_blob, key_blob_length,
TEST_KEY_1, sizeof(TEST_KEY_1),
NULL, NULL))
@@ -723,7 +723,7 @@
padding_type: PADDING_NONE,
};
- EXPECT_EQ(0,
+ ASSERT_EQ(0,
sDevice->verify_data(sDevice, ¶ms, key_blob, key_blob_length,
TEST_SIGN_DATA_1, sizeof(TEST_SIGN_DATA_1),
TEST_SIGN_SIGNATURE_1, sizeof(TEST_SIGN_SIGNATURE_1)))
@@ -745,7 +745,7 @@
padding_type: PADDING_NONE,
};
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->verify_data(sDevice, ¶ms, key_blob, key_blob_length,
TEST_SIGN_DATA_1, sizeof(TEST_SIGN_DATA_1),
TEST_SIGN_SIGNATURE_BOGUS_1, sizeof(TEST_SIGN_SIGNATURE_BOGUS_1)))
@@ -758,7 +758,7 @@
padding_type: PADDING_NONE,
};
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->verify_data(sDevice, ¶ms, NULL, 0,
TEST_SIGN_DATA_1, sizeof(TEST_SIGN_DATA_1),
TEST_SIGN_SIGNATURE_BOGUS_1, sizeof(TEST_SIGN_SIGNATURE_BOGUS_1)))
@@ -780,7 +780,7 @@
padding_type: PADDING_NONE,
};
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->verify_data(sDevice, ¶ms, key_blob, key_blob_length,
NULL, 0,
TEST_SIGN_SIGNATURE_1, sizeof(TEST_SIGN_SIGNATURE_1)))
@@ -802,7 +802,7 @@
padding_type: PADDING_NONE,
};
- EXPECT_EQ(-1,
+ ASSERT_EQ(-1,
sDevice->verify_data(sDevice, ¶ms, key.get(), key.length(),
TEST_SIGN_DATA_1, sizeof(TEST_SIGN_DATA_1),
NULL, 0))
@@ -830,7 +830,7 @@
<< "Should successfully import an RSA key";
UniqueKey key2(&sDevice, key2_blob, key2_blob_length);
- EXPECT_EQ(0, sDevice->delete_all(sDevice))
+ ASSERT_EQ(0, sDevice->delete_all(sDevice))
<< "Should erase all keys";
key1.reset();