use of android.net.wifi.p2p.WifiP2pGroup in project android_packages_apps_Settings by omnirom.
the class WifiP2pSettings method onPersistentGroupInfoAvailable.
@Override
public void onPersistentGroupInfoAvailable(WifiP2pGroupList groups) {
mPersistentCategoryController.removeAllChildren();
for (WifiP2pGroup group : groups.getGroupList()) {
if (DBG)
Log.d(TAG, " group " + group);
WifiP2pPersistentGroup wppg = new WifiP2pPersistentGroup(getPrefContext(), group);
mPersistentCategoryController.addChild(wppg);
if (wppg.getGroupName().equals(mSelectedGroupName)) {
if (DBG)
Log.d(TAG, "Selecting group " + wppg.getGroupName());
mSelectedGroup = wppg;
mSelectedGroupName = null;
}
}
if (mSelectedGroupName != null) {
// Looks like there's a dialog pending getting user confirmation to delete the
// selected group. When user hits OK on that dialog, we won't do anything; but we
// shouldn't be in this situation in first place, because these groups are persistent
// groups and they shouldn't just get deleted!
Log.w(TAG, " Selected group " + mSelectedGroupName + " disappered on next query ");
}
}
use of android.net.wifi.p2p.WifiP2pGroup in project android_packages_apps_Settings by omnirom.
the class WifiP2pSettingsTest method persistentController_withNoGroup_shouldBeUnavailable.
@Test
public void persistentController_withNoGroup_shouldBeUnavailable() {
final WifiP2pGroupList wifiP2pGroupList = mock(WifiP2pGroupList.class);
final List<WifiP2pGroup> groupList = new ArrayList<>();
doReturn(groupList).when(wifiP2pGroupList).getGroupList();
mFragment.onPersistentGroupInfoAvailable(wifiP2pGroupList);
assertThat(mFragment.mPersistentCategoryController.isAvailable()).isFalse();
}
Aggregations