diff --git a/src/com/android/phone/CallMonitorServiceProxy.java b/src/com/android/phone/CallHandlerServiceProxy.java
similarity index 76%
rename from src/com/android/phone/CallMonitorServiceProxy.java
rename to src/com/android/phone/CallHandlerServiceProxy.java
index 8339bba..cb1e188 100644
--- a/src/com/android/phone/CallMonitorServiceProxy.java
+++ b/src/com/android/phone/CallHandlerServiceProxy.java
@@ -28,15 +28,15 @@
 import android.os.SystemProperties;
 import android.util.Log;
 
-import com.android.services.telephony.common.ICallMonitorService;
+import com.android.services.telephony.common.ICallHandlerService;
 import com.android.services.telephony.common.ICallCommandService;
 
 /**
- * This class is responsible for passing through call state changes to the CallMonitorService.
+ * This class is responsible for passing through call state changes to the CallHandlerService.
  */
-public class CallMonitorServiceProxy extends Handler {
+public class CallHandlerServiceProxy extends Handler {
 
-    private static final String TAG = CallMonitorServiceProxy.class.getSimpleName();
+    private static final String TAG = CallHandlerServiceProxy.class.getSimpleName();
     private static final boolean DBG =
             (PhoneGlobals.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
     private static final boolean VDBG = (PhoneGlobals.DBG_LEVEL >= 2);
@@ -44,10 +44,10 @@
     private Context mContext;
     private CallStateMonitor mCallStateMonitor;
     private ServiceConnection mConnection;
-    private ICallMonitorService mCallMonitorService;
+    private ICallHandlerService mCallHandlerService;
     private CallCommandService mCallCommandService;
 
-    public CallMonitorServiceProxy(Context context, CallStateMonitor callStateMonitor,
+    public CallHandlerServiceProxy(Context context, CallStateMonitor callStateMonitor,
             CallCommandService callCommandService) {
         mContext = context;
         mCallStateMonitor = callStateMonitor;
@@ -71,7 +71,7 @@
     }
 
     /**
-     * Sets up the connection with ICallMonitorService
+     * Sets up the connection with ICallHandlerService
      */
     private void setupServiceConnection() {
         mConnection = new ServiceConnection() {
@@ -80,31 +80,31 @@
                 if (DBG) {
                     Log.d(TAG, "Service Connected");
                 }
-                onCallMonitorServiceConnected(ICallMonitorService.Stub.asInterface(service));
+                onCallHandlerServiceConnected(ICallHandlerService.Stub.asInterface(service));
             }
 
             @Override
             public void onServiceDisconnected(ComponentName className) {
-                mCallMonitorService = null;
+                mCallHandlerService = null;
             }
         };
 
-        Intent serviceIntent = new Intent(ICallMonitorService.class.getName());
+        Intent serviceIntent = new Intent(ICallHandlerService.class.getName());
         if (!mContext.bindService(serviceIntent, mConnection, Context.BIND_AUTO_CREATE)) {
-            Log.e(TAG, "Cound not bind to ICallMonitorService");
+            Log.e(TAG, "Cound not bind to ICallHandlerService");
         }
     }
 
     /**
      * Called when the in-call UI service is connected.  Send command interface to in-call.
      */
-    private void onCallMonitorServiceConnected(ICallMonitorService callMonitorService) {
-        mCallMonitorService = callMonitorService;
+    private void onCallHandlerServiceConnected(ICallHandlerService CallHandlerService) {
+        mCallHandlerService = CallHandlerService;
 
         try {
-            mCallMonitorService.setCallCommandService(mCallCommandService);
+            mCallHandlerService.setCallCommandService(mCallCommandService);
         } catch (RemoteException e) {
-            Log.e(TAG, "Remote exception calling CallMonitorService::onConnected. " + e);
+            Log.e(TAG, "Remote exception calling CallHandlerService::onConnected. " + e);
         }
     }
 
@@ -112,9 +112,9 @@
      * Send notification of a new incoming call.
      */
     private void onNewRingingConnection(AsyncResult result) {
-        if (mCallMonitorService != null) {
+        if (mCallHandlerService != null) {
             try {
-                mCallMonitorService.onIncomingCall(0);
+                mCallHandlerService.onIncomingCall(0);
             } catch (RemoteException e) {
                 Log.e(TAG, "Remote exception handling onIncomingCall:" + e);
             }
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index e4989dc..6cc687d 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -172,7 +172,7 @@
     PhoneInterfaceManager phoneMgr;
     CallManager mCM;
     CallStateMonitor callStateMonitor;
-    CallMonitorServiceProxy callMonitorServiceProxy;
+    CallHandlerServiceProxy CallHandlerServiceProxy;
     CallCommandService callCommandService;
     int mBluetoothHeadsetState = BluetoothProfile.STATE_DISCONNECTED;
     int mBluetoothHeadsetAudioState = BluetoothHeadset.STATE_AUDIO_DISCONNECTED;
@@ -542,7 +542,7 @@
             callCommandService = new CallCommandService(mCM);
 
             // Sends call state to the UI
-            callMonitorServiceProxy = new CallMonitorServiceProxy(this, callStateMonitor,
+            CallHandlerServiceProxy = new CallHandlerServiceProxy(this, callStateMonitor,
                     callCommandService);
 
             // Create the CallNotifer singleton, which handles
