Add partial connectivity related settings in SettingsLib.
Bug:
113450764
Bug:
128489091
Test: 1. Build pass.
2. Fake partial connectivity case for testing.
Change-Id: I4791abe9351c62d9549ada383aa4cc8aa34ddaf2
<!-- Summary for Connected wifi network without internet -->
<string name="wifi_connected_no_internet">Connected, no internet</string>
+ <!-- Summary for connected wifi network with partial internet connectivity [CHAR LIMIT=50] -->
+ <string name="wifi_limited_connection">Limited connection</string>
+
<!-- Wi-Fi status indicating that the current network is connected, but has no internet access. -->
<string name="wifi_status_no_internet">No internet</string>
int id = context.getResources()
.getIdentifier("network_available_sign_in", "string", "android");
return context.getString(id);
+ } else if (nc.hasCapability(
+ NetworkCapabilities.NET_CAPABILITY_PARTIAL_CONNECTIVITY)) {
+ return context.getString(R.string.wifi_limited_connection);
} else if (!nc.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)) {
return context.getString(R.string.wifi_connected_no_internet);
}
package com.android.settingslib.wifi;
import static android.net.NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_PARTIAL_CONNECTIVITY;
import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED;
import android.content.Context;
if (networkCapabilities.hasCapability(NET_CAPABILITY_CAPTIVE_PORTAL)) {
statusLabel = mContext.getString(R.string.wifi_status_sign_in_required);
return;
+ } else if (networkCapabilities.hasCapability(NET_CAPABILITY_PARTIAL_CONNECTIVITY)) {
+ statusLabel = mContext.getString(R.string.wifi_limited_connection);
+ return;
} else if (!networkCapabilities.hasCapability(NET_CAPABILITY_VALIDATED)) {
statusLabel = mContext.getString(R.string.wifi_status_no_internet);
return;