[Wi-Fi] Apply WifiTrackerLib objects in Wi-Fi Slice
This change uses WifiTrackerLib's WifiPickerTracker & WifiEntry to replace SettingLib's WifiTracker & AccessPoint. This change includes 1. WifiScanWorker has the callbacks similar to a lifecycle component but it's not a lifecycle component. Let WifiScanWorker implements LifecycleOwner and provides #getLifecycle() for WifiPickerTracker. 2. Remove captive portal related code because WifiEntry#connect will handle captive portal login if it's necessary. 3. Create WifiSliceItem to wrap WifiEntry because WifiEntry is an abstract object and it does not provide copy constructor. Without copy construcor, Wi-Fi Slice may show unexpected information when a WifiEntry is updated. 4. Use WifiTrackerLib's NetworkDetailsTracker & WifiEntry in WifiDialogActivity because it gets a WifiEntry key from Wi-Fi Slice. NetworkDetailsTracker can get the WifiEntry of th key. Bug: 155613549 Bug: 152571756 Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.slice make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi Change-Id: I0718f4647cea007a9b701922f3121a388dd43918
This commit is contained in:
@@ -57,7 +57,6 @@ import androidx.annotation.VisibleForTesting;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.wifi.WifiDialogActivity;
|
||||
import com.android.settings.wifi.qrcode.QrCamera;
|
||||
import com.android.settings.wifi.qrcode.QrDecorateView;
|
||||
import com.android.wifitrackerlib.WifiEntry;
|
||||
@@ -91,7 +90,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
// Key for Bundle usage
|
||||
private static final String KEY_IS_CONFIGURATOR_MODE = "key_is_configurator_mode";
|
||||
private static final String KEY_LATEST_ERROR_CODE = "key_latest_error_code";
|
||||
private static final String KEY_WIFI_CONFIGURATION = "key_wifi_configuration";
|
||||
public static final String KEY_WIFI_CONFIGURATION = "key_wifi_configuration";
|
||||
|
||||
private static final int ARG_RESTART_CAMERA = 1;
|
||||
|
||||
@@ -689,8 +688,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
final Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra(WifiDialogActivity.KEY_WIFI_CONFIGURATION,
|
||||
mEnrolleeWifiConfiguration);
|
||||
resultIntent.putExtra(KEY_WIFI_CONFIGURATION, mEnrolleeWifiConfiguration);
|
||||
|
||||
final Activity hostActivity = getActivity();
|
||||
hostActivity.setResult(Activity.RESULT_OK, resultIntent);
|
||||
|
Reference in New Issue
Block a user