Loading services/java/com/android/server/am/ActivityStack.java +1 −2 Original line number Diff line number Diff line Loading @@ -2594,8 +2594,7 @@ final class ActivityStack { } boolean abort = !mService.mIntentFirewall.checkStartActivity(intent, callerApp==null?null:callerApp.info, callingPackage, callingUid, callingPid, resolvedType, aInfo); callerApp==null?null:callerApp.info, callingUid, callingPid, resolvedType, aInfo); if (mMainStack) { if (mService.mController != null) { Loading services/java/com/android/server/firewall/AndFilter.java +3 −4 Original line number Diff line number Diff line Loading @@ -26,11 +26,10 @@ import java.io.IOException; class AndFilter extends FilterList { @Override public boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, String callerPackage, int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) { int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) { for (int i=0; i<children.size(); i++) { if (!children.get(i).matches(ifw, intent, callerApp, callerPackage, callerUid, callerPid, resolvedType, resolvedApp)) { if (!children.get(i).matches(ifw, intent, callerApp, callerUid, callerPid, resolvedType, resolvedApp)) { return false; } } Loading services/java/com/android/server/firewall/CategoryFilter.java +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class CategoryFilter implements Filter { } @Override public boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, String callerPackage, public boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) { Set<String> categories = intent.getCategories(); if (categories == null) { Loading services/java/com/android/server/firewall/Filter.java +4 −7 Original line number Diff line number Diff line Loading @@ -29,14 +29,11 @@ interface Filter { * be the specific app that is actually sending the intent. This also may be * null, if the caller is the system process, or an unrecognized process (e.g. * am start) * @param callerPackage The package name of the component sending the intent. This value is * provided by the caller and might be forged/faked. * @param callerUid * @param callerPid * @param resolvedType The resolved mime type of the intent * @param resolvedApp The application that contains the resolved component that the intent is */ boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, String callerPackage, int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp); int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp); } services/java/com/android/server/firewall/IntentFirewall.java +4 −6 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ public class IntentFirewall { StringFilter.HOST, StringFilter.MIME_TYPE, StringFilter.PATH, StringFilter.SENDER_PACKAGE, StringFilter.SSP, CategoryFilter.FACTORY, Loading @@ -98,17 +97,16 @@ public class IntentFirewall { readRules(getRulesFile()); } public boolean checkStartActivity(Intent intent, ApplicationInfo callerApp, String callerPackage, int callerUid, int callerPid, String resolvedType, ActivityInfo resolvedActivity) { public boolean checkStartActivity(Intent intent, ApplicationInfo callerApp, int callerUid, int callerPid, String resolvedType, ActivityInfo resolvedActivity) { List<Rule> matchingRules = mActivityResolver.queryIntent(intent, resolvedType, false, 0); boolean log = false; boolean block = false; for (int i=0; i< matchingRules.size(); i++) { Rule rule = matchingRules.get(i); if (rule.matches(this, intent, callerApp, callerPackage, callerUid, callerPid, resolvedType, resolvedActivity.applicationInfo)) { if (rule.matches(this, intent, callerApp, callerUid, callerPid, resolvedType, resolvedActivity.applicationInfo)) { block |= rule.getBlock(); log |= rule.getLog(); Loading Loading
services/java/com/android/server/am/ActivityStack.java +1 −2 Original line number Diff line number Diff line Loading @@ -2594,8 +2594,7 @@ final class ActivityStack { } boolean abort = !mService.mIntentFirewall.checkStartActivity(intent, callerApp==null?null:callerApp.info, callingPackage, callingUid, callingPid, resolvedType, aInfo); callerApp==null?null:callerApp.info, callingUid, callingPid, resolvedType, aInfo); if (mMainStack) { if (mService.mController != null) { Loading
services/java/com/android/server/firewall/AndFilter.java +3 −4 Original line number Diff line number Diff line Loading @@ -26,11 +26,10 @@ import java.io.IOException; class AndFilter extends FilterList { @Override public boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, String callerPackage, int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) { int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) { for (int i=0; i<children.size(); i++) { if (!children.get(i).matches(ifw, intent, callerApp, callerPackage, callerUid, callerPid, resolvedType, resolvedApp)) { if (!children.get(i).matches(ifw, intent, callerApp, callerUid, callerPid, resolvedType, resolvedApp)) { return false; } } Loading
services/java/com/android/server/firewall/CategoryFilter.java +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class CategoryFilter implements Filter { } @Override public boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, String callerPackage, public boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp) { Set<String> categories = intent.getCategories(); if (categories == null) { Loading
services/java/com/android/server/firewall/Filter.java +4 −7 Original line number Diff line number Diff line Loading @@ -29,14 +29,11 @@ interface Filter { * be the specific app that is actually sending the intent. This also may be * null, if the caller is the system process, or an unrecognized process (e.g. * am start) * @param callerPackage The package name of the component sending the intent. This value is * provided by the caller and might be forged/faked. * @param callerUid * @param callerPid * @param resolvedType The resolved mime type of the intent * @param resolvedApp The application that contains the resolved component that the intent is */ boolean matches(IntentFirewall ifw, Intent intent, ApplicationInfo callerApp, String callerPackage, int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp); int callerUid, int callerPid, String resolvedType, ApplicationInfo resolvedApp); }
services/java/com/android/server/firewall/IntentFirewall.java +4 −6 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ public class IntentFirewall { StringFilter.HOST, StringFilter.MIME_TYPE, StringFilter.PATH, StringFilter.SENDER_PACKAGE, StringFilter.SSP, CategoryFilter.FACTORY, Loading @@ -98,17 +97,16 @@ public class IntentFirewall { readRules(getRulesFile()); } public boolean checkStartActivity(Intent intent, ApplicationInfo callerApp, String callerPackage, int callerUid, int callerPid, String resolvedType, ActivityInfo resolvedActivity) { public boolean checkStartActivity(Intent intent, ApplicationInfo callerApp, int callerUid, int callerPid, String resolvedType, ActivityInfo resolvedActivity) { List<Rule> matchingRules = mActivityResolver.queryIntent(intent, resolvedType, false, 0); boolean log = false; boolean block = false; for (int i=0; i< matchingRules.size(); i++) { Rule rule = matchingRules.get(i); if (rule.matches(this, intent, callerApp, callerPackage, callerUid, callerPid, resolvedType, resolvedActivity.applicationInfo)) { if (rule.matches(this, intent, callerApp, callerUid, callerPid, resolvedType, resolvedActivity.applicationInfo)) { block |= rule.getBlock(); log |= rule.getLog(); Loading