Mms: Fix SMS is not sent in ECBM unless click send again
When clicking "yes" button on "Emergency Callback Mode" dialog,
EmergencyCallbackModeExitDialog.onDismiss() function will be called
and set the "exit_ecm_result" to false. Thus, after back to
ComposeMessageActivity, the message can't be sent.
Change to listen the AlertDialog's onCancel event instead.
Change-Id: Icf2e9a4b5e80c7901b0842c13c12a2dded28f50e
diff --git a/src/com/android/phone/EmergencyCallbackModeExitDialog.java b/src/com/android/phone/EmergencyCallbackModeExitDialog.java
index f5509b9..765c52d 100644
--- a/src/com/android/phone/EmergencyCallbackModeExitDialog.java
+++ b/src/com/android/phone/EmergencyCallbackModeExitDialog.java
@@ -24,7 +24,7 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
-import android.content.DialogInterface.OnDismissListener;
+import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
@@ -48,7 +48,7 @@
*
* @see EmergencyCallbackModeService
*/
-public class EmergencyCallbackModeExitDialog extends Activity implements OnDismissListener {
+public class EmergencyCallbackModeExitDialog extends Activity implements OnCancelListener {
private static final String TAG = "EmergencyCallbackMode";
@@ -246,7 +246,7 @@
finish();
}
}).create();
- mAlertDialog.setOnDismissListener(this);
+ mAlertDialog.setOnCancelListener(this);
return mAlertDialog;
case EXIT_ECM_IN_EMERGENCY_CALL_DIALOG:
@@ -263,7 +263,7 @@
finish();
}
}).create();
- mAlertDialog.setOnDismissListener(this);
+ mAlertDialog.setOnCancelListener(this);
return mAlertDialog;
case EXIT_ECM_PROGRESS_DIALOG:
@@ -299,10 +299,10 @@
}
/**
- * Closes activity when dialog is dismissed
+ * Closes activity when dialog is canceled
*/
@Override
- public void onDismiss(DialogInterface dialog) {
+ public void onCancel(DialogInterface dialog) {
EmergencyCallbackModeExitDialog.this.setResult(RESULT_OK, (new Intent())
.putExtra(EXTRA_EXIT_ECM_RESULT, false));
finish();