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

Commit a29d1f5c authored by András Kurucz's avatar András Kurucz
Browse files

[Flexiglass] Reset the tracked HUN row at the end of the touch

AmbientState was leaking the last mTrackedHeadsUpRow, because it was
never resetted. This CL resets it when HeadsUpTouchHelper receives an
ACTION_CANCEL up ACTION_UP event.

TouchHelpers were not receiving any more motion events after the user
has started an interaction with the shade (NSSL#isShadeBeingDragged()).
This CL keeps dispatching motion events to NSSL's TouchHelpers even
when we need to dispatch them to the scene framework.

Bug: 391204020
Test: check if AmbientState#mTrackedHeadsUpRow is resetted after swipes
      - receive a HUN
      - touch it (snooze, swipe down to open shade, any swipe)
      - finish the touch
      - dumpsysui AmbientState
Flag: com.android.systemui.scene_container
Change-Id: I6cdf739b9f8914f7fdfc9d3da65e5080036b06e7
parent 658b0cad
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.systemui.statusbar.notification.headsup;
package com.android.systemui.statusbar.notification.headsup;


import android.annotation.Nullable;
import android.content.Context;
import android.content.Context;
import android.os.RemoteException;
import android.os.RemoteException;
import android.view.MotionEvent;
import android.view.MotionEvent;
@@ -210,10 +211,12 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
                        if (mHeadsUpManager.shouldSwallowClick(
                        if (mHeadsUpManager.shouldSwallowClick(
                                mPickedChild.getEntry().getSbn().getKey())) {
                                mPickedChild.getEntry().getSbn().getKey())) {
                            endMotion();
                            endMotion();
                            setTrackingHeadsUp(false);
                            return true;
                            return true;
                        }
                        }
                    }
                    }
                    endMotion();
                    endMotion();
                    setTrackingHeadsUp(false);
                    return false;
                    return false;
            }
            }
            return false;
            return false;
@@ -258,7 +261,7 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
        void setHeadsUpDraggingStartingHeight(int startHeight);
        void setHeadsUpDraggingStartingHeight(int startHeight);


        /** Sets notification that is being expanded. */
        /** Sets notification that is being expanded. */
        void setTrackedHeadsUp(ExpandableNotificationRow expandableNotificationRow);
        void setTrackedHeadsUp(@Nullable ExpandableNotificationRow expandableNotificationRow);


        /** Called when a MotionEvent is about to trigger expansion. */
        /** Called when a MotionEvent is about to trigger expansion. */
        void startExpand(float newX, float newY, boolean startTracking, float expandedHeight);
        void startExpand(float newX, float newY, boolean startTracking, float expandedHeight);
+3 −0
Original line number Original line Diff line number Diff line
@@ -3630,6 +3630,9 @@ public class NotificationStackScrollLayout
                    mScrollViewFields.sendCurrentGestureInGuts(false);
                    mScrollViewFields.sendCurrentGestureInGuts(false);
                    mScrollViewFields.sendCurrentGestureOverscroll(false);
                    mScrollViewFields.sendCurrentGestureOverscroll(false);
                    setIsBeingDragged(false);
                    setIsBeingDragged(false);
                    // dispatch to touchHandlers, so they can still finalize a previously started
                    // motion, while the shade is being dragged
                    return super.dispatchTouchEvent(ev);
                }
                }
                return false;
                return false;
            }
            }