Implement InCallUiLock
When any locks are acquired, the InCallActivity will not auto-finish when there are no active calls. The disconnected cause and reject with SMS dialogs are migrated to use this API, which prevents the activity form ending before the user has finished interacting with the dialogs.
Bug: 64215256
Test: InCallPresenterTest
PiperOrigin-RevId: 171362338
Change-Id: Ied07ebbf6bee056ea6b2314c57f3324561b1651a
diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java
index b82b6c9..2ba4d98 100644
--- a/java/com/android/incallui/InCallActivity.java
+++ b/java/com/android/incallui/InCallActivity.java
@@ -245,23 +245,16 @@
return true;
}
- if (common.hasPendingDialogs()) {
- LogUtil.i(
- "InCallActivity.shouldCloseActivityOnFinish", "dialog is visible, not closing activity");
- return false;
- }
-
- AnswerScreen answerScreen = getAnswerScreen();
- if (answerScreen != null && answerScreen.hasPendingDialogs()) {
+ if (InCallPresenter.getInstance().isInCallUiLocked()) {
LogUtil.i(
"InCallActivity.shouldCloseActivityOnFinish",
- "answer screen dialog is visible, not closing activity");
+ "in call ui is locked, not closing activity");
return false;
}
LogUtil.i(
"InCallActivity.shouldCloseActivityOnFinish",
- "activity is visible and has no dialogs, allowing activity to close");
+ "activity is visible and has no locks, allowing activity to close");
return true;
}