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

Commit 7b27a809 authored by Raghavendra Prasad Nagaraj's avatar Raghavendra Prasad Nagaraj Committed by Linux Build Service Account
Browse files

perf: Add freq boost for first launch

Request for freq boost for first launch using
perflock API.

Change-Id: I1c8396b44e3dfa383d951aad887eb66d199c3788
parent 5354f4a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,6 +9,6 @@ LOCAL_SRC_FILES += \
    java/com/android/server/EventLogTags.logtags \
    java/com/android/server/am/EventLogTags.logtags

LOCAL_JAVA_LIBRARIES := android.policy telephony-common
LOCAL_JAVA_LIBRARIES := android.policy telephony-common org.codeaurora.Performance

include $(BUILD_STATIC_JAVA_LIBRARY)
+6 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.Objects;

import org.codeaurora.Performance;

/**
 * An entry in the history stack, representing an activity.
 */
@@ -924,6 +926,10 @@ final class ActivityRecord {
            if (displayStartTime != 0) {
                reportLaunchTimeLocked(SystemClock.uptimeMillis());
            }
            if(mStackSupervisor.mIsPerfLockAcquired == true) {
                mStackSupervisor.mPerf.perfLockRelease();
                mStackSupervisor.mIsPerfLockAcquired = false;
            }
            mStackSupervisor.sendWaitingVisibleReportLocked(this);
            startTime = 0;
            finishLaunchTickingLocked();
+14 −0
Original line number Diff line number Diff line
@@ -111,6 +111,9 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

/* Perf */
import org.codeaurora.Performance;

public final class ActivityStackSupervisor implements DisplayListener {
    static final boolean DEBUG = ActivityManagerService.DEBUG || false;
    static final boolean DEBUG_ADD_REMOVE = DEBUG || false;
@@ -139,6 +142,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
    static final int RESUME_TOP_ACTIVITY_MSG = FIRST_SUPERVISOR_STACK_MSG + 2;
    static final int SLEEP_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 3;
    static final int LAUNCH_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 4;
    public Performance mPerf = null;
    public boolean mIsPerfLockAcquired = false;
    static final int HANDLE_DISPLAY_ADDED = FIRST_SUPERVISOR_STACK_MSG + 5;
    static final int HANDLE_DISPLAY_CHANGED = FIRST_SUPERVISOR_STACK_MSG + 6;
    static final int HANDLE_DISPLAY_REMOVED = FIRST_SUPERVISOR_STACK_MSG + 7;
@@ -2632,6 +2637,15 @@ public final class ActivityStackSupervisor implements DisplayListener {
                }
            }
        }
        /* Acquire perf lock during new app launch */
        if (mPerf == null) {
            mPerf = new Performance();
        }
        if (mPerf != null && mIsPerfLockAcquired == false) {
            mPerf.perfLockAcquire(2000,0x1E01,0x20D,0x1C00);
            mIsPerfLockAcquired = true;
        }

        if (DEBUG_TASKS) Slog.d(TAG, "No task found");
        return null;
    }