Merge "Replaced setPanelExpanded with listener in NPVC/Central Surfaces" into tm-qpr-dev am: 2bb38bf265
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20031316 Change-Id: I468b932719506a8d7e42d63e97c57e486b70e9ad Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -44,6 +44,7 @@ import com.android.systemui.screenshot.ReferenceScreenshotModule;
|
||||
import com.android.systemui.shade.NotificationShadeWindowControllerImpl;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.shade.ShadeControllerImpl;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
|
||||
@@ -162,7 +163,8 @@ public abstract class ReferenceSystemUIModule {
|
||||
ConfigurationController configurationController,
|
||||
@Main Handler handler,
|
||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||
UiEventLogger uiEventLogger) {
|
||||
UiEventLogger uiEventLogger,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager) {
|
||||
return new HeadsUpManagerPhone(
|
||||
context,
|
||||
headsUpManagerLogger,
|
||||
@@ -173,7 +175,8 @@ public abstract class ReferenceSystemUIModule {
|
||||
configurationController,
|
||||
handler,
|
||||
accessibilityManagerWrapper,
|
||||
uiEventLogger
|
||||
uiEventLogger,
|
||||
shadeExpansionStateManager
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3394,11 +3394,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
||||
boolean isExpanded = !isFullyCollapsed() || mExpectingSynthesizedDown;
|
||||
if (mPanelExpanded != isExpanded) {
|
||||
mPanelExpanded = isExpanded;
|
||||
|
||||
mHeadsUpManager.setIsPanelExpanded(isExpanded);
|
||||
mStatusBarTouchableRegionManager.setPanelExpanded(isExpanded);
|
||||
mCentralSurfaces.setPanelExpanded(isExpanded);
|
||||
|
||||
mShadeExpansionStateManager.onShadeExpansionFullyChanged(isExpanded);
|
||||
if (!isExpanded && mQs != null && mQs.isCustomizing()) {
|
||||
mQs.closeCustomizer();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import android.view.WindowManager;
|
||||
import android.view.WindowManager.LayoutParams;
|
||||
import android.view.WindowManagerGlobal;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.keyguard.KeyguardUpdateMonitor;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
@@ -158,6 +159,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
||||
SysuiStatusBarStateController.RANK_STATUS_BAR_WINDOW_CONTROLLER);
|
||||
configurationController.addCallback(this);
|
||||
shadeExpansionStateManager.addQsExpansionListener(this::onQsExpansionChanged);
|
||||
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||
|
||||
float desiredPreferredRefreshRate = context.getResources()
|
||||
.getInteger(R.integer.config_keyguardRefreshRate);
|
||||
@@ -204,6 +206,14 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||
if (mCurrentState.mPanelExpanded != isExpanded) {
|
||||
mCurrentState.mPanelExpanded = isExpanded;
|
||||
apply(mCurrentState);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a listener to monitor scrims visibility
|
||||
* @param listener A listener to monitor scrims visibility
|
||||
@@ -698,15 +708,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
||||
apply(mCurrentState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPanelExpanded(boolean isExpanded) {
|
||||
if (mCurrentState.mPanelExpanded == isExpanded) {
|
||||
return;
|
||||
}
|
||||
mCurrentState.mPanelExpanded = isExpanded;
|
||||
apply(mCurrentState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteInputActive(boolean remoteInputActive) {
|
||||
mCurrentState.mRemoteInputActive = remoteInputActive;
|
||||
|
||||
@@ -34,6 +34,7 @@ import javax.inject.Inject
|
||||
class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
|
||||
|
||||
private val expansionListeners = CopyOnWriteArrayList<ShadeExpansionListener>()
|
||||
private val fullExpansionListeners = CopyOnWriteArrayList<ShadeFullExpansionListener>()
|
||||
private val qsExpansionListeners = CopyOnWriteArrayList<ShadeQsExpansionListener>()
|
||||
private val stateListeners = CopyOnWriteArrayList<ShadeStateListener>()
|
||||
private val shadeStateEventsListeners = CopyOnWriteArrayList<ShadeStateEventsListener>()
|
||||
@@ -62,6 +63,15 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
|
||||
expansionListeners.remove(listener)
|
||||
}
|
||||
|
||||
fun addFullExpansionListener(listener: ShadeFullExpansionListener) {
|
||||
fullExpansionListeners.add(listener)
|
||||
listener.onShadeExpansionFullyChanged(qsExpanded)
|
||||
}
|
||||
|
||||
fun removeFullExpansionListener(listener: ShadeFullExpansionListener) {
|
||||
fullExpansionListeners.remove(listener)
|
||||
}
|
||||
|
||||
fun addQsExpansionListener(listener: ShadeQsExpansionListener) {
|
||||
qsExpansionListeners.add(listener)
|
||||
listener.onQsExpansionChanged(qsExpanded)
|
||||
@@ -156,6 +166,13 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
|
||||
qsExpansionListeners.forEach { it.onQsExpansionChanged(qsExpanded) }
|
||||
}
|
||||
|
||||
fun onShadeExpansionFullyChanged(isExpanded: Boolean) {
|
||||
this.expanded = isExpanded
|
||||
|
||||
debugLog("expanded=$isExpanded")
|
||||
fullExpansionListeners.forEach { it.onShadeExpansionFullyChanged(isExpanded) }
|
||||
}
|
||||
|
||||
/** Updates the panel state if necessary. */
|
||||
fun updateState(@PanelState state: Int) {
|
||||
debugLog(
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.shade
|
||||
|
||||
/** A listener interface to be notified of expansion events for the notification shade. */
|
||||
fun interface ShadeFullExpansionListener {
|
||||
/** Invoked whenever the shade expansion changes, when it is fully collapsed or expanded */
|
||||
fun onShadeExpansionFullyChanged(isExpanded: Boolean)
|
||||
}
|
||||
@@ -123,9 +123,6 @@ public interface NotificationShadeWindowController extends RemoteInputController
|
||||
/** Sets whether the window was collapsed by force or not. */
|
||||
default void setForceWindowCollapsed(boolean force) {}
|
||||
|
||||
/** Sets whether panel is expanded or not. */
|
||||
default void setPanelExpanded(boolean isExpanded) {}
|
||||
|
||||
/** Gets whether the panel is expanded or not. */
|
||||
default boolean getPanelExpanded() {
|
||||
return false;
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.android.systemui.animation.Interpolators;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
|
||||
import com.android.systemui.statusbar.policy.CallbackController;
|
||||
|
||||
@@ -153,13 +154,18 @@ public class StatusBarStateControllerImpl implements
|
||||
private Interpolator mDozeInterpolator = Interpolators.FAST_OUT_SLOW_IN;
|
||||
|
||||
@Inject
|
||||
public StatusBarStateControllerImpl(UiEventLogger uiEventLogger, DumpManager dumpManager,
|
||||
InteractionJankMonitor interactionJankMonitor) {
|
||||
public StatusBarStateControllerImpl(
|
||||
UiEventLogger uiEventLogger,
|
||||
DumpManager dumpManager,
|
||||
InteractionJankMonitor interactionJankMonitor,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager
|
||||
) {
|
||||
mUiEventLogger = uiEventLogger;
|
||||
mInteractionJankMonitor = interactionJankMonitor;
|
||||
for (int i = 0; i < HISTORY_SIZE; i++) {
|
||||
mHistoricalRecords[i] = new HistoricalState();
|
||||
}
|
||||
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||
|
||||
dumpManager.registerDumpable(this);
|
||||
}
|
||||
@@ -262,21 +268,6 @@ public class StatusBarStateControllerImpl implements
|
||||
return mIsExpanded;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setPanelExpanded(boolean expanded) {
|
||||
if (mIsExpanded == expanded) {
|
||||
return false;
|
||||
}
|
||||
mIsExpanded = expanded;
|
||||
String tag = getClass().getSimpleName() + "#setIsExpanded";
|
||||
DejankUtils.startDetectingBlockingIpcs(tag);
|
||||
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
||||
rl.mListener.onExpandedChanged(mIsExpanded);
|
||||
}
|
||||
DejankUtils.stopDetectingBlockingIpcs(tag);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getInterpolatedDozeAmount() {
|
||||
return mDozeInterpolator.getInterpolation(mDozeAmount);
|
||||
@@ -325,6 +316,18 @@ public class StatusBarStateControllerImpl implements
|
||||
}
|
||||
}
|
||||
|
||||
private void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||
if (mIsExpanded != isExpanded) {
|
||||
mIsExpanded = isExpanded;
|
||||
String tag = getClass().getSimpleName() + "#setIsExpanded";
|
||||
DejankUtils.startDetectingBlockingIpcs(tag);
|
||||
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
||||
rl.mListener.onExpandedChanged(mIsExpanded);
|
||||
}
|
||||
DejankUtils.stopDetectingBlockingIpcs(tag);
|
||||
}
|
||||
}
|
||||
|
||||
private void startDozeAnimation() {
|
||||
if (mDozeAmount == 0f || mDozeAmount == 1f) {
|
||||
mDozeInterpolator = mIsDozing
|
||||
|
||||
@@ -108,13 +108,6 @@ public interface SysuiStatusBarStateController extends StatusBarStateController
|
||||
*/
|
||||
void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated);
|
||||
|
||||
/**
|
||||
* Update the expanded state from {@link CentralSurfaces}'s perspective
|
||||
* @param expanded are we expanded?
|
||||
* @return {@code true} if the state changed, else {@code false}
|
||||
*/
|
||||
boolean setPanelExpanded(boolean expanded);
|
||||
|
||||
/**
|
||||
* Sets whether to leave status bar open when hiding keyguard
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.settings.UserContextProvider;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.shade.ShadeEventsModule;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifInflaterImpl;
|
||||
@@ -160,6 +161,7 @@ public interface NotificationsModule {
|
||||
NotificationVisibilityProvider visibilityProvider,
|
||||
NotifPipeline notifPipeline,
|
||||
StatusBarStateController statusBarStateController,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||
NotificationLogger.ExpansionStateLogger expansionStateLogger,
|
||||
NotificationPanelLogger notificationPanelLogger) {
|
||||
return new NotificationLogger(
|
||||
@@ -169,6 +171,7 @@ public interface NotificationsModule {
|
||||
visibilityProvider,
|
||||
notifPipeline,
|
||||
statusBarStateController,
|
||||
shadeExpansionStateManager,
|
||||
expansionStateLogger,
|
||||
notificationPanelLogger);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.android.internal.statusbar.NotificationVisibility;
|
||||
import com.android.systemui.dagger.qualifiers.UiBackground;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
|
||||
@@ -92,25 +93,6 @@ public class NotificationLogger implements StateListener {
|
||||
private Boolean mPanelExpanded = null; // Use null to indicate state is not yet known
|
||||
private boolean mLogging = false;
|
||||
|
||||
protected final OnChildLocationsChangedListener mNotificationLocationsChangedListener =
|
||||
new OnChildLocationsChangedListener() {
|
||||
@Override
|
||||
public void onChildLocationsChanged() {
|
||||
if (mHandler.hasCallbacks(mVisibilityReporter)) {
|
||||
// Visibilities will be reported when the existing
|
||||
// callback is executed.
|
||||
return;
|
||||
}
|
||||
// Calculate when we're allowed to run the visibility
|
||||
// reporter. Note that this timestamp might already have
|
||||
// passed. That's OK, the callback will just be executed
|
||||
// ASAP.
|
||||
long nextReportUptimeMs =
|
||||
mLastVisibilityReportUptimeMs + VISIBILITY_REPORT_MIN_DELAY_MS;
|
||||
mHandler.postAtTime(mVisibilityReporter, nextReportUptimeMs);
|
||||
}
|
||||
};
|
||||
|
||||
// Tracks notifications currently visible in mNotificationStackScroller and
|
||||
// emits visibility events via NoMan on changes.
|
||||
protected Runnable mVisibilityReporter = new Runnable() {
|
||||
@@ -219,6 +201,7 @@ public class NotificationLogger implements StateListener {
|
||||
NotificationVisibilityProvider visibilityProvider,
|
||||
NotifPipeline notifPipeline,
|
||||
StatusBarStateController statusBarStateController,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||
ExpansionStateLogger expansionStateLogger,
|
||||
NotificationPanelLogger notificationPanelLogger) {
|
||||
mNotificationListener = notificationListener;
|
||||
@@ -232,6 +215,7 @@ public class NotificationLogger implements StateListener {
|
||||
mNotificationPanelLogger = notificationPanelLogger;
|
||||
// Not expected to be destroyed, don't need to unsubscribe
|
||||
statusBarStateController.addCallback(this);
|
||||
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||
|
||||
registerNewPipelineListener();
|
||||
}
|
||||
@@ -278,14 +262,14 @@ public class NotificationLogger implements StateListener {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "startNotificationLogging");
|
||||
}
|
||||
mListContainer.setChildLocationsChangedListener(mNotificationLocationsChangedListener);
|
||||
mListContainer.setChildLocationsChangedListener(this::onChildLocationsChanged);
|
||||
// Some transitions like mVisibleToUser=false -> mVisibleToUser=true don't
|
||||
// cause the scroller to emit child location events. Hence generate
|
||||
// one ourselves to guarantee that we're reporting visible
|
||||
// notifications.
|
||||
// (Note that in cases where the scroller does emit events, this
|
||||
// additional event doesn't break anything.)
|
||||
mNotificationLocationsChangedListener.onChildLocationsChanged();
|
||||
onChildLocationsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,21 +394,6 @@ public class NotificationLogger implements StateListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by CentralSurfaces to notify the logger that the panel expansion has changed.
|
||||
* The panel may be showing any of the normal notification panel, the AOD, or the bouncer.
|
||||
* @param isExpanded True if the panel is expanded.
|
||||
*/
|
||||
public void onPanelExpandedChanged(boolean isExpanded) {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "onPanelExpandedChanged: new=" + isExpanded);
|
||||
}
|
||||
mPanelExpanded = isExpanded;
|
||||
synchronized (mDozingLock) {
|
||||
maybeUpdateLoggingStatus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the notification is expanded / collapsed.
|
||||
*/
|
||||
@@ -433,6 +402,36 @@ public class NotificationLogger implements StateListener {
|
||||
mExpansionStateLogger.onExpansionChanged(key, isUserAction, isExpanded, location);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||
// mPanelExpanded is initialized as null
|
||||
if (mPanelExpanded == null || !mPanelExpanded.equals(isExpanded)) {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "onPanelExpandedChanged: new=" + isExpanded);
|
||||
}
|
||||
mPanelExpanded = isExpanded;
|
||||
synchronized (mDozingLock) {
|
||||
maybeUpdateLoggingStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void onChildLocationsChanged() {
|
||||
if (mHandler.hasCallbacks(mVisibilityReporter)) {
|
||||
// Visibilities will be reported when the existing
|
||||
// callback is executed.
|
||||
return;
|
||||
}
|
||||
// Calculate when we're allowed to run the visibility
|
||||
// reporter. Note that this timestamp might already have
|
||||
// passed. That's OK, the callback will just be executed
|
||||
// ASAP.
|
||||
long nextReportUptimeMs =
|
||||
mLastVisibilityReportUptimeMs + VISIBILITY_REPORT_MIN_DELAY_MS;
|
||||
mHandler.postAtTime(mVisibilityReporter, nextReportUptimeMs);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setVisibilityReporter(Runnable visibilityReporter) {
|
||||
mVisibilityReporter = visibilityReporter;
|
||||
|
||||
@@ -258,8 +258,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn
|
||||
|
||||
void onKeyguardViewManagerStatesUpdated();
|
||||
|
||||
void setPanelExpanded(boolean isExpanded);
|
||||
|
||||
ViewGroup getNotificationScrollLayout();
|
||||
|
||||
boolean isPulsing();
|
||||
|
||||
@@ -848,6 +848,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
||||
mScreenOffAnimationController = screenOffAnimationController;
|
||||
|
||||
mShadeExpansionStateManager.addExpansionListener(this::onPanelExpansionChanged);
|
||||
mShadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||
|
||||
mBubbleExpandListener = (isExpanding, key) ->
|
||||
mContext.getMainExecutor().execute(this::updateScrimController);
|
||||
@@ -1376,6 +1377,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
||||
private void onPanelExpansionChanged(ShadeExpansionChangeEvent event) {
|
||||
float fraction = event.getFraction();
|
||||
boolean tracking = event.getTracking();
|
||||
boolean isExpanded = event.getExpanded();
|
||||
dispatchPanelExpansionForKeyguardDismiss(fraction, tracking);
|
||||
|
||||
if (fraction == 0 || fraction == 1) {
|
||||
@@ -1388,6 +1390,23 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||
if (mPanelExpanded != isExpanded) {
|
||||
mPanelExpanded = isExpanded;
|
||||
if (isExpanded && mStatusBarStateController.getState() != StatusBarState.KEYGUARD) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "clearing notification effects from Height");
|
||||
}
|
||||
clearNotificationEffects();
|
||||
}
|
||||
|
||||
if (!isExpanded) {
|
||||
mRemoteInputManager.onPanelCollapsed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Lifecycle getLifecycle() {
|
||||
@@ -1792,27 +1811,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
||||
logStateToEventlog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPanelExpanded(boolean isExpanded) {
|
||||
if (mPanelExpanded != isExpanded) {
|
||||
mNotificationLogger.onPanelExpandedChanged(isExpanded);
|
||||
}
|
||||
mPanelExpanded = isExpanded;
|
||||
mStatusBarHideIconsForBouncerManager.setPanelExpandedAndTriggerUpdate(isExpanded);
|
||||
mNotificationShadeWindowController.setPanelExpanded(isExpanded);
|
||||
mStatusBarStateController.setPanelExpanded(isExpanded);
|
||||
if (isExpanded && mStatusBarStateController.getState() != StatusBarState.KEYGUARD) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "clearing notification effects from Height");
|
||||
}
|
||||
clearNotificationEffects();
|
||||
}
|
||||
|
||||
if (!isExpanded) {
|
||||
mRemoteInputManager.onPanelCollapsed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup getNotificationScrollLayout() {
|
||||
return mStackScroller;
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.provider.OnReorderingAllowedListener;
|
||||
@@ -111,7 +112,8 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
||||
ConfigurationController configurationController,
|
||||
@Main Handler handler,
|
||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||
UiEventLogger uiEventLogger) {
|
||||
UiEventLogger uiEventLogger,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager) {
|
||||
super(context, logger, handler, accessibilityManagerWrapper, uiEventLogger);
|
||||
Resources resources = mContext.getResources();
|
||||
mExtensionTime = resources.getInteger(R.integer.ambient_notification_extension_time);
|
||||
@@ -132,6 +134,8 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
||||
updateResources();
|
||||
}
|
||||
});
|
||||
|
||||
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||
}
|
||||
|
||||
public void setAnimationStateHandler(AnimationStateHandler handler) {
|
||||
@@ -220,13 +224,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
||||
mTrackingHeadsUp = trackingHeadsUp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify that the status bar panel gets expanded or collapsed.
|
||||
*
|
||||
* @param isExpanded True to notify expanded, false to notify collapsed.
|
||||
* TODO(b/237811427) replace with a listener
|
||||
*/
|
||||
public void setIsPanelExpanded(boolean isExpanded) {
|
||||
private void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||
if (isExpanded != mIsExpanded) {
|
||||
mIsExpanded = isExpanded;
|
||||
if (isExpanded) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.android.systemui.Dumpable
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.dagger.qualifiers.Main
|
||||
import com.android.systemui.dump.DumpManager
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager
|
||||
import com.android.systemui.statusbar.CommandQueue
|
||||
import com.android.systemui.statusbar.window.StatusBarWindowStateController
|
||||
import com.android.systemui.util.concurrency.DelayableExecutor
|
||||
@@ -24,10 +25,11 @@ import javax.inject.Inject
|
||||
*/
|
||||
@SysUISingleton
|
||||
class StatusBarHideIconsForBouncerManager @Inject constructor(
|
||||
private val commandQueue: CommandQueue,
|
||||
@Main private val mainExecutor: DelayableExecutor,
|
||||
statusBarWindowStateController: StatusBarWindowStateController,
|
||||
dumpManager: DumpManager
|
||||
private val commandQueue: CommandQueue,
|
||||
@Main private val mainExecutor: DelayableExecutor,
|
||||
statusBarWindowStateController: StatusBarWindowStateController,
|
||||
shadeExpansionStateManager: ShadeExpansionStateManager,
|
||||
dumpManager: DumpManager
|
||||
) : Dumpable {
|
||||
// State variables set by external classes.
|
||||
private var panelExpanded: Boolean = false
|
||||
@@ -47,6 +49,12 @@ class StatusBarHideIconsForBouncerManager @Inject constructor(
|
||||
statusBarWindowStateController.addListener {
|
||||
state -> setStatusBarStateAndTriggerUpdate(state)
|
||||
}
|
||||
shadeExpansionStateManager.addFullExpansionListener { isExpanded ->
|
||||
if (panelExpanded != isExpanded) {
|
||||
panelExpanded = isExpanded
|
||||
updateHideIconsForBouncer(animate = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns true if the status bar icons should be hidden in the bouncer. */
|
||||
@@ -63,11 +71,6 @@ class StatusBarHideIconsForBouncerManager @Inject constructor(
|
||||
this.displayId = displayId
|
||||
}
|
||||
|
||||
fun setPanelExpandedAndTriggerUpdate(panelExpanded: Boolean) {
|
||||
this.panelExpanded = panelExpanded
|
||||
updateHideIconsForBouncer(animate = false)
|
||||
}
|
||||
|
||||
fun setIsOccludedAndTriggerUpdate(isOccluded: Boolean) {
|
||||
this.isOccluded = isOccluded
|
||||
updateHideIconsForBouncer(animate = false)
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.ScreenDecorations;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
|
||||
@@ -68,12 +69,15 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
||||
private int mDisplayCutoutTouchableRegionSize;
|
||||
private int mStatusBarHeight;
|
||||
|
||||
private final OnComputeInternalInsetsListener mOnComputeInternalInsetsListener;
|
||||
|
||||
@Inject
|
||||
public StatusBarTouchableRegionManager(
|
||||
Context context,
|
||||
NotificationShadeWindowController notificationShadeWindowController,
|
||||
ConfigurationController configurationController,
|
||||
HeadsUpManagerPhone headsUpManager,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController
|
||||
) {
|
||||
mContext = context;
|
||||
@@ -101,17 +105,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
||||
updateTouchableRegion();
|
||||
}
|
||||
});
|
||||
mHeadsUpManager.addHeadsUpPhoneListener(
|
||||
new HeadsUpManagerPhone.OnHeadsUpPhoneListenerChange() {
|
||||
@Override
|
||||
public void onHeadsUpGoingAwayStateChanged(boolean headsUpGoingAway) {
|
||||
if (!headsUpGoingAway) {
|
||||
updateTouchableRegionAfterLayout();
|
||||
} else {
|
||||
updateTouchableRegion();
|
||||
}
|
||||
}
|
||||
});
|
||||
mHeadsUpManager.addHeadsUpPhoneListener(this::onHeadsUpGoingAwayStateChanged);
|
||||
|
||||
mNotificationShadeWindowController = notificationShadeWindowController;
|
||||
mNotificationShadeWindowController.setForcePluginOpenListener((forceOpen) -> {
|
||||
@@ -119,6 +113,9 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
||||
});
|
||||
|
||||
mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
|
||||
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||
|
||||
mOnComputeInternalInsetsListener = this::onComputeInternalInsets;
|
||||
}
|
||||
|
||||
protected void setup(
|
||||
@@ -136,17 +133,11 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
||||
pw.println(mTouchableRegion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify that the status bar panel gets expanded or collapsed.
|
||||
*
|
||||
* @param isExpanded True to notify expanded, false to notify collapsed.
|
||||
* TODO(b/237811427) replace with a listener
|
||||
*/
|
||||
public void setPanelExpanded(boolean isExpanded) {
|
||||
private void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||
if (isExpanded != mIsStatusBarExpanded) {
|
||||
mIsStatusBarExpanded = isExpanded;
|
||||
if (isExpanded) {
|
||||
// make sure our state is sane
|
||||
// make sure our state is sensible
|
||||
mForceCollapsedUntilLayout = false;
|
||||
}
|
||||
updateTouchableRegion();
|
||||
@@ -260,18 +251,22 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
||||
|| mUnlockedScreenOffAnimationController.isAnimationPlaying();
|
||||
}
|
||||
|
||||
private final OnComputeInternalInsetsListener mOnComputeInternalInsetsListener =
|
||||
new OnComputeInternalInsetsListener() {
|
||||
@Override
|
||||
public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) {
|
||||
if (shouldMakeEntireScreenTouchable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update touch insets to include any area needed for touching features that live in
|
||||
// the status bar (ie: heads up notifications)
|
||||
info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
|
||||
info.touchableRegion.set(calculateTouchableRegion());
|
||||
private void onHeadsUpGoingAwayStateChanged(boolean headsUpGoingAway) {
|
||||
if (!headsUpGoingAway) {
|
||||
updateTouchableRegionAfterLayout();
|
||||
} else {
|
||||
updateTouchableRegion();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) {
|
||||
if (shouldMakeEntireScreenTouchable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update touch insets to include any area needed for touching features that live in
|
||||
// the status bar (ie: heads up notifications)
|
||||
info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
|
||||
info.touchableRegion.set(calculateTouchableRegion());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.android.systemui.screenshot.ReferenceScreenshotModule;
|
||||
import com.android.systemui.shade.NotificationShadeWindowControllerImpl;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.shade.ShadeControllerImpl;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
@@ -157,7 +158,8 @@ public abstract class TvSystemUIModule {
|
||||
ConfigurationController configurationController,
|
||||
@Main Handler handler,
|
||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||
UiEventLogger uiEventLogger) {
|
||||
UiEventLogger uiEventLogger,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager) {
|
||||
return new HeadsUpManagerPhone(
|
||||
context,
|
||||
headsUpManagerLogger,
|
||||
@@ -168,7 +170,8 @@ public abstract class TvSystemUIModule {
|
||||
configurationController,
|
||||
handler,
|
||||
accessibilityManagerWrapper,
|
||||
uiEventLogger
|
||||
uiEventLogger,
|
||||
shadeExpansionStateManager
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
SystemClock systemClock = new FakeSystemClock();
|
||||
mStatusBarStateController = new StatusBarStateControllerImpl(mUiEventLogger, mDumpManager,
|
||||
mInteractionJankMonitor);
|
||||
mInteractionJankMonitor, mShadeExpansionStateManager);
|
||||
|
||||
KeyguardStatusView keyguardStatusView = new KeyguardStatusView(mContext);
|
||||
keyguardStatusView.setId(R.id.keyguard_status_view);
|
||||
@@ -379,7 +379,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
mDumpManager,
|
||||
mock(HeadsUpManagerPhone.class),
|
||||
new StatusBarStateControllerImpl(new UiEventLoggerFake(), mDumpManager,
|
||||
mInteractionJankMonitor),
|
||||
mInteractionJankMonitor, mShadeExpansionStateManager),
|
||||
mKeyguardBypassController,
|
||||
mDozeParameters,
|
||||
mScreenOffAnimationController);
|
||||
|
||||
@@ -239,9 +239,9 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void setPanelExpanded_notFocusable_altFocusable_whenPanelIsOpen() {
|
||||
mNotificationShadeWindowController.setPanelExpanded(true);
|
||||
mNotificationShadeWindowController.onShadeExpansionFullyChanged(true);
|
||||
clearInvocations(mWindowManager);
|
||||
mNotificationShadeWindowController.setPanelExpanded(true);
|
||||
mNotificationShadeWindowController.onShadeExpansionFullyChanged(true);
|
||||
verifyNoMoreInteractions(mWindowManager);
|
||||
mNotificationShadeWindowController.setNotificationShadeFocusable(true);
|
||||
|
||||
@@ -313,7 +313,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
|
||||
verifyNoMoreInteractions(mWindowManager);
|
||||
|
||||
clearInvocations(mWindowManager);
|
||||
mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
|
||||
mNotificationShadeWindowController.batchApplyWindowLayoutParams(() -> {
|
||||
mNotificationShadeWindowController.setForceDozeBrightness(false);
|
||||
verify(mWindowManager, never()).updateViewLayout(any(), any());
|
||||
});
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.android.internal.logging.testing.UiEventLoggerFake
|
||||
import com.android.systemui.SysuiTestCase
|
||||
import com.android.systemui.dump.DumpManager
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
@@ -48,6 +49,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
||||
|
||||
@Mock lateinit var interactionJankMonitor: InteractionJankMonitor
|
||||
@Mock private lateinit var mockDarkAnimator: ObjectAnimator
|
||||
@Mock private lateinit var shadeExpansionStateManager: ShadeExpansionStateManager
|
||||
|
||||
private lateinit var controller: StatusBarStateControllerImpl
|
||||
private lateinit var uiEventLogger: UiEventLoggerFake
|
||||
@@ -62,7 +64,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
||||
controller = object : StatusBarStateControllerImpl(
|
||||
uiEventLogger,
|
||||
mock(DumpManager::class.java),
|
||||
interactionJankMonitor
|
||||
interactionJankMonitor, shadeExpansionStateManager
|
||||
) {
|
||||
override fun createDarkAnimator(): ObjectAnimator { return mockDarkAnimator }
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.android.internal.logging.InstanceId;
|
||||
import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.internal.statusbar.NotificationVisibility;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
|
||||
@@ -88,6 +89,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
@Mock private NotificationVisibilityProvider mVisibilityProvider;
|
||||
@Mock private NotifPipeline mNotifPipeline;
|
||||
@Mock private NotificationListener mListener;
|
||||
@Mock private ShadeExpansionStateManager mShadeExpansionStateManager;
|
||||
|
||||
private NotificationEntry mEntry;
|
||||
private TestableNotificationLogger mLogger;
|
||||
@@ -118,6 +120,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
mVisibilityProvider,
|
||||
mNotifPipeline,
|
||||
mock(StatusBarStateControllerImpl.class),
|
||||
mShadeExpansionStateManager,
|
||||
mBarService,
|
||||
mExpansionStateLogger
|
||||
);
|
||||
@@ -152,7 +155,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
|
||||
when(mListContainer.isInVisibleLocation(any())).thenReturn(true);
|
||||
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
||||
mLogger.getChildLocationsChangedListenerForTest().onChildLocationsChanged();
|
||||
mLogger.onChildLocationsChanged();
|
||||
TestableLooper.get(this).processAllMessages();
|
||||
mUiBgExecutor.runAllReady();
|
||||
|
||||
@@ -162,7 +165,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
|
||||
// |mEntry| won't change visibility, so it shouldn't be reported again:
|
||||
Mockito.reset(mBarService);
|
||||
mLogger.getChildLocationsChangedListenerForTest().onChildLocationsChanged();
|
||||
mLogger.onChildLocationsChanged();
|
||||
TestableLooper.get(this).processAllMessages();
|
||||
mUiBgExecutor.runAllReady();
|
||||
|
||||
@@ -174,7 +177,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
throws Exception {
|
||||
when(mListContainer.isInVisibleLocation(any())).thenReturn(true);
|
||||
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
||||
mLogger.getChildLocationsChangedListenerForTest().onChildLocationsChanged();
|
||||
mLogger.onChildLocationsChanged();
|
||||
TestableLooper.get(this).processAllMessages();
|
||||
mUiBgExecutor.runAllReady();
|
||||
Mockito.reset(mBarService);
|
||||
@@ -189,13 +192,13 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
}
|
||||
|
||||
private void setStateAsleep() {
|
||||
mLogger.onPanelExpandedChanged(true);
|
||||
mLogger.onShadeExpansionFullyChanged(true);
|
||||
mLogger.onDozingChanged(true);
|
||||
mLogger.onStateChanged(StatusBarState.KEYGUARD);
|
||||
}
|
||||
|
||||
private void setStateAwake() {
|
||||
mLogger.onPanelExpandedChanged(false);
|
||||
mLogger.onShadeExpansionFullyChanged(false);
|
||||
mLogger.onDozingChanged(false);
|
||||
mLogger.onStateChanged(StatusBarState.SHADE);
|
||||
}
|
||||
@@ -221,7 +224,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
||||
setStateAwake();
|
||||
// Now expand panel
|
||||
mLogger.onPanelExpandedChanged(true);
|
||||
mLogger.onShadeExpansionFullyChanged(true);
|
||||
assertEquals(1, mNotificationPanelLoggerFake.getCalls().size());
|
||||
assertFalse(mNotificationPanelLoggerFake.get(0).isLockscreen);
|
||||
assertEquals(1, mNotificationPanelLoggerFake.get(0).list.notifications.length);
|
||||
@@ -263,6 +266,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
NotificationVisibilityProvider visibilityProvider,
|
||||
NotifPipeline notifPipeline,
|
||||
StatusBarStateControllerImpl statusBarStateController,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||
IStatusBarService barService,
|
||||
ExpansionStateLogger expansionStateLogger) {
|
||||
super(
|
||||
@@ -272,6 +276,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
visibilityProvider,
|
||||
notifPipeline,
|
||||
statusBarStateController,
|
||||
shadeExpansionStateManager,
|
||||
expansionStateLogger,
|
||||
mNotificationPanelLoggerFake
|
||||
);
|
||||
@@ -280,9 +285,5 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
// Make this on the current thread so we can wait for it during tests.
|
||||
mHandler = Handler.createAsync(Looper.myLooper());
|
||||
}
|
||||
|
||||
OnChildLocationsChangedListener getChildLocationsChangedListenerForTest() {
|
||||
return mNotificationLocationsChangedListener;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ import com.android.systemui.classifier.FalsingManagerFake;
|
||||
import com.android.systemui.media.controls.util.MediaFeatureFlag;
|
||||
import com.android.systemui.media.dialog.MediaOutputDialogFactory;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
@@ -151,7 +152,8 @@ public class NotificationTestHelper {
|
||||
mock(ConfigurationControllerImpl.class),
|
||||
new Handler(mTestLooper.getLooper()),
|
||||
mock(AccessibilityManagerWrapper.class),
|
||||
mock(UiEventLogger.class)
|
||||
mock(UiEventLogger.class),
|
||||
mock(ShadeExpansionStateManager.class)
|
||||
);
|
||||
mHeadsUpManager.mHandler.removeCallbacksAndMessages(null);
|
||||
mHeadsUpManager.mHandler = new Handler(mTestLooper.getLooper());
|
||||
|
||||
@@ -220,6 +220,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
@Mock private NotificationLockscreenUserManager mLockscreenUserManager;
|
||||
@Mock private NotificationRemoteInputManager mRemoteInputManager;
|
||||
@Mock private StatusBarStateControllerImpl mStatusBarStateController;
|
||||
@Mock private ShadeExpansionStateManager mShadeExpansionStateManager;
|
||||
@Mock private BatteryController mBatteryController;
|
||||
@Mock private DeviceProvisionedController mDeviceProvisionedController;
|
||||
@Mock private StatusBarNotificationPresenter mNotificationPresenter;
|
||||
@@ -339,6 +340,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
mVisibilityProvider,
|
||||
mock(NotifPipeline.class),
|
||||
mStatusBarStateController,
|
||||
mShadeExpansionStateManager,
|
||||
mExpansionStateLogger,
|
||||
new NotificationPanelLoggerFake()
|
||||
);
|
||||
@@ -1025,7 +1027,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
@Test
|
||||
public void collapseShade_callsAnimateCollapsePanels_whenExpanded() {
|
||||
// GIVEN the shade is expanded
|
||||
mCentralSurfaces.setPanelExpanded(true);
|
||||
mCentralSurfaces.onShadeExpansionFullyChanged(true);
|
||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||
|
||||
// WHEN collapseShade is called
|
||||
@@ -1038,7 +1040,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
@Test
|
||||
public void collapseShade_doesNotCallAnimateCollapsePanels_whenCollapsed() {
|
||||
// GIVEN the shade is collapsed
|
||||
mCentralSurfaces.setPanelExpanded(false);
|
||||
mCentralSurfaces.onShadeExpansionFullyChanged(false);
|
||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||
|
||||
// WHEN collapseShade is called
|
||||
@@ -1051,7 +1053,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
@Test
|
||||
public void collapseShadeForBugReport_callsAnimateCollapsePanels_whenFlagDisabled() {
|
||||
// GIVEN the shade is expanded & flag enabled
|
||||
mCentralSurfaces.setPanelExpanded(true);
|
||||
mCentralSurfaces.onShadeExpansionFullyChanged(true);
|
||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||
mFeatureFlags.set(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, false);
|
||||
|
||||
@@ -1065,7 +1067,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
@Test
|
||||
public void collapseShadeForBugReport_doesNotCallAnimateCollapsePanels_whenFlagEnabled() {
|
||||
// GIVEN the shade is expanded & flag enabled
|
||||
mCentralSurfaces.setPanelExpanded(true);
|
||||
mCentralSurfaces.onShadeExpansionFullyChanged(true);
|
||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||
mFeatureFlags.set(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, true);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||
import com.android.systemui.statusbar.AlertingNotificationManager;
|
||||
import com.android.systemui.statusbar.AlertingNotificationManagerTest;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
@@ -67,6 +68,7 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
||||
@Mock private KeyguardBypassController mBypassController;
|
||||
@Mock private ConfigurationControllerImpl mConfigurationController;
|
||||
@Mock private AccessibilityManagerWrapper mAccessibilityManagerWrapper;
|
||||
@Mock private ShadeExpansionStateManager mShadeExpansionStateManager;
|
||||
@Mock private UiEventLogger mUiEventLogger;
|
||||
private boolean mLivesPastNormalTime;
|
||||
|
||||
@@ -81,7 +83,8 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
||||
ConfigurationController configurationController,
|
||||
Handler handler,
|
||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||
UiEventLogger uiEventLogger
|
||||
UiEventLogger uiEventLogger,
|
||||
ShadeExpansionStateManager shadeExpansionStateManager
|
||||
) {
|
||||
super(
|
||||
context,
|
||||
@@ -93,7 +96,8 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
||||
configurationController,
|
||||
handler,
|
||||
accessibilityManagerWrapper,
|
||||
uiEventLogger
|
||||
uiEventLogger,
|
||||
shadeExpansionStateManager
|
||||
);
|
||||
mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
|
||||
mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
|
||||
@@ -125,7 +129,8 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
||||
mConfigurationController,
|
||||
mTestHandler,
|
||||
mAccessibilityManagerWrapper,
|
||||
mUiEventLogger
|
||||
mUiEventLogger,
|
||||
mShadeExpansionStateManager
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user