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

Commit 04855269 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Do not recycle HeadsUpManagerPhone objects" into main

parents fd70e030 d0b54515
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import com.android.systemui.statusbar.notification.shared.NotificationIconContai
import com.android.systemui.statusbar.notification.shared.NotificationMinimalismPrototype
import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRefactor
import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor
import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun
import com.android.systemui.statusbar.notification.shared.PriorityPeopleSection
import javax.inject.Inject

@@ -59,6 +60,7 @@ class FlagDependencies @Inject constructor(featureFlags: FeatureFlagsClassic, ha
        NotificationAvalancheSuppression.token dependsOn VisualInterruptionRefactor.token
        PriorityPeopleSection.token dependsOn SortBySectionTimeFlag.token
        NotificationMinimalismPrototype.token dependsOn NotificationsHeadsUpRefactor.token
        NotificationsHeadsUpRefactor.token dependsOn NotificationThrottleHun.token

        // SceneContainer dependencies
        SceneContainerFlag.getFlagDependencies().forEach { (alpha, beta) -> alpha dependsOn beta }
+4 −4
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements

        @Override
        public HeadsUpEntryPhone acquire() {
            NotificationsHeadsUpRefactor.assertInLegacyMode();
            NotificationThrottleHun.assertInLegacyMode();
            if (!mPoolObjects.isEmpty()) {
                return mPoolObjects.pop();
            }
@@ -126,7 +126,7 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements

        @Override
        public boolean release(@NonNull HeadsUpEntryPhone instance) {
            NotificationsHeadsUpRefactor.assertInLegacyMode();
            NotificationThrottleHun.assertInLegacyMode();
            mPoolObjects.push(instance);
            return true;
        }
@@ -428,7 +428,7 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements
    @NonNull
    @Override
    protected HeadsUpEntry createHeadsUpEntry(NotificationEntry entry) {
        if (NotificationsHeadsUpRefactor.isEnabled()) {
        if (NotificationThrottleHun.isEnabled()) {
            return new HeadsUpEntryPhone(entry);
        } else {
            HeadsUpEntryPhone headsUpEntry = mEntryPool.acquire();
@@ -454,7 +454,7 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements
    @Override
    protected void onEntryRemoved(HeadsUpEntry headsUpEntry) {
        super.onEntryRemoved(headsUpEntry);
        if (!NotificationsHeadsUpRefactor.isEnabled()) {
        if (!NotificationThrottleHun.isEnabled()) {
            mEntryPool.release((HeadsUpEntryPhone) headsUpEntry);
        }
        updateTopHeadsUpFlow();
+4 −4
Original line number Diff line number Diff line
@@ -439,7 +439,7 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
            onEntryRemoved(finalHeadsUpEntry);
            // TODO(b/328390331) move accessibility events to the view layer
            entry.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
            if (NotificationsHeadsUpRefactor.isEnabled()) {
            if (NotificationThrottleHun.isEnabled()) {
                finalHeadsUpEntry.cancelAutoRemovalCallbacks("removeEntry");
            } else {
                finalHeadsUpEntry.reset();
@@ -768,7 +768,7 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
        @Nullable private Runnable mCancelRemoveRunnable;

        public HeadsUpEntry() {
            NotificationsHeadsUpRefactor.assertInLegacyMode();
            NotificationThrottleHun.assertInLegacyMode();
        }

        public HeadsUpEntry(NotificationEntry entry) {
@@ -779,7 +779,7 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {

        /** Attach a NotificationEntry. */
        public void setEntry(@NonNull final NotificationEntry entry) {
            NotificationsHeadsUpRefactor.assertInLegacyMode();
            NotificationThrottleHun.assertInLegacyMode();
            setEntry(entry, createRemoveRunnable(entry));
        }

@@ -976,7 +976,7 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
        }

        public void reset() {
            NotificationsHeadsUpRefactor.assertInLegacyMode();
            NotificationThrottleHun.assertInLegacyMode();
            cancelAutoRemovalCallbacks("reset()");
            mEntry = null;
            mRemoveRunnable = null;