Merge "Bluetooth Audio HAL interface v2"
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index effde88..a4259c1 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -343,7 +343,7 @@
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.radio</name>
- <version>1.0-2</version>
+ <version>1.4</version>
<interface>
<name>IRadio</name>
<instance>slot1</instance>
@@ -357,7 +357,7 @@
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.radio.config</name>
- <version>1.0</version>
+ <version>1.2</version>
<interface>
<name>IRadioConfig</name>
<instance>default</instance>
diff --git a/current.txt b/current.txt
index 3f124ae..c063f3e 100644
--- a/current.txt
+++ b/current.txt
@@ -401,5 +401,6 @@
271187e261b30c01a33011aea257c07a2d2f05b72943ebee89e973e997849973 android.hardware.radio@1.0::types
1d19720d4fd38b1095f0f555a4bd92b3b12c9b1d0f560b0e9a474cd6dcc20db6 android.hardware.radio@1.2::IRadio
e78cf871f9fd1c072874e481e06e18e2681763cf2aa38c1fd777d53bab4eb69b android.hardware.sensors@1.0::types
+3d01e29e8129186f7567c4f9c8bee7480a0768e587b1be9b28adb0a6cbec6bf2 android.hardware.tv.cec@1.0::types
1722ad002317b1fae1400de709e90f442d94ef22864e05f7a12af48c32e8edc8 android.hardware.usb@1.1::types
29c8da7a13c40d488f569c812441d5754ee45bdcdb8ce6564f524b708d10a057 android.hardware.vibrator@1.1::types
diff --git a/graphics/allocator/2.0/default/OWNERS b/graphics/allocator/2.0/default/OWNERS
index 3aa5fa1..273cb4c 100644
--- a/graphics/allocator/2.0/default/OWNERS
+++ b/graphics/allocator/2.0/default/OWNERS
@@ -1,4 +1,4 @@
# Graphics team
jessehall@google.com
-olv@google.com
+marissaw@google.com
stoza@google.com
diff --git a/graphics/allocator/2.0/utils/OWNERS b/graphics/allocator/2.0/utils/OWNERS
index 3aa5fa1..273cb4c 100644
--- a/graphics/allocator/2.0/utils/OWNERS
+++ b/graphics/allocator/2.0/utils/OWNERS
@@ -1,4 +1,4 @@
# Graphics team
jessehall@google.com
-olv@google.com
+marissaw@google.com
stoza@google.com
diff --git a/graphics/composer/2.1/default/OWNERS b/graphics/composer/2.1/default/OWNERS
index 4714be2..db8fb80 100644
--- a/graphics/composer/2.1/default/OWNERS
+++ b/graphics/composer/2.1/default/OWNERS
@@ -1,5 +1,6 @@
# Graphics team
courtneygo@google.com
jessehall@google.com
-olv@google.com
+lpy@google.com
stoza@google.com
+vhau@google.com
diff --git a/graphics/composer/2.1/utils/OWNERS b/graphics/composer/2.1/utils/OWNERS
index d515a23..5acc631 100644
--- a/graphics/composer/2.1/utils/OWNERS
+++ b/graphics/composer/2.1/utils/OWNERS
@@ -1,4 +1,5 @@
courtneygo@google.com
jessehall@google.com
-olv@google.com
+lpy@google.com
stoza@google.com
+vhau@google.com
diff --git a/graphics/composer/2.1/vts/OWNERS b/graphics/composer/2.1/vts/OWNERS
index ef69d7c..0b42d2e 100644
--- a/graphics/composer/2.1/vts/OWNERS
+++ b/graphics/composer/2.1/vts/OWNERS
@@ -1,6 +1,7 @@
# Graphics team
-olv@google.com
+lpy@google.com
+vhau@google.com
# VTS team
yim@google.com
-zhuoyao@google.com
\ No newline at end of file
+zhuoyao@google.com
diff --git a/graphics/composer/2.2/default/OWNERS b/graphics/composer/2.2/default/OWNERS
index 4714be2..db8fb80 100644
--- a/graphics/composer/2.2/default/OWNERS
+++ b/graphics/composer/2.2/default/OWNERS
@@ -1,5 +1,6 @@
# Graphics team
courtneygo@google.com
jessehall@google.com
-olv@google.com
+lpy@google.com
stoza@google.com
+vhau@google.com
diff --git a/graphics/composer/2.2/utils/OWNERS b/graphics/composer/2.2/utils/OWNERS
index 1beb074..a17a50c 100644
--- a/graphics/composer/2.2/utils/OWNERS
+++ b/graphics/composer/2.2/utils/OWNERS
@@ -1,7 +1,8 @@
# Graphics team
courtneygo@google.com
-olv@google.com
+lpy@google.com
stoza@google.com
+vhau@google.com
# VTS team
yim@google.com
diff --git a/graphics/composer/2.2/vts/functional/OWNERS b/graphics/composer/2.2/vts/functional/OWNERS
index 1beb074..a17a50c 100644
--- a/graphics/composer/2.2/vts/functional/OWNERS
+++ b/graphics/composer/2.2/vts/functional/OWNERS
@@ -1,7 +1,8 @@
# Graphics team
courtneygo@google.com
-olv@google.com
+lpy@google.com
stoza@google.com
+vhau@google.com
# VTS team
yim@google.com
diff --git a/graphics/composer/2.3/default/OWNERS b/graphics/composer/2.3/default/OWNERS
index 3aa5fa1..820ebe6 100644
--- a/graphics/composer/2.3/default/OWNERS
+++ b/graphics/composer/2.3/default/OWNERS
@@ -1,4 +1,5 @@
# Graphics team
jessehall@google.com
-olv@google.com
+lpy@google.com
stoza@google.com
+vhau@google.com
diff --git a/graphics/mapper/2.0/default/OWNERS b/graphics/mapper/2.0/default/OWNERS
index 3aa5fa1..273cb4c 100644
--- a/graphics/mapper/2.0/default/OWNERS
+++ b/graphics/mapper/2.0/default/OWNERS
@@ -1,4 +1,4 @@
# Graphics team
jessehall@google.com
-olv@google.com
+marissaw@google.com
stoza@google.com
diff --git a/graphics/mapper/2.0/utils/OWNERS b/graphics/mapper/2.0/utils/OWNERS
index 3aa5fa1..273cb4c 100644
--- a/graphics/mapper/2.0/utils/OWNERS
+++ b/graphics/mapper/2.0/utils/OWNERS
@@ -1,4 +1,4 @@
# Graphics team
jessehall@google.com
-olv@google.com
+marissaw@google.com
stoza@google.com
diff --git a/graphics/mapper/2.0/vts/OWNERS b/graphics/mapper/2.0/vts/OWNERS
index ef69d7c..8e86f64 100644
--- a/graphics/mapper/2.0/vts/OWNERS
+++ b/graphics/mapper/2.0/vts/OWNERS
@@ -1,6 +1,6 @@
# Graphics team
-olv@google.com
+marissaw@google.com
# VTS team
yim@google.com
-zhuoyao@google.com
\ No newline at end of file
+zhuoyao@google.com
diff --git a/graphics/mapper/2.1/default/OWNERS b/graphics/mapper/2.1/default/OWNERS
index 3aa5fa1..273cb4c 100644
--- a/graphics/mapper/2.1/default/OWNERS
+++ b/graphics/mapper/2.1/default/OWNERS
@@ -1,4 +1,4 @@
# Graphics team
jessehall@google.com
-olv@google.com
+marissaw@google.com
stoza@google.com
diff --git a/graphics/mapper/2.1/utils/OWNERS b/graphics/mapper/2.1/utils/OWNERS
index 3aa5fa1..273cb4c 100644
--- a/graphics/mapper/2.1/utils/OWNERS
+++ b/graphics/mapper/2.1/utils/OWNERS
@@ -1,4 +1,4 @@
# Graphics team
jessehall@google.com
-olv@google.com
+marissaw@google.com
stoza@google.com
diff --git a/graphics/mapper/2.1/vts/OWNERS b/graphics/mapper/2.1/vts/OWNERS
index ef69d7c..8e86f64 100644
--- a/graphics/mapper/2.1/vts/OWNERS
+++ b/graphics/mapper/2.1/vts/OWNERS
@@ -1,6 +1,6 @@
# Graphics team
-olv@google.com
+marissaw@google.com
# VTS team
yim@google.com
-zhuoyao@google.com
\ No newline at end of file
+zhuoyao@google.com
diff --git a/neuralnetworks/1.0/vts/functional/Callbacks.cpp b/neuralnetworks/1.0/vts/functional/Callbacks.cpp
index a1c5a1a..03afcd0 100644
--- a/neuralnetworks/1.0/vts/functional/Callbacks.cpp
+++ b/neuralnetworks/1.0/vts/functional/Callbacks.cpp
@@ -139,8 +139,10 @@
return Void();
}
-Return<void> ExecutionCallback::notify_1_2(ErrorStatus errorStatus) {
+Return<void> ExecutionCallback::notify_1_2(ErrorStatus errorStatus,
+ const hidl_vec<OutputShape>& outputShapes) {
mErrorStatus = errorStatus;
+ mOutputShapes = outputShapes;
CallbackBase::notify();
return Void();
}
@@ -150,6 +152,11 @@
return mErrorStatus;
}
+const std::vector<OutputShape>& ExecutionCallback::getOutputShapes() {
+ wait();
+ return mOutputShapes;
+}
+
} // namespace implementation
} // namespace V1_2
} // namespace neuralnetworks
diff --git a/neuralnetworks/1.0/vts/functional/Callbacks.h b/neuralnetworks/1.0/vts/functional/Callbacks.h
index e89980d..46f29a6 100644
--- a/neuralnetworks/1.0/vts/functional/Callbacks.h
+++ b/neuralnetworks/1.0/vts/functional/Callbacks.h
@@ -275,8 +275,9 @@
* Either IExecutionCallback::notify or IExecutionCallback::notify_1_2 must
* be called exactly once on a given ExecutionCallback object.
*
- * @param status Error status returned from asynchronously preparing the
- * model; will be:
+ * @param status Error status returned from launching the asynchronous task
+ * (if the launch fails) or from the asynchronous task itself
+ * (if the launch succeeds). Must be:
* - NONE if the asynchronous execution was successful
* - DEVICE_UNAVAILABLE if driver is offline or busy
* - GENERAL_FAILURE if there is an unspecified error
@@ -285,27 +286,73 @@
* - INVALID_ARGUMENT if the input request is invalid
*/
Return<void> notify(ErrorStatus status) override;
- Return<void> notify_1_2(ErrorStatus status) override;
+
+ /**
+ * Similar to IExecutionCallback::notify, but for V1_2::IPreparedModel to
+ * also notify output shapes along with error status.
+ *
+ * @param status Error status returned from launching the asynchronous task
+ * (if the launch fails) or from the asynchronous task itself
+ * (if the launch succeeds). Must be:
+ * - NONE if the asynchronous execution was successful
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if the asynchronous task resulted in an
+ * unspecified error
+ * - OUTPUT_INSUFFICIENT_SIZE if at least one output
+ * operand buffer is not large enough to store the
+ * corresponding output
+ * - INVALID_ARGUMENT if one of the input arguments to
+ * prepareModel is invalid
+ * @param outputShapes A list of shape information of model output operands.
+ * The index into "outputShapes" corresponds to the index
+ * of the output operand in the Request outputs vector.
+ * outputShapes must be empty unless the status is either
+ * NONE or OUTPUT_INSUFFICIENT_SIZE.
+ */
+ Return<void> notify_1_2(ErrorStatus status, const hidl_vec<OutputShape>& outputShapes) override;
/**
* Retrieves the error status returned from the asynchronous task launched
- * by IPreparedModel::execute. If IPreparedModel::execute has not finished
+ * by either IPreparedModel::execute or IPreparedModel::execute_1_2. If
+ * IPreparedModel::execute or IPreparedModel::execute_1_2 has not finished
* asynchronously executing, this call will block until the asynchronous task
* notifies the object.
*
- * @return status Error status returned from asynchronously preparing the
- * model; will be:
+ * @return status Error status returned from launching the asynchronous task
+ * (if the launch fails) or from the asynchronous task itself
+ * (if the launch succeeds). Must be:
* - NONE if the asynchronous execution was successful
* - DEVICE_UNAVAILABLE if driver is offline or busy
- * - GENERAL_FAILURE if there is an unspecified error
- * - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
- * not large enough to store the resultant values
- * - INVALID_ARGUMENT if the input request is invalid
+ * - GENERAL_FAILURE if the asynchronous task resulted in an
+ * unspecified error
+ * - OUTPUT_INSUFFICIENT_SIZE if at least one output
+ * operand buffer is not large enough to store the
+ * corresponding output
+ * - INVALID_ARGUMENT if one of the input arguments to
+ * prepareModel is invalid
*/
ErrorStatus getStatus();
- private:
+ /**
+ * Retrieves the output shapes returned from the asynchronous task launched
+ * by IPreparedModel::execute_1_2. If IPreparedModel::execute_1_2 has not finished
+ * asynchronously executing, this call will block until the asynchronous task
+ * notifies the object.
+ *
+ * If the asynchronous task was launched by IPreparedModel::execute, an empty vector
+ * will be returned.
+ *
+ * @return outputShapes A list of shape information of model output operands.
+ * The index into "outputShapes" corresponds to the index
+ * of the output operand in the Request outputs vector.
+ * outputShapes must be empty unless the status is either
+ * NONE or OUTPUT_INSUFFICIENT_SIZE.
+ */
+ const std::vector<OutputShape>& getOutputShapes();
+
+ private:
ErrorStatus mErrorStatus;
+ std::vector<OutputShape> mOutputShapes;
};
diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
index 3b4eb21..b5a8607 100644
--- a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
+++ b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
@@ -89,13 +89,24 @@
sp<ExecutionCallback>& callback) {
return preparedModel->execute_1_2(request, callback);
}
-static Return<ErrorStatus> ExecutePreparedModel(sp<V1_0::IPreparedModel>&, const Request&) {
+static Return<ErrorStatus> ExecutePreparedModel(sp<V1_0::IPreparedModel>&, const Request&,
+ hidl_vec<OutputShape>*) {
ADD_FAILURE() << "asking for synchronous execution at V1_0";
return ErrorStatus::GENERAL_FAILURE;
}
static Return<ErrorStatus> ExecutePreparedModel(sp<V1_2::IPreparedModel>& preparedModel,
- const Request& request) {
- return preparedModel->executeSynchronously(request);
+ const Request& request,
+ hidl_vec<OutputShape>* outputShapes) {
+ ErrorStatus result;
+ Return<void> ret = preparedModel->executeSynchronously(
+ request, [&result, &outputShapes](ErrorStatus error, const hidl_vec<OutputShape>& shapes) {
+ result = error;
+ *outputShapes = shapes;
+ });
+ if (!ret.isOk()) {
+ return ErrorStatus::GENERAL_FAILURE;
+ }
+ return result;
}
enum class Synchronously { NO, YES };
const float kDefaultAtol = 1e-5f;
@@ -197,6 +208,8 @@
inputMemory->commit();
outputMemory->commit();
+ ErrorStatus executionStatus;
+ hidl_vec<OutputShape> outputShapes;
if (sync == Synchronously::NO) {
SCOPED_TRACE("asynchronous");
@@ -211,18 +224,24 @@
// retrieve execution status
executionCallback->wait();
- ErrorStatus executionReturnStatus = executionCallback->getStatus();
- EXPECT_EQ(ErrorStatus::NONE, executionReturnStatus);
+ executionStatus = executionCallback->getStatus();
+ outputShapes = executionCallback->getOutputShapes();
} else {
SCOPED_TRACE("synchronous");
// execute
- Return<ErrorStatus> executionStatus = ExecutePreparedModel(
- preparedModel, {.inputs = inputs_info, .outputs = outputs_info, .pools = pools});
- ASSERT_TRUE(executionStatus.isOk());
- EXPECT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(executionStatus));
+ Return<ErrorStatus> executionReturnStatus = ExecutePreparedModel(
+ preparedModel, {.inputs = inputs_info, .outputs = outputs_info, .pools = pools},
+ &outputShapes);
+ ASSERT_TRUE(executionReturnStatus.isOk());
+ executionStatus = static_cast<ErrorStatus>(executionReturnStatus);
}
+ ASSERT_EQ(ErrorStatus::NONE, executionStatus);
+ // TODO(xusongw): Check if the returned output shapes match with expectation once the
+ // sample driver implementation of dynamic output shape is finished.
+ ASSERT_EQ(outputShapes.size(), 0);
+
// validate results
outputMemory->read();
copy_back(&test, outputs_info, outputPtr);
diff --git a/neuralnetworks/1.2/Android.bp b/neuralnetworks/1.2/Android.bp
index 7d13104..d8762b0 100644
--- a/neuralnetworks/1.2/Android.bp
+++ b/neuralnetworks/1.2/Android.bp
@@ -27,6 +27,7 @@
"Operation",
"OperationType",
"OperationTypeRange",
+ "OutputShape",
],
gen_java: false,
}
diff --git a/neuralnetworks/1.2/IExecutionCallback.hal b/neuralnetworks/1.2/IExecutionCallback.hal
index 667e0d6..47de1b6 100644
--- a/neuralnetworks/1.2/IExecutionCallback.hal
+++ b/neuralnetworks/1.2/IExecutionCallback.hal
@@ -18,6 +18,7 @@
import @1.0::ErrorStatus;
import @1.0::IExecutionCallback;
+import OutputShape;
/**
* IExecutionCallback must be used to return the error status result from an
@@ -39,10 +40,16 @@
* - DEVICE_UNAVAILABLE if driver is offline or busy
* - GENERAL_FAILURE if the asynchronous task resulted in an
* unspecified error
- * - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
- * not large enough to store the resultant values
+ * - OUTPUT_INSUFFICIENT_SIZE if at least one output
+ * operand buffer is not large enough to store the
+ * corresponding output
* - INVALID_ARGUMENT if one of the input arguments to
* prepareModel is invalid
+ * @param outputShapes A list of shape information of model output operands.
+ * The index into "outputShapes" corresponds with to index
+ * of the output operand in the Request outputs vector.
+ * outputShapes must be empty unless the status is either
+ * NONE or OUTPUT_INSUFFICIENT_SIZE.
*/
- oneway notify_1_2(ErrorStatus status);
+ oneway notify_1_2(ErrorStatus status, vec<OutputShape> outputShapes);
};
diff --git a/neuralnetworks/1.2/IPreparedModel.hal b/neuralnetworks/1.2/IPreparedModel.hal
index 4e91c67..044ca28 100644
--- a/neuralnetworks/1.2/IPreparedModel.hal
+++ b/neuralnetworks/1.2/IPreparedModel.hal
@@ -100,11 +100,17 @@
* - NONE if execution is performed successfully
* - DEVICE_UNAVAILABLE if driver is offline or busy
* - GENERAL_FAILURE if there is an unspecified error
- * - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
- * not large enough to store the resultant values
+ * - OUTPUT_INSUFFICIENT_SIZE if at least one output
+ * operand buffer is not large enough to store the
+ * corresponding output
* - INVALID_ARGUMENT if one of the input arguments is
* invalid
+ * @return outputShapes A list of shape information of model output operands.
+ * The index into "outputShapes" corresponds to the index
+ * of the output operand in the Request outputs vector.
+ * outputShapes must be empty unless the status is either
+ * NONE or OUTPUT_INSUFFICIENT_SIZE.
*/
executeSynchronously(Request request)
- generates (ErrorStatus status);
+ generates (ErrorStatus status, vec<OutputShape> outputShapes);
};
diff --git a/neuralnetworks/1.2/types.hal b/neuralnetworks/1.2/types.hal
index 40c07e7..b072793 100644
--- a/neuralnetworks/1.2/types.hal
+++ b/neuralnetworks/1.2/types.hal
@@ -150,7 +150,7 @@
TRANSPOSE_CONV_2D = 84,
UNIDIRECTIONAL_SEQUENCE_LSTM = 85,
UNIDIRECTIONAL_SEQUENCE_RNN = 86,
- ROTATED_BBOX_TRANSFORM = 87,
+ DETECTION_POSTPROCESSING = 87,
ABS = 88,
ROI_POOLING = 89,
EQUAL = 90,
@@ -234,9 +234,6 @@
*
* For a scalar operand, dimensions.size() must be 0.
*
- * For a tensor operand, dimensions.size() must be at least 1;
- * however, any of the dimensions may be unspecified.
- *
* A tensor operand with all dimensions specified has "fully
* specified" dimensions. Whenever possible (i.e., whenever the
* dimensions are known at model construction time), a tensor
@@ -255,17 +252,20 @@
* . The operand has lifetime CONSTANT_COPY or
* CONSTANT_REFERENCE.
*
- * . The operand has lifetime MODEL_INPUT or MODEL_OUTPUT. Fully
+ * . The operand has lifetime MODEL_INPUT. Fully
* specified dimensions must either be present in the
* Operand or they must be provided in the corresponding
* RequestArgument.
- * EXCEPTION: If the input or output is optional and omitted
+ * EXCEPTION: If the input is optional and omitted
* (by setting the hasNoValue field of the corresponding
* RequestArgument to true) then it need not have fully
* specified dimensions.
*
* A tensor operand with some number of unspecified dimensions is
* represented by setting each unspecified dimension to 0.
+ *
+ * A tensor operand with unspecified rank is represented by providing
+ * an empty dimensions vector.
*/
vec<uint32_t> dimensions;
@@ -397,3 +397,18 @@
*/
bool relaxComputationFloat32toFloat16;
};
+
+/**
+ * Describes the shape information of an output operand after execution.
+ */
+struct OutputShape {
+ /**
+ * Dimensions of the operand.
+ */
+ vec<uint32_t> dimensions;
+
+ /**
+ * Whether the provided buffer size is sufficient for the output.
+ */
+ bool isSufficient;
+};
diff --git a/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp b/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp
index d80fbcf..1eaea4b 100644
--- a/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp
+++ b/neuralnetworks/1.2/vts/functional/ValidateRequest.cpp
@@ -110,15 +110,20 @@
executionCallback->wait();
ErrorStatus executionReturnStatus = executionCallback->getStatus();
+ const auto& outputShapes = executionCallback->getOutputShapes();
ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionReturnStatus);
+ ASSERT_EQ(outputShapes.size(), 0);
}
{
SCOPED_TRACE(message + " [executeSynchronously]");
- Return<ErrorStatus> executeStatus = preparedModel->executeSynchronously(request);
+ Return<void> executeStatus = preparedModel->executeSynchronously(
+ request, [](ErrorStatus error, const hidl_vec<OutputShape>& outputShapes) {
+ ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, error);
+ EXPECT_EQ(outputShapes.size(), 0);
+ });
ASSERT_TRUE(executeStatus.isOk());
- ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, static_cast<ErrorStatus>(executeStatus));
}
}
diff --git a/radio/1.4/IRadio.hal b/radio/1.4/IRadio.hal
index 511aa05..ba0dafa 100644
--- a/radio/1.4/IRadio.hal
+++ b/radio/1.4/IRadio.hal
@@ -18,6 +18,7 @@
import @1.0::Dial;
import @1.2::DataRequestReason;
+import @1.2::NetworkScanRequest;
import @1.3::IRadio;
import @1.4::AccessNetwork;
import @1.4::DataProfileInfo;
@@ -102,14 +103,14 @@
oneway setDataProfile_1_4(int32_t serial, vec<DataProfileInfo> profiles);
/**
- * Initiate emergency voice call, with zero or more emergency service category(s) and routing
- * information for handling the call. Android uses this request to make its emergency call
- * instead of using @1.0::IRadio.dial if the 'address' in the 'dialInfo' field is identified
- * as an emergency number by Android.
+ * Initiate emergency voice call, with zero or more emergency service category(s), zero or
+ * more emergency Uniform Resource Names (URN), and routing information for handling the call.
+ * Android uses this request to make its emergency call instead of using @1.0::IRadio.dial
+ * if the 'address' in the 'dialInfo' field is identified as an emergency number by Android.
*
- * In multi-sim senario, this radio request is sent through the IRadio service that serves
- * the subscription the emergency number belongs to, no matter of the PUK/PIN state of the
- * subscription and the service state.
+ * In multi-sim scenario, if the emergency number is from a specific subscription, this radio
+ * request is sent through the IRadio service that serves the subscription, no matter of the
+ * PUK/PIN state of the subscription and the service state of the radio.
*
* Some countries or carriers require some emergency numbers that must be handled with normal
* call routing or emergency routing. If the 'routing' field is specified as
@@ -119,22 +120,40 @@
* @1.4::EmergencyNumberRouting#UNKNOWN, Android does not know how to handle the call.
*
* If the dialed emergency number does not have a specified emergency service category, the
- * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; if the underlying
- * technology used to request emergency services does not support the emergency service
- * category, the categories may be ignored.
+ * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; if the dialed
+ * emergency number does not have specified emergency Uniform Resource Names, the 'urns' field
+ * is set to an empty list. If the underlying technology used to request emergency services
+ * does not support the emergency service category or emergency uniform resource names, the
+ * field 'categories' or 'urns' may be ignored.
*
- * Reference: 3gpp TS 22.101, Section 10 - Emergency Calls
+ * Reference: 3gpp 22.101, Section 10 - Emergency Calls;
+ * 3gpp 23.167, Section 6 - Functional description;
+ * 3gpp 24.503, Section 5.1.6.8.1 - General;
+ * RFC 5031
*
* @param serial Serial number of request.
* @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial.
* @param categories bitfield<@1.4::EmergencyServiceCategory> the Emergency Service Category(s)
* of the call.
+ * @param urns the emergency Uniform Resource Names (URN)
* @param routing @1.4::EmergencyCallRouting the emergency call routing information.
*
* Response function is IRadioResponse.emergencyDialResponse()
*/
oneway emergencyDial(int32_t serial, Dial dialInfo,
- bitfield<EmergencyServiceCategory> categories, EmergencyCallRouting routing);
+ bitfield<EmergencyServiceCategory> categories, vec<string> urns,
+ EmergencyCallRouting routing);
+
+ /**
+ * Starts a network scan
+ *
+ * @param serial Serial number of request.
+ * @param request Defines the radio networks/bands/channels which need to be scanned.
+ *
+ * Same API as @1.2::IRadio.startNetworkScan_1_2, except using the
+ * @1.4::IRadioResponse.startNetworkScanResponse_1_4 as the response.
+ */
+ oneway startNetworkScan_1_4(int32_t serial, NetworkScanRequest request);
/**
* Query the preferred network type bitmap.
diff --git a/radio/1.4/IRadioIndication.hal b/radio/1.4/IRadioIndication.hal
index a58d19c..58b7b70 100644
--- a/radio/1.4/IRadioIndication.hal
+++ b/radio/1.4/IRadioIndication.hal
@@ -27,22 +27,24 @@
* Report the current list of emergency numbers
*
* Each emergency number (@1.4::EmergencyNumber) in the emergency number list contains a
- * dialing number, zero or more service category(s), mobile country code, mobile network code,
- * and source(s) that indicate where it comes from.
+ * dialing number, zero or more service category(s), zero or more emergency uniform resource
+ * names, mobile country code, mobile network code, and source(s) that indicate where it comes
+ * from.
*
* Radio must report all the valid emergency numbers with known mobile country code, mobile
- * network code and emergency service categories from all available sources including network
- * signaling, sim, modem/oem configuration, and default configuration (112 and 911 must be
- * always available; additionally, 000, 08, 110, 999, 118 and 119 must be available when sim
- * is not present). Radio shall not report emergency numbers that are invalid in the current
- * locale. The reported emergency number list must not have duplicate @1.4::EmergencyNumber
- * entries. Please refer the documentation of @1.4::EmergencyNumber to construct each
- * emergency number to report.
+ * network code, emergency service categories, and emergency uniform resource names from all
+ * available sources including network signaling, sim, modem/oem configuration, and default
+ * configuration (112 and 911 must be always available; additionally, 000, 08, 110, 999, 118
+ * and 119 must be available when sim is not present). Radio shall not report emergency numbers
+ * that are invalid in the current locale. The reported emergency number list must not have
+ * duplicate @1.4::EmergencyNumber entries. Please refer the documentation of
+ * @1.4::EmergencyNumber to construct each emergency number to report.
*
* Radio must report the complete list of emergency numbers whenever the emergency numbers in
* the list are changed or whenever the client and the radio server are connected.
*
- * Reference: 3gpp 22.101, Section 10 - Emergency Calls
+ * Reference: 3gpp 22.101, Section 10 - Emergency Calls;
+ * 3gpp 24.008, Section 9.2.13.4 - Emergency Number List
*
* @param type Type of radio indication
* @param emergencyNumberList Current list of emergency numbers known to radio.
diff --git a/radio/1.4/IRadioResponse.hal b/radio/1.4/IRadioResponse.hal
index df40969..a58a5c1 100644
--- a/radio/1.4/IRadioResponse.hal
+++ b/radio/1.4/IRadioResponse.hal
@@ -50,6 +50,23 @@
/**
* @param info Response info struct containing response type, serial no. and error
+ *
+ * Same API as @1.1::IRadioResponse.startNetworkScanResponse, except disallowing error codes
+ * OPERATION_NOT_ALLOWED and REQUEST_NOT_SUPPORTED.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:DEVICE_IN_USE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
+ * RadioError:INVALID_ARGUMENTS
+ */
+ oneway startNetworkScanResponse_1_4(RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error
* @param cellInfo List of current cell information known to radio
*
* Valid errors returned:
diff --git a/radio/1.4/types.hal b/radio/1.4/types.hal
index 74613af..38ee8e5 100644
--- a/radio/1.4/types.hal
+++ b/radio/1.4/types.hal
@@ -52,20 +52,27 @@
};
/**
- * Emergency number contains information of number, one or more service category(s), mobile country
- * code (mcc), mobile network country (mnc) and source(s) that indicate where it comes from.
+ * Emergency number contains information of number, one or more service category(s), zero or more
+ * emergency uniform resource names, mobile country code (mcc), mobile network country (mnc) and
+ * source(s) that indicate where it comes from.
*
- * If the source of the emergency number is associated with country, field ‘mcc’ must be provided;
- * otherwise the field ‘mcc’ must be an empty string.
+ * If the emergency number is associated with country, field ‘mcc’ must be provided, otherwise
+ * field ‘mcc’ must be an empty string. If the emergency number is associated with network
+ * operator, field ‘mcc’ and 'mnc' must be provided, otherwise field ‘mnc’ must be an empty
+ * string. If the emergency number is specified with emergency service category(s), field
+ * 'categories' must be provided, otherwise field 'categories' must be
+ * @1.4::EmergencyServiceCategories::UNSPECIFIED. If the emergency number is specified with
+ * emergency uniform resource names (URN), field 'urns' must be provided, otherwise field 'urns'
+ * must be an empty list.
*
- * If the source of the emergency number is associated with network operator, field ‘mcc’ and
- * 'mnc' must be provided; otherwise the field ‘mnc’ must be an empty string.
+ * A unique EmergencyNumber has a unique combination of ‘number’, ‘mcc’, 'mnc', 'categories' and
+ * 'urns' fields. Multiple @1.4::EmergencyNumberSource should be merged into one 'sources' field
+ * via bitwise-OR combination for the same EmergencyNumber.
*
- * A unique EmergencyNumber has a unique combination of ‘number’, ‘mcc’, 'mnc' and 'categories'
- * fields. Multiple @1.4::EmergencyNumberSource should be merged into the bitfield for the same
- * EmergencyNumber.
- *
- * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
+ * Reference: 3gpp 22.101, Section 10 - Emergency Calls;
+ * 3gpp 23.167, Section 6 - Functional description;
+ * 3gpp 24.503, Section 5.1.6.8.1 - General;
+ * RFC 5031
*/
struct EmergencyNumber{
/**
@@ -87,6 +94,10 @@
*/
bitfield<EmergencyServiceCategory> categories;
/**
+ * The list of emergency Uniform Resource Names (URN).
+ */
+ vec<string> urns;
+ /**
* The bitfield of @1.4::EmergencyNumberSource(s). See @1.4::EmergencyNumberSource for the
* value of each bit.
*/
diff --git a/sensors/2.0/ISensors.hal b/sensors/2.0/ISensors.hal
index 1685a0a..3a9af46 100644
--- a/sensors/2.0/ISensors.hal
+++ b/sensors/2.0/ISensors.hal
@@ -95,11 +95,15 @@
* The Wake Lock FMQ is used by the framework to notify the HAL when it is
* safe to release its wake_lock. When the framework receives WAKE_UP events
* from the Event FMQ and the framework has acquired a wake_lock, the
- * framework must write a WakeLockEvent to the Wake Lock FMQ with the number
- * of WAKE_UP events processed. When the HAL reads the WakeLockEvent from
- * the Wake Lock FMQ, the HAL should decrement its current count of
- * unprocessed WAKE_UP events and release its wake_lock if the current
- * count of unprocessed WAKE_UP events is zero.
+ * framework must write the number of WAKE_UP events processed to the Wake
+ * Lock FMQ. When the HAL reads the data from the Wake Lock FMQ, the HAL
+ * decrements its current count of unprocessed WAKE_UP events and releases
+ * its wake_lock if the current count of unprocessed WAKE_UP events is
+ * zero.
+ *
+ * The framework must use the WakeLockQueueFlagBits::DATA_WRITTEN value to
+ * notify the HAL that data has been written to the Wake Lock FMQ and must
+ * be read by HAL.
*
* The ISensorsCallback is used by the HAL to notify the framework of
* asynchronous events, such as a dynamic sensor connection.
diff --git a/sensors/2.0/default/Sensors.cpp b/sensors/2.0/default/Sensors.cpp
index efc8b05..99c80df 100644
--- a/sensors/2.0/default/Sensors.cpp
+++ b/sensors/2.0/default/Sensors.cpp
@@ -31,6 +31,7 @@
using ::android::hardware::sensors::V1_0::Result;
using ::android::hardware::sensors::V1_0::SharedMemInfo;
using ::android::hardware::sensors::V2_0::SensorTimeout;
+using ::android::hardware::sensors::V2_0::WakeLockQueueFlagBits;
constexpr const char* kWakeLockName = "SensorsHAL_WAKEUP";
@@ -215,7 +216,9 @@
// Read events from the Wake Lock FMQ. Timeout after a reasonable amount of time to ensure
// that any held wake lock is able to be released if it is held for too long.
- mWakeLockQueue->readBlocking(&eventsHandled, 1 /* count */, kReadTimeoutNs);
+ mWakeLockQueue->readBlocking(&eventsHandled, 1 /* count */, 0 /* readNotification */,
+ static_cast<uint32_t>(WakeLockQueueFlagBits::DATA_WRITTEN),
+ kReadTimeoutNs);
updateWakeLock(0 /* eventsWritten */, eventsHandled);
}
}
diff --git a/sensors/2.0/types.hal b/sensors/2.0/types.hal
index f9defa2..4457544 100644
--- a/sensors/2.0/types.hal
+++ b/sensors/2.0/types.hal
@@ -40,3 +40,11 @@
*/
EVENTS_READ = 1 << 1,
};
+
+enum WakeLockQueueFlagBits : uint32_t {
+ /**
+ * Used to notify the HAL that the framework has written data to the Wake
+ * Lock FMQ.
+ */
+ DATA_WRITTEN = 1 << 0,
+};
diff --git a/tv/cec/1.0/types.hal b/tv/cec/1.0/types.hal
index c734c4d..ebe65ae 100644
--- a/tv/cec/1.0/types.hal
+++ b/tv/cec/1.0/types.hal
@@ -114,6 +114,8 @@
VENDOR_COMMAND_WITH_ID = 0xA0,
CLEAR_EXTERNAL_TIMER = 0xA1,
SET_EXTERNAL_TIMER = 0xA2,
+ REPORT_SHORT_AUDIO_DESCRIPTOR = 0xA3,
+ REQUEST_SHORT_AUDIO_DESCRIPTOR = 0xA4,
INITIATE_ARC = 0xC0,
REPORT_ARC_INITIATED = 0xC1,
REPORT_ARC_TERMINATED = 0xC2,
diff --git a/wifi/supplicant/1.2/vts/OWNERS b/wifi/supplicant/1.2/vts/OWNERS
new file mode 100644
index 0000000..8bfb148
--- /dev/null
+++ b/wifi/supplicant/1.2/vts/OWNERS
@@ -0,0 +1,2 @@
+rpius@google.com
+etancohen@google.com
diff --git a/wifi/supplicant/1.2/vts/functional/Android.bp b/wifi/supplicant/1.2/vts/functional/Android.bp
new file mode 100644
index 0000000..9bd998c
--- /dev/null
+++ b/wifi/supplicant/1.2/vts/functional/Android.bp
@@ -0,0 +1,60 @@
+//
+// Copyright (C) 2019 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.
+//
+
+cc_library_static {
+ name: "VtsHalWifiSupplicantV1_2TargetTestUtil",
+ defaults: ["VtsHalTargetTestDefaults"],
+ srcs: ["supplicant_hidl_test_utils_1_2.cpp"],
+ export_include_dirs: [
+ "."
+ ],
+ static_libs: [
+ "VtsHalWifiV1_0TargetTestUtil",
+ "VtsHalWifiSupplicantV1_0TargetTestUtil",
+ "VtsHalWifiSupplicantV1_1TargetTestUtil",
+ "android.hardware.wifi.supplicant@1.0",
+ "android.hardware.wifi.supplicant@1.1",
+ "android.hardware.wifi.supplicant@1.2",
+ "android.hardware.wifi@1.0",
+ "libcrypto",
+ "libgmock",
+ "libwifi-system",
+ "libwifi-system-iface",
+ ],
+}
+
+cc_test {
+ name: "VtsHalWifiSupplicantP2pV1_2TargetTest",
+ defaults: ["VtsHalTargetTestDefaults"],
+ srcs: [
+ "VtsHalWifiSupplicantV1_2TargetTest.cpp",
+ "supplicant_p2p_iface_hidl_test.cpp",
+ ],
+ static_libs: [
+ "VtsHalWifiV1_0TargetTestUtil",
+ "VtsHalWifiSupplicantV1_0TargetTestUtil",
+ "VtsHalWifiSupplicantV1_1TargetTestUtil",
+ "VtsHalWifiSupplicantV1_2TargetTestUtil",
+ "android.hardware.wifi.supplicant@1.0",
+ "android.hardware.wifi.supplicant@1.1",
+ "android.hardware.wifi.supplicant@1.2",
+ "android.hardware.wifi@1.0",
+ "libcrypto",
+ "libgmock",
+ "libwifi-system",
+ "libwifi-system-iface",
+ ],
+}
diff --git a/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp b/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp
new file mode 100644
index 0000000..9d0e960
--- /dev/null
+++ b/wifi/supplicant/1.2/vts/functional/VtsHalWifiSupplicantV1_2TargetTest.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <android/hardware/wifi/supplicant/1.1/ISupplicant.h>
+#include <android/hardware/wifi/supplicant/1.2/ISupplicant.h>
+
+#include "supplicant_hidl_test_utils.h"
+#include "wifi_hidl_test_utils.h"
+
+class WifiSupplicantHidlEnvironment_1_2 : public WifiSupplicantHidlEnvironment {
+ public:
+ // get the test environment singleton
+ static WifiSupplicantHidlEnvironment_1_2* Instance() {
+ static WifiSupplicantHidlEnvironment_1_2* instance =
+ new WifiSupplicantHidlEnvironment_1_2;
+ return instance;
+ }
+ virtual void registerTestServices() override {
+ registerTestService<::android::hardware::wifi::V1_0::IWifi>();
+ registerTestService<
+ ::android::hardware::wifi::supplicant::V1_0::ISupplicant>();
+ registerTestService<
+ ::android::hardware::wifi::supplicant::V1_1::ISupplicant>();
+ registerTestService<
+ ::android::hardware::wifi::supplicant::V1_2::ISupplicant>();
+ }
+
+ private:
+ WifiSupplicantHidlEnvironment_1_2() {}
+};
+
+WifiSupplicantHidlEnvironment* gEnv =
+ WifiSupplicantHidlEnvironment_1_2::Instance();
+
+int main(int argc, char** argv) {
+ ::testing::AddGlobalTestEnvironment(gEnv);
+ ::testing::InitGoogleTest(&argc, argv);
+ gEnv->init(&argc, argv);
+ int status = gEnv->initFromOptions(argc, argv);
+ if (status == 0) {
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ }
+ return status;
+}
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.cpp
new file mode 100644
index 0000000..5b5d4e9
--- /dev/null
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.cpp
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#include <VtsHalHidlTargetTestBase.h>
+#include <android-base/logging.h>
+
+#include "supplicant_hidl_test_utils.h"
+#include "supplicant_hidl_test_utils_1_2.h"
+
+using ::android::sp;
+using ::android::hardware::wifi::supplicant::V1_2::ISupplicantP2pIface;
+
+sp<ISupplicantP2pIface> getSupplicantP2pIface_1_2() {
+ return ISupplicantP2pIface::castFrom(getSupplicantP2pIface());
+}
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
new file mode 100644
index 0000000..48be08d
--- /dev/null
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#ifndef SUPPLICANT_HIDL_TEST_UTILS_1_2_H
+#define SUPPLICANT_HIDL_TEST_UTILS_1_2_H
+
+#include <android/hardware/wifi/supplicant/1.2/ISupplicantP2pIface.h>
+
+android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicantP2pIface>
+getSupplicantP2pIface_1_2();
+
+#endif /* SUPPLICANT_HIDL_TEST_UTILS_1_2_H */
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
new file mode 100644
index 0000000..46b4087
--- /dev/null
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+#include <android/hardware/wifi/supplicant/1.2/ISupplicantP2pIface.h>
+
+#include "supplicant_hidl_test_utils.h"
+#include "supplicant_hidl_test_utils_1_2.h"
+
+using ::android::sp;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hardware::wifi::supplicant::V1_2::ISupplicantP2pIface;
+
+namespace {
+constexpr uint8_t kTestSsid[] = {'D', 'I', 'R', 'E', 'C', 'T', '-', 'x',
+ 'y', '-', 'H', 'E', 'L', 'L', 'O'};
+constexpr char kTestPassphrase[] = "P2pWorld1234";
+constexpr uint8_t kTestZeroMacAddr[] = {[0 ... 5] = 0x0};
+} // namespace
+
+class SupplicantP2pIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_TRUE(turnOnExcessiveLogging());
+ p2p_iface_ = getSupplicantP2pIface_1_2();
+ ASSERT_NE(p2p_iface_.get(), nullptr);
+ }
+
+ virtual void TearDown() override { stopSupplicant(); }
+
+ protected:
+ // ISupplicantP2pIface object used for all tests in this fixture.
+ sp<ISupplicantP2pIface> p2p_iface_;
+};
+
+/*
+ * Verify that AddGroup_1_2 could create a group successfully.
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_Success) {
+ std::vector<uint8_t> ssid(kTestSsid, kTestSsid + sizeof(kTestSsid));
+ std::string passphrase = kTestPassphrase;
+ int freq = 5;
+ std::array<uint8_t, 6> zero_mac_addr;
+ memcpy(zero_mac_addr.data(), kTestZeroMacAddr, zero_mac_addr.size());
+ bool persistent = false;
+ int is_join = false;
+
+ p2p_iface_->addGroup_1_2(ssid, passphrase, persistent, freq, zero_mac_addr,
+ is_join, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+}
+
+/*
+ * Verify that AddGroup_1_2 fails due to invalid SSID.
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidSsid) {
+ std::vector<uint8_t> ssid;
+ std::string passphrase = kTestPassphrase;
+ int freq = 5;
+ std::array<uint8_t, 6> zero_mac_addr;
+ memcpy(zero_mac_addr.data(), kTestZeroMacAddr, zero_mac_addr.size());
+ bool persistent = false;
+ int is_join = false;
+
+ p2p_iface_->addGroup_1_2(
+ ssid, passphrase, persistent, freq, zero_mac_addr, is_join,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_ARGS_INVALID, status.code);
+ });
+}
+
+/*
+ * Verify that AddGroup_1_2 fails due to invalid passphrase.
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidPassphrase) {
+ std::vector<uint8_t> ssid(kTestSsid, kTestSsid + sizeof(kTestSsid));
+ std::string passphrase = "1234";
+ int freq = 5;
+ std::array<uint8_t, 6> zero_mac_addr;
+ memcpy(zero_mac_addr.data(), kTestZeroMacAddr, zero_mac_addr.size());
+ bool persistent = false;
+ int is_join = false;
+
+ p2p_iface_->addGroup_1_2(
+ ssid, passphrase, persistent, freq, zero_mac_addr, is_join,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_ARGS_INVALID, status.code);
+ });
+}
+
+/*
+ * Verify that AddGroup_1_2 fails due to invalid frequency.
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidFrequency) {
+ std::vector<uint8_t> ssid(kTestSsid, kTestSsid + sizeof(kTestSsid));
+ std::string passphrase = kTestPassphrase;
+ int freq = 9999;
+ std::array<uint8_t, 6> zero_mac_addr;
+ memcpy(zero_mac_addr.data(), kTestZeroMacAddr, zero_mac_addr.size());
+ bool persistent = false;
+ int is_join = false;
+
+ p2p_iface_->addGroup_1_2(
+ ssid, passphrase, persistent, freq, zero_mac_addr, is_join,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}