Fix "Add Network" button on SavedAccessPoints page.

Fix merge conflict.

The old onSubmit was a no-op. It now correctly pipes onSubmit to
WifiManager#save() with the new WifiConfiguration. On successful save,
it displays the new network in the list, and on failure, it displays a
toast indicating that the save action failed. Adds a test for the
WifiDialog behaviors on this page.

Bug: 66177765
Test: make RunSettingsRoboTests, manual - tested with Wifi enabled and
disabled, and with networks that were visible and not.
Change-Id: I27446aa49bc9efaf1ea1d6c6158928b62ce01ba2
This commit is contained in:
Eric Schwarzenbach
2017-09-20 16:34:23 -07:00
parent 0e680b3cfd
commit c03bd8f86f
3 changed files with 59 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
package com.android.settings.wrapper;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
/**
@@ -37,9 +38,16 @@ public class WifiManagerWrapper {
}
/**
* {@link WifiManager#removePasspointConfiguration}
* {@link WifiManager#forget}
*/
public void forget(int netId, WifiManager.ActionListener listener) {
mWifiManager.forget(netId, listener);
}
/**
* {@link WifiManager#save}
*/
public void save(WifiConfiguration config, WifiManager.ActionListener listener) {
mWifiManager.save(config, listener);
}
}