FileDocCategorySizeDatePackage
PortFilter.javaAPI DocAndroid 5.1 API4170Thu Mar 12 22:22:42 GMT 2015com.android.server.firewall

PortFilter

public class PortFilter extends Object implements Filter

Fields Summary
private static final String
ATTR_EQUALS
private static final String
ATTR_MIN
private static final String
ATTR_MAX
private static final int
NO_BOUND
private final int
mLowerBound
private final int
mUpperBound
public static final FilterFactory
FACTORY
Constructors Summary
private PortFilter(int lowerBound, int upperBound)


         
        mLowerBound = lowerBound;
        mUpperBound = upperBound;
    
Methods Summary
public booleanmatches(IntentFirewall ifw, android.content.ComponentName resolvedComponent, android.content.Intent intent, int callerUid, int callerPid, java.lang.String resolvedType, int receivingUid)

        int port = -1;
        Uri uri = intent.getData();
        if (uri != null) {
            port = uri.getPort();
        }
        return port != -1 &&
                (mLowerBound == NO_BOUND || mLowerBound <= port) &&
                (mUpperBound == NO_BOUND || mUpperBound >= port);