[Wi-Fi] Add a new intent handler process for adding new networks panel page.
For the R feature "Add saved networks to the device for apps", need to handle the new intent case to update the content to be the specific networks in the new intent. Bug: 146105504 Test: Add following unit test case to check if UI list had been updated: getThreeNetworksNewIntent_shouldHaveThreeItemsInUiList. Change-Id: Id043fabb16ba5a75aa81be8cacd403e62e5268b8
This commit is contained in:
@@ -129,8 +129,7 @@ public class AddAppNetworksFragmentTest {
|
||||
mAddAppNetworksFragment.mResultCodeArrayList = mFakedResultArrayList;
|
||||
|
||||
// Act
|
||||
mAddAppNetworksFragment.mUiToRequestedList = mAddAppNetworksFragment.filterSavedNetworks(
|
||||
mFakeSavedNetworksList);
|
||||
mAddAppNetworksFragment.filterSavedNetworks(mFakeSavedNetworksList);
|
||||
|
||||
// Assert
|
||||
assertThat(mAddAppNetworksFragment.mUiToRequestedList).hasSize(1);
|
||||
@@ -146,6 +145,23 @@ public class AddAppNetworksFragmentTest {
|
||||
SettingsEnums.PANEL_ADD_WIFI_NETWORKS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getThreeNetworksNewIntent_shouldHaveThreeItemsInUiList() {
|
||||
addOneSpecifiedNetworkConfig(mNewWpaConfigEntry);
|
||||
setUpBundle(mFakedSpecifiedNetworksList);
|
||||
setupFragment();
|
||||
|
||||
// Add two more networks and update framework bundle.
|
||||
addOneSpecifiedNetworkConfig(mNewWpaConfigEntry);
|
||||
addOneSpecifiedNetworkConfig(mNewOpenConfigEntry);
|
||||
setUpBundle(mFakedSpecifiedNetworksList);
|
||||
Bundle bundle = mAddAppNetworksFragment.getArguments();
|
||||
mAddAppNetworksFragment.createContent(bundle);
|
||||
|
||||
// Ui list should contain 3 networks.
|
||||
assertThat(mAddAppNetworksFragment.mUiToRequestedList).hasSize(3);
|
||||
}
|
||||
|
||||
private void addOneSavedNetworkConfig(@NonNull WifiConfiguration wifiConfiguration) {
|
||||
if (mFakeSavedNetworksList == null) {
|
||||
mFakeSavedNetworksList = new ArrayList<>();
|
||||
|
Reference in New Issue
Block a user