Dialer: WFC UI requiment: Notification and Dialog for network

If under no available network situation that will show a notification
and dialog, user will come into WIFI settings menu by the positive
button which in the dialog.

Calling by WFC, if there is no available network and already have
ACCESS_COARSE_LOCATION permission, show those.

Change-Id: I9a2da86f3575c7d7670167fbf66756ce221b8ae9
CRs-Fixed: 1081377
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 48d49af..98d9dc6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1160,7 +1160,8 @@
     <string name="call_data_info_description">Voice call usage time and data usage time</string>
     <string name="alert_call_over_wifi">Calls will be made over Wi-Fi.</string>
     <string name="alert_call_no_cellular_coverage">No cellular network available. Connect to available Wi-Fi to make calls.</string>
-    <string name="alert_user_connect_to_wifi_for_call">Connect to Wi-Fi to make calls.</string>
+    <string name="alert_user_connect_to_wifi_for_call">Connect to Wi-Fi to make calls</string>
+    <string name="alert_user_connect_to_wifi_for_call_text">Tap here to view available networks</string>
     <string name="missing_account_type">(No type)</string>
     <string name="missing_account_name">(No name)</string>
 </resources>
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 8dab294..50b4077 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -2020,6 +2020,7 @@
         } else {
             if(WifiCallUtils.shallShowWifiCallDialog(getActivity())) {
                  WifiCallUtils.showWifiCallDialog(getActivity());
+                 WifiCallUtils.showWifiCallNotification(getActivity());
              } else {
                  getView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
                  handleDialButtonPressed();
diff --git a/src/com/android/dialer/util/WifiCallUtils.java b/src/com/android/dialer/util/WifiCallUtils.java
index 0aa9a43..5e789ed 100644
--- a/src/com/android/dialer/util/WifiCallUtils.java
+++ b/src/com/android/dialer/util/WifiCallUtils.java
@@ -149,16 +149,13 @@
 
     public static void showWifiCallDialog(final Context context) {
         String promptMessage = context.getString(com.android.dialer.R.string
-                .alert_call_no_cellular_coverage) +"\n"+ context.getString(com.android.dialer.R
-                        .string.alert_user_connect_to_wifi_for_call);
+                .alert_call_no_cellular_coverage);
         AlertDialog.Builder diaBuilder = new AlertDialog.Builder(context);
         diaBuilder.setMessage(promptMessage);
         diaBuilder.setPositiveButton(com.android.internal.R.string.ok, new OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int which) {
-                Intent intent = new Intent(Intent.ACTION_MAIN);
-                intent.setClassName("com.qualcomm.qti.extsettings",
-                        "com.qualcomm.qti.extsettings.wificall.WifiCallingEnhancedSettings");
+                Intent intent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS);
                 context.startActivity(intent);
             }
         });
@@ -211,16 +208,18 @@
             builder.setAutoCancel(true);
             builder.setSmallIcon(R.drawable.wifi_calling_on_notification);
             builder.setContentTitle(
-                    context.getResources().getString(R.string.alert_user_connect_to_wifi_for_call));
+                    context.getResources().getString(
+                        R.string.alert_user_connect_to_wifi_for_call));
             builder.setContentText(
-                    context.getResources().getString(R.string.alert_user_connect_to_wifi_for_call));
+                    context.getResources().getString(
+                        R.string.alert_user_connect_to_wifi_for_call_text));
             notiManager.notify(NOTIFICATION_WIFI_CALL_ID, builder.build());
             new Handler().postDelayed(new Runnable() {
                     @Override
                     public void run() {
                         notiManager.cancel(NOTIFICATION_WIFI_CALL_ID);
                     }
-           }, 2000);
+           }, 5000);
         }
     }
 }