diff options
author | Arthur Ishiguro <arthuri@google.com> | 2020-05-11 16:51:19 -0700 |
---|---|---|
committer | Arthur Ishiguro <arthuri@google.com> | 2020-05-13 08:51:26 -0700 |
commit | d48a3262494ead1ec1e5d3aef91b7db392eb22a9 (patch) | |
tree | b8d0e6223a2b2f5427ca9e624d02213a8f107930 /apps | |
parent | 65b5b59408c9bacf3b5583850cf53913c8206d06 (diff) | |
download | chre-d48a3262494ead1ec1e5d3aef91b7db392eb22a9.tar.gz |
Adds .proto for CHRE audio concurrency test
Bug: 156296364
Test: None
Change-Id: I23e94f6a1e612a27838011ffa22c3ac5d277e7e8
Diffstat (limited to 'apps')
-rw-r--r-- | apps/test/common/proto/Android.bp | 28 | ||||
-rw-r--r-- | apps/test/common/proto/chre_audio_concurrency_test.proto | 42 | ||||
-rw-r--r-- | apps/test/common/proto/chre_test_common.proto | 17 |
3 files changed, 87 insertions, 0 deletions
diff --git a/apps/test/common/proto/Android.bp b/apps/test/common/proto/Android.bp index 779a4680..f7de8eaf 100644 --- a/apps/test/common/proto/Android.bp +++ b/apps/test/common/proto/Android.bp @@ -37,3 +37,31 @@ java_library { }, sdk_version: "system_current", } + +java_library { + name: "chre_audio_concurrency_test_java_proto", + host_supported: true, + srcs: [ + "./chre_audio_concurrency_test.proto", + ], + proto: { + type: "lite", + // Include protos in this directory + local_include_dirs: [ + ".", + ], + }, + sdk_version: "system_current", +} + +java_library { + name: "chre_test_common_java_proto", + host_supported: true, + srcs: [ + "./chre_test_common.proto", + ], + proto: { + type: "lite", + }, + sdk_version: "system_current", +} diff --git a/apps/test/common/proto/chre_audio_concurrency_test.proto b/apps/test/common/proto/chre_audio_concurrency_test.proto new file mode 100644 index 00000000..f0517cad --- /dev/null +++ b/apps/test/common/proto/chre_audio_concurrency_test.proto @@ -0,0 +1,42 @@ +syntax = "proto2"; + +package chre_audio_concurrency_test; + +option java_package = "com.google.android.chre.nanoapp.proto"; +option java_outer_classname = "ChreAudioConcurrencyTest"; + +import "chre_test_common.proto"; + +// Nanoappp message type can be either host to chre (H2C) or chre to host (C2H) +enum MessageType { + // Reserved for corrupted messages + UNDEFINED = 0; + + // H2C: A message to start a test step. + // Payload must be TestCommand. + TEST_COMMAND = 1; + + // C2H: A message indicating the test result. + // Payload must be chre_test_common.TestResult. + TEST_RESULT = 2; + + // C2H: A message indicating that CHRE audio has been enabled and + // data has been received, after a previously received ENABLE_AUDIO + // step from a TEST_COMMAND message. No payload. + TEST_AUDIO_ENABLED = 3; +} + +// A message to start a test step. +message TestCommand { + enum Step { + UNDEFINED = 0; + // Sets up the test by enabling CHRE audio and verifying data reception. + ENABLE_AUDIO = 1; + // The host will send this step when the AP has held and released access + // to the mic. The nanoapp should verify that audio data reception resumes. + VERIFY_AUDIO_RESUME = 2; + } + + // The test step. + optional Step step = 1; +} diff --git a/apps/test/common/proto/chre_test_common.proto b/apps/test/common/proto/chre_test_common.proto new file mode 100644 index 00000000..8a32a88b --- /dev/null +++ b/apps/test/common/proto/chre_test_common.proto @@ -0,0 +1,17 @@ +syntax = "proto2"; + +package chre_test_common; + +option java_package = "com.google.android.chre.nanoapp.proto"; +option java_outer_classname = "ChreTestCommon"; + +// A message used to provide the test result. +message TestResult { + enum Code { + PASSED = 0; + FAILED = 1; + } + + optional Code code = 1 [default = FAILED]; + optional bytes errorMessage = 2; +} |