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

Commit 8215d601 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ActivityStack: Add support for animation boost"

parents c73102b8 3fb12189
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2060,4 +2060,8 @@
    <!-- Support for disabling to fetch APN from OMH card
         for some cdma carriers -->
    <bool name="config_fetch_apn_from_omh_card">true</bool>
   <bool name="config_enablePerfBoostForAnimation">false</bool>
   <integer name="animationboost_timeout_param">0</integer>
   <integer name="animationboost_schedboost_param">0</integer>
   <integer name="animationboost_cpuboost_param">0</integer>
</resources>
+5 −0
Original line number Diff line number Diff line
@@ -2200,4 +2200,9 @@
  <java-symbol type="integer" name="launchboost_ksmboost_param" />

  <java-symbol type="bool" name="config_fetch_apn_from_omh_card" />
  <!-- cpu boost for Animationboost -->
  <java-symbol type="bool" name="config_enablePerfBoostForAnimation" />
  <java-symbol type="integer" name="animationboost_timeout_param" />
  <java-symbol type="integer" name="animationboost_schedboost_param" />
  <java-symbol type="integer" name="animationboost_cpuboost_param" />
</resources>
+26 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Objects;

import org.codeaurora.Performance;

/**
 * State and management of a single stack of activities.
 */
@@ -147,6 +149,11 @@ final class ActivityStack {
    final ActivityManagerService mService;
    final WindowManagerService mWindowManager;

    public Performance mPerf = null;
    public boolean mIsAnimationBoostEnabled = false;
    public int aBoostTimeOut = 0;
    public int aBoostCpuBoost = 0;
    public int aBoostSchedBoost = 0;
    /**
     * The back history of all previous (and possibly still
     * running) activities.  It contains #TaskRecord objects.
@@ -355,6 +362,16 @@ final class ActivityStack {
        mWindowManager = mService.mWindowManager;
        mStackId = activityContainer.mStackId;
        mCurrentUser = mService.mCurrentUserId;
        mIsAnimationBoostEnabled = mService.mContext.getResources().getBoolean(
                   com.android.internal.R.bool.config_enablePerfBoostForAnimation);
        if(mIsAnimationBoostEnabled) {
           aBoostSchedBoost = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.animationboost_schedboost_param);
           aBoostTimeOut = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.animationboost_timeout_param);
           aBoostCpuBoost = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.animationboost_cpuboost_param);
       }
    }

    /**
@@ -1718,6 +1735,9 @@ final class ActivityStack {
        // that the previous one will be hidden soon.  This way it can know
        // to ignore it when computing the desired screen orientation.
        boolean anim = true;
        if (mIsAnimationBoostEnabled == true && mPerf == null) {
            mPerf = new Performance();
        }
        if (prev != null) {
            if (prev.finishing) {
                if (DEBUG_TRANSITION) Slog.v(TAG,
@@ -1729,6 +1749,9 @@ final class ActivityStack {
                    mWindowManager.prepareAppTransition(prev.task == next.task
                            ? AppTransition.TRANSIT_ACTIVITY_CLOSE
                            : AppTransition.TRANSIT_TASK_CLOSE, false);
                    if(prev.task != next.task && mPerf != null) {
                       mPerf.perfLockAcquire(aBoostTimeOut, aBoostSchedBoost, aBoostCpuBoost);
		    }
                }
                mWindowManager.setAppWillBeHidden(prev.appToken);
                mWindowManager.setAppVisibility(prev.appToken, false);
@@ -1743,6 +1766,9 @@ final class ActivityStack {
                            : next.mLaunchTaskBehind
                                    ? AppTransition.TRANSIT_TASK_OPEN_BEHIND
                                    : AppTransition.TRANSIT_TASK_OPEN, false);
                    if(prev.task != next.task && mPerf != null) {
                        mPerf.perfLockAcquire(aBoostTimeOut, aBoostSchedBoost, aBoostCpuBoost);
                    }
                }
            }
            if (false) {