[Wi-Fi] Fix check mark button when edit the password of a secured network.
Should handle WifiConfigUiBase#dispatchSubmit() for check mark button events.
Bug: 152144169
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ConfigureWifiEntryFragmentTest
make RunSettingsRoboTests ROBOTEST_FILTER=ConfigureAccessPointFragmentTest
Change-Id: I35cbc1cdd6fbef3fd51aaa8dec94722e4155b7f4
diff --git a/src/com/android/settings/wifi/ConfigureAccessPointFragment.java b/src/com/android/settings/wifi/ConfigureAccessPointFragment.java
index a3090a8..3ada986 100644
--- a/src/com/android/settings/wifi/ConfigureAccessPointFragment.java
+++ b/src/com/android/settings/wifi/ConfigureAccessPointFragment.java
@@ -27,12 +27,12 @@
import android.view.ViewGroup;
import android.widget.Button;
+import androidx.annotation.VisibleForTesting;
+
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
import com.android.settingslib.wifi.AccessPoint;
-import androidx.annotation.VisibleForTesting;
-
/**
* Detail page for configuring Wi-Fi network.
*
@@ -113,7 +113,7 @@
@Override
public void dispatchSubmit() {
- // Do nothing
+ handleSubmitAction();
}
@Override
diff --git a/src/com/android/settings/wifi/ConfigureWifiEntryFragment.java b/src/com/android/settings/wifi/ConfigureWifiEntryFragment.java
index 23971e7..7655840 100644
--- a/src/com/android/settings/wifi/ConfigureWifiEntryFragment.java
+++ b/src/com/android/settings/wifi/ConfigureWifiEntryFragment.java
@@ -148,7 +148,7 @@
@Override
public void dispatchSubmit() {
- // Do nothing
+ handleSubmitAction();
}
@Override
diff --git a/tests/robotests/src/com/android/settings/wifi/ConfigureAccessPointFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/ConfigureAccessPointFragmentTest.java
index 5a12a88..1189760 100644
--- a/tests/robotests/src/com/android/settings/wifi/ConfigureAccessPointFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/ConfigureAccessPointFragmentTest.java
@@ -85,6 +85,13 @@
}
@Test
+ public void dispatchSubmit_shouldHandleSubmitAction() {
+ mConfigureAccessPointFragment.dispatchSubmit();
+
+ verify(mConfigureAccessPointFragment).handleSubmitAction();
+ }
+
+ @Test
public void onClickCancelButton_shouldHandleCancelAction() {
mConfigureAccessPointFragment.getCancelButton().performClick();
diff --git a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java
index ce9d10c..27517e8 100644
--- a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java
@@ -89,6 +89,13 @@
}
@Test
+ public void dispatchSubmit_shouldHandleSubmitAction() {
+ mConfigureWifiEntryFragment.dispatchSubmit();
+
+ verify(mConfigureWifiEntryFragment).handleSubmitAction();
+ }
+
+ @Test
public void onClickCancelButton_shouldHandleCancelAction() {
mConfigureWifiEntryFragment.getCancelButton().performClick();