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

Commit 6f74ca55 authored by Varun Shah's avatar Varun Shah
Browse files

Ensure the compaction handler is only used when compaction is enabled.

Fixes: 408081639
Test: manual (ensure no crashes with compaction disabled)
Flag: EXEMPT bugfix
Change-Id: I88169ac53aab4ec143984b7a90129b34d484bb30
parent 230f3ad0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -700,6 +700,9 @@ public class CachedAppOptimizer {
        if(compactProfile == null || compactProfile.equals(CompactProfile.NONE)) {
            return false;
        }
        if (mCompactionHandler == null) {
            return false;
        }
        final String processName = (app.processName != null ? app.processName : "");
        mCompactStatsManager.logCompactionRequested(source, compactProfile, processName);

@@ -728,9 +731,11 @@ public class CachedAppOptimizer {
    }

    void compactNative(CompactProfile compactProfile, int pid) {
        if (useCompaction()) {
            mCompactionHandler.sendMessage(mCompactionHandler.obtainMessage(
                    COMPACT_NATIVE_MSG, pid, compactProfile.ordinal()));
        }
    }

    void compactAllSystem() {
        if (useCompaction()) {