Wi-Fi DPP code refine
1. call Activity#setResult only for RESULT_OK case 2. refine @VisibleForTesting usage remove redundant assignment otherwise = PRIVATE set all @VisibleForTesting annotated methods package scope 3. rename WifiQrCode#SECURITY_WPA to WifiQrCode#SECURITY_WPA_PSK Bug: 120645817 Test: atest WifiQrCodeTest atest WifiDppConfiguratorActivityTest atest WifiDppEnrolleeActivityTest atest WifiDppQrCodeGeneratorFragmentTest atest WifiDppQrCodeScannerFragmentTest atest WifiNetworkListFragmentTest atest WifiDppChooseSavedWifiNetworkFragmentTest Change-Id: Id5de7eadc73185716422fc0d197f82bdd025ce45
This commit is contained in:
@@ -63,7 +63,11 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
|
||||
mButtonLeft.setText(R.string.wifi_dpp_add_another_device);
|
||||
mButtonLeft.setOnClickListener(v -> getFragmentManager().popBackStack());
|
||||
mButtonRight.setText(R.string.done);
|
||||
mButtonRight.setOnClickListener(v -> getActivity().finish());
|
||||
mButtonRight.setOnClickListener(v -> {
|
||||
final Activity activity = getActivity();
|
||||
activity.setResult(Activity.RESULT_OK);
|
||||
activity.finish();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,10 +142,7 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
|
||||
|
||||
mButtonLeft = view.findViewById(R.id.button_left);
|
||||
mButtonLeft.setText(R.string.cancel);
|
||||
mButtonLeft.setOnClickListener(v -> {
|
||||
getActivity().setResult(Activity.RESULT_CANCELED);
|
||||
getActivity().finish();
|
||||
});
|
||||
mButtonLeft.setOnClickListener(v -> getActivity().finish());
|
||||
|
||||
mButtonRight = view.findViewById(R.id.button_right);
|
||||
mButtonRight.setText(R.string.wifi_dpp_share_wifi);
|
||||
|
Reference in New Issue
Block a user