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. Bug: 155613549 Bug: 152571756 Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.slice make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi Change-Id: I2d66ea4905daca3244ec4cf8f2935cda817480b1
38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
/*
|
|
* Copyright (C) 2019 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License
|
|
*/
|
|
|
|
package com.android.settings.wifi.slice;
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
|
|
import com.android.settings.slices.SliceBackgroundWorker;
|
|
|
|
/**
|
|
* {@link SliceBackgroundWorker} for Wi-Fi, used by {@link ContextualWifiSlice}.
|
|
*/
|
|
public class ContextualWifiScanWorker extends WifiScanWorker {
|
|
|
|
public ContextualWifiScanWorker(Context context, Uri uri) {
|
|
super(context, uri);
|
|
}
|
|
|
|
@Override
|
|
protected int getApRowCount() {
|
|
return ContextualWifiSlice.getApRowCount();
|
|
}
|
|
}
|