SIP/phone: changes correspond to SIP refactoring.

Related CL: https://android-git/g/#change,69462

Change-Id: Ie0c3df540bcc7025f04f343245e2f807705c3715
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 1664343..fed719c 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -1481,7 +1481,7 @@
     private void createSipCallSettings() {
         // Add Internet call settings.
         if (SipManager.isVoipSupported(this)) {
-            mSipManager = SipManager.getInstance(this);
+            mSipManager = SipManager.newInstance(this);
             mSipProfilesDir = mPhone.getContext().getFilesDir()
                     .getAbsolutePath() + SipSettings.PROFILES_DIR;
             mSipSharedPreferences = new SipSharedPreferences(this);
diff --git a/src/com/android/phone/SipBroadcastReceiver.java b/src/com/android/phone/SipBroadcastReceiver.java
index 9866d72..c4c3850 100644
--- a/src/com/android/phone/SipBroadcastReceiver.java
+++ b/src/com/android/phone/SipBroadcastReceiver.java
@@ -53,18 +53,18 @@
         }
         mSipSharedPreferences = new SipSharedPreferences(context);
 
-        if (action.equals(SipManager.SIP_INCOMING_CALL_ACTION)) {
+        if (action.equals(SipManager.ACTION_SIP_INCOMING_CALL)) {
             takeCall(intent);
-        } else if (action.equals(SipManager.SIP_ADD_PHONE_ACTION)) {
-            String localSipUri = intent.getStringExtra(SipManager.LOCAL_URI_KEY);
+        } else if (action.equals(SipManager.ACTION_SIP_ADD_PHONE)) {
+            String localSipUri = intent.getStringExtra(SipManager.EXTRA_LOCAL_URI);
             SipPhone phone = PhoneFactory.makeSipPhone(localSipUri);
             if (phone != null) {
                 CallManager.getInstance().registerPhone(phone);
             }
             Log.d(TAG, "new phone: " + localSipUri + " #phones="
                     + CallManager.getInstance().getAllPhones().size());
-        } else if (action.equals(SipManager.SIP_REMOVE_PHONE_ACTION)) {
-            String localSipUri = intent.getStringExtra(SipManager.LOCAL_URI_KEY);
+        } else if (action.equals(SipManager.ACTION_SIP_REMOVE_PHONE)) {
+            String localSipUri = intent.getStringExtra(SipManager.EXTRA_LOCAL_URI);
             removeSipPhone(localSipUri);
             Log.d(TAG, "removed phone: " + localSipUri + " #phones="
                     + CallManager.getInstance().getAllPhones().size());
@@ -92,8 +92,8 @@
     private void takeCall(Intent intent) {
         Context phoneContext = PhoneApp.getInstance();
         try {
-            SipAudioCall sipAudioCall = SipManager.getInstance(phoneContext)
-                    .takeAudioCall(phoneContext, intent, null, false);
+            SipAudioCall sipAudioCall = SipManager.newInstance(phoneContext)
+                    .takeAudioCall(intent, null, false);
             for (Phone phone : CallManager.getInstance().getAllPhones()) {
                 if (phone.getPhoneType() == Phone.PHONE_TYPE_SIP) {
                    if (((SipPhone) phone).canTake(sipAudioCall)) return;
@@ -110,7 +110,7 @@
         final Context context = PhoneApp.getInstance();
         new Thread(new Runnable() {
             public void run() {
-                SipManager sipManager = SipManager.getInstance(context);
+                SipManager sipManager = SipManager.newInstance(context);
                 List<SipProfile> sipProfileList =
                         SipSettings.retrieveSipListFromDirectory(
                         context.getFilesDir().getAbsolutePath()
@@ -123,7 +123,7 @@
                             continue;
                         }
                         sipManager.open(profile,
-                                SipManager.SIP_INCOMING_CALL_ACTION, null);
+                                SipManager.ACTION_SIP_INCOMING_CALL, null);
                     } catch (SipException e) {
                         Log.e(TAG, "failed" + profile.getProfileName(), e);
                     }
diff --git a/src/com/android/phone/SipCallOptionHandler.java b/src/com/android/phone/SipCallOptionHandler.java
index b7b9318..665a9e7 100644
--- a/src/com/android/phone/SipCallOptionHandler.java
+++ b/src/com/android/phone/SipCallOptionHandler.java
@@ -277,7 +277,7 @@
 
         // Create the phone since we can not find it in CallManager
         try {
-            SipManager.getInstance(this).open(p);
+            SipManager.newInstance(this).open(p);
             Phone phone = PhoneFactory.makeSipPhone(p.getUriString());
             if (phone != null) {
                 cm.registerPhone(phone);
diff --git a/src/com/android/phone/sip/SipSettings.java b/src/com/android/phone/sip/SipSettings.java
index 10ccdd3..e638514 100644
--- a/src/com/android/phone/sip/SipSettings.java
+++ b/src/com/android/phone/sip/SipSettings.java
@@ -146,7 +146,7 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        mSipManager = SipManager.getInstance(SipSettings.this);
+        mSipManager = SipManager.newInstance(SipSettings.this);
         mSipSharedPreferences = new SipSharedPreferences(this);
         mPackageManager = getPackageManager();
         setContentView(R.layout.sip_settings_ui);
@@ -329,7 +329,7 @@
     private void registerProfile(SipProfile profile) {
         if (profile != null) {
             try {
-                mSipManager.open(profile, SipManager.SIP_INCOMING_CALL_ACTION,
+                mSipManager.open(profile, SipManager.ACTION_SIP_INCOMING_CALL,
                         createRegistrationListener());
             } catch (Exception e) {
                 Log.e(TAG, "register failed", e);