Fix NPE when connect timeout
If user click connect button and then receive timeout event after leave detail page, the NPE happened. Ignore the timeout event if activity already gone. Bug: 131141866 Test: manual test Test: make RunSettingsRoboTests -j32 ROBOTEST_FILTER=com.android.settings.wifi.details.WifiDetailPreferenceControllerTest Change-Id: Ic22c22027386d4a6de5d693eafcd9cd463ed3415
This commit is contained in:
@@ -1109,6 +1109,10 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
||||
}
|
||||
@Override
|
||||
public void onFinish() {
|
||||
if (mFragment == null || mFragment.getActivity() == null) {
|
||||
Log.d(TAG, "Ignore timeout since activity not exist!");
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "Timeout for state:" + mConnectingState);
|
||||
if (mConnectingState == STATE_ENABLE_WIFI) {
|
||||
updateConnectingState(STATE_ENABLE_WIFI_FAILED);
|
||||
|
Reference in New Issue
Block a user