Remove unused IExtendedNetworkService support

It was used in the cupcake era for docomo, and not used anymore.

Bug 7633569

Change-Id: I658bd5bd2f4d8d298a81d31a6b0b97ed1ccb7337
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 1d4061a..5fe6566 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -21,11 +21,9 @@
 import android.app.ProgressDialog;
 import android.bluetooth.IBluetoothHeadsetPhone;
 import android.content.ActivityNotFoundException;
-import android.content.ComponentName;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
-import android.content.ServiceConnection;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.res.Configuration;
@@ -34,13 +32,10 @@
 import android.net.Uri;
 import android.net.sip.SipManager;
 import android.os.AsyncResult;
-import android.os.AsyncTask;
 import android.os.Handler;
-import android.os.IBinder;
 import android.os.Message;
 import android.os.RemoteException;
 import android.os.SystemProperties;
-import android.provider.ContactsContract;
 import android.provider.Settings;
 import android.telephony.PhoneNumberUtils;
 import android.text.TextUtils;
@@ -58,7 +53,6 @@
 import com.android.internal.telephony.CallerInfo;
 import com.android.internal.telephony.CallerInfoAsyncQuery;
 import com.android.internal.telephony.Connection;
-import com.android.internal.telephony.IExtendedNetworkService;
 import com.android.internal.telephony.MmiCode;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
@@ -117,11 +111,6 @@
     /** Define for not a special CNAP string */
     private static final int CNAP_SPECIAL_CASE_NO = -1;
 
-    // Extended network service interface instance
-    private static IExtendedNetworkService mNwService = null;
-    // used to cancel MMI command after 15 seconds timeout for NWService requirement
-    private static Message mMmiTimeoutCbMsg = null;
-
     /** Noise suppression status as selected by user */
     private static boolean sIsNoiseSuppressionEnabled = true;
 
@@ -201,19 +190,6 @@
         }
     }
 
-
-    private static ServiceConnection ExtendedNetworkServiceConnection = new ServiceConnection() {
-        public void onServiceConnected(ComponentName name, IBinder iBinder) {
-            if (DBG) log("Extended NW onServiceConnected");
-            mNwService = IExtendedNetworkService.Stub.asInterface(iBinder);
-        }
-
-        public void onServiceDisconnected(ComponentName arg0) {
-            if (DBG) log("Extended NW onServiceDisconnected");
-            mNwService = null;
-        }
-    };
-
     /**
      * Register the ConnectionHandler with the phone, to receive connection events
      */
@@ -224,11 +200,6 @@
 
         // pass over cm as user.obj
         cm.registerForPreciseCallStateChanged(mConnectionHandler, PHONE_STATE_CHANGED, cm);
-        // Extended NW service
-        Intent intent = new Intent("com.android.ussd.IExtendedNetworkService");
-        cm.getDefaultPhone().getContext().bindService(intent,
-                ExtendedNetworkServiceConnection, Context.BIND_AUTO_CREATE);
-        if (DBG) log("Extended NW bindService IExtendedNetworkService");
 
     }
 
@@ -673,15 +644,6 @@
             if (phoneType == PhoneConstants.PHONE_TYPE_GSM && gatewayUri == null) {
                 if (DBG) log("dialed MMI code: " + number);
                 status = CALL_STATUS_DIALED_MMI;
-                // Set dialed MMI command to service
-                if (mNwService != null) {
-                    try {
-                        mNwService.setMmiString(number);
-                        if (DBG) log("Extended NW bindService setUssdString (" + number + ")");
-                    } catch (RemoteException e) {
-                        mNwService = null;
-                    }
-                }
             } else {
                 status = CALL_STATUS_FAILED;
             }
@@ -943,36 +905,6 @@
         //
         // Anything that is NOT a USSD request is a normal MMI request,
         // which will bring up a toast (desribed above).
-        // Optional code for Extended USSD running prompt
-        if (mNwService != null) {
-            if (DBG) log("running USSD code, displaying indeterminate progress.");
-            // create the indeterminate progress dialog and display it.
-            ProgressDialog pd = new ProgressDialog(context);
-            CharSequence textmsg = "";
-            try {
-                textmsg = mNwService.getMmiRunningText();
-
-            } catch (RemoteException e) {
-                mNwService = null;
-                textmsg = context.getText(R.string.ussdRunning);
-            }
-            if (DBG) log("Extended NW displayMMIInitiate (" + textmsg + ")");
-            pd.setMessage(textmsg);
-            pd.setCancelable(false);
-            pd.setIndeterminate(true);
-            pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND
-                    | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-            pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
-            pd.show();
-            // trigger a 15 seconds timeout to clear this progress dialog
-            mMmiTimeoutCbMsg = buttonCallbackMessage;
-            try {
-                mMmiTimeoutCbMsg.getTarget().sendMessageDelayed(buttonCallbackMessage, 15000);
-            } catch(NullPointerException e) {
-                mMmiTimeoutCbMsg = null;
-            }
-            return pd;
-        }
 
         boolean isCancelable = (mmiCode != null) && mmiCode.isCancelable();
 
@@ -1016,16 +948,6 @@
         MmiCode.State state = mmiCode.getState();
 
         if (DBG) log("displayMMIComplete: state=" + state);
-        // Clear timeout trigger message
-        if(mMmiTimeoutCbMsg != null) {
-            try{
-                mMmiTimeoutCbMsg.getTarget().removeMessages(mMmiTimeoutCbMsg.what);
-                if (DBG) log("Extended NW displayMMIComplete removeMsg");
-            } catch (NullPointerException e) {
-            }
-            mMmiTimeoutCbMsg = null;
-        }
-
 
         switch (state) {
             case PENDING:
@@ -1094,14 +1016,6 @@
             if (state != MmiCode.State.PENDING) {
                 if (DBG) log("MMI code has finished running.");
 
-                // Replace response message with Extended Mmi wording
-                if (mNwService != null) {
-                    try {
-                        text = mNwService.getUserMessage(text);
-                    } catch (RemoteException e) {
-                        mNwService = null;
-                    }
-                }
                 if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
                 if (text == null || text.length() == 0)
                     return;
@@ -1237,18 +1151,6 @@
                 canceled = true;
             }
         }
-
-        //clear timeout message and pre-set MMI command
-        if (mNwService != null) {
-            try {
-                mNwService.clearMmiString();
-            } catch (RemoteException e) {
-                mNwService = null;
-            }
-        }
-        if (mMmiTimeoutCbMsg != null) {
-            mMmiTimeoutCbMsg = null;
-        }
         return canceled;
     }