OSDN Git Service

API Review PhoneManager -> TelecommManager. Rename methods (3/6)
authorNancy Chen <nancychen@google.com>
Fri, 22 Aug 2014 05:53:05 +0000 (22:53 -0700)
committerNancy Chen <nancychen@google.com>
Fri, 22 Aug 2014 22:12:01 +0000 (15:12 -0700)
PhoneManager
- handlePinMMI docs should explain what a Pin is and what MMI is
- rename isInAPhoneCall to isInCall
- rename showCallScreen to showInCallScreen
- merge this class into TelecommManager, we don't need both

Bug: 16960458

Change-Id: I8285f15747b66fdfad93d203d848d4a62c0f9b2a

src/com/android/settings/CryptKeeper.java

index c2295e6..86e7387 100644 (file)
@@ -37,9 +37,8 @@ import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.os.storage.IMountService;
 import android.os.storage.StorageManager;
-
-import android.phone.PhoneManager;
 import android.provider.Settings;
+import android.telecomm.TelecommManager;
 import android.telephony.TelephonyManager;
 import android.text.Editable;
 import android.text.TextUtils;
@@ -875,7 +874,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
         }
 
         int textId;
-        if (getPhoneManager().isInAPhoneCall()) {
+        if (getTelecommManager().isInCall()) {
             // Show "return to call"
             textId = R.string.cryptkeeper_return_to_call;
         } else {
@@ -889,9 +888,9 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
     }
 
     private void takeEmergencyCallAction() {
-        PhoneManager phoneManager = getPhoneManager();
-        if (phoneManager.isInAPhoneCall()) {
-            phoneManager.showCallScreen(false /* showDialpad */);
+        TelecommManager telecommManager = getTelecommManager();
+        if (telecommManager.isInCall()) {
+            telecommManager.showInCallScreen(false /* showDialpad */);
         } else {
             launchEmergencyDialer();
         }
@@ -910,8 +909,8 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
         return (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
     }
 
-    private PhoneManager getPhoneManager() {
-        return (PhoneManager) getSystemService(Context.PHONE_SERVICE);
+    private TelecommManager getTelecommManager() {
+        return (TelecommManager) getSystemService(Context.TELECOMM_SERVICE);
     }
 
     /**