Merge changes Ie539c898,I92e041ed,I9e8030b4,I38442212,I355d0330, ... into udc-dev

* changes:
  Remove NOTIFICATION_INLINE_REPLY_ANIMATION flag
  Remove NOTIFICATION_GROUP_DISMISSAL_ANIMATION flag
  Remove NOTIFICATION_DISMISSAL_FADE flag
  Remove FSI_ON_DND_UPDATE flag
  Remove LEAVE_SHADE_OPEN_FOR_BUGREPORT flag
  Remove FILTER_UNSEEN_NOTIFS_ON_KEYGUARD flag
  Remove FSI_REQUIRES_KEYGUARD flag
This commit is contained in:
Jeff DeCew
2023-04-14 13:54:59 +00:00
committed by Android (Google) Code Review
25 changed files with 52 additions and 439 deletions

View File

@@ -58,12 +58,6 @@ object Flags {
"notification_drag_to_contents"
)
// TODO(b/254512517): Tracking Bug
val FSI_REQUIRES_KEYGUARD = releasedFlag(110, "fsi_requires_keyguard")
// TODO(b/259130119): Tracking Bug
val FSI_ON_DND_UPDATE = releasedFlag(259130119, "fsi_on_dnd_update")
// TODO(b/254512538): Tracking Bug
val INSTANT_VOICE_REPLY = unreleasedFlag(111, "instant_voice_reply")
@@ -74,16 +68,8 @@ object Flags {
val NOTIFICATION_MEMORY_LOGGING_ENABLED =
unreleasedFlag(119, "notification_memory_logging_enabled")
// TODO(b/254512731): Tracking Bug
@JvmField val NOTIFICATION_DISMISSAL_FADE = releasedFlag(113, "notification_dismissal_fade")
@JvmField val USE_ROUNDNESS_SOURCETYPES = releasedFlag(116, "use_roundness_sourcetype")
// TODO(b/259217907)
@JvmField
val NOTIFICATION_GROUP_DISMISSAL_ANIMATION =
releasedFlag(259217907, "notification_group_dismissal_animation")
@JvmField
val SIMPLIFIED_APPEAR_FRACTION =
unreleasedFlag(259395680, "simplified_appear_fraction", teamfood = true)
@@ -91,14 +77,6 @@ object Flags {
// TODO(b/257315550): Tracking Bug
val NO_HUN_FOR_OLD_WHEN = releasedFlag(118, "no_hun_for_old_when")
// TODO(b/260335638): Tracking Bug
@JvmField
val NOTIFICATION_INLINE_REPLY_ANIMATION =
releasedFlag(174148361, "notification_inline_reply_animation")
val FILTER_UNSEEN_NOTIFS_ON_KEYGUARD =
releasedFlag(254647461, "filter_unseen_notifs_on_keyguard")
// TODO(b/277338665): Tracking Bug
@JvmField
val NOTIFICATION_SHELF_REFACTOR =
@@ -613,8 +591,6 @@ object Flags {
@JvmField val CLIPBOARD_REMOTE_BEHAVIOR = releasedFlag(1701, "clipboard_remote_behavior")
// 1800 - shade container
@JvmField
val LEAVE_SHADE_OPEN_FOR_BUGREPORT = releasedFlag(1800, "leave_shade_open_for_bugreport")
// TODO(b/265944639): Tracking Bug
@JvmField val DUAL_SHADE = unreleasedFlag(1801, "dual_shade")

View File

@@ -1043,9 +1043,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
Log.w(TAG, "Bugreport handler could not be launched");
mIActivityManager.requestInteractiveBugReport();
}
// Maybe close shade (depends on a flag) so user sees the activity
mCentralSurfacesOptional.ifPresent(
CentralSurfaces::collapseShadeForBugreport);
} catch (RemoteException e) {
}
}
@@ -1064,8 +1061,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
mMetricsLogger.action(MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_FULL);
mUiEventLogger.log(GlobalActionsEvent.GA_BUGREPORT_LONG_PRESS);
mIActivityManager.requestFullBugReport();
// Maybe close shade (depends on a flag) so user sees the activity
mCentralSurfacesOptional.ifPresent(CentralSurfaces::collapseShadeForBugreport);
} catch (RemoteException e) {
}
return false;

View File

