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

Commit 30b52917 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11380007 from 39c5487f to 24Q2-release

Change-Id: I662c9e202be100a5ba861d5f283de9d476872cab
parents 8e45605b 39c5487f
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -20,3 +20,10 @@ flag {
    description: "This flag controls the order of the binder to prevent deadlock in system_server"
    description: "This flag controls the order of the binder to prevent deadlock in system_server"
    bug: "315973270"
    bug: "315973270"
}
}

flag {
    name: "prevent_invocation_repeat_of_ril_call_when_device_does_not_support_voice"
    namespace: "telephony"
    description: "This flag prevents repeat invocation of call related APIs in RIL when the device is not voice capable"
    bug: "290833783"
}
 No newline at end of file
+17 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.internal.telephony;
package com.android.internal.telephony;


import android.annotation.NonNull;
import android.compat.annotation.UnsupportedAppUsage;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.Context;
import android.os.AsyncResult;
import android.os.AsyncResult;
@@ -25,8 +26,11 @@ import android.os.Message;
import android.os.PersistableBundle;
import android.os.PersistableBundle;
import android.telephony.CarrierConfigManager;
import android.telephony.CarrierConfigManager;
import android.telephony.ServiceState;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.text.TextUtils;


import com.android.internal.telephony.flags.FeatureFlags;

