The feature failed after the CL "Force the adapter to rebind cards with a toggle". Because toggle slices have been forced to rebind after starting another activity and when any slice is updating. This unpins Wi-Fi slice and stops WifiScanWorker and then clears the saved clicked network. Solution: 1. Change ConnectToWifiHandler from activity to receiver and send broadcasts to it with FLAG_RECEIVER_FOREGROUND, so Wi-Fi slice won't be forced to rebind. 2. Seperate Wi-Fi scan worker and contextual Wi-Fi scan worker. Keep the original logic for the generic one, and then add the logic below to the contextual one. 3. Do not clear the saved clicked network when slice is unppined because it happens frequently in contextual homepage. 4. Introduce a static long in ContextualWifiScanWorker that updates once in every visible UI session. A session is when the screen is visible to user. 5. Use session token to determine whether auto-starting captive portal is needed. Fixes: 128056349 Test: robotest, visual in homepage and network panel Change-Id: I9e03c379806e124fa7253b2a635574b2433f6afc
64 lines
1.8 KiB
Java
64 lines
1.8 KiB
Java
package com.android.settings.slices;
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
|
|
import com.android.settings.network.telephony.Enhanced4gLteSliceHelper;
|
|
import com.android.settings.wifi.calling.WifiCallingSliceHelper;
|
|
|
|
/**
|
|
* Manages Slices in Settings.
|
|
*/
|
|
public interface SlicesFeatureProvider {
|
|
|
|
boolean DEBUG = false;
|
|
|
|
SliceDataConverter getSliceDataConverter(Context context);
|
|
|
|
/**
|
|
* Starts a new UI session for the purpose of using Slices.
|
|
*
|
|
* A UI session is defined as a duration of time when user stays in a UI screen. Screen rotation
|
|
* does not break the continuation of session, going to a sub-page and coming out does not break
|
|
* the continuation either. Leaving the page and coming back breaks it.
|
|
*/
|
|
void newUiSession();
|
|
|
|
/**
|
|
* Returns the token created in {@link #newUiSession}.
|
|
*/
|
|
long getUiSessionToken();
|
|
|
|
/**
|
|
* Asynchronous call to index the data used to build Slices.
|
|
* If the data is already indexed, the data will not change.
|
|
*/
|
|
void indexSliceDataAsync(Context context);
|
|
|
|
/**
|
|
* Indexes the data used to build Slices.
|
|
* If the data is already indexed, the data will not change.
|
|
*/
|
|
void indexSliceData(Context context);
|
|
|
|
|
|
/**
|
|
* Return a {@link CustomSliceable} associated to the Uri.
|
|
* <p>
|
|
* Do not change this method signature to accommodate for a special-case sliceable - a context
|
|
* is the only thing that should be needed to create the object.
|
|
*/
|
|
CustomSliceable getSliceableFromUri(Context context, Uri uri);
|
|
|
|
/**
|
|
* Gets new WifiCallingSliceHelper object
|
|
*/
|
|
WifiCallingSliceHelper getNewWifiCallingSliceHelper(Context context);
|
|
|
|
/**
|
|
* Gets new Enhanced4gLteSliceHelper object
|
|
*/
|
|
Enhanced4gLteSliceHelper getNewEnhanced4gLteSliceHelper(Context context);
|
|
}
|
|
|