diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index e6f480856b..5c5917b5b8 100644 --- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -46,5 +46,5 @@ interface IRemoteAccess { void unscheduleTask(String clientId, String scheduleId); void unscheduleAllTasks(String clientId); boolean isTaskScheduled(String clientId, String scheduleId); - List getAllScheduledTasks(String clientId); + List getAllPendingScheduledTasks(String clientId); } diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index 9863ed728d..705cdbdd08 100644 --- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -201,5 +201,5 @@ interface IRemoteAccess { * *

The finished scheduled tasks will not be included. */ - List getAllScheduledTasks(String clientId); + List getAllPendingScheduledTasks(String clientId); } diff --git a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp index 9224ebcf09..7707ee6de3 100644 --- a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp +++ b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp @@ -75,8 +75,9 @@ class MockGrpcClientStub : public WakeupClient::StubInterface { return Status::OK; } - Status GetAllScheduledTasks(ClientContext* context, const GetAllScheduledTasksRequest& request, - GetAllScheduledTasksResponse* response) { + Status GetAllPendingScheduledTasks(ClientContext* context, + const GetAllPendingScheduledTasksRequest& request, + GetAllPendingScheduledTasksResponse* response) { return Status::OK; } @@ -165,17 +166,19 @@ class MockGrpcClientStub : public WakeupClient::StubInterface { return nullptr; } - ClientAsyncResponseReaderInterface* AsyncGetAllScheduledTasksRaw( + ClientAsyncResponseReaderInterface* + AsyncGetAllPendingScheduledTasksRaw( [[maybe_unused]] ClientContext* context, - [[maybe_unused]] const GetAllScheduledTasksRequest& request, + [[maybe_unused]] const GetAllPendingScheduledTasksRequest& request, [[maybe_unused]] CompletionQueue* cq) { return nullptr; } - ClientAsyncResponseReaderInterface* - PrepareAsyncGetAllScheduledTasksRaw([[maybe_unused]] ClientContext* context, - [[maybe_unused]] const GetAllScheduledTasksRequest& request, - [[maybe_unused]] CompletionQueue* c) { + ClientAsyncResponseReaderInterface* + PrepareAsyncGetAllPendingScheduledTasksRaw( + [[maybe_unused]] ClientContext* context, + [[maybe_unused]] const GetAllPendingScheduledTasksRequest& request, + [[maybe_unused]] CompletionQueue* c) { return nullptr; } }; diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h index 23b4ebe505..6266de8419 100644 --- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h +++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h @@ -96,7 +96,7 @@ class RemoteAccessService ndk::ScopedAStatus isTaskScheduled(const std::string& clientId, const std::string& scheduleId, bool* out) override; - ndk::ScopedAStatus getAllScheduledTasks( + ndk::ScopedAStatus getAllPendingScheduledTasks( const std::string& clientId, std::vector* out) override; diff --git a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto index e061016daf..14ba0a5e74 100644 --- a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto +++ b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto @@ -99,7 +99,8 @@ service WakeupClient { * *

The finished scheduled tasks will not be included. */ - rpc GetAllScheduledTasks(GetAllScheduledTasksRequest) returns (GetAllScheduledTasksResponse) {} + rpc GetAllPendingScheduledTasks(GetAllPendingScheduledTasksRequest) + returns (GetAllPendingScheduledTasksResponse) {} } message GetRemoteTasksRequest {} @@ -154,10 +155,10 @@ message IsTaskScheduledResponse { bool isTaskScheduled = 1; } -message GetAllScheduledTasksRequest { +message GetAllPendingScheduledTasksRequest { string clientId = 1; } -message GetAllScheduledTasksResponse { +message GetAllPendingScheduledTasksResponse { repeated GrpcScheduleInfo allScheduledTasks = 1; } diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp index 55211345b9..2a7f2091e4 100644 --- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp +++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp @@ -399,13 +399,13 @@ ScopedAStatus RemoteAccessService::isTaskScheduled(const std::string& clientId, return ScopedAStatus::ok(); } -ScopedAStatus RemoteAccessService::getAllScheduledTasks(const std::string& clientId, - std::vector* out) { +ScopedAStatus RemoteAccessService::getAllPendingScheduledTasks(const std::string& clientId, + std::vector* out) { ClientContext context; - GetAllScheduledTasksRequest request = {}; - GetAllScheduledTasksResponse response = {}; + GetAllPendingScheduledTasksRequest request = {}; + GetAllPendingScheduledTasksResponse response = {}; request.set_clientid(clientId); - Status status = mGrpcStub->GetAllScheduledTasks(&context, request, &response); + Status status = mGrpcStub->GetAllPendingScheduledTasks(&context, request, &response); if (!status.ok()) { return rpcStatusToScopedAStatus(status, "Failed to call isTaskScheduled"); } diff --git a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp index 4af0003920..a46a983a9c 100644 --- a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp +++ b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp @@ -95,9 +95,9 @@ class MockGrpcClientStub : public WakeupClient::StubInterface { MOCK_METHOD(Status, IsTaskScheduled, (ClientContext * context, const IsTaskScheduledRequest& request, IsTaskScheduledResponse* response)); - MOCK_METHOD(Status, GetAllScheduledTasks, - (ClientContext * context, const GetAllScheduledTasksRequest& request, - GetAllScheduledTasksResponse* response)); + MOCK_METHOD(Status, GetAllPendingScheduledTasks, + (ClientContext * context, const GetAllPendingScheduledTasksRequest& request, + GetAllPendingScheduledTasksResponse* response)); // Async methods which we do not care. MOCK_METHOD(ClientAsyncReaderInterface*, AsyncGetRemoteTasksRaw, (ClientContext * context, const GetRemoteTasksRequest& request, CompletionQueue* cq, @@ -141,13 +141,13 @@ class MockGrpcClientStub : public WakeupClient::StubInterface { PrepareAsyncIsTaskScheduledRaw, (ClientContext * context, const IsTaskScheduledRequest& request, CompletionQueue* cq)); - MOCK_METHOD(ClientAsyncResponseReaderInterface*, - AsyncGetAllScheduledTasksRaw, - (ClientContext * context, const GetAllScheduledTasksRequest& request, + MOCK_METHOD(ClientAsyncResponseReaderInterface*, + AsyncGetAllPendingScheduledTasksRaw, + (ClientContext * context, const GetAllPendingScheduledTasksRequest& request, CompletionQueue* cq)); - MOCK_METHOD(ClientAsyncResponseReaderInterface*, - PrepareAsyncGetAllScheduledTasksRaw, - (ClientContext * context, const GetAllScheduledTasksRequest& request, + MOCK_METHOD(ClientAsyncResponseReaderInterface*, + PrepareAsyncGetAllPendingScheduledTasksRaw, + (ClientContext * context, const GetAllPendingScheduledTasksRequest& request, CompletionQueue* cq)); }; @@ -573,13 +573,13 @@ TEST_F(RemoteAccessServiceUnitTest, TestIsTaskScheduled) { EXPECT_EQ(grpcRequest.scheduleid(), kTestScheduleId); } -TEST_F(RemoteAccessServiceUnitTest, testGetAllScheduledTasks) { +TEST_F(RemoteAccessServiceUnitTest, testGetAllPendingScheduledTasks) { std::vector result; - GetAllScheduledTasksRequest grpcRequest = {}; - EXPECT_CALL(*getGrpcWakeupClientStub(), GetAllScheduledTasks) + GetAllPendingScheduledTasksRequest grpcRequest = {}; + EXPECT_CALL(*getGrpcWakeupClientStub(), GetAllPendingScheduledTasks) .WillOnce([&grpcRequest]([[maybe_unused]] ClientContext* context, - const GetAllScheduledTasksRequest& request, - GetAllScheduledTasksResponse* response) { + const GetAllPendingScheduledTasksRequest& request, + GetAllPendingScheduledTasksResponse* response) { grpcRequest = request; GrpcScheduleInfo* newInfo = response->add_allscheduledtasks(); newInfo->set_clientid(kTestClientId); @@ -591,7 +591,7 @@ TEST_F(RemoteAccessServiceUnitTest, testGetAllScheduledTasks) { return Status(); }); - ScopedAStatus status = getService()->getAllScheduledTasks(kTestClientId, &result); + ScopedAStatus status = getService()->getAllPendingScheduledTasks(kTestClientId, &result); ASSERT_TRUE(status.isOk()); EXPECT_EQ(grpcRequest.clientid(), kTestClientId); diff --git a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h index 2aab904429..a7f47c2c57 100644 --- a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h +++ b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h @@ -138,9 +138,9 @@ class TestWakeupClientServiceImpl : public WakeupClient::Service { const IsTaskScheduledRequest* request, IsTaskScheduledResponse* response) override; - grpc::Status GetAllScheduledTasks(grpc::ServerContext* context, - const GetAllScheduledTasksRequest* request, - GetAllScheduledTasksResponse* response) override; + grpc::Status GetAllPendingScheduledTasks( + grpc::ServerContext* context, const GetAllPendingScheduledTasksRequest* request, + GetAllPendingScheduledTasksResponse* response) override; /** * Starts generating fake tasks for the specific client repeatedly. diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp index 1db991c8b0..d22335377a 100644 --- a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp +++ b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp @@ -469,11 +469,11 @@ Status TestWakeupClientServiceImpl::IsTaskScheduled(ServerContext* context, return Status::OK; } -Status TestWakeupClientServiceImpl::GetAllScheduledTasks(ServerContext* context, - const GetAllScheduledTasksRequest* request, - GetAllScheduledTasksResponse* response) { +Status TestWakeupClientServiceImpl::GetAllPendingScheduledTasks( + ServerContext* context, const GetAllPendingScheduledTasksRequest* request, + GetAllPendingScheduledTasksResponse* response) { const std::string& clientId = request->clientid(); - printf("GetAllScheduledTasks called with client Id: %s\n", clientId.c_str()); + printf("GetAllPendingScheduledTasks called with client Id: %s\n", clientId.c_str()); response->clear_allscheduledtasks(); { std::unique_lock lk(mLock); diff --git a/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp b/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp index 960020d995..63458aee6d 100644 --- a/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp +++ b/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp @@ -280,7 +280,7 @@ TEST_F(TestWakeupClientServiceImplUnitTest, TestUnscheduleAllTasks) { EXPECT_EQ(getRemoteTaskResponses().size(), 0); } -TEST_F(TestWakeupClientServiceImplUnitTest, TestGetAllScheduledTasks) { +TEST_F(TestWakeupClientServiceImplUnitTest, TestGetAllPendingScheduledTasks) { std::string scheduleId1 = "scheduleId1"; std::string scheduleId2 = "scheduleId2"; int64_t time1 = getNow(); @@ -296,19 +296,19 @@ TEST_F(TestWakeupClientServiceImplUnitTest, TestGetAllScheduledTasks) { ASSERT_TRUE(status.ok()); ClientContext context; - GetAllScheduledTasksRequest request; - GetAllScheduledTasksResponse response; + GetAllPendingScheduledTasksRequest request; + GetAllPendingScheduledTasksResponse response; request.set_clientid("invalid client Id"); - status = getStub()->GetAllScheduledTasks(&context, request, &response); + status = getStub()->GetAllPendingScheduledTasks(&context, request, &response); ASSERT_TRUE(status.ok()); EXPECT_EQ(response.allscheduledtasks_size(), 0); ClientContext context2; - GetAllScheduledTasksRequest request2; - GetAllScheduledTasksResponse response2; + GetAllPendingScheduledTasksRequest request2; + GetAllPendingScheduledTasksResponse response2; request2.set_clientid(kTestClientId); - status = getStub()->GetAllScheduledTasks(&context2, request2, &response2); + status = getStub()->GetAllPendingScheduledTasks(&context2, request2, &response2); ASSERT_TRUE(status.ok()); ASSERT_EQ(response2.allscheduledtasks_size(), 2);