Rename to getAllPendingScheduledTasks.

Rename getAllScheduledTasks to getAllPendingScheduledTasks.

Test: Presubmit
Bug: 305285376
Change-Id: I0a908d3c4cc77ff718883e17468a2ff75df470d3
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 e6f4808..5c5917b 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 @@
   void unscheduleTask(String clientId, String scheduleId);
   void unscheduleAllTasks(String clientId);
   boolean isTaskScheduled(String clientId, String scheduleId);
-  List<android.hardware.automotive.remoteaccess.ScheduleInfo> getAllScheduledTasks(String clientId);
+  List<android.hardware.automotive.remoteaccess.ScheduleInfo> getAllPendingScheduledTasks(String clientId);
 }
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index 9863ed7..705cdbd 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -201,5 +201,5 @@
      *
      * <p>The finished scheduled tasks will not be included.
      */
-    List<ScheduleInfo> getAllScheduledTasks(String clientId);
+    List<ScheduleInfo> getAllPendingScheduledTasks(String clientId);
 }
diff --git a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
index 9224ebc..7707ee6 100644
--- a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
+++ b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
@@ -75,8 +75,9 @@
         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 @@
         return nullptr;
     }
 
-    ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>* AsyncGetAllScheduledTasksRaw(
+    ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*
+    AsyncGetAllPendingScheduledTasksRaw(
             [[maybe_unused]] ClientContext* context,
-            [[maybe_unused]] const GetAllScheduledTasksRequest& request,
+            [[maybe_unused]] const GetAllPendingScheduledTasksRequest& request,
             [[maybe_unused]] CompletionQueue* cq) {
         return nullptr;
     }
 
-    ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*
-    PrepareAsyncGetAllScheduledTasksRaw([[maybe_unused]] ClientContext* context,
-                                        [[maybe_unused]] const GetAllScheduledTasksRequest& request,
-                                        [[maybe_unused]] CompletionQueue* c) {
+    ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*
+    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 23b4ebe..6266de8 100644
--- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
+++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
@@ -96,7 +96,7 @@
     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<aidl::android::hardware::automotive::remoteaccess::ScheduleInfo>* out)
             override;
diff --git a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
index e061016..14ba0a5 100644
--- a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
+++ b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
@@ -99,7 +99,8 @@
      *
      * <p>The finished scheduled tasks will not be included.
      */
-    rpc GetAllScheduledTasks(GetAllScheduledTasksRequest) returns (GetAllScheduledTasksResponse) {}
+    rpc GetAllPendingScheduledTasks(GetAllPendingScheduledTasksRequest)
+            returns (GetAllPendingScheduledTasksResponse) {}
 }
 
 message GetRemoteTasksRequest {}
@@ -154,10 +155,10 @@
     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 5521134..2a7f209 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
@@ -399,13 +399,13 @@
     return ScopedAStatus::ok();
 }
 
-ScopedAStatus RemoteAccessService::getAllScheduledTasks(const std::string& clientId,
-                                                        std::vector<ScheduleInfo>* out) {
+ScopedAStatus RemoteAccessService::getAllPendingScheduledTasks(const std::string& clientId,
+                                                               std::vector<ScheduleInfo>* 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 4af0003..a46a983 100644
--- a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
+++ b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
@@ -95,9 +95,9 @@
     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<GetRemoteTasksResponse>*, AsyncGetRemoteTasksRaw,
                 (ClientContext * context, const GetRemoteTasksRequest& request, CompletionQueue* cq,
@@ -141,13 +141,13 @@
                 PrepareAsyncIsTaskScheduledRaw,
                 (ClientContext * context, const IsTaskScheduledRequest& request,
                  CompletionQueue* cq));
-    MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*,
-                AsyncGetAllScheduledTasksRaw,
-                (ClientContext * context, const GetAllScheduledTasksRequest& request,
+    MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*,
+                AsyncGetAllPendingScheduledTasksRaw,
+                (ClientContext * context, const GetAllPendingScheduledTasksRequest& request,
                  CompletionQueue* cq));
-    MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*,
-                PrepareAsyncGetAllScheduledTasksRaw,
-                (ClientContext * context, const GetAllScheduledTasksRequest& request,
+    MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*,
+                PrepareAsyncGetAllPendingScheduledTasksRaw,
+                (ClientContext * context, const GetAllPendingScheduledTasksRequest& request,
                  CompletionQueue* cq));
 };
 
@@ -573,13 +573,13 @@
     EXPECT_EQ(grpcRequest.scheduleid(), kTestScheduleId);
 }
 
-TEST_F(RemoteAccessServiceUnitTest, testGetAllScheduledTasks) {
+TEST_F(RemoteAccessServiceUnitTest, testGetAllPendingScheduledTasks) {
     std::vector<ScheduleInfo> 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 @@
                 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 2aab904..a7f47c2 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 @@
                                  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 1db991c..d223353 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 @@
     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 960020d..63458ae 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 @@
     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 @@
     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);