Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5742fb6 authored by Yue Liang's avatar Yue Liang Committed by Gerrit - the friendly Code Review server
Browse files

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
parent d1b92db3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1160,7 +1160,8 @@ e mode.</string>
    <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>
+1 −0
Original line number Diff line number Diff line
@@ -2020,6 +2020,7 @@ public class DialpadFragment extends Fragment
        } else {
            if(WifiCallUtils.shallShowWifiCallDialog(getActivity())) {
                 WifiCallUtils.showWifiCallDialog(getActivity());
                 WifiCallUtils.showWifiCallNotification(getActivity());
             } else {
                 getView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
                 handleDialButtonPressed();
+7 −8
Original line number Diff line number Diff line
@@ -149,16 +149,13 @@ public class WifiCallUtils {

    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 @@ public class WifiCallUtils {
            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);
        }
    }
}