Expose some level of logging to aid debugging.

Bug: 147095027
Test: N/A
Change-Id: Ic8436c7c5f27722dde3a375fa6fcf11822e9ff48
This commit is contained in:
Song Pan
2020-06-10 21:46:53 +01:00
parent 6d513e3306
commit bc86158b25

View File

@@ -205,8 +205,13 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
} }
if (DEBUG_INTEGRITY_COMPONENT) { if (DEBUG_INTEGRITY_COMPONENT) {
Slog.i(TAG, String.format("Successfully pushed rule set: %s", version)); Slog.i(
TAG,
String.format(
"Successfully pushed rule set to version '%s' from '%s'",
version, ruleProvider));
} }
FrameworkStatsLog.write( FrameworkStatsLog.write(
FrameworkStatsLog.INTEGRITY_RULES_PUSHED, FrameworkStatsLog.INTEGRITY_RULES_PUSHED,
success, success,
@@ -324,13 +329,12 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
+ getAllowedInstallers(packageInfo)); + getAllowedInstallers(packageInfo));
} }
IntegrityCheckResult result = mEvaluationEngine.evaluate(appInstallMetadata); IntegrityCheckResult result = mEvaluationEngine.evaluate(appInstallMetadata);
if (DEBUG_INTEGRITY_COMPONENT) { if (!result.getMatchedRules().isEmpty() || DEBUG_INTEGRITY_COMPONENT) {
Slog.i( Slog.i(
TAG, TAG,
"Integrity check result: " String.format(
+ result.getEffect() "Integrity check of %s result: %s due to %s",
+ " due to " packageName, result.getEffect(), result.getMatchedRules()));
+ result.getMatchedRules());
} }
FrameworkStatsLog.write( FrameworkStatsLog.write(
@@ -673,8 +677,10 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
// Obtain the system apps that are whitelisted in config_integrityRuleProviderPackages. // Obtain the system apps that are whitelisted in config_integrityRuleProviderPackages.
List<String> allowedRuleProviders = getAllowedRuleProviderSystemApps(); List<String> allowedRuleProviders = getAllowedRuleProviderSystemApps();
if (DEBUG_INTEGRITY_COMPONENT) { if (DEBUG_INTEGRITY_COMPONENT) {
Slog.i(TAG, String.format( Slog.i(
"Rule provider system app list contains: %s", allowedRuleProviders)); TAG,
String.format(
"Rule provider system app list contains: %s", allowedRuleProviders));
} }
// Identify the package names in the caller list. // Identify the package names in the caller list.
@@ -730,9 +736,9 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
private boolean integrityCheckIncludesRuleProvider() { private boolean integrityCheckIncludesRuleProvider() {
return Settings.Global.getInt( return Settings.Global.getInt(
mContext.getContentResolver(), mContext.getContentResolver(),
Settings.Global.INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER, Settings.Global.INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER,
0) 0)
== 1; == 1;
} }