Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 720c31c0 authored by Ömer Yaveroğlu's avatar Ömer Yaveroğlu
Browse files

Stop logging the AppIntegrityManager related logs (namely,...

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.

Change-Id: Ibb661e698e2a7d61624eb7ca0d94be05579ebf74
parent e126f761
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -214,12 +214,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 +340,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
+0 −15
Original line number Diff line number Diff line
@@ -82,21 +82,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());
+0 −7
Original line number Diff line number Diff line
@@ -40,8 +40,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 +56,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 +72,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