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

Commit 3e1e6e24 authored by Joanne Chung's avatar Joanne Chung
Browse files

Guard new added freezen metric by feature flag.

The main build is still be used for U release, the metrics cts
test fails because this new added metric. Guard this new change by
a feature flag.

Bug: 307561242
Test: atest PackageInstallationSessionReportedStatsTests
Change-Id: Ife56a8d2097a90ee841a9e4749e7a695e52322d1
parent 1cf36e8e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -60,9 +60,17 @@ flag {
}

flag {

    name: "rollback_lifetime"
    namespace: "package_manager_service"
    description: "Feature flag to enable custom rollback lifetime during install."
    bug: "299670324"
    is_fixed_read_only: true
}

flag {
    name: "improve_install_freeze"
    namespace: "package_manager_service"
    description: "Feature flag to improve install freeze time."
    bug: "307561242"
}
+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.pm;

import static android.content.pm.Flags.improveInstallFreeze;
import static android.content.pm.PackageInstaller.SessionParams.USER_ACTION_UNSPECIFIED;
import static android.content.pm.PackageManager.INSTALL_REASON_UNKNOWN;
import static android.content.pm.PackageManager.INSTALL_SCENARIO_DEFAULT;
@@ -962,13 +963,13 @@ final class InstallRequest {
    }

    public void onFreezeStarted() {
        if (mPackageMetrics != null) {
        if (mPackageMetrics != null && improveInstallFreeze()) {
            mPackageMetrics.onStepStarted(PackageMetrics.STEP_FREEZE_INSTALL);
        }
    }

    public void onFreezeCompleted() {
        if (mPackageMetrics != null) {
        if (mPackageMetrics != null && improveInstallFreeze()) {
            mPackageMetrics.onStepFinished(PackageMetrics.STEP_FREEZE_INSTALL);
        }
    }