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

Commit d784bdf4 authored by yawanng's avatar yawanng Committed by Yan Wang
Browse files

Dexopt: read min new methods/classes percent change from properties.

Bug: 172490638
Test:
1) flash locally
2) adb shell setprop name value
3) adb shell stop
4) adb shell start
5) adb shell cmd package compile -r bg-dexopt com.android.phone
Change-Id: I4049b7cecaef8a01eabf29868362065e466327b0
parent 8fdffdee
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -450,6 +450,20 @@ class RunProfman : public ExecVHelper {
            AddArg("--boot-image-merge");
        }

        uint32_t min_new_classes_percent_change = ::android::base::GetUintProperty<uint32_t>(
            "dalvik.vm.bgdexopt.new-classes-percent", /*default*/-1);
        if (min_new_classes_percent_change >= 0 && min_new_classes_percent_change <= 100) {
          AddArg("--min-new-classes-percent-change=" +
                 std::to_string(min_new_classes_percent_change));
        }

        uint32_t min_new_methods_percent_change = ::android::base::GetUintProperty<uint32_t>(
            "dalvik.vm.bgdexopt.new-methods-percent", /*default*/-1);
        if (min_new_methods_percent_change >=0 && min_new_methods_percent_change <= 100) {
          AddArg("--min-new-methods-percent-change=" +
                 std::to_string(min_new_methods_percent_change));
        }

        // Do not add after dex2oat_flags, they should override others for debugging.
        PrepareArgs(profman_bin);
    }