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

Commit 00887675 authored by Steve Kondik's avatar Steve Kondik
Browse files

systemui: Boost when expanding the notification shade

Change-Id: I3b6edaf850d7453920fe553203e74afc30dc47da
parent 374310d8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.res.Configuration;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PointF;
import android.os.PowerManager;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
@@ -202,6 +203,8 @@ public class NotificationStackScrollLayout extends ViewGroup
    private boolean mDisallowScrollingInThisMotion;
    private long mGoToFullShadeDelay;

    private final PowerManager mPm;

    private ViewTreeObserver.OnPreDrawListener mChildrenUpdater
            = new ViewTreeObserver.OnPreDrawListener() {
        @Override
@@ -237,6 +240,8 @@ public class NotificationStackScrollLayout extends ViewGroup
        mExpandHelper.setEventSource(this);
        mExpandHelper.setScrollAdapter(this);

        mPm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);

        mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, getContext());
        mSwipeHelper.setLongPressListener(mLongPressListener);
        initView(context);
@@ -762,6 +767,11 @@ public class NotificationStackScrollLayout extends ViewGroup
                && !mOnlyScrollingInThisMotion) {
            horizontalSwipeWantsIt = mSwipeHelper.onTouchEvent(ev);
        }

        if (expandWantsIt && mIsBeingDragged) {
            mPm.cpuBoost(200 * 1000);
        }

        return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || super.onTouchEvent(ev);
    }