Guarantee the system EVS viewer's launch
This CL modifies a logic to request a preview activity again only if the
original request is a high-priority request; e.g. the reverse gearshift.
Bug: 204120517
Test: Manually launch CarEvsCameraPreviewApp and confirm it is not
replaced with another instance launched by the SystemUI
Change-Id: I5582d16f040395614a1ff29b8d65b03b49440288
Merged-In: I5582d16f040395614a1ff29b8d65b03b49440288
diff --git a/service/src/com/android/car/evs/CarEvsService.java b/service/src/com/android/car/evs/CarEvsService.java
index f6cd55c..961707f 100644
--- a/service/src/com/android/car/evs/CarEvsService.java
+++ b/service/src/com/android/car/evs/CarEvsService.java
@@ -490,10 +490,13 @@
throw new IllegalStateException("CarEvsService is in the unknown state.");
}
- // Arms the timer
- mHandler.sendMessageDelayed(obtainMessage(CarEvsService::handleActivityRequestTimeout,
- CarEvsService.this).setWhat(MSG_CHECK_ACTIVITY_REQUEST_TIMEOUT),
- STREAM_START_REQUEST_TIMEOUT_MS);
+ // Arms the timer for the high-priority request
+ if (priority == REQUEST_PRIORITY_HIGH) {
+ mHandler.sendMessageDelayed(obtainMessage(
+ CarEvsService::handleActivityRequestTimeout,
+ CarEvsService.this).setWhat(MSG_CHECK_ACTIVITY_REQUEST_TIMEOUT),
+ STREAM_START_REQUEST_TIMEOUT_MS);
+ }
mState = SERVICE_STATE_REQUESTED;
mServiceType = service;