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

Commit 668dee01 authored by Nancy Chen's avatar Nancy Chen
Browse files

Hide "respond via SMS" option for non-default SMS SIM.

If an incoming call is coming in through the non-default SMS SIM, do not
show the "respond via SMS" option. This is to prevent accidentally
sending the SMS through a SIM the user may not want to use for SMS.

Bug: 18275919
Change-Id: I0136f30d6341e72ac6e914de41f9c41bd58f1bbb
parent 36e3ada7
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ public final class InCallController extends CallsManagerListenerBase {
     *
     * @param call The {@link Call} to parcel.
     * @param includeVideoProvider When {@code true}, the {@link IVideoProvider} is included in the
     *      parcelled call.  When {@code false}, the {@link IVideoProvider} is not included.
     *      parceled call.  When {@code false}, the {@link IVideoProvider} is not included.
     * @return The {@link ParcelableCall} containing all call information from the {@link Call}.
     */
    private ParcelableCall toParcelableCall(Call call, boolean includeVideoProvider) {
@@ -445,7 +445,10 @@ public final class InCallController extends CallsManagerListenerBase {
        int state = call.getState();
        int capabilities = call.getCallCapabilities();

        if (call.isRespondViaSmsCapable()) {
        boolean isDefaultSmsAccount =
                CallsManager.getInstance().getPhoneAccountRegistrar().isUserSelectedSmsPhoneAccount(
                        call.getTargetPhoneAccount());
        if (call.isRespondViaSmsCapable() && isDefaultSmsAccount) {
            capabilities |= PhoneCapabilities.RESPOND_VIA_TEXT;
        }

+5 −0
Original line number Diff line number Diff line
@@ -222,6 +222,11 @@ public final class PhoneAccountRegistrar {
        fireDefaultOutgoingChanged();
    }

    boolean isUserSelectedSmsPhoneAccount(PhoneAccountHandle accountHandle) {
        return getSubscriptionIdForPhoneAccount(accountHandle) ==
                SubscriptionManager.getDefaultSmsSubId();
    }

    public void setSimCallManager(PhoneAccountHandle callManager) {
        if (callManager != null) {
            PhoneAccount callManagerAccount = getPhoneAccount(callManager);