[WifiDialog] "Add network" return WifiConfig
When adding a network by manually entering SSID, return the wifi configuration to the caller. Change-Id: If490a341fe95b9c63f43d3bb30a2114bfcd45082
This commit is contained in:
@@ -36,6 +36,7 @@ public class WifiDialogActivity extends Activity implements WifiDialog.WifiDialo
|
|||||||
private static final int RESULT_FORGET = RESULT_FIRST_USER + 1;
|
private static final int RESULT_FORGET = RESULT_FIRST_USER + 1;
|
||||||
|
|
||||||
private static final String KEY_ACCESS_POINT_STATE = "access_point_state";
|
private static final String KEY_ACCESS_POINT_STATE = "access_point_state";
|
||||||
|
private static final String KEY_WIFI_CONFIGURATION = "wifi_configuration";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -110,6 +111,9 @@ public class WifiDialogActivity extends Activity implements WifiDialog.WifiDialo
|
|||||||
accessPoint.saveWifiState(accessPointState);
|
accessPoint.saveWifiState(accessPointState);
|
||||||
resultData.putExtra(KEY_ACCESS_POINT_STATE, accessPointState);
|
resultData.putExtra(KEY_ACCESS_POINT_STATE, accessPointState);
|
||||||
}
|
}
|
||||||
|
if (config != null) {
|
||||||
|
resultData.putExtra(KEY_WIFI_CONFIGURATION, config);
|
||||||
|
}
|
||||||
setResult(RESULT_CONNECTED, resultData);
|
setResult(RESULT_CONNECTED, resultData);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user