Add inject task cmd to default remoteaccess hal.
This allows local remote access HAL test. This CL also adds debug
status dump to remote access HAL.
Test: Manual run on gcar_emu
Bug: 272773565
Change-Id: Ic02b451d800cfe75d8c410a4dc52e8ce15e481b7
diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
index 5cfca61..9aabad6 100644
--- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
+++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
@@ -97,7 +97,10 @@
bool mTaskWaitStopped GUARDED_BY(mLock);
// A mutex to make sure startTaskLoop does not overlap with stopTaskLoop.
std::mutex mStartStopTaskLoopLock;
- bool mTaskLoopRunning GUARDED_BY(mStartStopTaskLoopLock);
+ bool mTaskLoopRunning GUARDED_BY(mStartStopTaskLoopLock) = false;
+ bool mGrpcConnected GUARDED_BY(mLock) = false;
+ std::unordered_map<std::string, size_t> mClientIdToTaskCount GUARDED_BY(mLock);
+
// Default wait time before retry connecting to remote access client is 10s.
size_t mRetryWaitInMs = 10'000;
std::shared_ptr<DebugRemoteTaskCallback> mDebugCallback;
@@ -110,6 +113,12 @@
void setRetryWaitInMs(size_t retryWaitInMs) { mRetryWaitInMs = retryWaitInMs; }
void dumpHelp(int fd);
+ void printCurrentStatus(int fd);
+ std::string clientIdToTaskCountToStringLocked() REQUIRES(mLock);
+ void debugInjectTask(int fd, std::string_view clientId, std::string_view taskData);
+ void updateGrpcConnected(bool connected);
+ android::base::Result<void> deliverRemoteTaskThroughCallback(const std::string& clientId,
+ std::string_view taskData);
};
} // namespace remoteaccess