media.c2 aidl: do not throw status, return instead
config(),query() and querySupportedValues() can return values as a
partial failure when status was thrown. So return the status instead of
throwing(For the compatibility with HIDL interface).
Bug: 254050314
Change-Id: Iece35ff11049e1b3fccb3b72a4d438621138e21e
diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl
index 32f5abd..04e776e 100644
--- a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl
+++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl
@@ -37,12 +37,23 @@
android.hardware.media.c2.IConfigurable.ConfigResult config(in android.hardware.media.c2.Params inParams, in boolean mayBlock);
int getId();
String getName();
- android.hardware.media.c2.Params query(in int[] indices, in boolean mayBlock);
+ android.hardware.media.c2.IConfigurable.QueryResult query(in int[] indices, in boolean mayBlock);
android.hardware.media.c2.ParamDescriptor[] querySupportedParams(in int start, in int count);
- android.hardware.media.c2.FieldSupportedValuesQueryResult[] querySupportedValues(in android.hardware.media.c2.FieldSupportedValuesQuery[] inFields, in boolean mayBlock);
+ android.hardware.media.c2.IConfigurable.QuerySupportedValuesResult querySupportedValues(in android.hardware.media.c2.FieldSupportedValuesQuery[] inFields, in boolean mayBlock);
@VintfStability
parcelable ConfigResult {
android.hardware.media.c2.Params params;
android.hardware.media.c2.SettingResult[] failures;
+ android.hardware.media.c2.Status status;
+ }
+ @VintfStability
+ parcelable QueryResult {
+ android.hardware.media.c2.Params params;
+ android.hardware.media.c2.Status status;
+ }
+ @VintfStability
+ parcelable QuerySupportedValuesResult {
+ android.hardware.media.c2.FieldSupportedValuesQueryResult[] values;
+ android.hardware.media.c2.Status status;
}
}
diff --git a/media/c2/aidl/android/hardware/media/c2/IConfigurable.aidl b/media/c2/aidl/android/hardware/media/c2/IConfigurable.aidl
index 7fdb825..1481c15 100644
--- a/media/c2/aidl/android/hardware/media/c2/IConfigurable.aidl
+++ b/media/c2/aidl/android/hardware/media/c2/IConfigurable.aidl
@@ -21,6 +21,7 @@
import android.hardware.media.c2.ParamDescriptor;
import android.hardware.media.c2.Params;
import android.hardware.media.c2.SettingResult;
+import android.hardware.media.c2.Status;
/**
* Generic configuration interface presented by all configurable Codec2 objects.
@@ -34,12 +35,42 @@
* Return parcelable for config() interface.
*
* This includes the successful config settings along with the failure reasons of
- * the specified setting.
+ * the specified setting. @p status is for the compatibility with HIDL interface.
+ * (The value is defined in Status.aidl, and possible values are enumerated
+ * in config() interface definition)
*/
@VintfStability
parcelable ConfigResult {
Params params;
SettingResult[] failures;
+ Status status;
+ }
+
+ /**
+ * Return parcelable for query() interface.
+ *
+ * @p params is the parameter descripion for queried configuration indices.
+ * @p status is for the compatibility with HIDL interface. (The value is defined in
+ * Status.aidl, and possible values are enumerated in query() interface definition)
+ */
+ @VintfStability
+ parcelable QueryResult {
+ Params params;
+ Status status;
+ }
+
+ /**
+ * Return parcelable for querySupportedValues() interface.
+ *
+ * @p values is the value descripion for queried configuration fields.
+ * @p status is for the compatibility with HIDL interface. (The value is defined in
+ * Status.aidl, and possible values are enumerated in querySupportedValues()
+ * interface definition)
+ */
+ @VintfStability
+ parcelable QuerySupportedValuesResult {
+ FieldSupportedValuesQueryResult[] values;
+ Status status;
}
/**
@@ -82,7 +113,8 @@
* @param mayBlock Whether this call may block or not.
* @return result of config. Params in the result should be in same order
* with @p inParams.
- * @throws ServiceSpecificException with one of the following values:
+ *
+ * Returned @p status will be one of the following.
* - `Status::NO_MEMORY` - Some supported parameters could not be updated
* successfully because they contained unsupported values.
* These are returned in @p failures.
@@ -146,17 +178,22 @@
*
* @param indices List of C2Param structure indices to query.
* @param mayBlock Whether this call may block or not.
- * @return Flattened representation of std::vector<C2Param> object.
- * Unsupported settings are skipped in the results. The order in @p indices
- * still be preserved except skipped settings.
- * @throws ServiceSpecificException with one of the following values:
+ * @return @p params is the flattened representation of std::vector<C2Param> object.
+ * Technically unsupported settings can be either skipped or invalidated.
+ * (Invalidated params will be skipped during unflattening to make these identical.)
+ * In the future we will want these to be invalidated to make it easier
+ * for the framework code.
+ *
+ * The order in @p indices still be preserved except skipped settings.
+ *
+ * Returned @p status will be one of the following.
* - `Status::NO_MEMORY` - Could not allocate memory for a supported parameter.
* - `Status::BLOCKING` - Querying some parameters requires blocking, but
* @p mayBlock is false.
* - `Status::TIMED_OUT` - The operation cannot be finished in a timely manner.
* - `Status::CORRUPTED` - Some unknown error occurred.
*/
- Params query(in int[] indices, in boolean mayBlock);
+ QueryResult query(in int[] indices, in boolean mayBlock);
/**
* Returns a list of supported parameters within a selected range of C2Param
@@ -197,9 +234,10 @@
*
* @param inFields List of field queries.
* @param mayBlock Whether this call may block or not.
- * @return List of supported values and results for the
+ * @return @p values is the list of supported values and results for the
* supplied queries.
- * @throws ServiceSpecificException with one of the following values:
+ *
+ * Returned @p status will be one of the following.
* - `Status::BLOCKING` - Querying some parameters requires blocking, but
* @p mayBlock is false.
* - `Status::NO_MEMORY` - Not enough memory to complete this method.
@@ -208,6 +246,6 @@
* - `Status::TIMED_OUT` - The operation cannot be finished in a timely manner.
* - `Status::CORRUPTED` - Some unknown error occurred.
*/
- FieldSupportedValuesQueryResult[] querySupportedValues(
+ QuerySupportedValuesResult querySupportedValues(
in FieldSupportedValuesQuery[] inFields, in boolean mayBlock);
}