diff options
| author | 2024-10-11 17:42:05 +0000 | |
|---|---|---|
| committer | 2024-10-11 17:42:05 +0000 | |
| commit | 4fe56fd0d57a54a2169e40cd927428febb346919 (patch) | |
| tree | 1cbc0adb818eabe2ddb3f75261498c3b0345cd42 | |
| parent | 378aaa057ceb3111f5a8c01ee10cd0d373f51f4b (diff) | |
| parent | 792e7007a4cd2a3f2e86ef5dd11ca33fc9484b38 (diff) | |
Merge "Stop logging the AppIntegrityManager related logs (namely, INTEGRITY_CHECK_RESULT_REPORTED and INTEGRITY_RULES_PUSHED) in preparation of the code clean-up of this deprecated component." into main
3 files changed, 0 insertions, 42 deletions
diff --git a/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java b/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java index 5514ec701c15..dc2c95797b8b 100644 --- a/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java +++ b/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java @@ -62,7 +62,6 @@ import com.android.internal.annotations.VisibleForTesting;  import com.android.internal.pm.parsing.PackageParser2;  import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;  import com.android.internal.util.ArrayUtils; -import com.android.internal.util.FrameworkStatsLog;  import com.android.server.LocalServices;  import com.android.server.integrity.engine.RuleEvaluationEngine;  import com.android.server.integrity.model.IntegrityCheckResult; @@ -214,12 +213,6 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {                                          version, ruleProvider));                      } -                    FrameworkStatsLog.write( -                            FrameworkStatsLog.INTEGRITY_RULES_PUSHED, -                            success, -                            ruleProvider, -                            version); -                      Intent intent = new Intent();                      intent.putExtra(EXTRA_STATUS, success ? STATUS_SUCCESS : STATUS_FAILURE);                      try { @@ -346,15 +339,6 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {                                  packageName, result.getEffect(), result.getMatchedRules()));              } -            FrameworkStatsLog.write( -                    FrameworkStatsLog.INTEGRITY_CHECK_RESULT_REPORTED, -                    packageName, -                    appCertificates.toString(), -                    appInstallMetadata.getVersionCode(), -                    installerPackageName, -                    result.getLoggingResponse(), -                    result.isCausedByAppCertRule(), -                    result.isCausedByInstallerRule());              mPackageManagerInternal.setIntegrityVerificationResult(                      verificationId,                      result.getEffect() == IntegrityCheckResult.Effect.ALLOW diff --git a/services/core/java/com/android/server/integrity/model/IntegrityCheckResult.java b/services/core/java/com/android/server/integrity/model/IntegrityCheckResult.java index 1fa067065e1b..b0647fc46473 100644 --- a/services/core/java/com/android/server/integrity/model/IntegrityCheckResult.java +++ b/services/core/java/com/android/server/integrity/model/IntegrityCheckResult.java @@ -19,8 +19,6 @@ package com.android.server.integrity.model;  import android.annotation.Nullable;  import android.content.integrity.Rule; -import com.android.internal.util.FrameworkStatsLog; -  import java.util.Collections;  import java.util.List; @@ -82,21 +80,6 @@ public final class IntegrityCheckResult {          return new IntegrityCheckResult(Effect.DENY, ruleList);      } -    /** -     * Returns the in value of the integrity check result for logging purposes. -     */ -    public int getLoggingResponse() { -        if (getEffect() == Effect.DENY) { -            return FrameworkStatsLog.INTEGRITY_CHECK_RESULT_REPORTED__RESPONSE__REJECTED; -        } else if (getEffect() == Effect.ALLOW && getMatchedRules().isEmpty()) { -            return FrameworkStatsLog.INTEGRITY_CHECK_RESULT_REPORTED__RESPONSE__ALLOWED; -        } else if (getEffect() == Effect.ALLOW && !getMatchedRules().isEmpty()) { -            return FrameworkStatsLog.INTEGRITY_CHECK_RESULT_REPORTED__RESPONSE__FORCE_ALLOWED; -        } else { -            throw new IllegalStateException("IntegrityCheckResult is not valid."); -        } -    } -      /** Returns true when the {@code mEffect} is caused by an app certificate mismatch. */      public boolean isCausedByAppCertRule() {          return mRuleList.stream().anyMatch(rule -> rule.getFormula().isAppCertificateFormula()); diff --git a/services/tests/servicestests/src/com/android/server/integrity/model/IntegrityCheckResultTest.java b/services/tests/servicestests/src/com/android/server/integrity/model/IntegrityCheckResultTest.java index 6c23ff6fcb3c..d31ed689a7da 100644 --- a/services/tests/servicestests/src/com/android/server/integrity/model/IntegrityCheckResultTest.java +++ b/services/tests/servicestests/src/com/android/server/integrity/model/IntegrityCheckResultTest.java @@ -22,8 +22,6 @@ import android.content.integrity.AtomicFormula;  import android.content.integrity.CompoundFormula;  import android.content.integrity.Rule; -import com.android.internal.util.FrameworkStatsLog; -  import org.junit.Test;  import org.junit.runner.RunWith;  import org.junit.runners.JUnit4; @@ -40,8 +38,6 @@ public class IntegrityCheckResultTest {          assertThat(allowResult.getEffect()).isEqualTo(IntegrityCheckResult.Effect.ALLOW);          assertThat(allowResult.getMatchedRules()).isEmpty(); -        assertThat(allowResult.getLoggingResponse()) -                .isEqualTo(FrameworkStatsLog.INTEGRITY_CHECK_RESULT_REPORTED__RESPONSE__ALLOWED);      }      @Test @@ -58,9 +54,6 @@ public class IntegrityCheckResultTest {          assertThat(allowResult.getEffect()).isEqualTo(IntegrityCheckResult.Effect.ALLOW);          assertThat(allowResult.getMatchedRules()).containsExactly(forceAllowRule); -        assertThat(allowResult.getLoggingResponse()) -                .isEqualTo( -                        FrameworkStatsLog.INTEGRITY_CHECK_RESULT_REPORTED__RESPONSE__FORCE_ALLOWED);      }      @Test @@ -77,8 +70,6 @@ public class IntegrityCheckResultTest {          assertThat(denyResult.getEffect()).isEqualTo(IntegrityCheckResult.Effect.DENY);          assertThat(denyResult.getMatchedRules()).containsExactly(failedRule); -        assertThat(denyResult.getLoggingResponse()) -                .isEqualTo(FrameworkStatsLog.INTEGRITY_CHECK_RESULT_REPORTED__RESPONSE__REJECTED);      }      @Test  |