Mark a connection as a Wifi Assistant connection based on the
ephemeral flag in WifiInfo.
Add this private field to WifiInfo.

Change-Id: Ic815b87a24e8272faa6e9e820b8fa55224af882a
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
index 0180a30..9325246 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
@@ -387,7 +387,7 @@
         } else if (isActive()) {
             // This is the active connection on non-passpoint network
             summary.append(getSummary(mContext, getDetailedState(),
-                    networkId == WifiConfiguration.INVALID_NETWORK_ID));
+                    mInfo != null && mInfo.isEphemeral()));
         } else if (mConfig != null && mConfig.isPasspoint()) {
             String format = mContext.getString(R.string.available_via_passpoint);
             summary.append(String.format(format, mConfig.providerFriendlyName));
@@ -620,7 +620,8 @@
     }
 
     public boolean isEphemeral() {
-        return !isSaved() && mNetworkInfo != null && mNetworkInfo.getState() != State.DISCONNECTED;
+        return mInfo != null && mInfo.isEphemeral() &&
+                mNetworkInfo != null && mNetworkInfo.getState() != State.DISCONNECTED;
     }
 
     /** Return whether the given {@link WifiInfo} is for this access point. */
@@ -757,7 +758,7 @@
             mAccessPointListener.onAccessPointChanged(this);
         }
     }
-    
+
     public static String getSummary(Context context, String ssid, DetailedState state,
             boolean isEphemeral, String passpointProvider) {
         if (state == DetailedState.CONNECTED && ssid == null) {