Merge "Merge "Camera: Add static metadata that can map device state to orientation" into sc-v2-dev am: 6621c1ad05" into sc-v2-dev-plus-aosp

This commit is contained in:
TreeHugger Robot 2021-10-08 06:08:48 +00:00 committed by Android (Google) Code Review
commit 11ac9efa38
3 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,50 @@
/*
* Copyright (C) 2021 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.
*/
/*
* Autogenerated from camera metadata definitions in
* /system/media/camera/docs/metadata_definitions.xml
* *** DO NOT EDIT BY HAND ***
*/
package android.hardware.camera.metadata@3.7;
import android.hardware.camera.metadata@3.2;
import android.hardware.camera.metadata@3.3;
import android.hardware.camera.metadata@3.4;
import android.hardware.camera.metadata@3.5;
import android.hardware.camera.metadata@3.6;
// No new metadata sections added in this revision
/**
* Main enumeration for defining camera metadata tags added in this revision
*
* <p>Partial documentation is included for each tag; for complete documentation, reference
* '/system/media/camera/docs/docs.html' in the corresponding Android source tree.</p>
*/
enum CameraMetadataTag : @3.6::CameraMetadataTag {
/** android.info.deviceStateOrientations [static, int64[], ndk_public]
*/
ANDROID_INFO_DEVICE_STATE_ORIENTATIONS = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_INFO_END_3_4,
ANDROID_INFO_END_3_7,
};
/*
* Enumeration definitions for the various entries that need them
*/

View file

@ -8161,6 +8161,20 @@ void CameraHidlTest::verifyCameraCharacteristics(Status status, const CameraMeta
poseReference >= ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA);
}
retcode = find_camera_metadata_ro_entry(metadata,
ANDROID_INFO_DEVICE_STATE_ORIENTATIONS, &entry);
if (0 == retcode && entry.count > 0) {
ASSERT_TRUE((entry.count % 2) == 0);
uint64_t maxPublicState = ((uint64_t) provider::V2_5::DeviceState::FOLDED) << 1;
uint64_t vendorStateStart = 1UL << 31; // Reserved for vendor specific states
uint64_t stateMask = (1 << vendorStateStart) - 1;
stateMask &= ~((1 << maxPublicState) - 1);
for (int i = 0; i < entry.count; i += 2){
ASSERT_TRUE((entry.data.i64[i] & stateMask) == 0);
ASSERT_TRUE((entry.data.i64[i+1] % 90) == 0);
}
}
verifyExtendedSceneModeCharacteristics(metadata);
verifyZoomCharacteristics(metadata);
}

View file

@ -901,6 +901,9 @@ c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardwar
4a087a308608d146b022ebc15633de989f5f4dfe1491a83fa41763290a82e40d android.hardware.automotive.vehicle@2.0::types
70eb14415391f835fb218b43a1e25f5d6495f098f96fa2acaea70985e98e1ce8 android.hardware.automotive.vehicle@2.0::types
# HALs released in Android SCv2
77f6fcf3fd0dd3e424d8a0292094ebd17e4c35454bb9abbd3a6cbed1aba70765 android.hardware.camera.metadata@3.7::types
# ABI preserving changes to HALs during Android T
62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot
ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardware.neuralnetworks@1.2::types