IMS-VT: Change in position and color of Alert Dialog action buttons.

Swaps the position of action buttons in low battery alert dialog and
changes the color.

Change-Id: I8d0eb20c3ca45c6ba9182c23e8bb2229788b8343
CRs-Fixed: 1089584
diff --git a/InCallUI/src/com/android/incallui/InCallLowBatteryListener.java b/InCallUI/src/com/android/incallui/InCallLowBatteryListener.java
index bdc46e1..c413b07 100644
--- a/InCallUI/src/com/android/incallui/InCallLowBatteryListener.java
+++ b/InCallUI/src/com/android/incallui/InCallLowBatteryListener.java
@@ -30,6 +30,7 @@
 package com.android.incallui;
 
 import android.app.AlertDialog;
+import android.graphics.Color;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.DialogInterface.OnCancelListener;
@@ -401,7 +402,7 @@
         });
 
         if (VideoUtils.isIncomingVideoCall(call)) {
-            alertDialog.setNegativeButton(R.string.low_battery_convert, new OnClickListener() {
+            alertDialog.setPositiveButton(R.string.low_battery_convert, new OnClickListener() {
                 @Override
                 public void onClick(DialogInterface dialog, int which) {
                      Log.d(this, "displayLowBatteryAlert answer as Voice Call");
@@ -411,7 +412,7 @@
             });
 
             alertDialog.setMessage(R.string.low_battery_msg);
-            alertDialog.setPositiveButton(R.string.low_battery_yes, new OnClickListener() {
+            alertDialog.setNegativeButton(R.string.low_battery_yes, new OnClickListener() {
                 @Override
                 public void onClick(DialogInterface dialog, int which) {
                      Log.d(this, "displayLowBatteryAlert answer as Video Call");
@@ -420,7 +421,7 @@
                 }
             });
         } else if (VideoUtils.isOutgoingVideoCall(call)) {
-            alertDialog.setNegativeButton(R.string.low_battery_convert, new OnClickListener() {
+            alertDialog.setPositiveButton(R.string.low_battery_convert, new OnClickListener() {
                 @Override
                 public void onClick(DialogInterface dialog, int which) {
                      Log.d(this, "displayLowBatteryAlert place Voice Call");
@@ -437,7 +438,7 @@
             });
 
             alertDialog.setMessage(R.string.low_battery_msg);
-            alertDialog.setPositiveButton(R.string.low_battery_yes, new OnClickListener() {
+            alertDialog.setNegativeButton(R.string.low_battery_yes, new OnClickListener() {
                 @Override
                 public void onClick(DialogInterface dialog, int which) {
                      Log.d(this, "displayLowBatteryAlert place Video Call");
@@ -453,8 +454,8 @@
             if (QtiCallUtils.hasVoiceCapabilities(call)) {
                 //active video call can be downgraded to voice
                 alertDialog.setMessage(R.string.low_battery_msg);
-                alertDialog.setPositiveButton(R.string.low_battery_yes, null);
-                alertDialog.setNegativeButton(R.string.low_battery_convert, new OnClickListener() {
+                alertDialog.setNegativeButton(R.string.low_battery_yes, null);
+                alertDialog.setPositiveButton(R.string.low_battery_convert, new OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         Log.d(this, "displayLowBatteryAlert downgrading to voice call");
@@ -465,8 +466,8 @@
                 /* video call doesn't have downgrade capabilities, so alert the user
                    with a hangup dialog*/
                 alertDialog.setMessage(R.string.low_battery_hangup_msg);
-                alertDialog.setNegativeButton(R.string.low_battery_no, null);
-                alertDialog.setPositiveButton(R.string.low_battery_yes, new OnClickListener() {
+                alertDialog.setPositiveButton(R.string.low_battery_no, null);
+                alertDialog.setNegativeButton(R.string.low_battery_yes, new OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         Log.d(this, "displayLowBatteryAlert hanging up the call: " + call);
@@ -495,6 +496,11 @@
         mAlert.setCanceledOnTouchOutside(false);
         mAlert.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
         mAlert.show();
+        /*
+         * By default both the buttons will have same color. In case we want to have different color
+         * we need to set specifically.
+         */
+        mAlert.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(Color.BLACK);
     }
 
     /*