diff options
| author | 2010-08-05 22:47:09 -0700 | |
|---|---|---|
| committer | 2010-08-05 22:47:09 -0700 | |
| commit | 910cf2028991dc7c41d24ae8de5dda0c13e2b4b1 (patch) | |
| tree | e16d9deb3913b8fc6ae4cc6aaf07e25e28db44b9 | |
| parent | 5187d2f43f302ddc24ff3126afedd5b444f592f2 (diff) | |
| parent | 88e590fb370d80d863417aae9330c8c2218f3175 (diff) | |
Merge "Fix the SipPhone codes related to the ITelephone interface change."
5 files changed, 64 insertions, 24 deletions
diff --git a/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java b/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java index 81e151e85c24..1229d14df943 100644 --- a/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java +++ b/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java @@ -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 } diff --git a/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java b/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java index d48f94ab81bd..ad05b82f2746 100644 --- a/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java +++ b/telephony/java/com/android/internal/telephony/sip/SipConnectionBase.java @@ -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; } - */ } diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java index 4e61d30e44e6..e11bd429903e 100755 --- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java @@ -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) { diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java b/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java index 36d65dbbd0b6..721b8af8052c 100755 --- a/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java @@ -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; diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhoneProxy.java b/telephony/java/com/android/internal/telephony/sip/SipPhoneProxy.java index 7cc1a9b8fbb3..8fa29630a5f4 100644 --- a/telephony/java/com/android/internal/telephony/sip/SipPhoneProxy.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhoneProxy.java @@ -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); + } } |