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

Commit 80a519ee authored by Thomas Stuart's avatar Thomas Stuart
Browse files

add anom report when telecom requests the user but phony has default

Telephony allows users to select a default outgoing sim when placing
outgoing calls.  However, there has been cases where this was set and
Telecom still prompted the user. This is due to the fact that some
activities do not update Telecom and Telephony & Telecom get out of
sync. This new report should catch a case where Telecom prompts the user
to select a sim to place the call on but Telephony has a default

Fixes: 302397094
Test:  none
Change-Id: Iedd02f6c9b93e204e02f68e88fb56eff9083a30d
parent a4f91d11
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ aconfig_declarations {
      "telecom_ringer_flag_declarations.aconfig",
      "telecom_api_flags.aconfig",
      "telecom_call_filtering_flags.aconfig",
      "telecom_incallservice_flags.aconfig"
      "telecom_incallservice_flags.aconfig",
      "telecom_default_phone_account_flags.aconfig",
    ],
}

+8 −0
Original line number Diff line number Diff line
package: "com.android.server.telecom.flags"

flag {
  name: "telephony_has_default_but_telecom_does_not"
  namespace: "telecom"
  description: "Telecom is requesting the user to select a sim account to place the outgoing call on but the user has a default account in the settings"
  bug: "302397094"
}
 No newline at end of file
+19 −1
Original line number Diff line number Diff line
@@ -133,7 +133,6 @@ import com.android.server.telecom.callfiltering.IncomingCallFilterGraphProvider;
import com.android.server.telecom.callredirection.CallRedirectionProcessor;
import com.android.server.telecom.components.ErrorDialogActivity;
import com.android.server.telecom.components.TelecomBroadcastReceiver;
import com.android.server.telecom.components.UserCallIntentProcessor;
import com.android.server.telecom.flags.FeatureFlags;
import com.android.server.telecom.stats.CallFailureCause;
import com.android.server.telecom.ui.AudioProcessingNotification;
@@ -293,6 +292,10 @@ public class CallsManager extends Call.ListenerBase
            UUID.fromString("2e994acb-1997-4345-8bf3-bad04303de26");
    public static final String EMERGENCY_CALL_ABORTED_NO_PHONE_ACCOUNTS_ERROR_MSG =
            "An emergency call was aborted since there were no available phone accounts.";
    public static final UUID TELEPHONY_HAS_DEFAULT_BUT_TELECOM_DOES_NOT_UUID =
            UUID.fromString("0a86157c-50ca-11ee-be56-0242ac120002");
    public static final String TELEPHONY_HAS_DEFAULT_BUT_TELECOM_DOES_NOT_MSG =
            "Telephony has a default MO acct but Telecom prompted user for MO";

    private static final int[] OUTGOING_CALL_STATES =
            {CallState.CONNECTING, CallState.SELECT_PHONE_ACCOUNT, CallState.DIALING,
@@ -2094,6 +2097,21 @@ public class CallsManager extends Call.ListenerBase
                                return CompletableFuture.completedFuture(Pair.create(callToPlace,
                                        accountSuggestions.get(0).getPhoneAccountHandle()));
                            }

                            // At this point Telecom is requesting the user to select a phone
                            // account. However, Telephony is reporting that the user has a default
                            // outgoing account (which is denoted by a non-negative subId number).
                            // At some point, Telecom and Telephony are out of sync with the default
                            // outgoing calling account.
                            if(mFeatureFlags.telephonyHasDefaultButTelecomDoesNot()) {
                                if (SubscriptionManager.getDefaultVoiceSubscriptionId() !=
                                        SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
                                    mAnomalyReporter.reportAnomaly(
                                            TELEPHONY_HAS_DEFAULT_BUT_TELECOM_DOES_NOT_UUID,
                                            TELEPHONY_HAS_DEFAULT_BUT_TELECOM_DOES_NOT_MSG);
                                }
                            }

                            // This is the state where the user is expected to select an account
                            callToPlace.setState(CallState.SELECT_PHONE_ACCOUNT,
                                    "needs account selection");
+1 −0
Original line number Diff line number Diff line
@@ -1709,6 +1709,7 @@ public class PhoneAccountRegistrar {
            } else {
                pw.println(defaultOutgoing);
            }
            pw.println("defaultVoiceSubId: " + SubscriptionManager.getDefaultVoiceSubscriptionId());
            pw.println("simCallManager: " + getSimCallManager(mCurrentUserHandle));
            pw.println("phoneAccounts:");
            pw.increaseIndent();