blob: 76394662572d683750120edd7e97e46c4693c575 [file] [log] [blame]
Ben Gruver4efe9402013-04-02 21:18:41 -07001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server.firewall;
18
19import android.content.Intent;
20import android.content.pm.ApplicationInfo;
21
22interface Filter {
23 /**
24 * Does the given intent + context info match this filter?
25 *
26 * @param ifw The IntentFirewall instance
27 * @param intent The intent being started/bound/broadcast
28 * @param callerApp An ApplicationInfo of an application in the caller's process. This may not
29 * be the specific app that is actually sending the intent. This also may be
30 * null, if the caller is the system process, or an unrecognized process (e.g.
31 * am start)
32 * @param callerPackage The package name of the component sending the intent. This value is
33* provided by the caller and might be forged/faked.
34 * @param callerUid
35 * @param callerPid
36 * @param resolvedType The resolved mime type of the intent
37 * @param resolvedApp The application that contains the resolved component that the intent is
38 */
39 boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp,
40 String callerPackage, int callerUid, int callerPid, String resolvedType,
41 ApplicationInfo resolvedApp);
42}