Merge "Revert^2 "ADD CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION"" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a23734e2b6
@@ -33,6 +33,7 @@ import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_IN
|
|||||||
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_OPEN_ALL_APPS;
|
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_OPEN_ALL_APPS;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_QUICK_SWITCH;
|
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_QUICK_SWITCH;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_UNLOCK_ENTRANCE_ANIMATION;
|
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_UNLOCK_ENTRANCE_ANIMATION;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_CLOCK_MOVE_ANIMATION;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_LAUNCH_CAMERA;
|
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_LAUNCH_CAMERA;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_OCCLUSION;
|
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_OCCLUSION;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PASSWORD_APPEAR;
|
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_PASSWORD_APPEAR;
|
||||||
@@ -231,6 +232,7 @@ public class InteractionJankMonitor {
|
|||||||
public static final int CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS = 66;
|
public static final int CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS = 66;
|
||||||
public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE = 67;
|
public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE = 67;
|
||||||
public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME = 68;
|
public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME = 68;
|
||||||
|
public static final int CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION = 70;
|
||||||
|
|
||||||
private static final int NO_STATSD_LOGGING = -1;
|
private static final int NO_STATSD_LOGGING = -1;
|
||||||
|
|
||||||
@@ -308,6 +310,8 @@ public class InteractionJankMonitor {
|
|||||||
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_SWIPE_TO_RECENTS,
|
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_SWIPE_TO_RECENTS,
|
||||||
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_SWIPE,
|
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_SWIPE,
|
||||||
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_TO_HOME,
|
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_TO_HOME,
|
||||||
|
NO_STATSD_LOGGING,
|
||||||
|
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_CLOCK_MOVE_ANIMATION,
|
||||||
};
|
};
|
||||||
|
|
||||||
private static volatile InteractionJankMonitor sInstance;
|
private static volatile InteractionJankMonitor sInstance;
|
||||||
@@ -396,7 +400,8 @@ public class InteractionJankMonitor {
|
|||||||
CUJ_RECENTS_SCROLLING,
|
CUJ_RECENTS_SCROLLING,
|
||||||
CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS,
|
CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS,
|
||||||
CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE,
|
CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE,
|
||||||
CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME
|
CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME,
|
||||||
|
CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION
|
||||||
})
|
})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface CujType {
|
public @interface CujType {
|
||||||
@@ -917,6 +922,8 @@ public class InteractionJankMonitor {
|
|||||||
return "LAUNCHER_CLOSE_ALL_APPS_SWIPE";
|
return "LAUNCHER_CLOSE_ALL_APPS_SWIPE";
|
||||||
case CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME:
|
case CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME:
|
||||||
return "LAUNCHER_CLOSE_ALL_APPS_TO_HOME";
|
return "LAUNCHER_CLOSE_ALL_APPS_TO_HOME";
|
||||||
|
case CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION:
|
||||||
|
return "LOCKSCREEN_CLOCK_MOVE_ANIMATION";
|
||||||
}
|
}
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import static android.view.View.VISIBLE;
|
|||||||
import static androidx.constraintlayout.widget.ConstraintSet.END;
|
import static androidx.constraintlayout.widget.ConstraintSet.END;
|
||||||
import static androidx.constraintlayout.widget.ConstraintSet.PARENT_ID;
|
import static androidx.constraintlayout.widget.ConstraintSet.PARENT_ID;
|
||||||
|
|
||||||
|
import static com.android.internal.jank.InteractionJankMonitor.CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION;
|
||||||
import static com.android.keyguard.KeyguardClockSwitch.LARGE;
|
import static com.android.keyguard.KeyguardClockSwitch.LARGE;
|
||||||
import static com.android.keyguard.KeyguardClockSwitch.SMALL;
|
import static com.android.keyguard.KeyguardClockSwitch.SMALL;
|
||||||
import static com.android.systemui.animation.Interpolators.EMPHASIZED_ACCELERATE;
|
import static com.android.systemui.animation.Interpolators.EMPHASIZED_ACCELERATE;
|
||||||
@@ -71,6 +72,7 @@ import android.os.VibrationEffect;
|
|||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.transition.ChangeBounds;
|
import android.transition.ChangeBounds;
|
||||||
import android.transition.Transition;
|
import android.transition.Transition;
|
||||||
|
import android.transition.TransitionListenerAdapter;
|
||||||
import android.transition.TransitionManager;
|
import android.transition.TransitionManager;
|
||||||
import android.transition.TransitionSet;
|
import android.transition.TransitionSet;
|
||||||
import android.transition.TransitionValues;
|
import android.transition.TransitionValues;
|
||||||
@@ -98,6 +100,7 @@ import android.widget.FrameLayout;
|
|||||||
import androidx.constraintlayout.widget.ConstraintSet;
|
import androidx.constraintlayout.widget.ConstraintSet;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
import com.android.internal.jank.InteractionJankMonitor;
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.internal.policy.SystemBarUtils;
|
import com.android.internal.policy.SystemBarUtils;
|
||||||
@@ -353,6 +356,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
private final NotificationGutsManager mGutsManager;
|
private final NotificationGutsManager mGutsManager;
|
||||||
private final AlternateBouncerInteractor mAlternateBouncerInteractor;
|
private final AlternateBouncerInteractor mAlternateBouncerInteractor;
|
||||||
private final QuickSettingsController mQsController;
|
private final QuickSettingsController mQsController;
|
||||||
|
private final InteractionJankMonitor mInteractionJankMonitor;
|
||||||
|
|
||||||
private long mDownTime;
|
private long mDownTime;
|
||||||
private boolean mTouchSlopExceededBeforeDown;
|
private boolean mTouchSlopExceededBeforeDown;
|
||||||
@@ -642,6 +646,19 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
step.getTransitionState() == TransitionState.RUNNING;
|
step.getTransitionState() == TransitionState.RUNNING;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private final TransitionListenerAdapter mKeyguardStatusAlignmentTransitionListener =
|
||||||
|
new TransitionListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onTransitionCancel(Transition transition) {
|
||||||
|
mInteractionJankMonitor.cancel(CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTransitionEnd(Transition transition) {
|
||||||
|
mInteractionJankMonitor.end(CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public NotificationPanelViewController(NotificationPanelView view,
|
public NotificationPanelViewController(NotificationPanelView view,
|
||||||
@Main Handler handler,
|
@Main Handler handler,
|
||||||
@@ -706,6 +723,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
NotificationStackSizeCalculator notificationStackSizeCalculator,
|
NotificationStackSizeCalculator notificationStackSizeCalculator,
|
||||||
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
|
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
|
||||||
ShadeTransitionController shadeTransitionController,
|
ShadeTransitionController shadeTransitionController,
|
||||||
|
InteractionJankMonitor interactionJankMonitor,
|
||||||
SystemClock systemClock,
|
SystemClock systemClock,
|
||||||
KeyguardBottomAreaViewModel keyguardBottomAreaViewModel,
|
KeyguardBottomAreaViewModel keyguardBottomAreaViewModel,
|
||||||
KeyguardBottomAreaInteractor keyguardBottomAreaInteractor,
|
KeyguardBottomAreaInteractor keyguardBottomAreaInteractor,
|
||||||
@@ -720,6 +738,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
DumpManager dumpManager,
|
DumpManager dumpManager,
|
||||||
KeyguardLongPressViewModel keyguardLongPressViewModel,
|
KeyguardLongPressViewModel keyguardLongPressViewModel,
|
||||||
KeyguardInteractor keyguardInteractor) {
|
KeyguardInteractor keyguardInteractor) {
|
||||||
|
mInteractionJankMonitor = interactionJankMonitor;
|
||||||
keyguardStateController.addCallback(new KeyguardStateController.Callback() {
|
keyguardStateController.addCallback(new KeyguardStateController.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onKeyguardFadingAwayChanged() {
|
public void onKeyguardFadingAwayChanged() {
|
||||||
@@ -1540,6 +1559,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
int statusConstraint = shouldBeCentered ? PARENT_ID : R.id.qs_edge_guideline;
|
int statusConstraint = shouldBeCentered ? PARENT_ID : R.id.qs_edge_guideline;
|
||||||
constraintSet.connect(R.id.keyguard_status_view, END, statusConstraint, END);
|
constraintSet.connect(R.id.keyguard_status_view, END, statusConstraint, END);
|
||||||
if (animate) {
|
if (animate) {
|
||||||
|
mInteractionJankMonitor.begin(mView, CUJ_LOCKSCREEN_CLOCK_MOVE_ANIMATION);
|
||||||
ChangeBounds transition = new ChangeBounds();
|
ChangeBounds transition = new ChangeBounds();
|
||||||
if (mSplitShadeEnabled) {
|
if (mSplitShadeEnabled) {
|
||||||
// Excluding media from the transition on split-shade, as it doesn't transition
|
// Excluding media from the transition on split-shade, as it doesn't transition
|
||||||
@@ -1563,6 +1583,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
// The clock container can sometimes be null. If it is, just fall back to the
|
// The clock container can sometimes be null. If it is, just fall back to the
|
||||||
// old animation rather than setting up the custom animations.
|
// old animation rather than setting up the custom animations.
|
||||||
if (clockContainerView == null || clockContainerView.getChildCount() == 0) {
|
if (clockContainerView == null || clockContainerView.getChildCount() == 0) {
|
||||||
|
transition.addListener(mKeyguardStatusAlignmentTransitionListener);
|
||||||
TransitionManager.beginDelayedTransition(
|
TransitionManager.beginDelayedTransition(
|
||||||
mNotificationContainerParent, transition);
|
mNotificationContainerParent, transition);
|
||||||
} else {
|
} else {
|
||||||
@@ -1581,10 +1602,11 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
adapter.setDuration(KEYGUARD_STATUS_VIEW_CUSTOM_CLOCK_MOVE_DURATION);
|
adapter.setDuration(KEYGUARD_STATUS_VIEW_CUSTOM_CLOCK_MOVE_DURATION);
|
||||||
adapter.addTarget(clockView);
|
adapter.addTarget(clockView);
|
||||||
set.addTransition(adapter);
|
set.addTransition(adapter);
|
||||||
|
set.addListener(mKeyguardStatusAlignmentTransitionListener);
|
||||||
TransitionManager.beginDelayedTransition(mNotificationContainerParent, set);
|
TransitionManager.beginDelayedTransition(mNotificationContainerParent, set);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
transition.addListener(mKeyguardStatusAlignmentTransitionListener);
|
||||||
TransitionManager.beginDelayedTransition(
|
TransitionManager.beginDelayedTransition(
|
||||||
mNotificationContainerParent, transition);
|
mNotificationContainerParent, transition);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -551,6 +551,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
|
|||||||
mNotificationStackSizeCalculator,
|
mNotificationStackSizeCalculator,
|
||||||
mUnlockedScreenOffAnimationController,
|
mUnlockedScreenOffAnimationController,
|
||||||
mShadeTransitionController,
|
mShadeTransitionController,
|
||||||
|
mInteractionJankMonitor,
|
||||||
systemClock,
|
systemClock,
|
||||||
mKeyguardBottomAreaViewModel,
|
mKeyguardBottomAreaViewModel,
|
||||||
mKeyguardBottomAreaInteractor,
|
mKeyguardBottomAreaInteractor,
|
||||||
|
|||||||
Reference in New Issue
Block a user