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

Commit 910cf202 authored by Chung-yih Wang's avatar Chung-yih Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix the SipPhone codes related to the ITelephone interface change."

parents 5187d2f4 88e590fb
Loading
Loading
Loading
Loading
+24 −6
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.telephony;

import android.net.NetworkProperties;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -94,15 +95,32 @@ public class SipPhoneNotifier implements PhoneNotifier {
        }
    }

    public void notifyDataConnection(Phone sender, String reason) {
    public void notifyDataConnection(Phone sender, String reason, String apnType) {
        doNotifyDataConnection(sender, reason, apnType, sender.getDataConnectionState(apnType));
    }

    public void notifyDataConnection(Phone sender, String reason, String apnType,
            Phone.DataState state) {
        doNotifyDataConnection(sender, reason, apnType, state);
    }

    private void doNotifyDataConnection(Phone sender, String reason, String apnType,
            Phone.DataState state) {
        // TODO
        // use apnType as the key to which connection we're talking about.
        // pass apnType back up to fetch particular for this one.
        TelephonyManager telephony = TelephonyManager.getDefault();
        NetworkProperties networkProperties = null;
        if (state == Phone.DataState.CONNECTED) {
            networkProperties = sender.getNetworkProperties(apnType);
        }
        try {
            mRegistry.notifyDataConnection(
                    convertDataState(sender.getDataConnectionState()),
                    convertDataState(state),
                    sender.isDataConnectivityPossible(), reason,
                    sender.getActiveApn(),
                    sender.getActiveApnTypes(),
                    sender.getInterfaceName(null),
                    apnType,
                    networkProperties,
                    ((telephony!=null) ? telephony.getNetworkType() :
                    TelephonyManager.NETWORK_TYPE_UNKNOWN));
        } catch (RemoteException ex) {
@@ -110,9 +128,9 @@ public class SipPhoneNotifier implements PhoneNotifier {
        }
    }

    public void notifyDataConnectionFailed(Phone sender, String reason) {
    public void notifyDataConnectionFailed(Phone sender, String reason, String apnType) {
        try {
            mRegistry.notifyDataConnectionFailed(reason);
            mRegistry.notifyDataConnectionFailed(reason, apnType);
        } catch (RemoteException ex) {
            // system process is dead
        }
+0 −2
Original line number Diff line number Diff line
@@ -236,11 +236,9 @@ abstract class SipConnectionBase extends Connection {
        return Connection.PRESENTATION_ALLOWED;
    }

    /*
    @Override
    public UUSInfo getUUSInfo() {
        // FIXME: what's this for SIP?
        return null;
    }
    */
}
+8 −9
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ import com.android.internal.telephony.PhoneNotifier;
import com.android.internal.telephony.PhoneProxy;
import com.android.internal.telephony.PhoneSubInfo;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.UUSInfo;

import java.io.IOException;
import java.text.ParseException;
@@ -100,6 +99,14 @@ public class SipPhone extends SipPhoneBase {
        //        new Integer(Phone.PHONE_TYPE_GSM).toString());
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof SipPhone)) return false;
        SipPhone that = (SipPhone) o;
        return mProfile.getUriString().equals(that.mProfile.getUriString());
    }

    public String getPhoneName() {
        return mProfile.getProfileName();
    }
@@ -165,10 +172,6 @@ public class SipPhone extends SipPhoneBase {
        }
    }

    public Connection dial(String dialString, UUSInfo uusinfo) throws CallStateException {
        return dial(dialString);
    }

    public Connection dial(String dialString) throws CallStateException {
        synchronized (SipPhone.class) {
            return dialInternal(dialString);
@@ -715,10 +718,6 @@ public class SipPhone extends SipPhoneBase {
            */
        }

        @Override
        public UUSInfo getUUSInfo() {
            return null;
        }
    }

    private static Call.State getCallStateFrom(SipAudioCall sipAudioCall) {
+14 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.internal.telephony.sip;
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.NetworkProperties;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
@@ -65,7 +66,7 @@ import com.android.internal.telephony.PhoneNotifier;
import com.android.internal.telephony.PhoneProxy;
import com.android.internal.telephony.PhoneSubInfo;
import com.android.internal.telephony.TelephonyProperties;
//import com.android.internal.telephony.UUSInfo;
import com.android.internal.telephony.UUSInfo;

import java.io.IOException;
import java.util.ArrayList;
@@ -102,13 +103,11 @@ abstract class SipPhoneBase extends PhoneBase {

    public abstract Call getRingingCall();

    /*
    public Connection dial(String dialString, UUSInfo uusInfo)
            throws CallStateException {
        // ignore UUSInfo
        return dial(dialString);
    }
    */

    void migrateFrom(SipPhoneBase from) {
        migrate(mRingbackRegistrants, from.mRingbackRegistrants);
@@ -538,6 +537,18 @@ abstract class SipPhoneBase extends PhoneBase {
        Log.e(LOG_TAG, "Error! This functionality is not implemented for SIP.");
    }

    //@Override
    public boolean needsOtaServiceProvisioning() {
        // FIXME: what's this for SIP?
        return false;
    }

    //@Override
    public NetworkProperties getNetworkProperties(String apnType) {
        // FIXME: what's this for SIP?
        return null;
    }

    void updatePhoneState() {
        State oldState = state;

+18 −4
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import com.android.internal.telephony.gsm.NetworkInfo;
import com.android.internal.telephony.test.SimulatedRadioControl;

import android.content.Context;
import android.net.NetworkProperties;
import android.os.Handler;
import android.os.Message;
import android.telephony.CellLocation;
@@ -94,6 +95,10 @@ public class SipPhoneProxy implements Phone {
        return mActivePhone.getDataConnectionState();
    }

    public DataState getDataConnectionState(String apnType) {
        return mActivePhone.getDataConnectionState(apnType);
    }

    public DataActivityState getDataActivityState() {
        return mActivePhone.getDataActivityState();
    }
@@ -330,10 +335,6 @@ public class SipPhoneProxy implements Phone {
        return mActivePhone.dial(dialString);
    }

    public Connection dial(String dialString, UUSInfo uusInfo) throws CallStateException {
        return mActivePhone.dial(dialString);
    }

    public boolean handlePinMmi(String dialString) {
        return mActivePhone.handlePinMmi(dialString);
    }
@@ -746,4 +747,17 @@ public class SipPhoneProxy implements Phone {
    public void unsetOnEcbModeExitResponse(Handler h){
        mActivePhone.unsetOnEcbModeExitResponse(h);
    }

    public Connection dial(String dialString, UUSInfo uusInfo)
            throws CallStateException {
        return mActivePhone.dial(dialString, uusInfo);
    }

    public boolean needsOtaServiceProvisioning() {
        return mActivePhone.needsOtaServiceProvisioning();
    }

    public NetworkProperties getNetworkProperties(String apnType) {
        return mActivePhone.getNetworkProperties(apnType);
    }
}