am 1ca1b441: merge from open-source master

Merge commit '1ca1b441b65d55659e2553540f9b75b9749d7fde' into kraken

* commit '1ca1b441b65d55659e2553540f9b75b9749d7fde':
  Removed calls to deprecated APIs and unused imports
  Look at mNumber instead of mName when deciding whether to add or edit a fixed dialling list entry
diff --git a/src/com/android/phone/DeleteFdnContactScreen.java b/src/com/android/phone/DeleteFdnContactScreen.java
index 98b5e64..b030d87 100644
--- a/src/com/android/phone/DeleteFdnContactScreen.java
+++ b/src/com/android/phone/DeleteFdnContactScreen.java
@@ -93,16 +93,20 @@
         mName =  intent.getStringExtra(INTENT_EXTRA_NAME);
         mNumber =  intent.getStringExtra(INTENT_EXTRA_NUMBER);
 
-        if (TextUtils.isEmpty(mName)) {
+        if (TextUtils.isEmpty(mNumber)) {
             finish();
         }
     }
 
     private void deleteContact() {
         StringBuilder buf = new StringBuilder();
-        buf.append("tag='");
-        buf.append(mName);
-        buf.append("' AND number='");
+        if (TextUtils.isEmpty(mName)) {
+            buf.append("number='");
+        } else {
+            buf.append("tag='");
+            buf.append(mName);
+            buf.append("' AND number='");
+        }
         buf.append(mNumber);
         buf.append("' AND pin2='");
         buf.append(mPin2);
diff --git a/src/com/android/phone/EditFdnContactScreen.java b/src/com/android/phone/EditFdnContactScreen.java
index 562a240..9c6c97e 100644
--- a/src/com/android/phone/EditFdnContactScreen.java
+++ b/src/com/android/phone/EditFdnContactScreen.java
@@ -205,9 +205,7 @@
         mName =  intent.getStringExtra(INTENT_EXTRA_NAME);
         mNumber =  intent.getStringExtra(INTENT_EXTRA_NUMBER);
 
-        if (TextUtils.isEmpty(mName) && TextUtils.isEmpty(mNumber)) {
-            mAddContact = true;
-        }
+        mAddContact = TextUtils.isEmpty(mNumber);
     }
 
     /**
diff --git a/src/com/android/phone/EditPhoneNumberPreference.java b/src/com/android/phone/EditPhoneNumberPreference.java
index 47011d3..79295c6 100644
--- a/src/com/android/phone/EditPhoneNumberPreference.java
+++ b/src/com/android/phone/EditPhoneNumberPreference.java
@@ -187,7 +187,7 @@
     @Override
     protected void onBindDialogView(View view) {
         // default the button clicked to be the cancel button.
-        mButtonClicked = DialogInterface.BUTTON2;
+        mButtonClicked = DialogInterface.BUTTON_NEGATIVE;
 
         super.onBindDialogView(view);
 
@@ -307,7 +307,7 @@
     @Override
     public void onClick(DialogInterface dialog, int which) {
         // The neutral button (button3) is always the toggle.
-        if ((mConfirmationMode == CM_ACTIVATION) && (which == DialogInterface.BUTTON3)) {
+        if ((mConfirmationMode == CM_ACTIVATION) && (which == DialogInterface.BUTTON_NEUTRAL)) {
             //flip the toggle if we are in the correct mode.
             setToggled(!isToggled());
         }
@@ -321,8 +321,8 @@
     // phone numbers and calling the close action listener.
     protected void onDialogClosed(boolean positiveResult) {
         // A positive result is technically either button1 or button3.
-        if ((mButtonClicked == DialogInterface.BUTTON1) ||
-                (mButtonClicked == DialogInterface.BUTTON3)){
+        if ((mButtonClicked == DialogInterface.BUTTON_POSITIVE) ||
+                (mButtonClicked == DialogInterface.BUTTON_NEUTRAL)){
             setPhoneNumber(getEditText().getText().toString());
             super.onDialogClosed(positiveResult);
             setText(getStringValue());
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index f121516..aab89ff 100755
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -1025,10 +1025,10 @@
                     new DialogInterface.OnClickListener() {
                         public void onClick(DialogInterface dialog, int whichButton) {
                             switch (whichButton) {
-                                case DialogInterface.BUTTON1:
+                                case DialogInterface.BUTTON_POSITIVE:
                                     phone.sendUssdResponse(inputText.getText().toString());
                                     break;
-                                case DialogInterface.BUTTON2:
+                                case DialogInterface.BUTTON_NEGATIVE:
                                     if (mmiCode.isCancelable()) {
                                         mmiCode.cancel();
                                     }
diff --git a/src/com/android/phone/Settings.java b/src/com/android/phone/Settings.java
index 8c4c1e9..de54658 100644
--- a/src/com/android/phone/Settings.java
+++ b/src/com/android/phone/Settings.java
@@ -84,7 +84,7 @@
     //This is a method implemented for DialogInterface.OnClickListener.
     //  Used to dismiss the dialogs when they come up.
     public void onClick(DialogInterface dialog, int which) {
-        if (which == DialogInterface.BUTTON1) {
+        if (which == DialogInterface.BUTTON_POSITIVE) {
             mPhone.setDataRoamingEnabled(true);
             mOkClicked = true;
         } else {