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

Commit a26b0bae authored by Yining Liu's avatar Yining Liu
Browse files

Re-format files

Run ktfmt to reformat the files touched by adding logs to track the
reasons for calling HeadsUpManager#removeNotification.

Bug: 357316448
Test: atest SystemUITests
Flag: EXEMPT refactor
Change-Id: I95fd75acfade2ef9d77d32d342b4d29725324c40
parent 260212d1
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -179,8 +179,8 @@ class HeadsUpManagerPhoneTest(flags: FlagsParameterization) : BaseHeadsUpManager
        mContext
            .getOrCreateTestableResources()
            .addOverride(R.integer.ambient_notification_extension_time, 500)
        mAvalancheController = AvalancheController(dumpManager, mUiEventLogger,
                mHeadsUpManagerLogger, mBgHandler)
        mAvalancheController =
            AvalancheController(dumpManager, mUiEventLogger, mHeadsUpManagerLogger, mBgHandler)
    }

    @Test
@@ -200,7 +200,8 @@ class HeadsUpManagerPhoneTest(flags: FlagsParameterization) : BaseHeadsUpManager
        hmp.addSwipedOutNotification(entry.key)

        // Remove should succeed because the notification is swiped out
        val removedImmediately = hmp.removeNotification(
        val removedImmediately =
            hmp.removeNotification(
                entry.key,
                /* releaseImmediately= */ false,
                /* reason= */ "swipe out"
+6 −1
Original line number Diff line number Diff line
@@ -173,7 +173,12 @@ class NotificationTransitionAnimatorController(
        // TODO: b/297247841 - Call on the row we're removing, which may differ from notification.
        HeadsUpUtil.setNeedsHeadsUpDisappearAnimationAfterClick(notification, animate)

        headsUpManager.removeNotification(row.entry.key, true /* releaseImmediately */, animate, reason)
        headsUpManager.removeNotification(
            row.entry.key,
            true /* releaseImmediately */,
            animate,
            reason
        )
    }

    override fun onTransitionAnimationCancelled(newKeyguardOccludedState: Boolean?) {
+8 −4
Original line number Diff line number Diff line
@@ -524,7 +524,11 @@ constructor(
                    val removeImmediatelyForRemoteInput =
                        (mRemoteInputManager.isSpinning(entryKey) &&
                            !NotificationRemoteInputManager.FORCE_REMOTE_INPUT_HISTORY)
                    mHeadsUpManager.removeNotification(entry.key, removeImmediatelyForRemoteInput, "onEntryRemoved, reason: $reason")
                    mHeadsUpManager.removeNotification(
                        entry.key,
                        removeImmediatelyForRemoteInput,
                        "onEntryRemoved, reason: $reason"
                    )
                }
            }

+1 −1
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            mBubblesManagerOptional.ifPresent(bubblesManager ->
                    bubblesManager.onUserChangedBubble(entry, !entry.isBubble()));
            mHeadsUpManager.removeNotification(entry.getKey(), /* releaseImmediately= */ true,
                    "onNotificationBubbleIconClicked");
                    /* reason= */ "onNotificationBubbleIconClicked");
        };
        if (entry.isBubble()) {
            // entry is being un-bubbled, no need to unlock
+11 −12
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ interface HeadsUpManager : Dumpable {
        key: String,
        releaseImmediately: Boolean,
        animate: Boolean,
            reason: String): Boolean
        reason: String
    ): Boolean

    /** Clears all managed notifications. */
    fun releaseAllImmediately()
@@ -293,7 +294,5 @@ class HeadsUpManagerEmptyImpl @Inject constructor() : HeadsUpManager {

@Module
interface HeadsUpEmptyImplModule {
    @Binds
    @SysUISingleton
    fun bindsHeadsUpManager(noOpHum: HeadsUpManagerEmptyImpl): HeadsUpManager
    @Binds @SysUISingleton fun bindsHeadsUpManager(noOpHum: HeadsUpManagerEmptyImpl): HeadsUpManager
}
Loading