diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-25 12:34:20 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-25 12:34:20 +0000 |
commit | a7e91a4b468db65a7c5f335b2c7c350abc4475c0 (patch) | |
tree | 51dafe9857ffc536e5b1a8f6c472f4fdac75e290 | |
parent | 00cbcc5fe893ac688e941e137b187c300646d378 (diff) | |
parent | a5e20436c36775be87953f34ac1ceba440342878 (diff) | |
download | interfaces-a7e91a4b468db65a7c5f335b2c7c350abc4475c0.tar.gz |
Snap for 8358640 from a5e20436c36775be87953f34ac1ceba440342878 to mainline-go-extservices-release
Change-Id: I0c52d8e0afab0a18d9374a06c0be08559ead5bfa
35 files changed, 627 insertions, 580 deletions
diff --git a/automotive/display/OWNERS b/automotive/display/OWNERS index e5a11e8..4787f0b 100644 --- a/automotive/display/OWNERS +++ b/automotive/display/OWNERS @@ -1,3 +1,2 @@ -haoxiangl@google.com -swan@google.com +ankitarora@google.com changyeon@google.com diff --git a/automotive/display/aidl/Android.bp b/automotive/display/aidl/Android.bp new file mode 100644 index 0000000..3fe2418 --- /dev/null +++ b/automotive/display/aidl/Android.bp @@ -0,0 +1,39 @@ +// Copyright (C) 2022 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. + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +aidl_interface { + name: "android.frameworks.automotive.display", + vendor_available: true, + srcs: ["android/frameworks/automotive/display/*.aidl"], + stability: "vintf", + imports: ["android.hardware.common-V2"], + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + enabled: false, + }, + ndk: { + vndk: { + enabled: false, + }, + }, + }, +} diff --git a/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/DisplayDesc.aidl b/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/DisplayDesc.aidl new file mode 100644 index 0000000..476f79f --- /dev/null +++ b/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/DisplayDesc.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 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 FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.frameworks.automotive.display; +@VintfStability +parcelable DisplayDesc { + int width; + int height; + long layer; + android.frameworks.automotive.display.Rotation orientation; +} diff --git a/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/ICarDisplayProxy.aidl b/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/ICarDisplayProxy.aidl new file mode 100644 index 0000000..643623a --- /dev/null +++ b/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/ICarDisplayProxy.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 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 FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.frameworks.automotive.display; +@VintfStability +interface ICarDisplayProxy { + long[] getDisplayIdList(); + android.frameworks.automotive.display.DisplayDesc getDisplayInfo(in long id); + android.hardware.common.NativeHandle getHGraphicBufferProducer(in long id); + void hideWindow(in long id); + void showWindow(in long id); +} diff --git a/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/Rotation.aidl b/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/Rotation.aidl new file mode 100644 index 0000000..8c4c374 --- /dev/null +++ b/automotive/display/aidl/aidl_api/android.frameworks.automotive.display/current/android/frameworks/automotive/display/Rotation.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 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 FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.frameworks.automotive.display; +@Backing(type="int") @VintfStability +enum Rotation { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3, +} diff --git a/automotive/display/aidl/android/frameworks/automotive/display/DisplayDesc.aidl b/automotive/display/aidl/android/frameworks/automotive/display/DisplayDesc.aidl new file mode 100644 index 0000000..2fef27a --- /dev/null +++ b/automotive/display/aidl/android/frameworks/automotive/display/DisplayDesc.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 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. + */ + +package android.frameworks.automotive.display; + +import android.frameworks.automotive.display.Rotation; + +/** + * Structure describing the basic properties of an EVS display + * + * The HAL is responsible for filling out this structure to describe + * the EVS display. As an implementation detail, this may be a physical + * display or a virtual display that is overlaid or mixed with another + * presentation device. + */ +@VintfStability +parcelable DisplayDesc { + /** + * The width of the display in pixels + */ + int width; + /** + * The height of the display in pixels + */ + int height; + /** + * Z-ordered group of layers (the layer stack) currently on this display, + * from ::android::ui::DisplayState + */ + long layer; + /** + * Counterclock-wise orientation of the display + */ + Rotation orientation; +} diff --git a/automotive/display/aidl/android/frameworks/automotive/display/ICarDisplayProxy.aidl b/automotive/display/aidl/android/frameworks/automotive/display/ICarDisplayProxy.aidl new file mode 100644 index 0000000..e09c4bc --- /dev/null +++ b/automotive/display/aidl/android/frameworks/automotive/display/ICarDisplayProxy.aidl @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2022 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. + */ + +package android.frameworks.automotive.display; + +import android.frameworks.automotive.display.DisplayDesc; +import android.hardware.common.NativeHandle; + +/** + * ICarDisplayProxy is an interface implemented by the car display proxy daemon and allows + * the vendor processes to render their contents on the display via SurfaceFlinger. + * + * To obtain a Surface associated with the target display, a client needs to call + * ICarDisplayProxy.getHGraphicBufferProducer() and convert a returned NativeHandle into + * HGraphicBufferProducer. libbufferqueueconverter provides getSurfaceFromHGPB() to get + * the surface from a converted HGraphicBufferProducer. A client can control the visibility + * of a target surface via ICarDisplayProxy.showWindow() and ICarDisplayProxy.hideWindow(). + */ +@VintfStability +interface ICarDisplayProxy { + /** + * Returns the stable identifiers of all available displays. + * + * @return A list of stable display identifiers. + */ + long[] getDisplayIdList(); + + /** + * Returns the descriptor of the target display. + * + * @param in id A stable ID of a target display. + * @return A display descriptor + * @throws STATUS_BAD_VALUE if a given display id is invalid + */ + DisplayDesc getDisplayInfo(in long id); + + /** + * Gets an HGraphicBufferProducer instance from the service. + * + * @param in id A stable ID of a target display. + * @return HGraphicBufferProducer object in the form of NativeHandle. + * @throws STATUS_FAILED_TRANSACTION if it fails to create the surface or read the display + * information + * STATUS_BAD_VALUE if it fails to create HGraphicBufferProducer + */ + NativeHandle getHGraphicBufferProducer(in long id); + + /** + * Sets the ANativeWindow, which is associated with the IGraphicBufferProducer, + * to be invisible and to release the control over display. + * + * @param in id A stable ID of a target display. + */ + void hideWindow(in long id); + + /** + * Sets the ANativeWindow, which is associated with the IGraphicBufferProducer, + * to be visible and to take over the display. + * + * @param in id A stable ID of a target display. + * @throws STATUS_BAD_VALUE if a given display id or a display token is invalid. + * STATUS_NAME_NOT_FOUND if it fails to find a display associated with the + * display token. + * Other STATUS_* if it fails to apply a SurfaceFlinger transaction. + */ + void showWindow(in long id); +} diff --git a/automotive/display/aidl/android/frameworks/automotive/display/Rotation.aidl b/automotive/display/aidl/android/frameworks/automotive/display/Rotation.aidl new file mode 100644 index 0000000..bb6ebf8 --- /dev/null +++ b/automotive/display/aidl/android/frameworks/automotive/display/Rotation.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 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. + */ + +package android.frameworks.automotive.display; + +/** + * Rotation: + * + * The required counterclockwise rotation of EVS camera stream and display. + */ +@VintfStability +@Backing(type="int") +enum Rotation { + /** No rotation */ + ROTATION_0 = 0, + /** Rotate by 90 degree counterclockwise */ + ROTATION_90 = 1, + /** Rotate by 180 degree counterclockwise */ + ROTATION_180 = 2, + /** Rotate by 270 degree counterclockwise */ + ROTATION_270 = 3 +} diff --git a/automotive/powerpolicy/aidl/Android.bp b/automotive/powerpolicy/aidl/Android.bp index 197aac4..bc76b3c 100644 --- a/automotive/powerpolicy/aidl/Android.bp +++ b/automotive/powerpolicy/aidl/Android.bp @@ -29,7 +29,12 @@ aidl_interface { stability: "vintf", backend: { java: { - platform_apis: true, + sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], enabled: true, }, }, @@ -38,7 +43,6 @@ aidl_interface { aidl_interface { name: "android.frameworks.automotive.powerpolicy.internal", - unstable: true, vendor_available: false, srcs: [ "android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl", @@ -46,7 +50,12 @@ aidl_interface { ], backend: { java: { - platform_apis: true, + sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], enabled: true, }, }, diff --git a/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/.hash b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/.hash new file mode 100644 index 0000000..d7e9cbf --- /dev/null +++ b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/.hash @@ -0,0 +1 @@ +ad6a6554d1587a1845520dcc5aeb547ea3e8cc6e diff --git a/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl new file mode 100644 index 0000000..549fd3c --- /dev/null +++ b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 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 FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.frameworks.automotive.powerpolicy.internal; +@VintfStability +interface ICarPowerPolicySystemNotification { + android.frameworks.automotive.powerpolicy.internal.PolicyState notifyCarServiceReady(); + void notifyPowerPolicyChange(in @utf8InCpp String policyId, boolean force); + void notifyPowerPolicyDefinition(in @utf8InCpp String policyId, in @utf8InCpp String[] enabledComponents, in @utf8InCpp String[] disabledComponents); +} diff --git a/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/android/frameworks/automotive/powerpolicy/internal/PolicyState.aidl b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/android/frameworks/automotive/powerpolicy/internal/PolicyState.aidl new file mode 100644 index 0000000..eb929e7 --- /dev/null +++ b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/1/android/frameworks/automotive/powerpolicy/internal/PolicyState.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020 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 FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.frameworks.automotive.powerpolicy.internal; +@VintfStability +parcelable PolicyState { + @utf8InCpp String policyId; + @utf8InCpp String policyGroupId; +} diff --git a/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/current/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/current/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl new file mode 100644 index 0000000..cd4fd9d --- /dev/null +++ b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/current/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 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 FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.frameworks.automotive.powerpolicy.internal; +/* @hide */ +interface ICarPowerPolicySystemNotification { + android.frameworks.automotive.powerpolicy.internal.PolicyState notifyCarServiceReady(); + void notifyPowerPolicyChange(in @utf8InCpp String policyId, boolean force); + void notifyPowerPolicyDefinition(in @utf8InCpp String policyId, in @utf8InCpp String[] enabledComponents, in @utf8InCpp String[] disabledComponents); +} diff --git a/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/current/android/frameworks/automotive/powerpolicy/internal/PolicyState.aidl b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/current/android/frameworks/automotive/powerpolicy/internal/PolicyState.aidl new file mode 100644 index 0000000..d1c58e5 --- /dev/null +++ b/automotive/powerpolicy/aidl/aidl_api/android.frameworks.automotive.powerpolicy.internal/current/android/frameworks/automotive/powerpolicy/internal/PolicyState.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2020 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 FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.frameworks.automotive.powerpolicy.internal; +parcelable PolicyState { + @utf8InCpp String policyId; + @utf8InCpp String policyGroupId; +} diff --git a/automotive/powerpolicy/aidl/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl b/automotive/powerpolicy/aidl/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl index 08078f0..beb39d1 100644 --- a/automotive/powerpolicy/aidl/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl +++ b/automotive/powerpolicy/aidl/android/frameworks/automotive/powerpolicy/internal/ICarPowerPolicySystemNotification.aidl @@ -23,8 +23,9 @@ import android.frameworks.automotive.powerpolicy.internal.PolicyState; * VHAL changes the power policy and the power policy daemon notifies the change to registered * subscribers. When subscribing to policy changes, a filter can be specified so that the registered * callbacks can listen only to a specific power component's change. + * + * @hide */ - interface ICarPowerPolicySystemNotification { /** * CarService uses this method to tell that CarService is ready for taking over power policy @@ -47,10 +48,12 @@ interface ICarPowerPolicySystemNotification { * System private API for CarService. * * @param policyId The current policy ID. + * @param force If {@code true}, the given policy is applied even when the current policy + * is a system power policy. * @throws IllegalStateException if it fails to notify power policy change. * @throws SecurityException if the caller doesn't have sufficient permissions. */ - void notifyPowerPolicyChange(in @utf8InCpp String policyId); + void notifyPowerPolicyChange(in @utf8InCpp String policyId, boolean force); /** * CarService uses this method to tell that there is a newly defined power policy. diff --git a/automotive/telemetry/aidl/Android.bp b/automotive/telemetry/aidl/Android.bp index cfb04f5..6379c35 100644 --- a/automotive/telemetry/aidl/Android.bp +++ b/automotive/telemetry/aidl/Android.bp @@ -32,6 +32,12 @@ aidl_interface { enabled: true, }, java: { + sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], enabled: false, }, ndk: { diff --git a/automotive/telemetry/aidl/android/frameworks/automotive/telemetry/ICarTelemetry.aidl b/automotive/telemetry/aidl/android/frameworks/automotive/telemetry/ICarTelemetry.aidl index daf2d77..f3256d5 100644 --- a/automotive/telemetry/aidl/android/frameworks/automotive/telemetry/ICarTelemetry.aidl +++ b/automotive/telemetry/aidl/android/frameworks/automotive/telemetry/ICarTelemetry.aidl @@ -27,11 +27,10 @@ interface ICarTelemetry { /** * Sends a list of CarData to CarTelemetry. * - * <p>Total `dataList` size is limited to 10KB, if it's larger than that, all the data is dropped. - * Note that Binder has 1MB data limit from all the clients combined, please keep that in + * <p>Note that Binder has 1MB data limit from all the clients combined, please keep that in * mind when writing frequent data. * - * @throws {@code Parcel#EX_ILLEGAL_ARGUMENT} if {@code dataList} is too large. + * @throws IllegalArgumentException if total {@code dataList#content} size is more than 10KB. */ void write(in CarData[] dataList); } diff --git a/bufferhub/1.0/vts/functional/Android.bp b/automotive/telemetry/aidl/vts/functional/Android.bp index f936850..fafe437 100644 --- a/bufferhub/1.0/vts/functional/Android.bp +++ b/automotive/telemetry/aidl/vts/functional/Android.bp @@ -1,5 +1,4 @@ -// -// Copyright (C) 2018 The Android Open Source Project +// 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. @@ -19,31 +18,24 @@ package { } cc_test { - name: "VtsHalBufferHubV1_0TargetTest", - defaults: [ - "Vts10HalTargetTestDefaults" + name: "VtsHalCarTelemetryTest", + defaults: ["VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static"], + srcs: ["VtsHalCarTelemetryTest.cpp"], + shared_libs: [ + "libbinder_ndk", ], - header_libs: [ - // TODO(b/118893702): remove dependency once ui/BufferHubDefs.h moved - // off dvr_api.h - "libdvr_headers", - "libnativewindow_headers", + // libbase, liblog, libutils are declared in "VtsHalTargetTestDefaults". + static_libs: [ + "libgflags", + "libgmock", + "android.frameworks.automotive.telemetry-V1-ndk", ], - srcs: [ - "VtsHalBufferHubV1_0TargetTest.cpp", - ], - shared_libs: [ - "android.frameworks.bufferhub@1.0", - "libcutils", - "libhidlbase", - "liblog", - "libui", - "libutils", + test_suites: [ + "general-tests", + "vts", ], cflags: [ - "-Wall", - "-Werror", "-O0", "-g", - ] + ], } diff --git a/automotive/telemetry/aidl/vts/functional/VtsHalCarTelemetryTest.cpp b/automotive/telemetry/aidl/vts/functional/VtsHalCarTelemetryTest.cpp new file mode 100644 index 0000000..763a381 --- /dev/null +++ b/automotive/telemetry/aidl/vts/functional/VtsHalCarTelemetryTest.cpp @@ -0,0 +1,85 @@ +/* + * 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. + */ +#define LOG_TAG "cartelemetryd_hal_aidl_test" + +#include <aidl/Gtest.h> +#include <aidl/Vintf.h> +#include <aidl/android/frameworks/automotive/telemetry/CarData.h> +#include <aidl/android/frameworks/automotive/telemetry/ICarTelemetry.h> +#include <android-base/logging.h> +#include <android/binder_auto_utils.h> +#include <android/binder_ibinder.h> +#include <android/binder_manager.h> +#include <android/binder_process.h> +#include <android/binder_status.h> +#include <gmock/gmock.h> +#include <gtest/gtest.h> + +#include <vector> + +namespace android { +namespace frameworks { +namespace automotive { +namespace telemetry { + +using ::aidl::android::frameworks::automotive::telemetry::CarData; +using ::aidl::android::frameworks::automotive::telemetry::ICarTelemetry; + +CarData buildCarData(int id, const std::vector<uint8_t>& content) { + CarData msg; + msg.id = id; + msg.content = content; + return msg; +} + +class CarTelemetryTest : public testing::TestWithParam<std::string> { + public: + virtual void SetUp() override { + mService = ICarTelemetry::fromBinder( + ndk::SpAIBinder(::AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, mService.get()) << "Instance '" << GetParam() << "'' is not available."; + } + + std::shared_ptr<ICarTelemetry> mService; +}; + +// TODO(b/182598466): Add verifying contents after adding internal AIDLs for reading +// TODO(b/182598466): Add test for size limit check +TEST_P(CarTelemetryTest, writeReturnsOk) { + CarData msg = buildCarData(101, {1, 0, 1, 0}); + + auto status = mService->write({msg}); + + EXPECT_TRUE(status.isOk()) << status.getMessage(); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CarTelemetryTest); +INSTANTIATE_TEST_SUITE_P( + AutomotiveHal, CarTelemetryTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(ICarTelemetry::descriptor)), + ::android::PrintInstanceNameToString); + +} // namespace telemetry +} // namespace automotive +} // namespace frameworks +} // namespace android + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/bufferhub/1.0/Android.bp b/bufferhub/1.0/Android.bp deleted file mode 100644 index 2c5aa0a..0000000 --- a/bufferhub/1.0/Android.bp +++ /dev/null @@ -1,26 +0,0 @@ -// This file is autogenerated by hidl-gen -Landroidbp. - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -hidl_interface { - name: "android.frameworks.bufferhub@1.0", - root: "android.frameworks", - srcs: [ - "types.hal", - "IBufferClient.hal", - "IBufferHub.hal", - ], - interfaces: [ - "android.hardware.graphics.common@1.0", - "android.hardware.graphics.common@1.1", - "android.hardware.graphics.common@1.2", - "android.hidl.base@1.0", - ], - gen_java: true, - apex_available: [ - "com.android.media.swcodec", - "//apex_available:platform", - ], -} diff --git a/bufferhub/1.0/IBufferClient.hal b/bufferhub/1.0/IBufferClient.hal deleted file mode 100644 index 6a0e75c..0000000 --- a/bufferhub/1.0/IBufferClient.hal +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2018 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. - */ -package android.frameworks.bufferhub@1.0; - -interface IBufferClient { - /** - * Creates a token that could be used for IBufferHub::import function later. - * - * @return token A per-boot-unique token in handle format. The content of - * token is opaque and implementation defined. Could be used for create - * another IBufferClient via IBufferHub::import function. - * @return status The result of this operation. NO_ERROR on success, - * error codes on failure. - */ - duplicate() generates (handle token, BufferHubStatus status); - - /** - * Closes this client. - * - * All further function calls must return CLIENT_CLOSED. All the unused - * tokens generated by this client via IBufferClient::duplicate must become - * invalid, and try to use them for import will return INVALID_TOKEN. - * - * Calling close must immediately free the underlying buffers if they are - * only used by this client, but the client must also be freed after - * calling this method. - * - * User may manually call this function to avoid race condition caused by - * asynchronous destructors. - * - * @return status The result of this operation. NO_ERROR on success, - * error codes on failure. - */ - close() generates (BufferHubStatus status); -};
\ No newline at end of file diff --git a/bufferhub/1.0/IBufferHub.hal b/bufferhub/1.0/IBufferHub.hal deleted file mode 100644 index cc0a4f1..0000000 --- a/bufferhub/1.0/IBufferHub.hal +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2018 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. - */ -package android.frameworks.bufferhub@1.0; - -import android.hardware.graphics.common@1.2::HardwareBufferDescription; -import IBufferClient; - -interface IBufferHub { - /** - * Allocates a new buffer. - * - * @param description The desired buffer parameters for the new buffer. - * @param userMetadataSize The size of the user defined metadata in bytes. - * @return status The result of this operation. NO_ERROR on success, - * error code on failure. - * @return bufferClient An bufferClient interface associated with - * the buffer just allocated. - * @return bufferTraits the struct containing the information of the buffer. - */ - allocateBuffer(HardwareBufferDescription description, - uint32_t userMetadataSize) - generates (BufferHubStatus status, - IBufferClient bufferClient, - BufferTraits bufferTraits); - - /** - * Fetches a bufferClient interface from a provided handle. - * - * @param nativeHandle Handle received from allocateBuffer. - * @return status The result of this operation. NO_ERROR on success, - * error code on failure. - * @return bufferClient An bufferClient interface associated with - * the nativeHandle passed in. - * @return bufferTraits the struct containing the information of the buffer. - */ - importBuffer(handle nativeHandle) - generates (BufferHubStatus status, - IBufferClient bufferClient, - BufferTraits bufferTraits); -}; diff --git a/bufferhub/1.0/types.hal b/bufferhub/1.0/types.hal deleted file mode 100644 index e56d66e..0000000 --- a/bufferhub/1.0/types.hal +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2018 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. - */ -package android.frameworks.bufferhub@1.0; - -import android.hardware.graphics.common@1.2::HardwareBufferDescription; - -enum BufferHubStatus : uint32_t { - NO_ERROR = 0, // Success - ALLOCATION_FAILED, // Buffer allocation failed - INVALID_TOKEN, // Token is invalid - BUFFER_FREED, // Buffer is freed already - CLIENT_CLOSED, // Client is closed already - MAX_CLIENT, // Buffer cannot have more clients -}; - -/** - * A struct containing necessary information to create a buffer object. - */ -struct BufferTraits { - /** - * Static descriptors (such as height, width, format) of the buffer. - */ - HardwareBufferDescription bufferDesc; - - /** - * Handle comes from android.hardware.graphics.allocator@2.0. Represents - * the underlying physical buffer object. - */ - handle bufferHandle; - - /** - * Client-defined handle containing other useful params and fds. The data - * in the handle may be exposed by ll-ndk clients but in a format that is - * described by the client. This actual structure will not be exposed. - */ - handle bufferInfo; -}; diff --git a/bufferhub/1.0/vts/OWNERS b/bufferhub/1.0/vts/OWNERS deleted file mode 100644 index 4d35f97..0000000 --- a/bufferhub/1.0/vts/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -jwcai@google.com -marissaw@google.com -yuexima@google.com diff --git a/bufferhub/1.0/vts/functional/VtsHalBufferHubV1_0TargetTest.cpp b/bufferhub/1.0/vts/functional/VtsHalBufferHubV1_0TargetTest.cpp deleted file mode 100644 index 224eeba..0000000 --- a/bufferhub/1.0/vts/functional/VtsHalBufferHubV1_0TargetTest.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (C) 2018 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. - */ - -#define LOG_TAG "VtsHalBufferHubV1_0TargetTest" - -#include <VtsHalHidlTargetTestBase.h> -#include <android-base/logging.h> -#include <android/frameworks/bufferhub/1.0/IBufferClient.h> -#include <android/frameworks/bufferhub/1.0/IBufferHub.h> -#include <android/hardware_buffer.h> -#include <gtest/gtest.h> -#include <hwbinder/IPCThreadState.h> -#include <ui/BufferHubDefs.h> - -using ::android::frameworks::bufferhub::V1_0::BufferHubStatus; -using ::android::frameworks::bufferhub::V1_0::BufferTraits; -using ::android::frameworks::bufferhub::V1_0::IBufferClient; -using ::android::frameworks::bufferhub::V1_0::IBufferHub; -using ::android::hardware::hidl_handle; -using ::android::hardware::graphics::common::V1_2::HardwareBufferDescription; - -namespace android { -namespace frameworks { -namespace bufferhub { -namespace vts { - -// Stride is an output that unknown before allocation. -const AHardwareBuffer_Desc kDesc = { - /*width=*/640UL, /*height=*/480UL, - /*layers=*/1, /*format=*/AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM, - /*usage=*/0ULL, /*stride=*/0UL, - /*rfu0=*/0UL, /*rfu1=*/0ULL}; -const size_t kUserMetadataSize = 1; - -// Test environment for BufferHub HIDL HAL. -class BufferHubHidlEnv : public ::testing::VtsHalHidlTargetTestEnvBase { - public: - // get the test environment singleton - static BufferHubHidlEnv* Instance() { - static BufferHubHidlEnv* instance = new BufferHubHidlEnv; - return instance; - } - - void registerTestServices() override { registerTestService<IBufferHub>(); } - - private: - BufferHubHidlEnv() {} -}; - -class HalBufferHubVts : public ::testing::VtsHalHidlTargetTestBase { - protected: - void SetUp() override { - VtsHalHidlTargetTestBase::SetUp(); - - mBufferHub = IBufferHub::getService(); - ASSERT_NE(nullptr, mBufferHub.get()); - } - - sp<IBufferHub> mBufferHub; -}; - -// TOOD(b/121345852): use bit_cast to unpack bufferInfo when C++20 becomes available. -uint32_t clientStateMask(const BufferTraits& bufferTraits) { - uint32_t clientStateMask; - memcpy(&clientStateMask, &bufferTraits.bufferInfo->data[3], sizeof(clientStateMask)); - return clientStateMask; -} - -// Helper function to verify that given bufferTrais: -// 1. is consistent with kDesc -// 2. have a non-null gralloc handle -// 3. have a non-null buffer info handle with: -// 1) metadata fd >= 0 (valid fd) -// 2) event fd >= 0 (valid fd) -// 3) buffer Id >= 0 -// 4) client bit mask != 0 -// 5) user metadata size = kUserMetadataSize -// -// The structure of BufferTraits.bufferInfo handle is defined in ui/BufferHubDefs.h -bool isValidTraits(const BufferTraits& bufferTraits) { - AHardwareBuffer_Desc desc; - memcpy(&desc, &bufferTraits.bufferDesc, sizeof(AHardwareBuffer_Desc)); - - const native_handle_t* bufferInfo = bufferTraits.bufferInfo.getNativeHandle(); - if (bufferInfo == nullptr) { - return false; - } - const int metadataFd = bufferInfo->data[0]; - const int eventFd = bufferInfo->data[1]; - const int bufferId = bufferInfo->data[2]; - uint32_t userMetadataSize; - memcpy(&userMetadataSize, &bufferTraits.bufferInfo->data[4], sizeof(userMetadataSize)); - - // Not comparing stride because it's unknown before allocation - return desc.format == kDesc.format && desc.height == kDesc.height && - desc.layers == kDesc.layers && desc.usage == kDesc.usage && desc.width == kDesc.width && - bufferTraits.bufferHandle.getNativeHandle() != nullptr && metadataFd >= 0 && - eventFd >= 0 && bufferId >= 0 && clientStateMask(bufferTraits) != 0U && - userMetadataSize == kUserMetadataSize; -} - -// Test IBufferHub::allocateBuffer then IBufferClient::close -TEST_F(HalBufferHubVts, AllocateAndFreeBuffer) { - HardwareBufferDescription desc; - memcpy(&desc, &kDesc, sizeof(HardwareBufferDescription)); - - BufferHubStatus ret; - sp<IBufferClient> client; - BufferTraits bufferTraits = {}; - IBufferHub::allocateBuffer_cb callback = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client = outClient; - bufferTraits = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->allocateBuffer(desc, kUserMetadataSize, callback).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - ASSERT_NE(nullptr, client.get()); - EXPECT_TRUE(isValidTraits(bufferTraits)); - - ASSERT_EQ(BufferHubStatus::NO_ERROR, client->close()); - EXPECT_EQ(BufferHubStatus::CLIENT_CLOSED, client->close()); -} - -// Test destroying IBufferClient without calling close -TEST_F(HalBufferHubVts, DestroyClientWithoutClose) { - HardwareBufferDescription desc; - memcpy(&desc, &kDesc, sizeof(HardwareBufferDescription)); - - BufferHubStatus ret; - sp<IBufferClient> client; - BufferTraits bufferTraits = {}; - IBufferHub::allocateBuffer_cb callback = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client = outClient; - bufferTraits = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->allocateBuffer(desc, kUserMetadataSize, callback).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - ASSERT_NE(nullptr, client.get()); - EXPECT_TRUE(isValidTraits(bufferTraits)); - - // Not calling client->close() before destruction here intentionally to see if anything would - // break. User is recommended to call close() in any case. - client.clear(); - - // Flush the command to remote side, wait for 10ms, and ping service again to check if alive - hardware::IPCThreadState::self()->flushCommands(); - usleep(10000); - ASSERT_TRUE(mBufferHub->ping().isOk()); -} - -// Test IBufferClient::duplicate after IBufferClient::close -TEST_F(HalBufferHubVts, DuplicateFreedBuffer) { - HardwareBufferDescription desc; - memcpy(&desc, &kDesc, sizeof(HardwareBufferDescription)); - - BufferHubStatus ret; - sp<IBufferClient> client; - BufferTraits bufferTraits = {}; - IBufferHub::allocateBuffer_cb callback = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client = outClient; - bufferTraits = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->allocateBuffer(desc, kUserMetadataSize, callback).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - ASSERT_NE(nullptr, client.get()); - EXPECT_TRUE(isValidTraits(bufferTraits)); - - ASSERT_EQ(BufferHubStatus::NO_ERROR, client->close()); - - hidl_handle token; - IBufferClient::duplicate_cb dupCb = [&](const auto& outToken, const auto& status) { - token = outToken; - ret = status; - }; - ASSERT_TRUE(client->duplicate(dupCb).isOk()); - EXPECT_EQ(ret, BufferHubStatus::CLIENT_CLOSED); - EXPECT_EQ(token.getNativeHandle(), nullptr); -} - -// Test normal import process using IBufferHub::import function -TEST_F(HalBufferHubVts, DuplicateAndImportBuffer) { - HardwareBufferDescription desc; - memcpy(&desc, &kDesc, sizeof(HardwareBufferDescription)); - - BufferHubStatus ret; - sp<IBufferClient> client; - BufferTraits bufferTraits = {}; - IBufferHub::allocateBuffer_cb callback = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client = outClient; - bufferTraits = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->allocateBuffer(desc, kUserMetadataSize, callback).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - ASSERT_NE(nullptr, client.get()); - EXPECT_TRUE(isValidTraits(bufferTraits)); - - hidl_handle token; - IBufferClient::duplicate_cb dupCb = [&](const auto& outToken, const auto& status) { - token = outToken; - ret = status; - }; - ASSERT_TRUE(client->duplicate(dupCb).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - ASSERT_NE(token.getNativeHandle(), nullptr); - EXPECT_GT(token->numInts, 1); - EXPECT_EQ(token->numFds, 0); - - sp<IBufferClient> client2; - BufferTraits bufferTraits2 = {}; - IBufferHub::importBuffer_cb importCb = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client2 = outClient; - bufferTraits2 = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->importBuffer(token, importCb).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - EXPECT_NE(nullptr, client2.get()); - EXPECT_TRUE(isValidTraits(bufferTraits2)); - - // Since they are two clients of one buffer, the id should be the same but client state bit mask - // should be different. - const int bufferId1 = bufferTraits.bufferInfo->data[2]; - const int bufferId2 = bufferTraits2.bufferInfo->data[2]; - EXPECT_EQ(bufferId1, bufferId2); - EXPECT_NE(clientStateMask(bufferTraits), clientStateMask(bufferTraits2)); - - EXPECT_EQ(BufferHubStatus::NO_ERROR, client->close()); - EXPECT_EQ(BufferHubStatus::NO_ERROR, client2->close()); -} - -// Test calling IBufferHub::import with nullptr. Must not crash the service -TEST_F(HalBufferHubVts, ImportNullToken) { - hidl_handle nullToken; - BufferHubStatus ret; - sp<IBufferClient> client; - BufferTraits bufferTraits = {}; - IBufferHub::importBuffer_cb importCb = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client = outClient; - bufferTraits = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->importBuffer(nullToken, importCb).isOk()); - EXPECT_EQ(ret, BufferHubStatus::INVALID_TOKEN); - EXPECT_EQ(nullptr, client.get()); - EXPECT_FALSE(isValidTraits(bufferTraits)); -} - -// Test calling IBufferHub::import with an nonexistant token. -TEST_F(HalBufferHubVts, ImportInvalidToken) { - native_handle_t* tokenHandle = native_handle_create(/*numFds=*/0, /*numInts=*/2); - tokenHandle->data[0] = 0; - // Assign a random number since we cannot know the HMAC value. - tokenHandle->data[1] = 42; - - hidl_handle invalidToken(tokenHandle); - BufferHubStatus ret; - sp<IBufferClient> client; - BufferTraits bufferTraits = {}; - IBufferHub::importBuffer_cb importCb = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client = outClient; - bufferTraits = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->importBuffer(invalidToken, importCb).isOk()); - EXPECT_EQ(ret, BufferHubStatus::INVALID_TOKEN); - EXPECT_EQ(nullptr, client.get()); - EXPECT_FALSE(isValidTraits(bufferTraits)); -} - -// Test calling IBufferHub::import after the original IBufferClient is closed -TEST_F(HalBufferHubVts, ImportFreedBuffer) { - HardwareBufferDescription desc; - memcpy(&desc, &kDesc, sizeof(HardwareBufferDescription)); - - BufferHubStatus ret; - sp<IBufferClient> client; - BufferTraits bufferTraits = {}; - IBufferHub::allocateBuffer_cb callback = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client = outClient; - bufferTraits = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->allocateBuffer(desc, kUserMetadataSize, callback).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - ASSERT_NE(nullptr, client.get()); - EXPECT_TRUE(isValidTraits(bufferTraits)); - - hidl_handle token; - IBufferClient::duplicate_cb dupCb = [&](const auto& outToken, const auto& status) { - token = outToken; - ret = status; - }; - ASSERT_TRUE(client->duplicate(dupCb).isOk()); - EXPECT_EQ(ret, BufferHubStatus::NO_ERROR); - ASSERT_NE(token.getNativeHandle(), nullptr); - EXPECT_GT(token->numInts, 1); - EXPECT_EQ(token->numFds, 0); - - // Close the client. Now the token should be invalid. - ASSERT_EQ(BufferHubStatus::NO_ERROR, client->close()); - - sp<IBufferClient> client2; - BufferTraits bufferTraits2 = {}; - IBufferHub::importBuffer_cb importCb = [&](const auto& status, const auto& outClient, - const auto& traits) { - ret = status; - client2 = outClient; - bufferTraits2 = std::move(traits); - }; - ASSERT_TRUE(mBufferHub->importBuffer(token, importCb).isOk()); - EXPECT_EQ(ret, BufferHubStatus::INVALID_TOKEN); - EXPECT_EQ(nullptr, client2.get()); - EXPECT_FALSE(isValidTraits(bufferTraits2)); -} - -} // namespace vts -} // namespace bufferhub -} // namespace frameworks -} // namespace android - -int main(int argc, char** argv) { - ::testing::AddGlobalTestEnvironment( - android::frameworks::bufferhub::vts::BufferHubHidlEnv::Instance()); - ::testing::InitGoogleTest(&argc, argv); - android::frameworks::bufferhub::vts::BufferHubHidlEnv::Instance()->init(&argc, argv); - int status = RUN_ALL_TESTS(); - LOG(INFO) << "Test result = " << status; - return status; -} diff --git a/cameraservice/vts/functional/OWNERS b/cameraservice/vts/functional/OWNERS index f48a95c..d1d18b4 100644 --- a/cameraservice/vts/functional/OWNERS +++ b/cameraservice/vts/functional/OWNERS @@ -1 +1,2 @@ +# Bug component: 41727 include platform/frameworks/av:/camera/OWNERS diff --git a/current.txt b/current.txt index e106135..54c2b07 100644 --- a/current.txt +++ b/current.txt @@ -18,10 +18,12 @@ a5dab2e6528095ccf4e9ae7e54e6e36ffe3dc0e1133fa3f9197f0b36216e09eb android.framewo 5d4901c7f86a9e198b8d14e6e1de2fd819804db482b881dcf6230050f1dfdf34 android.frameworks.displayservice@1.0::IEventCallback d80cdd518a48e1ff49f4776c7ea407b9be8d451510ff2cb8e57b2286f623496e android.frameworks.displayservice@1.0::types +# Framwork-only HALs released in Android Q for VR (not used, deleted) +# 3b3358e32e3011646f48ebaf5478a02590eafe07e8d8f1711a511fda15cf0f70 android.frameworks.bufferhub@1.0::IBufferClient +# d15b1612e60aa4767cf07ef8d3f3bd64e877cb6b1569787a67227a1a0a9f6fbe android.frameworks.bufferhub@1.0::IBufferHub +# 74b9db2f5e440c78ff0f6234f68b5141af752a981be6b9366531a1b83ec6430b android.frameworks.bufferhub@1.0::types + # Framework HALs released in Android Q -3b3358e32e3011646f48ebaf5478a02590eafe07e8d8f1711a511fda15cf0f70 android.frameworks.bufferhub@1.0::IBufferClient -d15b1612e60aa4767cf07ef8d3f3bd64e877cb6b1569787a67227a1a0a9f6fbe android.frameworks.bufferhub@1.0::IBufferHub -74b9db2f5e440c78ff0f6234f68b5141af752a981be6b9366531a1b83ec6430b android.frameworks.bufferhub@1.0::types e295e84a8f1bc1d8a4cb0da60969ca7a2ec617b7b7fb8629dc5a536ad8632dce android.frameworks.cameraservice.common@2.0::types 451a064694f87cdb7e24400c246fa7974eccb05a5bf6bddad175521fd18a9185 android.frameworks.cameraservice.device@2.0::ICameraDeviceCallback 0eb9a751491befc207a8f5a94496489afd121f98560630771741af58d88fadff android.frameworks.cameraservice.device@2.0::ICameraDeviceUser diff --git a/sensorservice/1.0/vts/functional/Android.bp b/sensorservice/1.0/vts/functional/Android.bp index feb01ab..a465c8a 100644 --- a/sensorservice/1.0/vts/functional/Android.bp +++ b/sensorservice/1.0/vts/functional/Android.bp @@ -21,6 +21,7 @@ package { cc_test { name: "VtsHalSensorManagerV1_0TargetTest", defaults: ["hidl_defaults"], + tidy_timeout_srcs: ["VtsHalSensorManagerV1_0TargetTest.cpp"], srcs: ["VtsHalSensorManagerV1_0TargetTest.cpp"], shared_libs: [ "libbase", diff --git a/stats/1.0/test_client/StatsClient.cpp b/stats/1.0/test_client/StatsClient.cpp index 5abaac0..344610e 100644 --- a/stats/1.0/test_client/StatsClient.cpp +++ b/stats/1.0/test_client/StatsClient.cpp @@ -181,7 +181,7 @@ int main(int argc, char* argv[]) { tmp.intValue(3); values.push_back(tmp); VendorAtom atom = { - .reverseDomainName = "com.google.pixel", .atomId = 100001, .values = values}; + .reverseDomainName = "", .atomId = 100001, .values = values}; client->reportVendorAtom(atom); ++hal_calls; break; diff --git a/stats/1.0/vts/functional/OWNERS b/stats/1.0/vts/functional/OWNERS index f60a4a7..338354d 100644 --- a/stats/1.0/vts/functional/OWNERS +++ b/stats/1.0/vts/functional/OWNERS @@ -1,3 +1,2 @@ -maggiewhite@google.com -yro@google.com +# Bug component: 709877 achant@google.com diff --git a/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp b/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp index 8a57955..fd18189 100644 --- a/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp +++ b/stats/1.0/vts/functional/VtsHalStatsV1_0TargetTest.cpp @@ -140,7 +140,7 @@ TEST_P(StatsHidlTest, reportVendorAtom) { values.push_back(tmp); tmp.intValue(3); values.push_back(tmp); - VendorAtom atom = {.reverseDomainName = "com.google.pixel", .atomId = 100001, .values = values}; + VendorAtom atom = {.reverseDomainName = "", .atomId = 100001, .values = values}; Return<void> ret; client->reportVendorAtom(atom); diff --git a/stats/aidl/test_client/AidlStatsClient.cpp b/stats/aidl/test_client/AidlStatsClient.cpp index 2f8cd89..f6782e6 100644 --- a/stats/aidl/test_client/AidlStatsClient.cpp +++ b/stats/aidl/test_client/AidlStatsClient.cpp @@ -80,7 +80,7 @@ int main(int argc, char* argv[]) { tmp.set<VendorAtomValue::intValue>(3); values.push_back(tmp); VendorAtom atom = { - .reverseDomainName = "com.google.pixel", .atomId = 100001, .values = values}; + .reverseDomainName = "", .atomId = 100001, .values = values}; const ndk::ScopedAStatus ret = service->reportVendorAtom(atom); if (!ret.isOk()) { std::cout << "reportVendorAtom failed: " << ret.getServiceSpecificError() diff --git a/stats/aidl/test_client/Android.bp b/stats/aidl/test_client/Android.bp index c2afd6f..8a8c895 100644 --- a/stats/aidl/test_client/Android.bp +++ b/stats/aidl/test_client/Android.bp @@ -31,7 +31,7 @@ cc_binary { "AidlStatsClient.cpp", ], shared_libs: [ - "android.frameworks.stats-V1-ndk_platform", + "android.frameworks.stats-V1-ndk", "libbase", "libbinder_ndk", "libutils", diff --git a/stats/aidl/vts/functional/Android.bp b/stats/aidl/vts/functional/Android.bp index e0663bd..3a63bb0 100644 --- a/stats/aidl/vts/functional/Android.bp +++ b/stats/aidl/vts/functional/Android.bp @@ -32,7 +32,7 @@ cc_test { "libvndksupport", ], static_libs: [ - "android.frameworks.stats-V1-ndk_platform", + "android.frameworks.stats-V1-ndk", ], test_suites: [ "general-tests", diff --git a/stats/aidl/vts/functional/VtsHalStatsTargetTest.cpp b/stats/aidl/vts/functional/VtsHalStatsTargetTest.cpp index ac46f49..576fa04 100644 --- a/stats/aidl/vts/functional/VtsHalStatsTargetTest.cpp +++ b/stats/aidl/vts/functional/VtsHalStatsTargetTest.cpp @@ -54,7 +54,7 @@ TEST_P(StatsAidlTest, reportVendorAtom) { values.push_back(tmp); tmp.set<VendorAtomValue::intValue>(3); values.push_back(tmp); - VendorAtom atom = {.reverseDomainName = "com.google.pixel", .atomId = 100001, .values = values}; + VendorAtom atom = {.reverseDomainName = "", .atomId = 100001, .values = values}; const ndk::ScopedAStatus ret = client->reportVendorAtom(atom); ASSERT_TRUE(ret.isOk()); @@ -75,7 +75,7 @@ TEST_P(StatsAidlTest, reportVendorAtomInvalidAtomIdLow) { values.push_back(tmp); tmp.set<VendorAtomValue::intValue>(3); values.push_back(tmp); - VendorAtom atom = {.reverseDomainName = "com.google.pixel", .atomId = 1000, .values = values}; + VendorAtom atom = {.reverseDomainName = "", .atomId = 1000, .values = values}; const ndk::ScopedAStatus ret = client->reportVendorAtom(atom); ASSERT_TRUE(ret.isOk()); @@ -96,7 +96,7 @@ TEST_P(StatsAidlTest, reportVendorAtomInvalidAtomIdHigh) { values.push_back(tmp); tmp.set<VendorAtomValue::intValue>(3); values.push_back(tmp); - VendorAtom atom = {.reverseDomainName = "com.google.pixel", .atomId = 300001, .values = values}; + VendorAtom atom = {.reverseDomainName = "", .atomId = 300001, .values = values}; const ndk::ScopedAStatus ret = client->reportVendorAtom(atom); ASSERT_TRUE(ret.isOk()); @@ -117,7 +117,7 @@ TEST_P(StatsAidlTest, reportVendorAtomInvalidDomainNameTooLong) { values.push_back(tmp); tmp.set<VendorAtomValue::intValue>(3); values.push_back(tmp); - VendorAtom atom = {.reverseDomainName = "com.google.pixel.SubDomainName.SubDomainName.Domain", + VendorAtom atom = {.reverseDomainName = "", .atomId = 100001, .values = values}; const ndk::ScopedAStatus ret = client->reportVendorAtom(atom); |