transcoding: Make TranscodingTestConfig to be nullable.
Bug: 145628554
Bug: 154734285
Test: Unit test
Change-Id: I93b5f6a34ad02d82f154d3ae07ed0516b1780db2
diff --git a/services/mediatranscoding/SimulatedTranscoder.cpp b/services/mediatranscoding/SimulatedTranscoder.cpp
index cdced2d..5aa325f 100644
--- a/services/mediatranscoding/SimulatedTranscoder.cpp
+++ b/services/mediatranscoding/SimulatedTranscoder.cpp
@@ -50,8 +50,8 @@
void SimulatedTranscoder::start(
ClientIdType clientId, JobIdType jobId, const TranscodingRequestParcel& request,
const std::shared_ptr<ITranscodingClientCallback>& /*clientCallback*/) {
- if (request.testConfig.processingTotalTimeMs > 0) {
- mJobProcessingTimeMs = request.testConfig.processingTotalTimeMs;
+ if (request.testConfig.has_value() && request.testConfig->processingTotalTimeMs > 0) {
+ mJobProcessingTimeMs = request.testConfig->processingTotalTimeMs;
}
ALOGV("%s: job {%d}: processingTime: %lld", __FUNCTION__, jobId,
(long long)mJobProcessingTimeMs);