Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6b13e2c authored by Mahesh A Saptasagar's avatar Mahesh A Saptasagar Committed by Steve Kondik
Browse files

p2p: Fix for GC unable to scan GO after tear down.

A start of the search is not done on a group removed
broadcast event for mLastGroupFormed being set, which
would result in the Group Client not able to find the
GO , though a p2p_find is issued before a disconnect.
This is due to the fact that supplicant shall notify
the p2p device info only once per p2p_find.

To avoid this remove the conditions that is blocking
the search to happen and issue another p2p_find.

Change-Id: I4abad5c472808f9aa03e644eb1c6a26bfab8a4e6
CRs-Fixed: 504022
parent ecdeb0f7
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ public class WifiP2pSettings extends SettingsPreferenceFragment
    private boolean mWifiP2pSearching;
    private int mConnectedDevices;
    private WifiP2pGroup mConnectedGroup;
    private boolean mLastGroupFormed = false;

    private PreferenceGroup mPeersGroup;
    private PreferenceGroup mPersistentGroup;
@@ -133,12 +132,10 @@ public class WifiP2pSettings extends SettingsPreferenceFragment
                }
                if (networkInfo.isConnected()) {
                    if (DBG) Log.d(TAG, "Connected");
                } else if (mLastGroupFormed != true) {
                } else {
                    //start a search when we are disconnected
                    //but not on group removed broadcast event
                    startSearch();
                }
                mLastGroupFormed = wifip2pinfo.groupFormed;
            } else if (WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION.equals(action)) {
                mThisDevice = (WifiP2pDevice) intent.getParcelableExtra(
                        WifiP2pManager.EXTRA_WIFI_P2P_DEVICE);
@@ -538,7 +535,7 @@ public class WifiP2pSettings extends SettingsPreferenceFragment
    }

    private void startSearch() {
        if (mWifiP2pManager != null && !mWifiP2pSearching) {
        if (mWifiP2pManager != null) {
            mWifiP2pManager.discoverPeers(mChannel, new WifiP2pManager.ActionListener() {
                public void onSuccess() {
                }