]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Ignore deprecation warning for legacy code in NetworkManager
authorTobias Brunner <tobias@strongswan.org>
Tue, 6 Oct 2020 13:08:39 +0000 (15:08 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 29 Oct 2020 09:22:51 +0000 (10:22 +0100)
src/frontends/android/app/src/main/java/org/strongswan/android/logic/NetworkManager.java

index e283cd56d7f2f0980eb4cd30cc397cdbd772e495..ec7e80eef8e727b31b6ea6f36f4afe9162f129a7 100644 (file)
@@ -21,7 +21,6 @@ import android.content.Intent;
 import android.content.IntentFilter;
 import android.net.ConnectivityManager;
 import android.net.Network;
-import android.net.NetworkInfo;
 import android.net.NetworkRequest;
 import android.os.Build;
 
@@ -126,10 +125,12 @@ public class NetworkManager extends BroadcastReceiver implements Runnable
                }
        }
 
+       @SuppressWarnings("deprecation")
        public boolean isConnected()
        {
+               /* deprecated since API level 29 */
                ConnectivityManager cm = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
-               NetworkInfo info = null;
+               android.net.NetworkInfo info = null;
                if (cm != null)
                {
                        info = cm.getActiveNetworkInfo();