Add private dns dialog in wifi settings

This option lives in menu. A dialog will show up once this menu
is clicked.

We reuse most of the logic in go/aog/524415 with the following
updates:
1. Use radioGroup instead of directly control radioButton
2. remove bunch of methods if they are only used once.

Following cl will:
1. Remove this feature in development page
2. Add the help link at the bottom of the dialog
3. Disable "Save" button when hostname is invalid.

Bug: 68030013
Test: add for later

Change-Id: I4c6d359dc9c55675858c20e47953ef677b31c3b5
This commit is contained in:
jackqdyulei
2017-11-08 13:29:23 -08:00
parent d0965a21e4
commit 05cb931a31
8 changed files with 398 additions and 14 deletions

View File

@@ -48,8 +48,11 @@ public class NetworkDashboardFragment extends DashboardFragment implements
MobilePlanPreferenceHost {
private static final String TAG = "NetworkDashboardFrag";
private static final int MENU_NETWORK_RESET = Menu.FIRST;
private static final int MENU_PRIVATE_DNS = Menu.FIRST + 1;
private NetworkResetActionMenuController mNetworkResetController;
private PrivateDnsMenuController mPrivateDnsMenuController;
@Override
public int getMetricsCategory() {
@@ -69,7 +72,9 @@ public class NetworkDashboardFragment extends DashboardFragment implements
@Override
public void onAttach(Context context) {
super.onAttach(context);
mNetworkResetController = new NetworkResetActionMenuController(context);
mNetworkResetController = new NetworkResetActionMenuController(context, MENU_NETWORK_RESET);
mPrivateDnsMenuController = new PrivateDnsMenuController(getFragmentManager(),
MENU_PRIVATE_DNS);
}
@Override
@@ -81,6 +86,7 @@ public class NetworkDashboardFragment extends DashboardFragment implements
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
mNetworkResetController.buildMenuItem(menu);
mPrivateDnsMenuController.buildMenuItem(menu);
}
@Override