Skip to content

Commit

Permalink
mobile: Fix Android linter issues (envoyproxy#36039)
Browse files Browse the repository at this point in the history
This PR suppresses the linter for the constant check as well as removing
`NetworkCapabilities.TRANSPORT_LOWPAN` since it's only supported in
version SDK 27.

Risk Level: low
Testing: CI
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: mobile

Signed-off-by: Fredy Wijaya <[email protected]>
  • Loading branch information
fredyw authored Sep 9, 2024
1 parent 3537377 commit ed6c95f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.envoyproxy.envoymobile.engine.types.EnvoyNetworkType;

import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
Expand Down Expand Up @@ -63,7 +64,6 @@ static class DefaultNetworkCallback extends NetworkCallback {
NetworkCapabilities.TRANSPORT_CELLULAR, NetworkCapabilities.TRANSPORT_WIFI,
NetworkCapabilities.TRANSPORT_BLUETOOTH, NetworkCapabilities.TRANSPORT_ETHERNET,
NetworkCapabilities.TRANSPORT_VPN, NetworkCapabilities.TRANSPORT_WIFI_AWARE,
NetworkCapabilities.TRANSPORT_LOWPAN,
};
private static final int EMPTY_TRANSPORT_TYPE = -1;

Expand All @@ -77,6 +77,7 @@ public void onAvailable(@NonNull Network network) {
envoyEngine.onDefaultNetworkAvailable();
}

@SuppressLint("WrongConstant")
@Override
public void onCapabilitiesChanged(@NonNull Network network,
@NonNull NetworkCapabilities networkCapabilities) {
Expand Down

0 comments on commit ed6c95f

Please sign in to comment.