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

SenderPackageFilter

public class SenderPackageFilter extends Object implements Filter

Fields Summary
private static final String
ATTR_NAME
public final String
mPackageName
public static final FilterFactory
FACTORY
Constructors Summary
public SenderPackageFilter(String packageName)


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

        IPackageManager pm = AppGlobals.getPackageManager();

        int packageUid = -1;
        try {
            packageUid = pm.getPackageUid(mPackageName, UserHandle.USER_OWNER);
        } catch (RemoteException ex) {
            // handled below
        }

        if (packageUid == -1)  {
            return false;
        }

        return UserHandle.isSameApp(packageUid, callerUid);