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

Commit 89e616fa authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Remove HUN when user launches intent from its guts" into rvc-dev

parents 2a3c6204 5fb94cca
Loading
Loading
Loading
Loading
+20 −13
Original line number Original line Diff line number Diff line
@@ -285,18 +285,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
        mLogger.logHandleClickAfterKeyguardDismissed(sbn.getKey());
        mLogger.logHandleClickAfterKeyguardDismissed(sbn.getKey());


        // TODO: Some of this code may be able to move to NotificationEntryManager.
        // TODO: Some of this code may be able to move to NotificationEntryManager.
        if (mHeadsUpManager != null && mHeadsUpManager.isAlerting(sbn.getKey())) {
        removeHUN(row);
            // Release the HUN notification to the shade.

            if (mPresenter.isPresenterFullyCollapsed()) {
                HeadsUpUtil.setIsClickedHeadsUpNotification(row, true);
            }
            //
            // In most cases, when FLAG_AUTO_CANCEL is set, the notification will
            // become canceled shortly by NoMan, but we can't assume that.
            mHeadsUpManager.removeNotification(sbn.getKey(),
                    true /* releaseImmediately */);
        }
        NotificationEntry parentToCancel = null;
        NotificationEntry parentToCancel = null;
        if (shouldAutoCancel(sbn) && mGroupManager.isOnlyChildInGroup(sbn)) {
        if (shouldAutoCancel(sbn) && mGroupManager.isOnlyChildInGroup(sbn)) {
            NotificationEntry summarySbn = mGroupManager.getLogicalGroupSummary(sbn);
            NotificationEntry summarySbn = mGroupManager.getLogicalGroupSummary(sbn);
@@ -461,8 +450,12 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
                                        row, mStatusBar.isOccluded())),
                                        row, mStatusBar.isOccluded())),
                                new UserHandle(UserHandle.getUserId(appUid)));
                                new UserHandle(UserHandle.getUserId(appUid)));
                mActivityLaunchAnimator.setLaunchResult(launchResult, true /* isActivityIntent */);
                mActivityLaunchAnimator.setLaunchResult(launchResult, true /* isActivityIntent */);
                if (shouldCollapse()) {

                // Putting it back on the main thread, since we're touching views
                // Putting it back on the main thread, since we're touching views
                mMainThreadHandler.post(() -> {
                    removeHUN(row);
                });
                if (shouldCollapse()) {
                    mMainThreadHandler.post(() -> mCommandQueue.animateCollapsePanels(
                    mMainThreadHandler.post(() -> mCommandQueue.animateCollapsePanels(
                            CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */));
                            CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */));
                }
                }
@@ -494,6 +487,20 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
        }, null, false /* afterKeyguardGone */);
        }, null, false /* afterKeyguardGone */);
    }
    }


    private void removeHUN(ExpandableNotificationRow row) {
        String key = row.getEntry().getSbn().getKey();
        if (mHeadsUpManager != null && mHeadsUpManager.isAlerting(key)) {
            // Release the HUN notification to the shade.
            if (mPresenter.isPresenterFullyCollapsed()) {
                HeadsUpUtil.setIsClickedHeadsUpNotification(row, true);
            }

            // In most cases, when FLAG_AUTO_CANCEL is set, the notification will
            // become canceled shortly by NoMan, but we can't assume that.
            mHeadsUpManager.removeNotification(key, true /* releaseImmediately */);
        }
    }

    private void handleFullScreenIntent(NotificationEntry entry) {
    private void handleFullScreenIntent(NotificationEntry entry) {
        if (mNotificationInterruptStateProvider.shouldLaunchFullScreenIntentWhenAdded(entry)) {
        if (mNotificationInterruptStateProvider.shouldLaunchFullScreenIntentWhenAdded(entry)) {
            if (shouldSuppressFullScreenIntent(entry)) {
            if (shouldSuppressFullScreenIntent(entry)) {