Loading contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -40,5 +40,6 @@ interface IContextHubCallback { void handleTransactionResult(in int transactionId, in boolean success); void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request); byte[16] getUuid(); String getName(); const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; } contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl +9 −1 Original line number Diff line number Diff line Loading @@ -92,12 +92,20 @@ interface IContextHubCallback { /** * This callback is passed to the HAL implementation to allow the HAL to request a UUID that * uniquely identifies an IContextHubCallback. * uniquely identifies a client. * * @return a byte array representating the UUID */ byte[16] getUuid(); /** * This callback gets the name of a client implementing this IContextHubCallback interface, * which must be a hard-coded string and does not change at runtime. * * <p>The name provides a human-readable way to identify a client for troubleshooting purpose. */ String getName(); /** * Amount of time, in milliseconds, that a handleNanSessionRequest can be pending before the * Contexthub service must respond. Loading contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -49,8 +49,9 @@ using ::android::hardware::contexthub::vts_utils::kNonExistentAppId; using ::android::hardware::contexthub::vts_utils::waitForCallback; // 6612b522-b717-41c8-b48d-c0b1cc64e142 const std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8, constexpr std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8, 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42}; const String16 kName{"VtsAidlHalContextHubTargetTest"}; class ContextHubAidl : public testing::TestWithParam<std::tuple<std::string, int32_t>> { public: Loading Loading @@ -135,6 +136,11 @@ class EmptyContextHubCallback : public android::hardware::contexthub::BnContextH *out_uuid = kUuid; return Status::ok(); } Status getName(::android::String16* out_name) override { *out_name = kName; return Status::ok(); } }; TEST_P(ContextHubAidl, TestRegisterCallback) { Loading Loading @@ -171,6 +177,11 @@ class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCall return Status::ok(); } Status getName(::android::String16* out_name) override { *out_name = kName; return Status::ok(); } std::promise<std::vector<NanoappInfo>> promise; }; Loading Loading @@ -242,6 +253,11 @@ class TransactionResultCallback : public android::hardware::contexthub::BnContex return Status::ok(); } Status getName(::android::String16* out_name) override { *out_name = kName; return Status::ok(); } uint32_t expectedTransactionId = 0; std::promise<bool> promise; }; Loading Loading
contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -40,5 +40,6 @@ interface IContextHubCallback { void handleTransactionResult(in int transactionId, in boolean success); void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request); byte[16] getUuid(); String getName(); const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; }
contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl +9 −1 Original line number Diff line number Diff line Loading @@ -92,12 +92,20 @@ interface IContextHubCallback { /** * This callback is passed to the HAL implementation to allow the HAL to request a UUID that * uniquely identifies an IContextHubCallback. * uniquely identifies a client. * * @return a byte array representating the UUID */ byte[16] getUuid(); /** * This callback gets the name of a client implementing this IContextHubCallback interface, * which must be a hard-coded string and does not change at runtime. * * <p>The name provides a human-readable way to identify a client for troubleshooting purpose. */ String getName(); /** * Amount of time, in milliseconds, that a handleNanSessionRequest can be pending before the * Contexthub service must respond. Loading
contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -49,8 +49,9 @@ using ::android::hardware::contexthub::vts_utils::kNonExistentAppId; using ::android::hardware::contexthub::vts_utils::waitForCallback; // 6612b522-b717-41c8-b48d-c0b1cc64e142 const std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8, constexpr std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8, 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42}; const String16 kName{"VtsAidlHalContextHubTargetTest"}; class ContextHubAidl : public testing::TestWithParam<std::tuple<std::string, int32_t>> { public: Loading Loading @@ -135,6 +136,11 @@ class EmptyContextHubCallback : public android::hardware::contexthub::BnContextH *out_uuid = kUuid; return Status::ok(); } Status getName(::android::String16* out_name) override { *out_name = kName; return Status::ok(); } }; TEST_P(ContextHubAidl, TestRegisterCallback) { Loading Loading @@ -171,6 +177,11 @@ class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCall return Status::ok(); } Status getName(::android::String16* out_name) override { *out_name = kName; return Status::ok(); } std::promise<std::vector<NanoappInfo>> promise; }; Loading Loading @@ -242,6 +253,11 @@ class TransactionResultCallback : public android::hardware::contexthub::BnContex return Status::ok(); } Status getName(::android::String16* out_name) override { *out_name = kName; return Status::ok(); } uint32_t expectedTransactionId = 0; std::promise<bool> promise; }; Loading