import java.io.FileDescriptor;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.ArrayList;
@@ -55,6 +59,9 @@ public abstract class CallTracker extends Handler {


    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    protected boolean mNumberConverted = false;
    protected boolean mNumberConverted = false;

    protected final @NonNull FeatureFlags mFeatureFlags;

    private final int VALID_COMPARE_LENGTH   = 3;
    private final int VALID_COMPARE_LENGTH   = 3;


    //***** Events
    //***** Events
@@ -77,7 +84,8 @@ public abstract class CallTracker extends Handler {
    protected static final int EVENT_THREE_WAY_DIAL_BLANK_FLASH    = 20;
    protected static final int EVENT_THREE_WAY_DIAL_BLANK_FLASH    = 20;


    @UnsupportedAppUsage
    @UnsupportedAppUsage
    public CallTracker() {
    public CallTracker(FeatureFlags featureFlags) {
        mFeatureFlags = featureFlags;
    }
    }


    protected void pollCallsWhenSafe() {
    protected void pollCallsWhenSafe() {
@@ -91,6 +99,14 @@ public abstract class CallTracker extends Handler {


    protected void
    protected void
    pollCallsAfterDelay() {
    pollCallsAfterDelay() {
        if (mFeatureFlags.preventInvocationRepeatOfRilCallWhenDeviceDoesNotSupportVoice()) {
            if (!mCi.getHalVersion(TelephonyManager.HAL_SERVICE_VOICE)
                    .greaterOrEqual(RIL.RADIO_HAL_VERSION_1_4)) {
                log("Skip polling because HAL_SERVICE_VOICE < RADIO_HAL_VERSION_1.4");
                return;
            }
        }

        Message msg = obtainMessage();
        Message msg = obtainMessage();


        msg.what = EVENT_REPOLL_AFTER_DELAY;
        msg.what = EVENT_REPOLL_AFTER_DELAY;
+4 −1
Original line number Original line Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.internal.telephony.PhoneInternalInterface.DialArgs;
import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
import com.android.internal.telephony.domainselection.DomainSelectionResolver;
import com.android.internal.telephony.domainselection.DomainSelectionResolver;
import com.android.internal.telephony.emergency.EmergencyStateTracker;
import com.android.internal.telephony.emergency.EmergencyStateTracker;
import com.android.internal.telephony.flags.FeatureFlags;
import com.android.internal.telephony.metrics.TelephonyMetrics;
import com.android.internal.telephony.metrics.TelephonyMetrics;
import com.android.telephony.Rlog;
import com.android.telephony.Rlog;


@@ -155,7 +156,9 @@ public class GsmCdmaCallTracker extends CallTracker {


    //***** Constructors
    //***** Constructors


    public GsmCdmaCallTracker (GsmCdmaPhone phone) {
    public GsmCdmaCallTracker(GsmCdmaPhone phone, FeatureFlags featureFlags) {
        super(featureFlags);

        this.mPhone = phone;
        this.mPhone = phone;
        mCi = phone.mCi;
        mCi = phone.mCi;
        mCi.registerForCallStateChanged(this, EVENT_CALL_STATE_CHANGE, null);
        mCi.registerForCallStateChanged(this, EVENT_CALL_STATE_CHANGE, null);
+1 −1
Original line number Original line Diff line number Diff line
@@ -464,7 +464,7 @@ public class GsmCdmaPhone extends Phone {
        }
        }


        mCT = mTelephonyComponentFactory.inject(GsmCdmaCallTracker.class.getName())
        mCT = mTelephonyComponentFactory.inject(GsmCdmaCallTracker.class.getName())
                .makeGsmCdmaCallTracker(this);
                .makeGsmCdmaCallTracker(this, mFeatureFlags);
        mIccPhoneBookIntManager = mTelephonyComponentFactory
        mIccPhoneBookIntManager = mTelephonyComponentFactory
                .inject(IccPhoneBookInterfaceManager.class.getName())
                .inject(IccPhoneBookInterfaceManager.class.getName())
                .makeIccPhoneBookInterfaceManager(this);
                .makeIccPhoneBookInterfaceManager(this);
+37 −4
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@ import android.sysprop.TelephonyProperties;
import android.telephony.PhoneCapability;
import android.telephony.PhoneCapability;
import android.telephony.SubscriptionManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyRegistryManager;
import android.text.TextUtils;
import android.text.TextUtils;
import android.util.Log;
import android.util.Log;


@@ -47,6 +48,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.Set;
import java.util.stream.Collectors;


/**
/**
 * This class manages phone's configuration which defines the potential capability (static) of the
 * This class manages phone's configuration which defines the potential capability (static) of the
@@ -74,7 +76,8 @@ public class PhoneConfigurationManager {
    private static PhoneConfigurationManager sInstance = null;
    private static PhoneConfigurationManager sInstance = null;
    private final Context mContext;
    private final Context mContext;
    private PhoneCapability mStaticCapability;
    private PhoneCapability mStaticCapability;
    private Set<Integer> mSlotsSupportingSimultaneousCellularCalls = new HashSet<>();
    private final Set<Integer> mSlotsSupportingSimultaneousCellularCalls = new HashSet<>(2);
    private final Set<Integer> mSubIdsSupportingSimultaneousCellularCalls = new HashSet<>(2);
    private final RadioConfig mRadioConfig;
    private final RadioConfig mRadioConfig;
    private final Handler mHandler;
    private final Handler mHandler;
    // mPhones is obtained from PhoneFactory and can have phones corresponding to inactive modems as
    // mPhones is obtained from PhoneFactory and can have phones corresponding to inactive modems as
@@ -148,6 +151,25 @@ public class PhoneConfigurationManager {
        }
        }
    }
    }


    /**
     * Updates the mapping between the slot IDs that support simultaneous calling and the
     * associated sub IDs as well as notifies listeners.
     */
    private void updateSimultaneousSubIdsFromPhoneIdMappingAndNotify() {
        if (!mFeatureFlags.simultaneousCallingIndications()) return;
        Set<Integer> slotCandidates = mSlotsSupportingSimultaneousCellularCalls.stream()
                .map(i -> mPhones[i].getSubId())
                .filter(i ->i > SubscriptionManager.INVALID_SUBSCRIPTION_ID)
                        .collect(Collectors.toSet());
        if (mSubIdsSupportingSimultaneousCellularCalls.equals(slotCandidates))  return;
        log("updateSimultaneousSubIdsFromPhoneIdMapping update: "
                + mSubIdsSupportingSimultaneousCellularCalls + " -> " + slotCandidates);
        mSubIdsSupportingSimultaneousCellularCalls.clear();
        mSubIdsSupportingSimultaneousCellularCalls.addAll(slotCandidates);
        mNotifier.notifySimultaneousCellularCallingSubscriptionsChanged(
                mSubIdsSupportingSimultaneousCellularCalls);
    }

    private void registerForRadioState(Phone phone) {
    private void registerForRadioState(Phone phone) {
        phone.mCi.registerForAvailable(mHandler, Phone.EVENT_RADIO_AVAILABLE, phone);
        phone.mCi.registerForAvailable(mHandler, Phone.EVENT_RADIO_AVAILABLE, phone);
    }
    }
@@ -187,6 +209,16 @@ public class PhoneConfigurationManager {
            updateSimultaneousCallingSupport();
            updateSimultaneousCallingSupport();
            mRadioConfig.registerForSimultaneousCallingSupportStatusChanged(mHandler,
            mRadioConfig.registerForSimultaneousCallingSupportStatusChanged(mHandler,
                    EVENT_SIMULTANEOUS_CALLING_SUPPORT_CHANGED, null);
                    EVENT_SIMULTANEOUS_CALLING_SUPPORT_CHANGED, null);
            if (mFeatureFlags.simultaneousCallingIndications()) {
                mContext.getSystemService(TelephonyRegistryManager.class)
                        .addOnSubscriptionsChangedListener(
                                new SubscriptionManager.OnSubscriptionsChangedListener() {
                                    @Override
                                    public void onSubscriptionsChanged() {
                                        updateSimultaneousSubIdsFromPhoneIdMappingAndNotify();
                                    }
                                }, mHandler::post);
            }
        }
        }
    }
    }


@@ -291,7 +323,6 @@ public class PhoneConfigurationManager {
                        if (mSlotsSupportingSimultaneousCellularCalls.size() > getPhoneCount()) {
                        if (mSlotsSupportingSimultaneousCellularCalls.size() > getPhoneCount()) {
                            loge("Invalid size of DSDA slots. Disabling cellular DSDA.");
                            loge("Invalid size of DSDA slots. Disabling cellular DSDA.");
                            mSlotsSupportingSimultaneousCellularCalls.clear();
                            mSlotsSupportingSimultaneousCellularCalls.clear();
                            break;
                        }
                        }
                    } else {
                    } else {
                        log(msg.what + " failure. Not getting logical slots that support "
                        log(msg.what + " failure. Not getting logical slots that support "
@@ -299,8 +330,7 @@ public class PhoneConfigurationManager {
                        mSlotsSupportingSimultaneousCellularCalls.clear();
                        mSlotsSupportingSimultaneousCellularCalls.clear();
                    }
                    }
                    if (mFeatureFlags.simultaneousCallingIndications()) {
                    if (mFeatureFlags.simultaneousCallingIndications()) {
                        mNotifier.notifySimultaneousCellularCallingSubscriptionsChanged(
                        updateSimultaneousSubIdsFromPhoneIdMappingAndNotify();
                                mSlotsSupportingSimultaneousCellularCalls);
                    }
                    }
                    break;
                    break;
                default:
                default:
@@ -540,6 +570,9 @@ public class PhoneConfigurationManager {
            } else {
            } else {
                // The number of active modems is 0 or 1, disable cellular DSDA:
                // The number of active modems is 0 or 1, disable cellular DSDA:
                mSlotsSupportingSimultaneousCellularCalls.clear();
                mSlotsSupportingSimultaneousCellularCalls.clear();
                if (mFeatureFlags.simultaneousCallingIndications()) {
                    updateSimultaneousSubIdsFromPhoneIdMappingAndNotify();
                }
            }
            }


            // When the user enables DSDS mode, the default VOICE and SMS subId should be switched
            // When the user enables DSDS mode, the default VOICE and SMS subId should be switched
Loading