diff options
author | Devin Moore <devinmoore@google.com> | 2021-01-18 16:11:20 -0800 |
---|---|---|
committer | Devin Moore <devinmoore@google.com> | 2021-01-22 13:30:19 -0800 |
commit | 17365e56a26fbc10aba10e7e0141d0c4f4937614 (patch) | |
tree | 726762f5751c09b074ae489b4cf3d2a0b28ae40d /common | |
parent | 600b7775ef945b70b211d67bf2a3285a0071c252 (diff) | |
download | platform_hardware_interfaces-17365e56a26fbc10aba10e7e0141d0c4f4937614.tar.gz platform_hardware_interfaces-17365e56a26fbc10aba10e7e0141d0c4f4937614.tar.bz2 platform_hardware_interfaces-17365e56a26fbc10aba10e7e0141d0c4f4937614.zip |
Use NativeHandle in MQDescriptor instead of ParcelFileDescriptor
android.hardware.common.fmq.MQDescriptor needs to handle multiple file
descriptors, so changing from ParcelFileDescriptor to
android.hardware.common.NativeHandle.
android.hardware.common.fmq.GrantorDescriptor needs to keep track of the
fdIndex as well.
Bug: 176912570
Test: atest fmq_unit_tests fmq_test
Change-Id: I15f2393e6c420ae5394322b28c4523fa80f7dcc7
Diffstat (limited to 'common')
7 files changed, 43 insertions, 27 deletions
diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp index 004adab514..9389712733 100644 --- a/common/fmq/aidl/Android.bp +++ b/common/fmq/aidl/Android.bp @@ -9,6 +9,9 @@ aidl_interface { srcs: [ "android/hardware/common/fmq/*.aidl", ], + imports: [ + "android.hardware.common", + ], stability: "vintf", backend: { java: { diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl index 7ac1930715..03277964ae 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl @@ -2,13 +2,14 @@ // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// 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 changes to the AIDL files built +// 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 @@ -18,6 +19,7 @@ package android.hardware.common.fmq; @VintfStability parcelable GrantorDescriptor { + int fdIndex; int offset; long extent; } diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl index 26073691f1..56f1de3cd8 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl @@ -2,13 +2,14 @@ // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// 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 changes to the AIDL files built +// 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 @@ -19,7 +20,7 @@ package android.hardware.common.fmq; @VintfStability parcelable MQDescriptor { android.hardware.common.fmq.GrantorDescriptor[] grantors; - ParcelFileDescriptor fileDescriptor; + android.hardware.common.NativeHandle handle; int quantum; int flags; } diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl index 2142bdbd13..264171dca1 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl @@ -2,13 +2,14 @@ // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// 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 changes to the AIDL files built +// 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 diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl index 1220674e13..eaf2ffdd16 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl @@ -2,13 +2,14 @@ // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// 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 changes to the AIDL files built +// 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 diff --git a/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl index ca69d94d55..672415e65a 100644 --- a/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl +++ b/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl @@ -22,6 +22,10 @@ package android.hardware.common.fmq; @VintfStability parcelable GrantorDescriptor { /* + * Index of file descriptor for this grantor + */ + int fdIndex; + /* * The offset of this descriptor in the shared memory in bytes. */ int offset; diff --git a/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl index 82917d6fbe..46622f00a9 100644 --- a/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl +++ b/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl @@ -16,6 +16,7 @@ package android.hardware.common.fmq; +import android.hardware.common.NativeHandle; import android.hardware.common.fmq.GrantorDescriptor; /* @@ -34,8 +35,11 @@ parcelable MQDescriptor<T, Flavor> { * for blocking operations in the shared memory. */ GrantorDescriptor[] grantors; - /* File descriptor for shared memory used in the message queue */ - ParcelFileDescriptor fileDescriptor; + /* + * NativeHandle that contains the file descriptors for shared memory used + * in the message queue + */ + NativeHandle handle; /* Size of each item, T, in bytes */ int quantum; /* EventFlag word for blocking operations */ |