Skip to content

Commit

Permalink
SystemUI: Forward port QS fling animation boost to NotificationPanelV…
Browse files Browse the repository at this point in the history
…iewController

PanelViewController.java was deleted and migrated
to NotificationPanelViewController.java in Android
13 QPR2.

Change-Id: I2113e059709da2154479d9a6a4a3d5100f829a52
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
  • Loading branch information
xboxfanj authored and hungphan2001 committed Nov 27, 2023
1 parent 2cfdd71 commit ac6b914
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
import android.text.TextUtils;
import android.util.BoostFramework;
import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.MathUtils;
Expand Down Expand Up @@ -657,6 +658,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump

private final PowerManagerInternal mLocalPowerManager;

/**
* For PanelView fling perflock call
*/
private BoostFramework mPerf = null;

private final Runnable mFlingCollapseRunnable = () -> fling(0, false /* expand */,
mNextCollapseSpeedUpFactor, false /* expandBecauseOfFalsing */);
private final Runnable mAnimateKeyguardBottomAreaInvisibleEndRunnable =
Expand Down Expand Up @@ -1007,6 +1013,7 @@ public void onUnlockAnimationStarted(
mAlternateBouncerInteractor = alternateBouncerInteractor;
dumpManager.registerDumpable(this);
mLocalPowerManager = LocalServices.getService(PowerManagerInternal.class);
mPerf = new BoostFramework();
}

private void unlockAnimationFinished() {
Expand Down Expand Up @@ -2044,6 +2051,10 @@ public void onAnimationEnd(Animator animation) {
if (mLocalPowerManager != null) {
mLocalPowerManager.setPowerBoost(Boost.DISPLAY_UPDATE_IMMINENT, 200);
}
if (mPerf != null) {
String currentPackage = mView.getContext().getPackageName();
mPerf.perfHint(BoostFramework.VENDOR_HINT_SCROLL_BOOST, currentPackage, -1, BoostFramework.Scroll.PANEL_VIEW);
}
animator.addListener(new AnimatorListenerAdapter() {
private boolean mCancelled;

Expand All @@ -2056,11 +2067,17 @@ public void onAnimationStart(Animator animation) {

@Override
public void onAnimationCancel(Animator animation) {
if (mPerf != null) {
mPerf.perfLockRelease();
}
mCancelled = true;
}

@Override
public void onAnimationEnd(Animator animation) {
if (mPerf != null) {
mPerf.perfLockRelease();
}
if (shouldSpringBack && !mCancelled) {
// After the shade is flung open to an overscrolled state, spring back
// the shade by reducing section padding to 0.
Expand Down

0 comments on commit ac6b914

Please sign in to comment.