use of android.net.wifi.p2p.WifiP2pGroup in project android_packages_apps_Settings by LineageOS.
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 SudaMod.
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 Resurrection_packages_apps_Settings by ResurrectionRemix.
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 robolectric by robolectric.
the class ShadowWifiP2pManagerTest method requestGroupInfo.
@Test
public void requestGroupInfo() {
TestGroupInfoListener listener = new TestGroupInfoListener();
WifiP2pGroup wifiP2pGroup = new WifiP2pGroup();
shadowOf(wifiP2pGroup).setInterface("ssid");
shadowOf(wifiP2pGroup).setPassphrase("passphrase");
shadowOf(wifiP2pGroup).setNetworkName("networkname");
shadowManager.setGroupInfo(channel, wifiP2pGroup);
manager.requestGroupInfo(channel, listener);
shadowMainLooper().idle();
assertThat(listener.group.getNetworkName()).isEqualTo(wifiP2pGroup.getNetworkName());
assertThat(listener.group.getInterface()).isEqualTo(wifiP2pGroup.getInterface());
assertThat(listener.group.getPassphrase()).isEqualTo(wifiP2pGroup.getPassphrase());
}
use of android.net.wifi.p2p.WifiP2pGroup in project robolectric by robolectric.
the class ShadowWifiP2pManagerTest method requestGroupInfo_nullListener.
@Test
public void requestGroupInfo_nullListener() {
WifiP2pGroup wifiP2pGroup = new WifiP2pGroup();
shadowManager.setGroupInfo(channel, wifiP2pGroup);
manager.requestGroupInfo(channel, null);
// Should not fail with a null listener
}
Aggregations