Merge "Replaced setPanelExpanded with listener in NPVC/Central Surfaces" into tm-qpr-dev
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.NotificationShadeWindowControllerImpl;
|
||||||
import com.android.systemui.shade.ShadeController;
|
import com.android.systemui.shade.ShadeController;
|
||||||
import com.android.systemui.shade.ShadeControllerImpl;
|
import com.android.systemui.shade.ShadeControllerImpl;
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
|
||||||
@@ -162,7 +163,8 @@ public abstract class ReferenceSystemUIModule {
|
|||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
@Main Handler handler,
|
@Main Handler handler,
|
||||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||||
UiEventLogger uiEventLogger) {
|
UiEventLogger uiEventLogger,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager) {
|
||||||
return new HeadsUpManagerPhone(
|
return new HeadsUpManagerPhone(
|
||||||
context,
|
context,
|
||||||
headsUpManagerLogger,
|
headsUpManagerLogger,
|
||||||
@@ -173,7 +175,8 @@ public abstract class ReferenceSystemUIModule {
|
|||||||
configurationController,
|
configurationController,
|
||||||
handler,
|
handler,
|
||||||
accessibilityManagerWrapper,
|
accessibilityManagerWrapper,
|
||||||
uiEventLogger
|
uiEventLogger,
|
||||||
|
shadeExpansionStateManager
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3394,11 +3394,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
boolean isExpanded = !isFullyCollapsed() || mExpectingSynthesizedDown;
|
boolean isExpanded = !isFullyCollapsed() || mExpectingSynthesizedDown;
|
||||||
if (mPanelExpanded != isExpanded) {
|
if (mPanelExpanded != isExpanded) {
|
||||||
mPanelExpanded = isExpanded;
|
mPanelExpanded = isExpanded;
|
||||||
|
mShadeExpansionStateManager.onShadeExpansionFullyChanged(isExpanded);
|
||||||
mHeadsUpManager.setIsPanelExpanded(isExpanded);
|
|
||||||
mStatusBarTouchableRegionManager.setPanelExpanded(isExpanded);
|
|
||||||
mCentralSurfaces.setPanelExpanded(isExpanded);
|
|
||||||
|
|
||||||
if (!isExpanded && mQs != null && mQs.isCustomizing()) {
|
if (!isExpanded && mQs != null && mQs.isCustomizing()) {
|
||||||
mQs.closeCustomizer();
|
mQs.closeCustomizer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import android.view.WindowManager;
|
|||||||
import android.view.WindowManager.LayoutParams;
|
import android.view.WindowManager.LayoutParams;
|
||||||
import android.view.WindowManagerGlobal;
|
import android.view.WindowManagerGlobal;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.keyguard.KeyguardUpdateMonitor;
|
import com.android.keyguard.KeyguardUpdateMonitor;
|
||||||
import com.android.systemui.Dumpable;
|
import com.android.systemui.Dumpable;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
@@ -158,6 +159,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
|||||||
SysuiStatusBarStateController.RANK_STATUS_BAR_WINDOW_CONTROLLER);
|
SysuiStatusBarStateController.RANK_STATUS_BAR_WINDOW_CONTROLLER);
|
||||||
configurationController.addCallback(this);
|
configurationController.addCallback(this);
|
||||||
shadeExpansionStateManager.addQsExpansionListener(this::onQsExpansionChanged);
|
shadeExpansionStateManager.addQsExpansionListener(this::onQsExpansionChanged);
|
||||||
|
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||||
|
|
||||||
float desiredPreferredRefreshRate = context.getResources()
|
float desiredPreferredRefreshRate = context.getResources()
|
||||||
.getInteger(R.integer.config_keyguardRefreshRate);
|
.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
|
* Register a listener to monitor scrims visibility
|
||||||
* @param listener 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);
|
apply(mCurrentState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPanelExpanded(boolean isExpanded) {
|
|
||||||
if (mCurrentState.mPanelExpanded == isExpanded) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mCurrentState.mPanelExpanded = isExpanded;
|
|
||||||
apply(mCurrentState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemoteInputActive(boolean remoteInputActive) {
|
public void onRemoteInputActive(boolean remoteInputActive) {
|
||||||
mCurrentState.mRemoteInputActive = remoteInputActive;
|
mCurrentState.mRemoteInputActive = remoteInputActive;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import javax.inject.Inject
|
|||||||
class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
|
class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
|
||||||
|
|
||||||
private val expansionListeners = CopyOnWriteArrayList<ShadeExpansionListener>()
|
private val expansionListeners = CopyOnWriteArrayList<ShadeExpansionListener>()
|
||||||
|
private val fullExpansionListeners = CopyOnWriteArrayList<ShadeFullExpansionListener>()
|
||||||
private val qsExpansionListeners = CopyOnWriteArrayList<ShadeQsExpansionListener>()
|
private val qsExpansionListeners = CopyOnWriteArrayList<ShadeQsExpansionListener>()
|
||||||
private val stateListeners = CopyOnWriteArrayList<ShadeStateListener>()
|
private val stateListeners = CopyOnWriteArrayList<ShadeStateListener>()
|
||||||
private val shadeStateEventsListeners = CopyOnWriteArrayList<ShadeStateEventsListener>()
|
private val shadeStateEventsListeners = CopyOnWriteArrayList<ShadeStateEventsListener>()
|
||||||
@@ -62,6 +63,15 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
|
|||||||
expansionListeners.remove(listener)
|
expansionListeners.remove(listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun addFullExpansionListener(listener: ShadeFullExpansionListener) {
|
||||||
|
fullExpansionListeners.add(listener)
|
||||||
|
listener.onShadeExpansionFullyChanged(qsExpanded)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun removeFullExpansionListener(listener: ShadeFullExpansionListener) {
|
||||||
|
fullExpansionListeners.remove(listener)
|
||||||
|
}
|
||||||
|
|
||||||
fun addQsExpansionListener(listener: ShadeQsExpansionListener) {
|
fun addQsExpansionListener(listener: ShadeQsExpansionListener) {
|
||||||
qsExpansionListeners.add(listener)
|
qsExpansionListeners.add(listener)
|
||||||
listener.onQsExpansionChanged(qsExpanded)
|
listener.onQsExpansionChanged(qsExpanded)
|
||||||
@@ -156,6 +166,13 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
|
|||||||
qsExpansionListeners.forEach { it.onQsExpansionChanged(qsExpanded) }
|
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. */
|
/** Updates the panel state if necessary. */
|
||||||
fun updateState(@PanelState state: Int) {
|
fun updateState(@PanelState state: Int) {
|
||||||
debugLog(
|
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. */
|
/** Sets whether the window was collapsed by force or not. */
|
||||||
default void setForceWindowCollapsed(boolean force) {}
|
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. */
|
/** Gets whether the panel is expanded or not. */
|
||||||
default boolean getPanelExpanded() {
|
default boolean getPanelExpanded() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import com.android.systemui.animation.Interpolators;
|
|||||||
import com.android.systemui.dagger.SysUISingleton;
|
import com.android.systemui.dagger.SysUISingleton;
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
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.notification.stack.StackStateAnimator;
|
||||||
import com.android.systemui.statusbar.policy.CallbackController;
|
import com.android.systemui.statusbar.policy.CallbackController;
|
||||||
|
|
||||||
@@ -153,13 +154,18 @@ public class StatusBarStateControllerImpl implements
|
|||||||
private Interpolator mDozeInterpolator = Interpolators.FAST_OUT_SLOW_IN;
|
private Interpolator mDozeInterpolator = Interpolators.FAST_OUT_SLOW_IN;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public StatusBarStateControllerImpl(UiEventLogger uiEventLogger, DumpManager dumpManager,
|
public StatusBarStateControllerImpl(
|
||||||
InteractionJankMonitor interactionJankMonitor) {
|
UiEventLogger uiEventLogger,
|
||||||
|
DumpManager dumpManager,
|
||||||
|
InteractionJankMonitor interactionJankMonitor,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager
|
||||||
|
) {
|
||||||
mUiEventLogger = uiEventLogger;
|
mUiEventLogger = uiEventLogger;
|
||||||
mInteractionJankMonitor = interactionJankMonitor;
|
mInteractionJankMonitor = interactionJankMonitor;
|
||||||
for (int i = 0; i < HISTORY_SIZE; i++) {
|
for (int i = 0; i < HISTORY_SIZE; i++) {
|
||||||
mHistoricalRecords[i] = new HistoricalState();
|
mHistoricalRecords[i] = new HistoricalState();
|
||||||
}
|
}
|
||||||
|
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||||
|
|
||||||
dumpManager.registerDumpable(this);
|
dumpManager.registerDumpable(this);
|
||||||
}
|
}
|
||||||
@@ -262,21 +268,6 @@ public class StatusBarStateControllerImpl implements
|
|||||||
return mIsExpanded;
|
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
|
@Override
|
||||||
public float getInterpolatedDozeAmount() {
|
public float getInterpolatedDozeAmount() {
|
||||||
return mDozeInterpolator.getInterpolation(mDozeAmount);
|
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() {
|
private void startDozeAnimation() {
|
||||||
if (mDozeAmount == 0f || mDozeAmount == 1f) {
|
if (mDozeAmount == 0f || mDozeAmount == 1f) {
|
||||||
mDozeInterpolator = mIsDozing
|
mDozeInterpolator = mIsDozing
|
||||||
|
|||||||
@@ -108,13 +108,6 @@ public interface SysuiStatusBarStateController extends StatusBarStateController
|
|||||||
*/
|
*/
|
||||||
void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated);
|
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
|
* 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.settings.UserContextProvider;
|
||||||
import com.android.systemui.shade.ShadeController;
|
import com.android.systemui.shade.ShadeController;
|
||||||
import com.android.systemui.shade.ShadeEventsModule;
|
import com.android.systemui.shade.ShadeEventsModule;
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.statusbar.NotificationListener;
|
import com.android.systemui.statusbar.NotificationListener;
|
||||||
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
|
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotifInflaterImpl;
|
import com.android.systemui.statusbar.notification.collection.NotifInflaterImpl;
|
||||||
@@ -160,6 +161,7 @@ public interface NotificationsModule {
|
|||||||
NotificationVisibilityProvider visibilityProvider,
|
NotificationVisibilityProvider visibilityProvider,
|
||||||
NotifPipeline notifPipeline,
|
NotifPipeline notifPipeline,
|
||||||
StatusBarStateController statusBarStateController,
|
StatusBarStateController statusBarStateController,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||||
NotificationLogger.ExpansionStateLogger expansionStateLogger,
|
NotificationLogger.ExpansionStateLogger expansionStateLogger,
|
||||||
NotificationPanelLogger notificationPanelLogger) {
|
NotificationPanelLogger notificationPanelLogger) {
|
||||||
return new NotificationLogger(
|
return new NotificationLogger(
|
||||||
@@ -169,6 +171,7 @@ public interface NotificationsModule {
|
|||||||
visibilityProvider,
|
visibilityProvider,
|
||||||
notifPipeline,
|
notifPipeline,
|
||||||
statusBarStateController,
|
statusBarStateController,
|
||||||
|
shadeExpansionStateManager,
|
||||||
expansionStateLogger,
|
expansionStateLogger,
|
||||||
notificationPanelLogger);
|
notificationPanelLogger);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import com.android.internal.statusbar.NotificationVisibility;
|
|||||||
import com.android.systemui.dagger.qualifiers.UiBackground;
|
import com.android.systemui.dagger.qualifiers.UiBackground;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
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.NotificationListener;
|
||||||
import com.android.systemui.statusbar.StatusBarState;
|
import com.android.systemui.statusbar.StatusBarState;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
|
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 mPanelExpanded = null; // Use null to indicate state is not yet known
|
||||||
private boolean mLogging = false;
|
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
|
// Tracks notifications currently visible in mNotificationStackScroller and
|
||||||
// emits visibility events via NoMan on changes.
|
// emits visibility events via NoMan on changes.
|
||||||
protected Runnable mVisibilityReporter = new Runnable() {
|
protected Runnable mVisibilityReporter = new Runnable() {
|
||||||
@@ -219,6 +201,7 @@ public class NotificationLogger implements StateListener {
|
|||||||
NotificationVisibilityProvider visibilityProvider,
|
NotificationVisibilityProvider visibilityProvider,
|
||||||
NotifPipeline notifPipeline,
|
NotifPipeline notifPipeline,
|
||||||
StatusBarStateController statusBarStateController,
|
StatusBarStateController statusBarStateController,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||||
ExpansionStateLogger expansionStateLogger,
|
ExpansionStateLogger expansionStateLogger,
|
||||||
NotificationPanelLogger notificationPanelLogger) {
|
NotificationPanelLogger notificationPanelLogger) {
|
||||||
mNotificationListener = notificationListener;
|
mNotificationListener = notificationListener;
|
||||||
@@ -232,6 +215,7 @@ public class NotificationLogger implements StateListener {
|
|||||||
mNotificationPanelLogger = notificationPanelLogger;
|
mNotificationPanelLogger = notificationPanelLogger;
|
||||||
// Not expected to be destroyed, don't need to unsubscribe
|
// Not expected to be destroyed, don't need to unsubscribe
|
||||||
statusBarStateController.addCallback(this);
|
statusBarStateController.addCallback(this);
|
||||||
|
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||||
|
|
||||||
registerNewPipelineListener();
|
registerNewPipelineListener();
|
||||||
}
|
}
|
||||||
@@ -278,14 +262,14 @@ public class NotificationLogger implements StateListener {
|
|||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.i(TAG, "startNotificationLogging");
|
Log.i(TAG, "startNotificationLogging");
|
||||||
}
|
}
|
||||||
mListContainer.setChildLocationsChangedListener(mNotificationLocationsChangedListener);
|
mListContainer.setChildLocationsChangedListener(this::onChildLocationsChanged);
|
||||||
// Some transitions like mVisibleToUser=false -> mVisibleToUser=true don't
|
// Some transitions like mVisibleToUser=false -> mVisibleToUser=true don't
|
||||||
// cause the scroller to emit child location events. Hence generate
|
// cause the scroller to emit child location events. Hence generate
|
||||||
// one ourselves to guarantee that we're reporting visible
|
// one ourselves to guarantee that we're reporting visible
|
||||||
// notifications.
|
// notifications.
|
||||||
// (Note that in cases where the scroller does emit events, this
|
// (Note that in cases where the scroller does emit events, this
|
||||||
// additional event doesn't break anything.)
|
// additional event doesn't break anything.)
|
||||||
mNotificationLocationsChangedListener.onChildLocationsChanged();
|
onChildLocationsChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,11 +395,17 @@ public class NotificationLogger implements StateListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by CentralSurfaces to notify the logger that the panel expansion has changed.
|
* Called when the notification is expanded / collapsed.
|
||||||
* 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) {
|
public void onExpansionChanged(String key, boolean isUserAction, boolean isExpanded) {
|
||||||
|
NotificationVisibility.NotificationLocation location = mVisibilityProvider.getLocation(key);
|
||||||
|
mExpansionStateLogger.onExpansionChanged(key, isUserAction, isExpanded, location);
|
||||||
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||||
|
// mPanelExpanded is initialized as null
|
||||||
|
if (mPanelExpanded == null || !mPanelExpanded.equals(isExpanded)) {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.i(TAG, "onPanelExpandedChanged: new=" + isExpanded);
|
Log.i(TAG, "onPanelExpandedChanged: new=" + isExpanded);
|
||||||
}
|
}
|
||||||
@@ -424,13 +414,22 @@ public class NotificationLogger implements StateListener {
|
|||||||
maybeUpdateLoggingStatus();
|
maybeUpdateLoggingStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
@VisibleForTesting
|
||||||
* Called when the notification is expanded / collapsed.
|
void onChildLocationsChanged() {
|
||||||
*/
|
if (mHandler.hasCallbacks(mVisibilityReporter)) {
|
||||||
public void onExpansionChanged(String key, boolean isUserAction, boolean isExpanded) {
|
// Visibilities will be reported when the existing
|
||||||
NotificationVisibility.NotificationLocation location = mVisibilityProvider.getLocation(key);
|
// callback is executed.
|
||||||
mExpansionStateLogger.onExpansionChanged(key, isUserAction, isExpanded, location);
|
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
|
@VisibleForTesting
|
||||||
|
|||||||
@@ -258,8 +258,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn
|
|||||||
|
|
||||||
void onKeyguardViewManagerStatesUpdated();
|
void onKeyguardViewManagerStatesUpdated();
|
||||||
|
|
||||||
void setPanelExpanded(boolean isExpanded);
|
|
||||||
|
|
||||||
ViewGroup getNotificationScrollLayout();
|
ViewGroup getNotificationScrollLayout();
|
||||||
|
|
||||||
boolean isPulsing();
|
boolean isPulsing();
|
||||||
|
|||||||
@@ -848,6 +848,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mScreenOffAnimationController = screenOffAnimationController;
|
mScreenOffAnimationController = screenOffAnimationController;
|
||||||
|
|
||||||
mShadeExpansionStateManager.addExpansionListener(this::onPanelExpansionChanged);
|
mShadeExpansionStateManager.addExpansionListener(this::onPanelExpansionChanged);
|
||||||
|
mShadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||||
|
|
||||||
mBubbleExpandListener = (isExpanding, key) ->
|
mBubbleExpandListener = (isExpanding, key) ->
|
||||||
mContext.getMainExecutor().execute(this::updateScrimController);
|
mContext.getMainExecutor().execute(this::updateScrimController);
|
||||||
@@ -1376,6 +1377,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
private void onPanelExpansionChanged(ShadeExpansionChangeEvent event) {
|
private void onPanelExpansionChanged(ShadeExpansionChangeEvent event) {
|
||||||
float fraction = event.getFraction();
|
float fraction = event.getFraction();
|
||||||
boolean tracking = event.getTracking();
|
boolean tracking = event.getTracking();
|
||||||
|
boolean isExpanded = event.getExpanded();
|
||||||
dispatchPanelExpansionForKeyguardDismiss(fraction, tracking);
|
dispatchPanelExpansionForKeyguardDismiss(fraction, tracking);
|
||||||
|
|
||||||
if (fraction == 0 || fraction == 1) {
|
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
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Lifecycle getLifecycle() {
|
public Lifecycle getLifecycle() {
|
||||||
@@ -1792,27 +1811,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
logStateToEventlog();
|
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
|
@Override
|
||||||
public ViewGroup getNotificationScrollLayout() {
|
public ViewGroup getNotificationScrollLayout() {
|
||||||
return mStackScroller;
|
return mStackScroller;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import com.android.systemui.R;
|
|||||||
import com.android.systemui.dagger.qualifiers.Main;
|
import com.android.systemui.dagger.qualifiers.Main;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
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.StatusBarState;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||||
import com.android.systemui.statusbar.notification.collection.provider.OnReorderingAllowedListener;
|
import com.android.systemui.statusbar.notification.collection.provider.OnReorderingAllowedListener;
|
||||||
@@ -111,7 +112,8 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
|||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
@Main Handler handler,
|
@Main Handler handler,
|
||||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||||
UiEventLogger uiEventLogger) {
|
UiEventLogger uiEventLogger,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager) {
|
||||||
super(context, logger, handler, accessibilityManagerWrapper, uiEventLogger);
|
super(context, logger, handler, accessibilityManagerWrapper, uiEventLogger);
|
||||||
Resources resources = mContext.getResources();
|
Resources resources = mContext.getResources();
|
||||||
mExtensionTime = resources.getInteger(R.integer.ambient_notification_extension_time);
|
mExtensionTime = resources.getInteger(R.integer.ambient_notification_extension_time);
|
||||||
@@ -132,6 +134,8 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
|||||||
updateResources();
|
updateResources();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAnimationStateHandler(AnimationStateHandler handler) {
|
public void setAnimationStateHandler(AnimationStateHandler handler) {
|
||||||
@@ -220,13 +224,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
|||||||
mTrackingHeadsUp = trackingHeadsUp;
|
mTrackingHeadsUp = trackingHeadsUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||||
* 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) {
|
|
||||||
if (isExpanded != mIsExpanded) {
|
if (isExpanded != mIsExpanded) {
|
||||||
mIsExpanded = isExpanded;
|
mIsExpanded = isExpanded;
|
||||||
if (isExpanded) {
|
if (isExpanded) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.android.systemui.Dumpable
|
|||||||
import com.android.systemui.dagger.SysUISingleton
|
import com.android.systemui.dagger.SysUISingleton
|
||||||
import com.android.systemui.dagger.qualifiers.Main
|
import com.android.systemui.dagger.qualifiers.Main
|
||||||
import com.android.systemui.dump.DumpManager
|
import com.android.systemui.dump.DumpManager
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager
|
||||||
import com.android.systemui.statusbar.CommandQueue
|
import com.android.systemui.statusbar.CommandQueue
|
||||||
import com.android.systemui.statusbar.window.StatusBarWindowStateController
|
import com.android.systemui.statusbar.window.StatusBarWindowStateController
|
||||||
import com.android.systemui.util.concurrency.DelayableExecutor
|
import com.android.systemui.util.concurrency.DelayableExecutor
|
||||||
@@ -27,6 +28,7 @@ class StatusBarHideIconsForBouncerManager @Inject constructor(
|
|||||||
private val commandQueue: CommandQueue,
|
private val commandQueue: CommandQueue,
|
||||||
@Main private val mainExecutor: DelayableExecutor,
|
@Main private val mainExecutor: DelayableExecutor,
|
||||||
statusBarWindowStateController: StatusBarWindowStateController,
|
statusBarWindowStateController: StatusBarWindowStateController,
|
||||||
|
shadeExpansionStateManager: ShadeExpansionStateManager,
|
||||||
dumpManager: DumpManager
|
dumpManager: DumpManager
|
||||||
) : Dumpable {
|
) : Dumpable {
|
||||||
// State variables set by external classes.
|
// State variables set by external classes.
|
||||||
@@ -47,6 +49,12 @@ class StatusBarHideIconsForBouncerManager @Inject constructor(
|
|||||||
statusBarWindowStateController.addListener {
|
statusBarWindowStateController.addListener {
|
||||||
state -> setStatusBarStateAndTriggerUpdate(state)
|
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. */
|
/** Returns true if the status bar icons should be hidden in the bouncer. */
|
||||||
@@ -63,11 +71,6 @@ class StatusBarHideIconsForBouncerManager @Inject constructor(
|
|||||||
this.displayId = displayId
|
this.displayId = displayId
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setPanelExpandedAndTriggerUpdate(panelExpanded: Boolean) {
|
|
||||||
this.panelExpanded = panelExpanded
|
|
||||||
updateHideIconsForBouncer(animate = false)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setIsOccludedAndTriggerUpdate(isOccluded: Boolean) {
|
fun setIsOccludedAndTriggerUpdate(isOccluded: Boolean) {
|
||||||
this.isOccluded = isOccluded
|
this.isOccluded = isOccluded
|
||||||
updateHideIconsForBouncer(animate = false)
|
updateHideIconsForBouncer(animate = false)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import com.android.systemui.Dumpable;
|
|||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.ScreenDecorations;
|
import com.android.systemui.ScreenDecorations;
|
||||||
import com.android.systemui.dagger.SysUISingleton;
|
import com.android.systemui.dagger.SysUISingleton;
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
|
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
|
||||||
@@ -68,12 +69,15 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
|||||||
private int mDisplayCutoutTouchableRegionSize;
|
private int mDisplayCutoutTouchableRegionSize;
|
||||||
private int mStatusBarHeight;
|
private int mStatusBarHeight;
|
||||||
|
|
||||||
|
private final OnComputeInternalInsetsListener mOnComputeInternalInsetsListener;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public StatusBarTouchableRegionManager(
|
public StatusBarTouchableRegionManager(
|
||||||
Context context,
|
Context context,
|
||||||
NotificationShadeWindowController notificationShadeWindowController,
|
NotificationShadeWindowController notificationShadeWindowController,
|
||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
HeadsUpManagerPhone headsUpManager,
|
HeadsUpManagerPhone headsUpManager,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||||
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController
|
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController
|
||||||
) {
|
) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@@ -101,17 +105,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
|||||||
updateTouchableRegion();
|
updateTouchableRegion();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mHeadsUpManager.addHeadsUpPhoneListener(
|
mHeadsUpManager.addHeadsUpPhoneListener(this::onHeadsUpGoingAwayStateChanged);
|
||||||
new HeadsUpManagerPhone.OnHeadsUpPhoneListenerChange() {
|
|
||||||
@Override
|
|
||||||
public void onHeadsUpGoingAwayStateChanged(boolean headsUpGoingAway) {
|
|
||||||
if (!headsUpGoingAway) {
|
|
||||||
updateTouchableRegionAfterLayout();
|
|
||||||
} else {
|
|
||||||
updateTouchableRegion();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mNotificationShadeWindowController = notificationShadeWindowController;
|
mNotificationShadeWindowController = notificationShadeWindowController;
|
||||||
mNotificationShadeWindowController.setForcePluginOpenListener((forceOpen) -> {
|
mNotificationShadeWindowController.setForcePluginOpenListener((forceOpen) -> {
|
||||||
@@ -119,6 +113,9 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
|
mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
|
||||||
|
shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);
|
||||||
|
|
||||||
|
mOnComputeInternalInsetsListener = this::onComputeInternalInsets;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setup(
|
protected void setup(
|
||||||
@@ -136,17 +133,11 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
|||||||
pw.println(mTouchableRegion);
|
pw.println(mTouchableRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void onShadeExpansionFullyChanged(Boolean isExpanded) {
|
||||||
* 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) {
|
|
||||||
if (isExpanded != mIsStatusBarExpanded) {
|
if (isExpanded != mIsStatusBarExpanded) {
|
||||||
mIsStatusBarExpanded = isExpanded;
|
mIsStatusBarExpanded = isExpanded;
|
||||||
if (isExpanded) {
|
if (isExpanded) {
|
||||||
// make sure our state is sane
|
// make sure our state is sensible
|
||||||
mForceCollapsedUntilLayout = false;
|
mForceCollapsedUntilLayout = false;
|
||||||
}
|
}
|
||||||
updateTouchableRegion();
|
updateTouchableRegion();
|
||||||
@@ -260,10 +251,15 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
|||||||
|| mUnlockedScreenOffAnimationController.isAnimationPlaying();
|
|| mUnlockedScreenOffAnimationController.isAnimationPlaying();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final OnComputeInternalInsetsListener mOnComputeInternalInsetsListener =
|
private void onHeadsUpGoingAwayStateChanged(boolean headsUpGoingAway) {
|
||||||
new OnComputeInternalInsetsListener() {
|
if (!headsUpGoingAway) {
|
||||||
@Override
|
updateTouchableRegionAfterLayout();
|
||||||
public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) {
|
} else {
|
||||||
|
updateTouchableRegion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) {
|
||||||
if (shouldMakeEntireScreenTouchable()) {
|
if (shouldMakeEntireScreenTouchable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -273,5 +269,4 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
|||||||
info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
|
info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
|
||||||
info.touchableRegion.set(calculateTouchableRegion());
|
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.NotificationShadeWindowControllerImpl;
|
||||||
import com.android.systemui.shade.ShadeController;
|
import com.android.systemui.shade.ShadeController;
|
||||||
import com.android.systemui.shade.ShadeControllerImpl;
|
import com.android.systemui.shade.ShadeControllerImpl;
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
import com.android.systemui.statusbar.NotificationListener;
|
import com.android.systemui.statusbar.NotificationListener;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
@@ -157,7 +158,8 @@ public abstract class TvSystemUIModule {
|
|||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
@Main Handler handler,
|
@Main Handler handler,
|
||||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||||
UiEventLogger uiEventLogger) {
|
UiEventLogger uiEventLogger,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager) {
|
||||||
return new HeadsUpManagerPhone(
|
return new HeadsUpManagerPhone(
|
||||||
context,
|
context,
|
||||||
headsUpManagerLogger,
|
headsUpManagerLogger,
|
||||||
@@ -168,7 +170,8 @@ public abstract class TvSystemUIModule {
|
|||||||
configurationController,
|
configurationController,
|
||||||
handler,
|
handler,
|
||||||
accessibilityManagerWrapper,
|
accessibilityManagerWrapper,
|
||||||
uiEventLogger
|
uiEventLogger,
|
||||||
|
shadeExpansionStateManager
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
SystemClock systemClock = new FakeSystemClock();
|
SystemClock systemClock = new FakeSystemClock();
|
||||||
mStatusBarStateController = new StatusBarStateControllerImpl(mUiEventLogger, mDumpManager,
|
mStatusBarStateController = new StatusBarStateControllerImpl(mUiEventLogger, mDumpManager,
|
||||||
mInteractionJankMonitor);
|
mInteractionJankMonitor, mShadeExpansionStateManager);
|
||||||
|
|
||||||
KeyguardStatusView keyguardStatusView = new KeyguardStatusView(mContext);
|
KeyguardStatusView keyguardStatusView = new KeyguardStatusView(mContext);
|
||||||
keyguardStatusView.setId(R.id.keyguard_status_view);
|
keyguardStatusView.setId(R.id.keyguard_status_view);
|
||||||
@@ -379,7 +379,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
mDumpManager,
|
mDumpManager,
|
||||||
mock(HeadsUpManagerPhone.class),
|
mock(HeadsUpManagerPhone.class),
|
||||||
new StatusBarStateControllerImpl(new UiEventLoggerFake(), mDumpManager,
|
new StatusBarStateControllerImpl(new UiEventLoggerFake(), mDumpManager,
|
||||||
mInteractionJankMonitor),
|
mInteractionJankMonitor, mShadeExpansionStateManager),
|
||||||
mKeyguardBypassController,
|
mKeyguardBypassController,
|
||||||
mDozeParameters,
|
mDozeParameters,
|
||||||
mScreenOffAnimationController);
|
mScreenOffAnimationController);
|
||||||
|
|||||||
@@ -239,9 +239,9 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void setPanelExpanded_notFocusable_altFocusable_whenPanelIsOpen() {
|
public void setPanelExpanded_notFocusable_altFocusable_whenPanelIsOpen() {
|
||||||
mNotificationShadeWindowController.setPanelExpanded(true);
|
mNotificationShadeWindowController.onShadeExpansionFullyChanged(true);
|
||||||
clearInvocations(mWindowManager);
|
clearInvocations(mWindowManager);
|
||||||
mNotificationShadeWindowController.setPanelExpanded(true);
|
mNotificationShadeWindowController.onShadeExpansionFullyChanged(true);
|
||||||
verifyNoMoreInteractions(mWindowManager);
|
verifyNoMoreInteractions(mWindowManager);
|
||||||
mNotificationShadeWindowController.setNotificationShadeFocusable(true);
|
mNotificationShadeWindowController.setNotificationShadeFocusable(true);
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
|
|||||||
verifyNoMoreInteractions(mWindowManager);
|
verifyNoMoreInteractions(mWindowManager);
|
||||||
|
|
||||||
clearInvocations(mWindowManager);
|
clearInvocations(mWindowManager);
|
||||||
mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
|
mNotificationShadeWindowController.batchApplyWindowLayoutParams(() -> {
|
||||||
mNotificationShadeWindowController.setForceDozeBrightness(false);
|
mNotificationShadeWindowController.setForceDozeBrightness(false);
|
||||||
verify(mWindowManager, never()).updateViewLayout(any(), any());
|
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.SysuiTestCase
|
||||||
import com.android.systemui.dump.DumpManager
|
import com.android.systemui.dump.DumpManager
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Assert.assertFalse
|
import org.junit.Assert.assertFalse
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
@@ -48,6 +49,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
|||||||
|
|
||||||
@Mock lateinit var interactionJankMonitor: InteractionJankMonitor
|
@Mock lateinit var interactionJankMonitor: InteractionJankMonitor
|
||||||
@Mock private lateinit var mockDarkAnimator: ObjectAnimator
|
@Mock private lateinit var mockDarkAnimator: ObjectAnimator
|
||||||
|
@Mock private lateinit var shadeExpansionStateManager: ShadeExpansionStateManager
|
||||||
|
|
||||||
private lateinit var controller: StatusBarStateControllerImpl
|
private lateinit var controller: StatusBarStateControllerImpl
|
||||||
private lateinit var uiEventLogger: UiEventLoggerFake
|
private lateinit var uiEventLogger: UiEventLoggerFake
|
||||||
@@ -62,7 +64,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
|||||||
controller = object : StatusBarStateControllerImpl(
|
controller = object : StatusBarStateControllerImpl(
|
||||||
uiEventLogger,
|
uiEventLogger,
|
||||||
mock(DumpManager::class.java),
|
mock(DumpManager::class.java),
|
||||||
interactionJankMonitor
|
interactionJankMonitor, shadeExpansionStateManager
|
||||||
) {
|
) {
|
||||||
override fun createDarkAnimator(): ObjectAnimator { return mockDarkAnimator }
|
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.IStatusBarService;
|
||||||
import com.android.internal.statusbar.NotificationVisibility;
|
import com.android.internal.statusbar.NotificationVisibility;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.statusbar.NotificationListener;
|
import com.android.systemui.statusbar.NotificationListener;
|
||||||
import com.android.systemui.statusbar.StatusBarState;
|
import com.android.systemui.statusbar.StatusBarState;
|
||||||
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
|
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
|
||||||
@@ -88,6 +89,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
@Mock private NotificationVisibilityProvider mVisibilityProvider;
|
@Mock private NotificationVisibilityProvider mVisibilityProvider;
|
||||||
@Mock private NotifPipeline mNotifPipeline;
|
@Mock private NotifPipeline mNotifPipeline;
|
||||||
@Mock private NotificationListener mListener;
|
@Mock private NotificationListener mListener;
|
||||||
|
@Mock private ShadeExpansionStateManager mShadeExpansionStateManager;
|
||||||
|
|
||||||
private NotificationEntry mEntry;
|
private NotificationEntry mEntry;
|
||||||
private TestableNotificationLogger mLogger;
|
private TestableNotificationLogger mLogger;
|
||||||
@@ -118,6 +120,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
mVisibilityProvider,
|
mVisibilityProvider,
|
||||||
mNotifPipeline,
|
mNotifPipeline,
|
||||||
mock(StatusBarStateControllerImpl.class),
|
mock(StatusBarStateControllerImpl.class),
|
||||||
|
mShadeExpansionStateManager,
|
||||||
mBarService,
|
mBarService,
|
||||||
mExpansionStateLogger
|
mExpansionStateLogger
|
||||||
);
|
);
|
||||||
@@ -152,7 +155,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
when(mListContainer.isInVisibleLocation(any())).thenReturn(true);
|
when(mListContainer.isInVisibleLocation(any())).thenReturn(true);
|
||||||
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
||||||
mLogger.getChildLocationsChangedListenerForTest().onChildLocationsChanged();
|
mLogger.onChildLocationsChanged();
|
||||||
TestableLooper.get(this).processAllMessages();
|
TestableLooper.get(this).processAllMessages();
|
||||||
mUiBgExecutor.runAllReady();
|
mUiBgExecutor.runAllReady();
|
||||||
|
|
||||||
@@ -162,7 +165,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// |mEntry| won't change visibility, so it shouldn't be reported again:
|
// |mEntry| won't change visibility, so it shouldn't be reported again:
|
||||||
Mockito.reset(mBarService);
|
Mockito.reset(mBarService);
|
||||||
mLogger.getChildLocationsChangedListenerForTest().onChildLocationsChanged();
|
mLogger.onChildLocationsChanged();
|
||||||
TestableLooper.get(this).processAllMessages();
|
TestableLooper.get(this).processAllMessages();
|
||||||
mUiBgExecutor.runAllReady();
|
mUiBgExecutor.runAllReady();
|
||||||
|
|
||||||
@@ -174,7 +177,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
throws Exception {
|
throws Exception {
|
||||||
when(mListContainer.isInVisibleLocation(any())).thenReturn(true);
|
when(mListContainer.isInVisibleLocation(any())).thenReturn(true);
|
||||||
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
||||||
mLogger.getChildLocationsChangedListenerForTest().onChildLocationsChanged();
|
mLogger.onChildLocationsChanged();
|
||||||
TestableLooper.get(this).processAllMessages();
|
TestableLooper.get(this).processAllMessages();
|
||||||
mUiBgExecutor.runAllReady();
|
mUiBgExecutor.runAllReady();
|
||||||
Mockito.reset(mBarService);
|
Mockito.reset(mBarService);
|
||||||
@@ -189,13 +192,13 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setStateAsleep() {
|
private void setStateAsleep() {
|
||||||
mLogger.onPanelExpandedChanged(true);
|
mLogger.onShadeExpansionFullyChanged(true);
|
||||||
mLogger.onDozingChanged(true);
|
mLogger.onDozingChanged(true);
|
||||||
mLogger.onStateChanged(StatusBarState.KEYGUARD);
|
mLogger.onStateChanged(StatusBarState.KEYGUARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setStateAwake() {
|
private void setStateAwake() {
|
||||||
mLogger.onPanelExpandedChanged(false);
|
mLogger.onShadeExpansionFullyChanged(false);
|
||||||
mLogger.onDozingChanged(false);
|
mLogger.onDozingChanged(false);
|
||||||
mLogger.onStateChanged(StatusBarState.SHADE);
|
mLogger.onStateChanged(StatusBarState.SHADE);
|
||||||
}
|
}
|
||||||
@@ -221,7 +224,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
|
||||||
setStateAwake();
|
setStateAwake();
|
||||||
// Now expand panel
|
// Now expand panel
|
||||||
mLogger.onPanelExpandedChanged(true);
|
mLogger.onShadeExpansionFullyChanged(true);
|
||||||
assertEquals(1, mNotificationPanelLoggerFake.getCalls().size());
|
assertEquals(1, mNotificationPanelLoggerFake.getCalls().size());
|
||||||
assertFalse(mNotificationPanelLoggerFake.get(0).isLockscreen);
|
assertFalse(mNotificationPanelLoggerFake.get(0).isLockscreen);
|
||||||
assertEquals(1, mNotificationPanelLoggerFake.get(0).list.notifications.length);
|
assertEquals(1, mNotificationPanelLoggerFake.get(0).list.notifications.length);
|
||||||
@@ -263,6 +266,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
NotificationVisibilityProvider visibilityProvider,
|
NotificationVisibilityProvider visibilityProvider,
|
||||||
NotifPipeline notifPipeline,
|
NotifPipeline notifPipeline,
|
||||||
StatusBarStateControllerImpl statusBarStateController,
|
StatusBarStateControllerImpl statusBarStateController,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager,
|
||||||
IStatusBarService barService,
|
IStatusBarService barService,
|
||||||
ExpansionStateLogger expansionStateLogger) {
|
ExpansionStateLogger expansionStateLogger) {
|
||||||
super(
|
super(
|
||||||
@@ -272,6 +276,7 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
visibilityProvider,
|
visibilityProvider,
|
||||||
notifPipeline,
|
notifPipeline,
|
||||||
statusBarStateController,
|
statusBarStateController,
|
||||||
|
shadeExpansionStateManager,
|
||||||
expansionStateLogger,
|
expansionStateLogger,
|
||||||
mNotificationPanelLoggerFake
|
mNotificationPanelLoggerFake
|
||||||
);
|
);
|
||||||
@@ -280,9 +285,5 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
|||||||
// Make this on the current thread so we can wait for it during tests.
|
// Make this on the current thread so we can wait for it during tests.
|
||||||
mHandler = Handler.createAsync(Looper.myLooper());
|
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.controls.util.MediaFeatureFlag;
|
||||||
import com.android.systemui.media.dialog.MediaOutputDialogFactory;
|
import com.android.systemui.media.dialog.MediaOutputDialogFactory;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||||
@@ -151,7 +152,8 @@ public class NotificationTestHelper {
|
|||||||
mock(ConfigurationControllerImpl.class),
|
mock(ConfigurationControllerImpl.class),
|
||||||
new Handler(mTestLooper.getLooper()),
|
new Handler(mTestLooper.getLooper()),
|
||||||
mock(AccessibilityManagerWrapper.class),
|
mock(AccessibilityManagerWrapper.class),
|
||||||
mock(UiEventLogger.class)
|
mock(UiEventLogger.class),
|
||||||
|
mock(ShadeExpansionStateManager.class)
|
||||||
);
|
);
|
||||||
mHeadsUpManager.mHandler.removeCallbacksAndMessages(null);
|
mHeadsUpManager.mHandler.removeCallbacksAndMessages(null);
|
||||||
mHeadsUpManager.mHandler = new Handler(mTestLooper.getLooper());
|
mHeadsUpManager.mHandler = new Handler(mTestLooper.getLooper());
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
@Mock private NotificationLockscreenUserManager mLockscreenUserManager;
|
@Mock private NotificationLockscreenUserManager mLockscreenUserManager;
|
||||||
@Mock private NotificationRemoteInputManager mRemoteInputManager;
|
@Mock private NotificationRemoteInputManager mRemoteInputManager;
|
||||||
@Mock private StatusBarStateControllerImpl mStatusBarStateController;
|
@Mock private StatusBarStateControllerImpl mStatusBarStateController;
|
||||||
|
@Mock private ShadeExpansionStateManager mShadeExpansionStateManager;
|
||||||
@Mock private BatteryController mBatteryController;
|
@Mock private BatteryController mBatteryController;
|
||||||
@Mock private DeviceProvisionedController mDeviceProvisionedController;
|
@Mock private DeviceProvisionedController mDeviceProvisionedController;
|
||||||
@Mock private StatusBarNotificationPresenter mNotificationPresenter;
|
@Mock private StatusBarNotificationPresenter mNotificationPresenter;
|
||||||
@@ -339,6 +340,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
mVisibilityProvider,
|
mVisibilityProvider,
|
||||||
mock(NotifPipeline.class),
|
mock(NotifPipeline.class),
|
||||||
mStatusBarStateController,
|
mStatusBarStateController,
|
||||||
|
mShadeExpansionStateManager,
|
||||||
mExpansionStateLogger,
|
mExpansionStateLogger,
|
||||||
new NotificationPanelLoggerFake()
|
new NotificationPanelLoggerFake()
|
||||||
);
|
);
|
||||||
@@ -1025,7 +1027,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void collapseShade_callsAnimateCollapsePanels_whenExpanded() {
|
public void collapseShade_callsAnimateCollapsePanels_whenExpanded() {
|
||||||
// GIVEN the shade is expanded
|
// GIVEN the shade is expanded
|
||||||
mCentralSurfaces.setPanelExpanded(true);
|
mCentralSurfaces.onShadeExpansionFullyChanged(true);
|
||||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||||
|
|
||||||
// WHEN collapseShade is called
|
// WHEN collapseShade is called
|
||||||
@@ -1038,7 +1040,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void collapseShade_doesNotCallAnimateCollapsePanels_whenCollapsed() {
|
public void collapseShade_doesNotCallAnimateCollapsePanels_whenCollapsed() {
|
||||||
// GIVEN the shade is collapsed
|
// GIVEN the shade is collapsed
|
||||||
mCentralSurfaces.setPanelExpanded(false);
|
mCentralSurfaces.onShadeExpansionFullyChanged(false);
|
||||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||||
|
|
||||||
// WHEN collapseShade is called
|
// WHEN collapseShade is called
|
||||||
@@ -1051,7 +1053,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void collapseShadeForBugReport_callsAnimateCollapsePanels_whenFlagDisabled() {
|
public void collapseShadeForBugReport_callsAnimateCollapsePanels_whenFlagDisabled() {
|
||||||
// GIVEN the shade is expanded & flag enabled
|
// GIVEN the shade is expanded & flag enabled
|
||||||
mCentralSurfaces.setPanelExpanded(true);
|
mCentralSurfaces.onShadeExpansionFullyChanged(true);
|
||||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||||
mFeatureFlags.set(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, false);
|
mFeatureFlags.set(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, false);
|
||||||
|
|
||||||
@@ -1065,7 +1067,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void collapseShadeForBugReport_doesNotCallAnimateCollapsePanels_whenFlagEnabled() {
|
public void collapseShadeForBugReport_doesNotCallAnimateCollapsePanels_whenFlagEnabled() {
|
||||||
// GIVEN the shade is expanded & flag enabled
|
// GIVEN the shade is expanded & flag enabled
|
||||||
mCentralSurfaces.setPanelExpanded(true);
|
mCentralSurfaces.onShadeExpansionFullyChanged(true);
|
||||||
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE);
|
||||||
mFeatureFlags.set(Flags.LEAVE_SHADE_OPEN_FOR_BUGREPORT, true);
|
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.internal.logging.UiEventLogger;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.statusbar.AlertingNotificationManager;
|
import com.android.systemui.statusbar.AlertingNotificationManager;
|
||||||
import com.android.systemui.statusbar.AlertingNotificationManagerTest;
|
import com.android.systemui.statusbar.AlertingNotificationManagerTest;
|
||||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||||
@@ -67,6 +68,7 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
|||||||
@Mock private KeyguardBypassController mBypassController;
|
@Mock private KeyguardBypassController mBypassController;
|
||||||
@Mock private ConfigurationControllerImpl mConfigurationController;
|
@Mock private ConfigurationControllerImpl mConfigurationController;
|
||||||
@Mock private AccessibilityManagerWrapper mAccessibilityManagerWrapper;
|
@Mock private AccessibilityManagerWrapper mAccessibilityManagerWrapper;
|
||||||
|
@Mock private ShadeExpansionStateManager mShadeExpansionStateManager;
|
||||||
@Mock private UiEventLogger mUiEventLogger;
|
@Mock private UiEventLogger mUiEventLogger;
|
||||||
private boolean mLivesPastNormalTime;
|
private boolean mLivesPastNormalTime;
|
||||||
|
|
||||||
@@ -81,7 +83,8 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
|||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
Handler handler,
|
Handler handler,
|
||||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||||
UiEventLogger uiEventLogger
|
UiEventLogger uiEventLogger,
|
||||||
|
ShadeExpansionStateManager shadeExpansionStateManager
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
context,
|
context,
|
||||||
@@ -93,7 +96,8 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
|||||||
configurationController,
|
configurationController,
|
||||||
handler,
|
handler,
|
||||||
accessibilityManagerWrapper,
|
accessibilityManagerWrapper,
|
||||||
uiEventLogger
|
uiEventLogger,
|
||||||
|
shadeExpansionStateManager
|
||||||
);
|
);
|
||||||
mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
|
mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
|
||||||
mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
|
mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
|
||||||
@@ -125,7 +129,8 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
|||||||
mConfigurationController,
|
mConfigurationController,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mAccessibilityManagerWrapper,
|
mAccessibilityManagerWrapper,
|
||||||
mUiEventLogger
|
mUiEventLogger,
|
||||||
|
mShadeExpansionStateManager
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user