From 91c90d131e3aac91143406783851c225fdca8916 Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Wed, 2 Jul 2014 11:08:59 -0700 Subject: Make use of PhoneManager.handlePinMmi() in dialer. Change-Id: I00a935860c218ec3744ed26265bce2988ef39560 --- src/com/android/dialer/SpecialCharSequenceMgr.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java index 9d622aa16..4a6e4b289 100644 --- a/src/com/android/dialer/SpecialCharSequenceMgr.java +++ b/src/com/android/dialer/SpecialCharSequenceMgr.java @@ -20,7 +20,6 @@ import android.app.AlertDialog; import android.app.KeyguardManager; import android.app.ProgressDialog; import android.content.ActivityNotFoundException; -import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; @@ -28,8 +27,7 @@ import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Looper; -import android.os.RemoteException; -import android.os.ServiceManager; +import android.phone.PhoneManager; import android.provider.Settings; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; @@ -39,7 +37,6 @@ import android.widget.EditText; import android.widget.Toast; import com.android.contacts.common.database.NoNullCursorAsyncQueryHandler; -import com.android.internal.telephony.ITelephony; /** * Helper class to listen for some magic character sequences @@ -228,13 +225,9 @@ public class SpecialCharSequenceMgr { static boolean handlePinEntry(Context context, String input) { if ((input.startsWith("**04") || input.startsWith("**05")) && input.endsWith("#")) { - try { - return ITelephony.Stub.asInterface(ServiceManager.getService("phone")) - .handlePinMmi(input); - } catch (RemoteException e) { - Log.e(TAG, "Failed to handlePinMmi due to remote exception"); - return false; - } + PhoneManager phoneManager = + (PhoneManager) context.getSystemService(Context.PHONE_SERVICE); + return phoneManager.handlePinMmi(input); } return false; } -- cgit v1.2.3