diff options
| author | 2024-03-06 19:17:54 +0000 | |
|---|---|---|
| committer | 2024-03-07 02:03:45 +0000 | |
| commit | efcfa073802711cd0962128449aacd98b83fba07 (patch) | |
| tree | adb0635fb719abc4fe0a1bcfef50c1ed2cf36ce8 | |
| parent | 33493216f62eb52acac0eb3de8fe0aa696c8b751 (diff) | |
Clean up NOTIFICATION_INLINE_REPLY_ANIMATION flag
Fix: 260335638
Test: atest SystemUITests
Flag: LEGACY NOTIFICATION_INLINE_REPLY_ANIMATION ENABLED
Change-Id: If852320af78edbb5f5323207bf57f4965652ba3f
7 files changed, 18 insertions, 75 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt index 6bb846491224..4939b9e1f2de 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt @@ -76,10 +76,6 @@ object Flags { val NOTIFICATION_MEMORY_LOGGING_ENABLED = releasedFlag("notification_memory_logging_enabled") - // TODO(b/260335638): Tracking Bug - @JvmField - val NOTIFICATION_INLINE_REPLY_ANIMATION = releasedFlag("notification_inline_reply_animation") - // TODO(b/288326013): Tracking Bug @JvmField val NOTIFICATION_ASYNC_HYBRID_VIEW_INFLATION = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 5f3a83aa35e0..a6aff5ab449c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -278,8 +278,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private OnExpandClickListener mOnExpandClickListener; private View.OnClickListener mOnFeedbackClickListener; private Path mExpandingClipPath; - private final RefactorFlag mInlineReplyAnimation = - RefactorFlag.forView(Flags.NOTIFICATION_INLINE_REPLY_ANIMATION); private static boolean shouldSimulateSlowMeasure() { return Compile.IS_DEBUG && RefactorFlag.forView( @@ -3241,13 +3239,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mGuts.setActualHeight(height); return; } - int contentHeight = Math.max(getMinHeight(), height); for (NotificationContentView l : mLayouts) { - if (mInlineReplyAnimation.isEnabled()) { - l.setContentHeight(height); - } else { - l.setContentHeight(contentHeight); - } + l.setContentHeight(height); } if (mIsSummaryWithChildren) { mChildrenContainer.setActualHeight(height); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java index 137e1b2ab809..8a3e7e8a0580 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java @@ -699,8 +699,7 @@ public class NotificationContentView extends FrameLayout implements Notification int hint; if (mHeadsUpChild != null && isVisibleOrTransitioning(VISIBLE_TYPE_HEADSUP)) { hint = getViewHeight(VISIBLE_TYPE_HEADSUP); - if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance() - && mHeadsUpRemoteInputController.isFocusAnimationFlagActive()) { + if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()) { // While the RemoteInputView is animating its appearance, it should be allowed // to overlap the hint, therefore no space is reserved for the hint during the // appearance animation of the RemoteInputView diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index 5bced934be7a..9633cb085afa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -135,7 +135,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene @Nullable private RevealParams mRevealParams; private Rect mContentBackgroundBounds; - private boolean mIsFocusAnimationFlagActive; private boolean mIsAnimatingAppearance = false; // TODO(b/193539698): move these to a Controller @@ -432,7 +431,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene // case to prevent flicker. if (!mRemoved) { ViewGroup parent = (ViewGroup) getParent(); - if (animate && parent != null && mIsFocusAnimationFlagActive) { + if (animate && parent != null) { ViewGroup grandParent = (ViewGroup) parent.getParent(); View actionsContainer = getActionsContainerLayout(); @@ -497,8 +496,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } private void setTopMargin(int topMargin) { - if (!(getLayoutParams() instanceof FrameLayout.LayoutParams)) return; - final FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) getLayoutParams(); + if (!(getLayoutParams() instanceof FrameLayout.LayoutParams layoutParams)) return; layoutParams.topMargin = topMargin; setLayoutParams(layoutParams); } @@ -608,24 +606,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } /** - * Sets whether the feature flag for the revised inline reply animation is active or not. - * @param active - */ - public void setIsFocusAnimationFlagActive(boolean active) { - mIsFocusAnimationFlagActive = active; - } - - /** * Focuses the RemoteInputView and animates its appearance */ public void focusAnimated() { - if (!mIsFocusAnimationFlagActive && getVisibility() != VISIBLE - && mRevealParams != null) { - android.animation.Animator animator = mRevealParams.createCircularRevealAnimator(this); - animator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); - animator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN); - animator.start(); - } else if (mIsFocusAnimationFlagActive && getVisibility() != VISIBLE) { + if (getVisibility() != VISIBLE) { mIsAnimatingAppearance = true; setAlpha(0f); Animator focusAnimator = getFocusAnimator(getActionsContainerLayout()); @@ -680,37 +664,19 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } private void reset() { - if (mIsFocusAnimationFlagActive) { - mProgressBar.setVisibility(INVISIBLE); - mResetting = true; - mSending = false; - mController.removeSpinning(mEntry.getKey(), mToken); - onDefocus(true /* animate */, false /* logClose */, () -> { - mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText()); - mEditText.getText().clear(); - mEditText.setEnabled(isAggregatedVisible()); - mSendButton.setVisibility(VISIBLE); - updateSendButton(); - setAttachment(null); - mResetting = false; - }); - return; - } - + mProgressBar.setVisibility(INVISIBLE); mResetting = true; mSending = false; - mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText()); - - mEditText.getText().clear(); - mEditText.setEnabled(isAggregatedVisible()); - mSendButton.setVisibility(VISIBLE); - mProgressBar.setVisibility(INVISIBLE); mController.removeSpinning(mEntry.getKey(), mToken); - updateSendButton(); - onDefocus(false /* animate */, false /* logClose */, null /* doAfterDefocus */); - setAttachment(null); - - mResetting = false; + onDefocus(true /* animate */, false /* logClose */, () -> { + mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText()); + mEditText.getText().clear(); + mEditText.setEnabled(isAggregatedVisible()); + mSendButton.setVisibility(VISIBLE); + updateSendButton(); + setAttachment(null); + mResetting = false; + }); } @Override @@ -854,7 +820,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); - if (mIsFocusAnimationFlagActive) setPivotY(getMeasuredHeight()); + setPivotY(getMeasuredHeight()); if (mContentBackgroundBounds != null) { mContentBackground.setBounds(mContentBackgroundBounds); } @@ -1015,9 +981,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene private RemoteInputView mRemoteInputView; boolean mShowImeOnInputConnection; - private LightBarController mLightBarController; + private final LightBarController mLightBarController; private InputMethodManager mInputMethodManager; - private ArraySet<String> mSupportedMimes = new ArraySet<>(); + private final ArraySet<String> mSupportedMimes = new ArraySet<>(); UserHandle mUser; public RemoteEditText(Context context, AttributeSet attrs) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt index 6c0d43394074..bfee9adf1f15 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputViewController.kt @@ -32,7 +32,6 @@ import android.view.View import com.android.internal.logging.UiEventLogger import com.android.systemui.res.R import com.android.systemui.flags.FeatureFlags -import com.android.systemui.flags.Flags.NOTIFICATION_INLINE_REPLY_ANIMATION import com.android.systemui.statusbar.NotificationRemoteInputManager import com.android.systemui.statusbar.RemoteInputController import com.android.systemui.statusbar.notification.collection.NotificationEntry @@ -64,8 +63,6 @@ interface RemoteInputViewController { var revealParams: RevealParams? - val isFocusAnimationFlagActive: Boolean - /** * Sets the smart reply that should be inserted in the remote input, or `null` if the user is * not editing a smart reply. @@ -155,9 +152,6 @@ class RemoteInputViewControllerImpl @Inject constructor( override val isActive: Boolean get() = view.isActive - override val isFocusAnimationFlagActive: Boolean - get() = mFlags.isEnabled(NOTIFICATION_INLINE_REPLY_ANIMATION) - override fun bind() { if (isBound) return isBound = true @@ -168,7 +162,6 @@ class RemoteInputViewControllerImpl @Inject constructor( view.setSupportedMimeTypes(it.allowedDataTypes) } view.setRevealParameters(revealParams) - view.setIsFocusAnimationFlagActive(isFocusAnimationFlagActive) view.addOnEditTextFocusChangedListener(onFocusChangeListener) view.addOnSendRemoteInputListener(onSendRemoteInputListener) diff --git a/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java index dd428f562bd1..ccdcee5e0318 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/ExpandHelperTest.java @@ -32,7 +32,6 @@ import androidx.test.filters.SmallTest; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.animation.AnimatorTestRule; import com.android.systemui.flags.FakeFeatureFlags; -import com.android.systemui.flags.Flags; import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationTestHelper; @@ -57,7 +56,6 @@ public class ExpandHelperTest extends SysuiTestCase { @Before public void setUp() throws Exception { - mFeatureFlags.setDefault(Flags.NOTIFICATION_INLINE_REPLY_ANIMATION); mDependency.injectMockDependency(KeyguardUpdateMonitor.class); mDependency.injectMockDependency(NotificationMediaManager.class); allowTestableLooperAsMainThread(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java index 13167b2d281f..c25978271b17 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java @@ -71,7 +71,6 @@ import com.android.systemui.res.R; import com.android.systemui.SysuiTestCase; import com.android.systemui.animation.AnimatorTestRule; import com.android.systemui.flags.FakeFeatureFlags; -import com.android.systemui.flags.Flags; import com.android.systemui.statusbar.NotificationRemoteInputManager; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.notification.collection.NotificationEntry; @@ -455,7 +454,6 @@ public class RemoteInputViewTest extends SysuiTestCase { private RemoteInputViewController bindController( RemoteInputView view, NotificationEntry entry) { - mFeatureFlags.set(Flags.NOTIFICATION_INLINE_REPLY_ANIMATION, true); RemoteInputViewControllerImpl viewController = new RemoteInputViewControllerImpl( view, entry, |