@@ -31,26 +31,12 @@ class NotifPipelineFlags @Inject constructor(
fun isDevLoggingEnabled(): Boolean =
featureFlags.isEnabled(Flags.NOTIFICATION_PIPELINE_DEVELOPER_LOGGING)
fun fullScreenIntentRequiresKeyguard(): Boolean =
featureFlags.isEnabled(Flags.FSI_REQUIRES_KEYGUARD)
fun fsiOnDNDUpdate(): Boolean = featureFlags.isEnabled(Flags.FSI_ON_DND_UPDATE)
fun forceDemoteFsi(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.FSI_FORCE_DEMOTE)
fun showStickyHunForDeniedFsi(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.SHOW_STICKY_HUN_FOR_DENIED_FSI)
fun allowDismissOngoing(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.ALLOW_DISMISS_ONGOING)
fun isOtpRedactionEnabled(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.OTP_REDACTION)
val shouldFilterUnseenNotifsOnKeyguard: Boolean
get() = featureFlags.isEnabled(Flags.FILTER_UNSEEN_NOTIFS_ON_KEYGUARD)
val isNoHunForOldWhenEnabled: Boolean
get() = featureFlags.isEnabled(Flags.NO_HUN_FOR_OLD_WHEN)
}

View File

@@ -392,8 +392,7 @@ class HeadsUpCoordinator @Inject constructor(
mNotificationInterruptStateProvider.logFullScreenIntentDecision(entry, fsiDecision)
if (fsiDecision.shouldLaunch) {
mLaunchFullScreenIntentProvider.launchFullScreenIntent(entry)
} else if (mFlags.fsiOnDNDUpdate() &&
fsiDecision == FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND) {
} else if (fsiDecision == FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND) {
// If DND was the only reason this entry was suppressed, note it for potential
// reconsideration on later ranking updates.
addForFSIReconsideration(entry, mSystemClock.currentTimeMillis())
@@ -509,7 +508,7 @@ class HeadsUpCoordinator @Inject constructor(
// - was suppressed from FSI launch only by a DND suppression
// - is within the recency window for reconsideration
// If any of these entries are no longer suppressed, launch the FSI now.
if (mFlags.fsiOnDNDUpdate() && isCandidateForFSIReconsideration(entry)) {
if (isCandidateForFSIReconsideration(entry)) {
val decision =
mNotificationInterruptStateProvider.getFullScreenIntentDecision(entry)
if (decision.shouldLaunch) {

View File

@@ -95,9 +95,7 @@ constructor(
pipeline.addFinalizeFilter(notifFilter)
keyguardNotificationVisibilityProvider.addOnStateChangedListener(::invalidateListFromFilter)
updateSectionHeadersVisibility()
if (notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard) {
attachUnseenFilter(pipeline)
}
attachUnseenFilter(pipeline)
}
private fun attachUnseenFilter(pipeline: NotifPipeline) {

View File

@@ -16,7 +16,6 @@
package com.android.systemui.statusbar.notification.collection.inflation;
import static com.android.systemui.flags.Flags.NOTIFICATION_INLINE_REPLY_ANIMATION;
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_CONTRACTED;
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_EXPANDED;
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_PUBLIC;
@@ -31,7 +30,6 @@ import android.view.ViewGroup;
import com.android.internal.util.NotificationMessagingUtil;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
@@ -73,7 +71,6 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
private NotificationListContainer mListContainer;
private BindRowCallback mBindRowCallback;
private NotificationClicker mNotificationClicker;
private FeatureFlags mFeatureFlags;
@Inject
public NotificationRowBinderImpl(
@@ -85,8 +82,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
RowContentBindStage rowContentBindStage,
Provider<RowInflaterTask> rowInflaterTaskProvider,
ExpandableNotificationRowComponent.Builder expandableNotificationRowComponentBuilder,
IconManager iconManager,
FeatureFlags featureFlags) {
IconManager iconManager) {
mContext = context;
mNotifBindPipeline = notifBindPipeline;
mRowContentBindStage = rowContentBindStage;
@@ -96,7 +92,6 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
mRowInflaterTaskProvider = rowInflaterTaskProvider;
mExpandableNotificationRowComponentBuilder = expandableNotificationRowComponentBuilder;
mIconManager = iconManager;
mFeatureFlags = featureFlags;
}
/**
@@ -180,8 +175,6 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
entry.setRow(row);
mNotifBindPipeline.manageRow(entry, row);
mBindRowCallback.onBindRow(row);
row.setInlineReplyAnimationFlagEnabled(
mFeatureFlags.isEnabled(NOTIFICATION_INLINE_REPLY_ANIMATION));
}
/**

View File

@@ -97,10 +97,6 @@ public interface NotificationInterruptStateProvider {
* that the HUN will probably not display.
*/
NO_FSI_NO_HUN_OR_KEYGUARD(false),
/**
* No conditions blocking FSI launch.
*/
FSI_EXPECTED_NOT_TO_HUN(true),
/**
* The notification is coming from a suspended packages, so FSI is suppressed.
*/

View File

@@ -321,30 +321,22 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter
suppressedByDND);
}
// Check whether FSI requires the keyguard to be showing.
if (mFlags.fullScreenIntentRequiresKeyguard()) {
// If notification won't HUN and keyguard is showing, launch the FSI.
if (mKeyguardStateController.isShowing()) {
if (mKeyguardStateController.isOccluded()) {
return getDecisionGivenSuppression(
FullScreenIntentDecision.FSI_KEYGUARD_OCCLUDED,
suppressedByDND);
} else {
// Likely LOCKED_SHADE, but launch FSI anyway
return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_LOCKED_SHADE,
suppressedByDND);
}
// If notification won't HUN and keyguard is showing, launch the FSI.
if (mKeyguardStateController.isShowing()) {
if (mKeyguardStateController.isOccluded()) {
return getDecisionGivenSuppression(
FullScreenIntentDecision.FSI_KEYGUARD_OCCLUDED,
suppressedByDND);
} else {
// Likely LOCKED_SHADE, but launch FSI anyway
return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_LOCKED_SHADE,
suppressedByDND);
}
// Detect the case determined by b/231322873 to launch FSI while device is in use,
// as blocked by the correct implementation, and report the event.
return getDecisionGivenSuppression(FullScreenIntentDecision.NO_FSI_NO_HUN_OR_KEYGUARD,
suppressedByDND);
}
// If the notification won't HUN for some other reason (DND/snooze/etc), launch FSI.
return getDecisionGivenSuppression(FullScreenIntentDecision.FSI_EXPECTED_NOT_TO_HUN,
// Detect the case determined by b/231322873 to launch FSI while device is in use,
// as blocked by the correct implementation, and report the event.
return getDecisionGivenSuppression(FullScreenIntentDecision.NO_FSI_NO_HUN_OR_KEYGUARD,
suppressedByDND);
}
@@ -409,14 +401,11 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter
}
final boolean isSnoozedPackage = isSnoozedPackage(sbn);
final boolean fsiRequiresKeyguard = mFlags.fullScreenIntentRequiresKeyguard();
final boolean hasFsi = sbn.getNotification().fullScreenIntent != null;
// Assume any notification with an FSI is time-sensitive (like an alarm or incoming call)
// and ignore whether HUNs have been snoozed for the package.
final boolean shouldBypassSnooze = fsiRequiresKeyguard && hasFsi;
if (isSnoozedPackage && !shouldBypassSnooze) {
if (isSnoozedPackage && !hasFsi) {
if (log) mLogger.logNoHeadsUpPackageSnoozed(entry);
return false;
}

View File

@@ -272,7 +272,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
private OnExpandClickListener mOnExpandClickListener;
private View.OnClickListener mOnFeedbackClickListener;
private Path mExpandingClipPath;
private boolean mIsInlineReplyAnimationFlagEnabled = false;
// Listener will be called when receiving a long click event.
// Use #setLongPressPosition to optionally assign positional data with the long press.
@@ -3086,10 +3085,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
return showingLayout != null && showingLayout.requireRowToHaveOverlappingRendering();
}
public void setInlineReplyAnimationFlagEnabled(boolean isEnabled) {
mIsInlineReplyAnimationFlagEnabled = isEnabled;
}
@Override
public void setActualHeight(int height, boolean notifyListeners) {
boolean changed = height != getActualHeight();
@@ -3109,11 +3104,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
}
int contentHeight = Math.max(getMinHeight(), height);
for (NotificationContentView l : mLayouts) {
if (mIsInlineReplyAnimationFlagEnabled) {
l.setContentHeight(height);
} else {
l.setContentHeight(contentHeight);
}
l.setContentHeight(height);
}
if (mIsSummaryWithChildren) {
mChildrenContainer.setActualHeight(height);

View File

@@ -376,8 +376,7 @@ public class ExpandableNotificationRowController implements NotifViewController
public boolean offerToKeepInParentForAnimation() {
//If the User dismissed the notification's parent, we want to keep it attached until the
//dismiss animation is ongoing. Therefore we don't want to remove it in the ShadeViewDiffer.
if (mFeatureFlags.isEnabled(Flags.NOTIFICATION_GROUP_DISMISSAL_ANIMATION)
&& mView.isParentDismissed()) {
if (mView.isParentDismissed()) {
mView.setKeepInParentForDismissAnimation(true);
return true;
}

View File

@@ -635,8 +635,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

View File

@@ -180,7 +180,6 @@ public class NotificationStackScrollLayoutController {
private final SeenNotificationsProvider mSeenNotificationsProvider;
private NotificationStackScrollLayout mView;
private boolean mFadeNotificationsOnDismiss;
private NotificationSwipeHelper mSwipeHelper;
@Nullable
private Boolean mHistoryEnabled;
@@ -548,7 +547,7 @@ public class NotificationStackScrollLayoutController {
public boolean updateSwipeProgress(View animView, boolean dismissable,
float swipeProgress) {
// Returning true prevents alpha fading.
return !mFadeNotificationsOnDismiss;
return false;
}
@Override
@@ -773,7 +772,6 @@ public class NotificationStackScrollLayoutController {
mLockscreenUserManager.addUserChangedListener(mLockscreenUserChangeListener);
mFadeNotificationsOnDismiss = mFeatureFlags.isEnabled(Flags.NOTIFICATION_DISMISSAL_FADE);
if (!mUseRoundnessSourceTypes) {
mNotificationRoundnessManager.setOnRoundingChangedCallback(mView::invalidate);
mView.addOnExpandedHeightChangedListener(mNotificationRoundnessManager::setExpanded);
@@ -1942,8 +1940,7 @@ public class NotificationStackScrollLayoutController {
public void setNotifStats(@NonNull NotifStats notifStats) {
mNotifStats = notifStats;
mView.setHasFilteredOutSeenNotifications(
mNotifPipelineFlags.getShouldFilterUnseenNotifsOnKeyguard()
&& mSeenNotificationsProvider.getHasFilteredOutSeenNotifications());
mSeenNotificationsProvider.getHasFilteredOutSeenNotifications());
updateFooter();
updateShowEmptyShadeView();
}

View File

@@ -430,9 +430,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn
void collapseShade();
/** Collapse the shade, but conditional on a flag specific to the trigger of a bugreport. */
void collapseShadeForBugreport();
int getWakefulnessState();
boolean isScreenFullyOff();

View File

@@ -951,11 +951,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
mUiModeManager = mContext.getSystemService(UiModeManager.class);
mBubblesOptional.ifPresent(this::initBubbles);
// Do not restart System UI when the bugreport flag changes.
mFeatureFlags.addListener(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, event -> {
event.requestNoRestart();
});
mStatusBarSignalPolicy.init();
mKeyguardIndicationController.init();
@@ -3530,13 +3525,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
}
}
@Override
public void collapseShadeForBugreport() {
if (!mFeatureFlags.isEnabled(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT)) {
collapseShade();
}
}
@VisibleForTesting
final WakefulnessLifecycle.Observer mWakefulnessObserver = new WakefulnessLifecycle.Observer() {
@Override

View File

@@ -331,26 +331,6 @@ class StatusBarNotificationPresenter implements NotificationPresenter,
return true;
}
if (sbn.getNotification().fullScreenIntent != null
&& !mNotifPipelineFlags.fullScreenIntentRequiresKeyguard()) {
// we don't allow head-up on the lockscreen (unless there's a
// "showWhenLocked" activity currently showing) if
// the potential HUN has a fullscreen intent
if (mKeyguardStateController.isShowing() && !mCentralSurfaces.isOccluded()) {
if (DEBUG) {
Log.d(TAG, "No heads up: entry has fullscreen intent on lockscreen "
+ sbn.getKey());
}
return true;
}
if (mAccessibilityManager.isTouchExplorationEnabled()) {
if (DEBUG) {
Log.d(TAG, "No heads up: accessible fullscreen: " + sbn.getKey());
}
return true;
}
}
return false;
}

View File

@@ -21,7 +21,6 @@ import static android.view.WindowInsetsAnimation.Callback.DISPATCH_MODE_STOP;
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_STANDARD;
import android.app.ActivityManager;
import android.app.Notification;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
@@ -135,7 +134,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
@@ -433,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();
ViewGroupOverlay overlay = parent.getOverlay();
@@ -597,25 +595,11 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
mEditText.setText(editTextContent);
}
/**
* 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());
@@ -670,37 +654,19 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
}
private void reset() {
if (mIsFocusAnimationFlagActive) {
mProgressBar.setVisibility(INVISIBLE);
mResetting = true;
mSending = false;
onDefocus(true /* animate */, false /* logClose */, () -> {
mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText());
mEditText.getText().clear();
mEditText.setEnabled(isAggregatedVisible());
mSendButton.setVisibility(VISIBLE);
mController.removeSpinning(mEntry.getKey(), mToken);
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);
mController.removeSpinning(mEntry.getKey(), mToken);
updateSendButton();
setAttachment(null);
mResetting = false;
});
}
@Override
@@ -844,7 +810,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);
}

View File

@@ -30,8 +30,6 @@ import android.util.Log
import android.view.View
import com.android.internal.logging.UiEventLogger
import com.android.systemui.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
@@ -63,8 +61,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.
@@ -122,7 +118,6 @@ class RemoteInputViewControllerImpl @Inject constructor(
private val remoteInputController: RemoteInputController,
private val shortcutManager: ShortcutManager,
private val uiEventLogger: UiEventLogger,
private val mFlags: FeatureFlags
) : RemoteInputViewController {
private val onSendListeners = ArraySet<OnSendRemoteInputListener>()
@@ -154,9 +149,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
@@ -167,7 +159,6 @@ class RemoteInputViewControllerImpl @Inject constructor(
view.setSupportedMimeTypes(it.allowedDataTypes)
}
view.setRevealParameters(revealParams)
view.setIsFocusAnimationFlagActive(isFocusAnimationFlagActive)
view.addOnEditTextFocusChangedListener(onFocusChangeListener)
view.addOnSendRemoteInputListener(onSendRemoteInputListener)

View File

@@ -22,7 +22,6 @@ import android.testing.TestableLooper.RunWithLooper
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.logcatLogBuffer
import com.android.systemui.flags.Flags
import com.android.systemui.statusbar.NotificationRemoteInputManager
import com.android.systemui.statusbar.notification.NotifPipelineFlags
import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder
@@ -171,9 +170,6 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
// Set the default FSI decision
setShouldFullScreen(any(), FullScreenIntentDecision.NO_FULL_SCREEN_INTENT)
// Run tests with default feature flag state
whenever(flags.fsiOnDNDUpdate()).thenReturn(Flags.FSI_ON_DND_UPDATE.default)
}
@Test
@@ -258,7 +254,7 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
@Test
fun testOnEntryAdded_shouldFullScreen() {
setShouldFullScreen(entry, FullScreenIntentDecision.FSI_EXPECTED_NOT_TO_HUN)
setShouldFullScreen(entry, FullScreenIntentDecision.FSI_KEYGUARD_SHOWING)
collectionListener.onEntryAdded(entry)
verify(launchFullScreenIntentProvider).launchFullScreenIntent(entry)
}
@@ -853,39 +849,8 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
)
}
@Test
fun testOnRankingApplied_noFSIOnUpdateWhenFlagOff() {
// Ensure the feature flag is off
whenever(flags.fsiOnDNDUpdate()).thenReturn(false)
// GIVEN that mEntry was previously suppressed from full-screen only by DND
setShouldFullScreen(entry, FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND)
collectionListener.onEntryAdded(entry)
// Verify that this causes a log
verifyLoggedFullScreenIntentDecision(
entry,
FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND
)
clearInterruptionProviderInvocations()
// and it is then updated to allow full screen
setShouldFullScreen(entry, FullScreenIntentDecision.FSI_DEVICE_NOT_INTERACTIVE)
whenever(notifPipeline.allNotifs).thenReturn(listOf(entry))
collectionListener.onRankingApplied()
// THEN it should not full screen because the feature is off
verify(launchFullScreenIntentProvider, never()).launchFullScreenIntent(any())
// VERIFY that no additional logging happens either
verifyNoFullScreenIntentDecisionLogged()
}
@Test
fun testOnRankingApplied_updateToFullScreen() {
// Turn on the feature
whenever(flags.fsiOnDNDUpdate()).thenReturn(true)
// GIVEN that mEntry was previously suppressed from full-screen only by DND
setShouldFullScreen(entry, FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND)
collectionListener.onEntryAdded(entry)
@@ -929,9 +894,6 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
@Test
fun testOnRankingApplied_withOnlyDndSuppressionAllowsFsiLater() {
// Turn on the feature
whenever(flags.fsiOnDNDUpdate()).thenReturn(true)
// GIVEN that mEntry was previously suppressed from full-screen only by DND
setShouldFullScreen(entry, FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND)
collectionListener.onEntryAdded(entry)
@@ -980,9 +942,6 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
@Test
fun testOnRankingApplied_newNonFullScreenAnswerInvalidatesCandidate() {
// Turn on the feature
whenever(flags.fsiOnDNDUpdate()).thenReturn(true)
// GIVEN that mEntry was previously suppressed from full-screen only by DND
whenever(notifPipeline.allNotifs).thenReturn(listOf(entry))
setShouldFullScreen(entry, FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND)
@@ -1018,9 +977,6 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
@Test
fun testOnRankingApplied_noFSIWhenAlsoSuppressedForOtherReasons() {
// Feature on
whenever(flags.fsiOnDNDUpdate()).thenReturn(true)
// GIVEN that mEntry is suppressed by DND (functionally), but not *only* DND
setShouldFullScreen(entry, FullScreenIntentDecision.NO_FSI_SUPPRESSED_BY_DND)
collectionListener.onEntryAdded(entry)
@@ -1035,9 +991,6 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
@Test
fun testOnRankingApplied_noFSIWhenTooOld() {
// Feature on
whenever(flags.fsiOnDNDUpdate()).thenReturn(true)
// GIVEN that mEntry is suppressed only by DND
setShouldFullScreen(entry, FullScreenIntentDecision.NO_FSI_SUPPRESSED_ONLY_BY_DND)
collectionListener.onEntryAdded(entry)
@@ -1046,7 +999,7 @@ class HeadsUpCoordinatorTest : SysuiTestCase() {
coordinator.addForFSIReconsideration(entry, systemClock.currentTimeMillis() - 10000)
// and it is updated to full screen later
setShouldFullScreen(entry, FullScreenIntentDecision.FSI_EXPECTED_NOT_TO_HUN)
setShouldFullScreen(entry, FullScreenIntentDecision.FSI_KEYGUARD_SHOWING)
collectionListener.onRankingApplied()
// THEN it should still not full screen because it's too old

View File

@@ -97,8 +97,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterSuppressesSeenNotifWhileKeyguardShowing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -124,8 +122,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterStopsMarkingSeenNotifWhenTransitionToAod() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is not expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(false)
@@ -151,8 +147,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilter_headsUpMarkedAsSeen() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is not expanded
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(false)
@@ -183,14 +177,12 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterDoesNotSuppressSeenOngoingNotifWhileKeyguardShowing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and an ongoing notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
runKeyguardCoordinatorTest {
val fakeEntry = NotificationEntryBuilder()
.setNotification(Notification.Builder(mContext).setOngoing(true).build())
.setNotification(Notification.Builder(mContext, "id").setOngoing(true).build())
.build()
collectionListener.onEntryAdded(fakeEntry)
@@ -205,8 +197,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterDoesNotSuppressSeenMediaNotifWhileKeyguardShowing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a media notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -229,8 +219,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterUpdatesSeenProviderWhenSuppressing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -255,8 +243,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterInvalidatesWhenSettingChanges() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, and shade is expanded
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -292,8 +278,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterAllowsNewNotif() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is showing, no notifications present
keyguardRepository.setKeyguardShowing(true)
runKeyguardCoordinatorTest {
@@ -308,8 +292,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterSeenGroupSummaryWithUnseenChild() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -342,8 +324,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenNotificationIsMarkedAsSeenWhenKeyguardGoesAway() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is showing, not dozing, unseen notification is present
keyguardRepository.setKeyguardShowing(true)
keyguardRepository.setDozing(false)
@@ -370,8 +350,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenNotificationIsNotMarkedAsSeenIfShadeNotExpanded() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is showing, unseen notification is present
keyguardRepository.setKeyguardShowing(true)
runKeyguardCoordinatorTest {
@@ -441,20 +419,15 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
val unseenFilter: NotifFilter
get() = keyguardCoordinator.unseenNotifFilter
// TODO(254647461): Remove lazy from these properties once
// Flags.FILTER_UNSEEN_NOTIFS_ON_KEYGUARD is enabled and removed
val collectionListener: NotifCollectionListener by lazy {
withArgCaptor { verify(notifPipeline).addCollectionListener(capture()) }
val collectionListener: NotifCollectionListener = withArgCaptor {
verify(notifPipeline).addCollectionListener(capture())
}
val onHeadsUpChangedListener: OnHeadsUpChangedListener by lazy {
val onHeadsUpChangedListener: OnHeadsUpChangedListener get() =
withArgCaptor { verify(headsUpManager).addListener(capture()) }
}
val statusBarStateListener: StatusBarStateController.StateListener by lazy {
val statusBarStateListener: StatusBarStateController.StateListener get() =
withArgCaptor { verify(statusBarStateController).addCallback(capture()) }
}
var showOnlyUnseenNotifsOnKeyguardSetting: Boolean
get() =

View File

@@ -123,7 +123,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(false);
when(mUserTracker.getUserId()).thenReturn(ActivityManager.getCurrentUser());
mUiEventLoggerFake = new UiEventLoggerFake();
@@ -543,12 +542,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
verify(mLogger, never()).logMaybeHeadsUpDespiteOldWhen(any(), anyLong(), anyLong(), any());
}
@Test
public void testShouldNotFullScreen_notPendingIntent_withStrictFlag() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldNotFullScreen_notPendingIntent();
}
@Test
public void testShouldNotFullScreen_notPendingIntent() throws RemoteException {
NotificationEntry entry = createNotification(IMPORTANCE_HIGH);
@@ -603,12 +596,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
verify(mLogger).logNoFullscreen(entry, "NO_FSI_SUPPRESSED_BY_DND");
}
@Test
public void testShouldNotFullScreen_notHighImportance_withStrictFlag() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldNotFullScreen_notHighImportance();
}
@Test
public void testShouldNotFullScreen_notHighImportance() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_DEFAULT, /* silenced */ false);
@@ -625,12 +612,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
verify(mLogger, never()).logFullscreen(any(), any());
}
@Test
public void testShouldNotFullScreen_isGroupAlertSilenced_withStrictFlag() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldNotFullScreen_isGroupAlertSilenced();
}
@Test
public void testShouldNotFullScreen_isGroupAlertSilenced() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ true);
@@ -655,12 +636,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
assertThat(fakeUiEvent.packageName).isEqualTo(entry.getSbn().getPackageName());
}
@Test
public void testShouldNotFullScreen_isSuppressedByBubbleMetadata_withStrictFlag() {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldNotFullScreen_isSuppressedByBubbleMetadata();
}
@Test
public void testShouldNotFullScreen_isSuppressedByBubbleMetadata() {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
@@ -688,12 +663,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
assertThat(fakeUiEvent.packageName).isEqualTo(entry.getSbn().getPackageName());
}
@Test
public void testShouldFullScreen_notInteractive_withStrictFlag() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldFullScreen_notInteractive();
}
@Test
public void testShouldFullScreen_notInteractive() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
@@ -713,12 +682,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
verify(mLogger).logFullscreen(entry, "FSI_DEVICE_NOT_INTERACTIVE");
}
@Test
public void testShouldFullScreen_isDreaming_withStrictFlag() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldFullScreen_isDreaming();
}
@Test
public void testShouldFullScreen_isDreaming() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
@@ -735,12 +698,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
verify(mLogger).logFullscreen(entry, "FSI_DEVICE_IS_DREAMING");
}
@Test
public void testShouldFullScreen_onKeyguard_withStrictFlag() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldFullScreen_onKeyguard();
}
@Test
public void testShouldFullScreen_onKeyguard() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
@@ -757,12 +714,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
verify(mLogger).logFullscreen(entry, "FSI_KEYGUARD_SHOWING");
}
@Test
public void testShouldNotFullScreen_willHun_withStrictFlag() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
testShouldNotFullScreen_willHun();
}
@Test
public void testShouldNotFullScreen_willHun() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
@@ -781,26 +732,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
}
@Test
public void testShouldFullScreen_packageSnoozed() throws RemoteException {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
when(mPowerManager.isScreenOn()).thenReturn(true);
when(mStatusBarStateController.isDreaming()).thenReturn(false);
when(mStatusBarStateController.getState()).thenReturn(SHADE);
when(mHeadsUpManager.isSnoozed("a")).thenReturn(true);
assertThat(mNotifInterruptionStateProvider.getFullScreenIntentDecision(entry))
.isEqualTo(FullScreenIntentDecision.FSI_EXPECTED_NOT_TO_HUN);
assertThat(mNotifInterruptionStateProvider.shouldLaunchFullScreenIntentWhenAdded(entry))
.isTrue();
verify(mLogger, never()).logNoFullscreen(any(), any());
verify(mLogger, never()).logNoFullscreenWarning(any(), any());
verify(mLogger).logFullscreen(entry, "FSI_EXPECTED_NOT_TO_HUN");
}
@Test
public void testShouldNotFullScreen_snoozed_occluding_withStrictRules() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
public void testShouldNotFullScreen_snoozed_occluding() throws Exception {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
when(mPowerManager.isScreenOn()).thenReturn(true);
@@ -820,8 +752,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
}
@Test
public void testShouldHeadsUp_snoozed_occluding_withStrictRules() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
public void testShouldHeadsUp_snoozed_occluding() throws Exception {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
when(mPowerManager.isScreenOn()).thenReturn(true);
@@ -845,8 +776,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
}
@Test
public void testShouldNotFullScreen_snoozed_lockedShade_withStrictRules() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
public void testShouldNotFullScreen_snoozed_lockedShade() throws Exception {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
when(mPowerManager.isScreenOn()).thenReturn(true);
@@ -866,8 +796,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
}
@Test
public void testShouldHeadsUp_snoozed_lockedShade_withStrictRules() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
public void testShouldHeadsUp_snoozed_lockedShade() throws Exception {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
when(mPowerManager.isScreenOn()).thenReturn(true);
@@ -891,8 +820,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
}
@Test
public void testShouldNotFullScreen_snoozed_unlocked_withStrictRules() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
public void testShouldNotFullScreen_snoozed_unlocked() throws Exception {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
when(mPowerManager.isScreenOn()).thenReturn(true);
@@ -955,8 +883,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
}
@Test
public void testShouldHeadsUp_snoozed_unlocked_withStrictRules() throws Exception {
when(mFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
public void testShouldHeadsUp_snoozed_unlocked() throws Exception {
NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silenced */ false);
when(mPowerManager.isInteractive()).thenReturn(true);
when(mPowerManager.isScreenOn()).thenReturn(true);

View File

@@ -25,7 +25,6 @@ import com.android.internal.statusbar.IStatusBarService
import com.android.systemui.SysuiTestCase
import com.android.systemui.classifier.FalsingCollector
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.plugins.PluginManager
import com.android.systemui.plugins.statusbar.StatusBarStateController
@@ -145,8 +144,6 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() {
@Test
fun offerKeepInParent_parentDismissed() {
whenever(featureFlags.isEnabled(Flags.NOTIFICATION_GROUP_DISMISSAL_ANIMATION))
.thenReturn(true)
whenever(view.isParentDismissed).thenReturn(true)
Assert.assertTrue(controller.offerToKeepInParentForAnimation())
@@ -155,9 +152,6 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() {
@Test
fun offerKeepInParent_parentNotDismissed() {
whenever(featureFlags.isEnabled(Flags.NOTIFICATION_GROUP_DISMISSAL_ANIMATION))
.thenReturn(true)
Assert.assertFalse(controller.offerToKeepInParentForAnimation())
Mockito.verify(view, never()).setKeepInParentForDismissAnimation(anyBoolean())
}

View File

@@ -403,7 +403,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
@Test
public void testSetNotifStats_updatesHasFilteredOutSeenNotifications() {
when(mNotifPipelineFlags.getShouldFilterUnseenNotifsOnKeyguard()).thenReturn(true);
mSeenNotificationsProvider.setHasFilteredOutSeenNotifications(true);
mController.attach(mNotificationStackScrollLayout);
mController.getNotifStackController().setNotifStats(NotifStats.getEmpty());

View File

@@ -1204,34 +1204,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
verify(mShadeController, never()).animateCollapseShade();
}
@Test
public void collapseShadeForBugReport_callsanimateCollapseShade_whenFlagDisabled() {
// GIVEN the shade is expanded & flag enabled
mCentralSurfaces.onShadeExpansionFullyChanged(true);
mCentralSurfaces.setBarStateForTest(SHADE);
mFeatureFlags.set(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, false);
// WHEN collapseShadeForBugreport is called
mCentralSurfaces.collapseShadeForBugreport();
// VERIFY that animateCollapseShade is called
verify(mShadeController).animateCollapseShade();
}
@Test
public void collapseShadeForBugReport_doesNotCallanimateCollapseShade_whenFlagEnabled() {
// GIVEN the shade is expanded & flag enabled
mCentralSurfaces.onShadeExpansionFullyChanged(true);
mCentralSurfaces.setBarStateForTest(SHADE);
mFeatureFlags.set(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, true);
// WHEN collapseShadeForBugreport is called
mCentralSurfaces.collapseShadeForBugreport();
// VERIFY that animateCollapseShade is called
verify(mShadeController, never()).animateCollapseShade();
}
@Test
public void deviceStateChange_unfolded_shadeOpen_setsLeaveOpenOnKeyguardHide() {
setFoldedStates(FOLD_STATE_FOLDED);

View File

@@ -194,46 +194,7 @@ public class StatusBarNotificationPresenterTest extends SysuiTestCase {
}
@Test
public void testNoSuppressHeadsUp_FSI_occludedKeygaurd() {
when(mNotifPipelineFlags.fullScreenIntentRequiresKeyguard()).thenReturn(false);
Notification n = new Notification.Builder(getContext(), "a")
.setFullScreenIntent(mock(PendingIntent.class), true)
.build();
NotificationEntry entry = new NotificationEntryBuilder()
.setPkg("a")
.setOpPkg("a")
.setTag("a")
.setNotification(n)
.build();
when(mKeyguardStateController.isShowing()).thenReturn(true);
when(mKeyguardStateController.isOccluded()).thenReturn(true);
when(mCentralSurfaces.isOccluded()).thenReturn(true);
assertFalse(mInterruptSuppressor.suppressAwakeHeadsUp(entry));
}
@Test
public void testSuppressHeadsUp_FSI_nonOccludedKeygaurd() {
when(mNotifPipelineFlags.fullScreenIntentRequiresKeyguard()).thenReturn(false);
Notification n = new Notification.Builder(getContext(), "a")
.setFullScreenIntent(mock(PendingIntent.class), true)
.build();
NotificationEntry entry = new NotificationEntryBuilder()
.setPkg("a")
.setOpPkg("a")
.setTag("a")
.setNotification(n)
.build();
when(mKeyguardStateController.isShowing()).thenReturn(true);
when(mKeyguardStateController.isOccluded()).thenReturn(false);
when(mCentralSurfaces.isOccluded()).thenReturn(false);
assertTrue(mInterruptSuppressor.suppressAwakeHeadsUp(entry));
}
@Test
public void testNoSuppressHeadsUp_FSI_nonOccludedKeygaurd_withNewFlag() {
when(mNotifPipelineFlags.fullScreenIntentRequiresKeyguard()).thenReturn(true);
public void testNoSuppressHeadsUp_FSI_nonOccludedKeyguard() {
Notification n = new Notification.Builder(getContext(), "a")
.setFullScreenIntent(mock(PendingIntent.class), true)
.build();

View File

@@ -70,8 +70,6 @@ import com.android.internal.logging.testing.UiEventLoggerFake;
import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
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;
@@ -453,17 +451,13 @@ public class RemoteInputViewTest extends SysuiTestCase {
private RemoteInputViewController bindController(
RemoteInputView view,
NotificationEntry entry) {
FakeFeatureFlags fakeFeatureFlags = new FakeFeatureFlags();
fakeFeatureFlags.set(Flags.NOTIFICATION_INLINE_REPLY_ANIMATION, true);
RemoteInputViewControllerImpl viewController = new RemoteInputViewControllerImpl(
view,
entry,
mRemoteInputQuickSettingsDisabler,
mController,
mShortcutManager,
mUiEventLoggerFake,
fakeFeatureFlags
);
mUiEventLoggerFake);
viewController.bind();
return viewController;
}