Skip to content

Commit 558f676

Browse files
committed
hot fix
1 parent 10b1a3b commit 558f676

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

‎app/src/main/java/com/drivehub/kamera/settings/UiPrefs.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public final class UiPrefs {
2323
public static final String KEY_SIGNAL_OVERLAY_TAP_TO_HIDE_ENABLED = "signalOverlayTapToHideEnabled";
2424
public static final String KEY_SIGNAL_OVERLAY_TAP_TO_HIDE_DURATION_SEC = "signalOverlayTapToHideDurationSec";
2525
public static final int DEFAULT_SIGNAL_OVERLAY_TAP_TO_HIDE_DURATION_SEC = 5;
26-
public static final int MIN_SIGNAL_OVERLAY_TAP_TO_HIDE_SEC = 3;
26+
public static final int MIN_SIGNAL_OVERLAY_TAP_TO_HIDE_SEC = 2;
2727
public static final int MAX_SIGNAL_OVERLAY_TAP_TO_HIDE_SEC = 120;
2828
public static final String KEY_OVERLAY_HIDE_DELAY_MS = "overlayHideDelayMs";
2929
public static final String KEY_OVERLAY_MIN_SHOW_MS = "overlayMinShowMs";

‎app/src/main/java/com/drivehub/kamera/signal/SignalService.java‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,11 @@ private void updateOverlayDecision() {
627627
return;
628628
}
629629

630-
if ((previousMode == 1 || previousMode == 2) && nextMode == 0) {
630+
if ((previousMode == 1 || previousMode == 2) && (nextMode == 0 || nextMode == 4)) {
631631
currentMode = -2;
632-
long delayMs = computeOverlayHideDelayMs();
632+
// For mode 0: respect both hideDelay and minShowTime.
633+
// For mode 4 (rearview): only respect minShowTime — no artificial gap before the mirror.
634+
long delayMs = nextMode == 4 ? computeRemainingMinShowMs() : computeOverlayHideDelayMs();
633635
mainHandler.removeCallbacks(hideRunnable);
634636
mainHandler.postDelayed(hideRunnable, delayMs);
635637
Log.i(TAG, "Signal/gear off => will reapply overlay state after " + delayMs + "ms");
@@ -741,6 +743,18 @@ private long computeOverlayHideDelayMs() {
741743
return Math.max(hideDelayMs, remainingMinShowMs);
742744
}
743745

746+
// Only the remaining min-show time, without adding the regular hide delay.
747+
// Used when transitioning from a signal overlay to rearview (mode 4).
748+
private long computeRemainingMinShowMs() {
749+
long minShowMs = readOverlayMinShowMs();
750+
long shownAtMs = overlayShownAtMs;
751+
if (shownAtMs <= 0L || minShowMs <= 0L) {
752+
return 0L;
753+
}
754+
long elapsedVisibleMs = Math.max(0L, SystemClock.elapsedRealtime() - shownAtMs);
755+
return Math.max(0L, minShowMs - elapsedVisibleMs);
756+
}
757+
744758
private boolean isOemAvmInForeground() {
745759
try {
746760
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);

0 commit comments

Comments
 (0)