Enable launching captive portal directly
Whenever a user has connected to a captive portal network, split the
ConnectedAccessPointPreference to allow directly signing into the
captive portal or modifying the network's settings. When in any other
network state, use the old behavior of a single tappable preference that
takes the user to settings.
Bug: 63929546
Bug: 68031656
Test: make RunSettingsRoboTests
Test: manual by connecting to Captive Portal and normal WiFi networks.
Change-Id: I444202a12138d90c94bda94945c121c8c0810536
(cherry picked from commit 7577624db7
)
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
|
||||
package com.android.settings.wifi;
|
||||
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.wifi.WifiConfiguration;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
@@ -101,4 +101,10 @@ public class WifiUtils {
|
||||
Settings.Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN, 0) != 0;
|
||||
return isLockdownFeatureEnabled;
|
||||
}
|
||||
|
||||
/** Returns true if the provided NetworkCapabilities indicate a captive portal network. */
|
||||
public static boolean canSignIntoNetwork(NetworkCapabilities capabilities) {
|
||||
return (capabilities != null
|
||||
&& capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user