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

Commit 68274f52 authored by Susheel nyamala's avatar Susheel nyamala Committed by Linux Build Service Account
Browse files

Add subscription handling to notify dataconnection

In TelephonyRegistry, to notifyDataConnection method
add subscription based handling to connectedapns list
which keep track of apn type connected.
Without this, when default apn on non-dds sub is notified
as disconnected, data icon on dds sub will be erased.

Change-Id: I7023ac1fcde13bdb5afec684be26fb286a25eb4b
CRs-Fixed: 712007
parent 598a2d95
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {

    private String[] mDataConnectionApn;

    private ArrayList<String> mConnectedApns;
    private ArrayList<String>[] mConnectedApns;

    private LinkProperties[] mDataConnectionLinkProperties;

@@ -232,13 +232,13 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {

        mContext = context;
        mBatteryStats = BatteryStatsService.getService();
        mConnectedApns = new ArrayList<String>();

        int numPhones = TelephonyManager.getDefault().getPhoneCount();
        if (DBG) log("TelephonyRegistor: ctor numPhones=" + numPhones);
        mNumPhones = numPhones;
        mCallState = new int[numPhones];
        mDataActivity = new int[numPhones];
        mConnectedApns = (ArrayList[]) new ArrayList[numPhones];
        mDataConnectionState = new int[numPhones];
        mDataConnectionNetworkType = new int[numPhones];
        mCallIncomingNumber = new String[numPhones];
@@ -256,6 +256,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        for (int i = 0; i < numPhones; i++) {
            mCallState[i] =  TelephonyManager.CALL_STATE_IDLE;
            mDataActivity[i] = TelephonyManager.DATA_ACTIVITY_NONE;
            mConnectedApns[i] = new ArrayList<String>();
            mDataConnectionState[i] = TelephonyManager.DATA_UNKNOWN;
            mCallIncomingNumber[i] =  "";
            mServiceState[i] =  new ServiceState();
@@ -276,7 +277,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                location.fillInNotifierBundle(mCellLocation[i]);
            }
        }
        mConnectedApns = new ArrayList<String>();
    }

    public void systemRunning() {
@@ -815,16 +815,16 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
            int phoneId = SubscriptionManager.getPhoneId(subId);
            boolean modified = false;
            if (state == TelephonyManager.DATA_CONNECTED) {
                if (!mConnectedApns.contains(apnType)) {
                    mConnectedApns.add(apnType);
                if (!mConnectedApns[phoneId].contains(apnType)) {
                    mConnectedApns[phoneId].add(apnType);
                    if (mDataConnectionState[phoneId] != state) {
                        mDataConnectionState[phoneId] = state;
                        modified = true;
                    }
                }
            } else {
                if (mConnectedApns.remove(apnType)) {
                    if (mConnectedApns.isEmpty()) {
                if (mConnectedApns[phoneId].remove(apnType)) {
                    if (mConnectedApns[phoneId].isEmpty()) {
                        mDataConnectionState[phoneId] = state;
                        modified = true;
                    } else {