Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e41337d7 authored by Thomas Stuart's avatar Thomas Stuart
Browse files

add a flag for ConnectionServiceFocusManager#getCurrentFocusCall

A flag should have been added with the changes in b/280128990.  Gating the changed code with a flag to ensure the code has enough soak time before release.

Fixes: 309541253
Bug:  280128990 (original bug)
Test: build + existing tests
Change-Id: Ibb19b05f5005e885fe5dde690f74ad37f7d062d7
parent 486b36f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ aconfig_declarations {
      "telecom_incallservice_flags.aconfig",
      "telecom_default_phone_account_flags.aconfig",
      "telecom_callaudioroutestatemachine_flags.aconfig",
      "telecom_anomaly_report_flags.aconfig",
      "telecom_callaudiomodestatemachine_flags.aconfig",
      "telecom_calllog_flags.aconfig",
      "telecom_resolve_hidden_dependencies.aconfig"
+8 −0
Original line number Diff line number Diff line
package: "com.android.server.telecom.flags"

flag {
  name: "gen_anom_report_on_focus_timeout"
  namespace: "telecom"
  description: "When getCurrentFocusCall times out, generate an anom. report"
  bug: "309541253"
}
+4 −0
Original line number Diff line number Diff line
@@ -2941,6 +2941,10 @@ public class CallsManager extends Call.ListenerBase
            // from the client via a transaction before answering.
            call.answer(videoState);
        } else {
            if (!mFeatureFlags.genAnomReportOnFocusTimeout()) {
                Call activeCall = (Call) mConnectionSvrFocusMgr.getCurrentFocusCall();
                Log.d(this, "answerCall: Incoming call = %s Ongoing call %s", call, activeCall);
            }
            // Hold or disconnect the active call and request call focus for the incoming call.
            Bundle bundle = new Bundle();
            bundle.putLong(TelecomManager.EXTRA_CALL_ANSWERED_TIME_MILLIS,
+18 −12
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.util.LogPrinter;
import android.util.Printer;

import com.android.internal.annotations.VisibleForTesting;
import com.android.server.telecom.flags.Flags;
import com.android.internal.util.IndentingPrintWriter;

import java.util.ArrayList;
@@ -340,8 +341,10 @@ public class ConnectionServiceFocusManager {
            if (syncCallFocus != null) {
                return syncCallFocus.orElse(null);
            } else {
                if (Flags.genAnomReportOnFocusTimeout()) {
                    Log.w(TAG, "Timed out waiting for synchronous current focus. Returning possibly"
                        + " inaccurate result. returning currentFocusCall=[%s]", mCurrentFocusCall);
                                    + " inaccurate result. returning currentFocusCall=[%s]",
                            mCurrentFocusCall);

                    // dump the state of the handler to better understand the timeout
                    mEventHandler.dump(
@@ -351,7 +354,10 @@ public class ConnectionServiceFocusManager {
                    mAnomalyReporter.reportAnomaly(
                            WATCHDOG_GET_CALL_FOCUS_TIMEOUT_UUID,
                            WATCHDOG_GET_CALL_FOCUS_TIMEOUT_MSG);

                } else {
                    Log.w(TAG, "Timed out waiting for synchronous current focus. Returning possibly"
                            + " inaccurate result");
                }
                return mCurrentFocusCall;
            }
        } catch (InterruptedException e) {