Revert "[Wi-Fi] Apply WifiTrackerLib objects in Wi-Fi Slice"
This reverts commit 7b1aded2a6
.
Reason for revert: Settings is crashing for WiFi selection in SetupWizard on wembley
Bug: 161434533
Change-Id: I1d90e9bae1b31862fba674db0d7497e43f987a7f
Test: Locally reverted, reflashed, and was able to select WiFi without Settings crashing.
Exempt-From-Owner-Approval: Revert to clear up P0 while all owners are outside of work hours
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.wifi.slice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.android.settings.slices.SliceBackgroundWorker;
|
||||
|
||||
@@ -26,12 +27,44 @@ import com.android.settings.slices.SliceBackgroundWorker;
|
||||
*/
|
||||
public class ContextualWifiScanWorker extends WifiScanWorker {
|
||||
|
||||
private static long sVisibleUiSessionToken;
|
||||
private static long sActiveSession;
|
||||
|
||||
public ContextualWifiScanWorker(Context context, Uri uri) {
|
||||
super(context, uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a new visible UI session for the purpose of automatically starting captive portal.
|
||||
*
|
||||
* A visible UI session is defined as a duration of time when a UI screen is visible to user.
|
||||
* Going to a sub-page and coming out breaks the continuation, leaving the page and coming back
|
||||
* breaks it too.
|
||||
*/
|
||||
public static void newVisibleUiSession() {
|
||||
sVisibleUiSessionToken = SystemClock.elapsedRealtime();
|
||||
}
|
||||
|
||||
static void saveSession() {
|
||||
sActiveSession = sVisibleUiSessionToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearClickedWifiOnSliceUnpinned() {
|
||||
// Do nothing for contextual Wi-Fi slice
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isSessionValid() {
|
||||
if (sVisibleUiSessionToken != sActiveSession) {
|
||||
clearClickedWifi();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getApRowCount() {
|
||||
return ContextualWifiSlice.getApRowCount();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user