Merge "Removed calls to NPVC.getView()" into tm-qpr-dev am: c11ec4ac24
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20472791 Change-Id: Ie20c1cab7910109c0c9b2cba83c2bd8b97d3a020 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -680,7 +680,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
};
|
};
|
||||||
private final Runnable mMaybeHideExpandedRunnable = () -> {
|
private final Runnable mMaybeHideExpandedRunnable = () -> {
|
||||||
if (getExpansionFraction() == 0.0f) {
|
if (getExpansionFraction() == 0.0f) {
|
||||||
getView().post(mHideExpandedRunnable);
|
postToView(mHideExpandedRunnable);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2815,7 +2815,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
return top + mNotificationStackScrollLayoutController.getHeight()
|
return top + mNotificationStackScrollLayoutController.getHeight()
|
||||||
+ mSplitShadeNotificationsScrimMarginBottom;
|
+ mSplitShadeNotificationsScrimMarginBottom;
|
||||||
} else {
|
} else {
|
||||||
return getView().getBottom();
|
return mView.getBottom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2830,7 +2830,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
|
|
||||||
private int calculateRightQsClippingBound() {
|
private int calculateRightQsClippingBound() {
|
||||||
if (mIsFullWidth) {
|
if (mIsFullWidth) {
|
||||||
return getView().getRight() + mDisplayRightInset;
|
return mView.getRight() + mDisplayRightInset;
|
||||||
} else {
|
} else {
|
||||||
return mNotificationStackScrollLayoutController.getRight();
|
return mNotificationStackScrollLayoutController.getRight();
|
||||||
}
|
}
|
||||||
@@ -5195,6 +5195,26 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
return mView;
|
return mView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** */
|
||||||
|
public boolean postToView(Runnable action) {
|
||||||
|
return mView.post(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** */
|
||||||
|
public boolean sendInterceptTouchEventToView(MotionEvent event) {
|
||||||
|
return mView.onInterceptTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** */
|
||||||
|
public void requestLayoutOnView() {
|
||||||
|
mView.requestLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** */
|
||||||
|
public void resetViewAlphas() {
|
||||||
|
ViewGroupFadeHelper.reset(mView);
|
||||||
|
}
|
||||||
|
|
||||||
private void beginJankMonitoring() {
|
private void beginJankMonitoring() {
|
||||||
if (mInteractionJankMonitor == null) {
|
if (mInteractionJankMonitor == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ public class NotificationShadeWindowViewController {
|
|||||||
MotionEvent cancellation = MotionEvent.obtain(ev);
|
MotionEvent cancellation = MotionEvent.obtain(ev);
|
||||||
cancellation.setAction(MotionEvent.ACTION_CANCEL);
|
cancellation.setAction(MotionEvent.ACTION_CANCEL);
|
||||||
mStackScrollLayout.onInterceptTouchEvent(cancellation);
|
mStackScrollLayout.onInterceptTouchEvent(cancellation);
|
||||||
mNotificationPanelViewController.getView().onInterceptTouchEvent(cancellation);
|
mNotificationPanelViewController.sendInterceptTouchEventToView(cancellation);
|
||||||
cancellation.recycle();
|
cancellation.recycle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class ShadeControllerImpl implements ShadeController {
|
|||||||
if (getCentralSurfaces().getNotificationShadeWindowView()
|
if (getCentralSurfaces().getNotificationShadeWindowView()
|
||||||
.isVisibleToUser()) {
|
.isVisibleToUser()) {
|
||||||
getNotificationPanelViewController().removeOnGlobalLayoutListener(this);
|
getNotificationPanelViewController().removeOnGlobalLayoutListener(this);
|
||||||
getNotificationPanelViewController().getView().post(executable);
|
getNotificationPanelViewController().postToView(executable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener
|
|||||||
//resize the layout. Let's
|
//resize the layout. Let's
|
||||||
// make sure that the window stays small for one frame until the
|
// make sure that the window stays small for one frame until the
|
||||||
//touchableRegion is set.
|
//touchableRegion is set.
|
||||||
mNotificationPanelViewController.getView().requestLayout();
|
mNotificationPanelViewController.requestLayoutOnView();
|
||||||
mNotificationShadeWindowController.setForceWindowCollapsed(true);
|
mNotificationShadeWindowController.setForceWindowCollapsed(true);
|
||||||
mNotificationPanelViewController.getView().post(() -> {
|
mNotificationPanelViewController.postToView(() -> {
|
||||||
mNotificationShadeWindowController.setForceWindowCollapsed(false);
|
mNotificationShadeWindowController.setForceWindowCollapsed(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ import com.android.systemui.statusbar.NotificationShadeWindowController;
|
|||||||
import com.android.systemui.statusbar.RemoteInputController;
|
import com.android.systemui.statusbar.RemoteInputController;
|
||||||
import com.android.systemui.statusbar.StatusBarState;
|
import com.android.systemui.statusbar.StatusBarState;
|
||||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||||
import com.android.systemui.statusbar.notification.ViewGroupFadeHelper;
|
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBouncer.PrimaryBouncerExpansionCallback;
|
import com.android.systemui.statusbar.phone.KeyguardBouncer.PrimaryBouncerExpansionCallback;
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||||
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
||||||
@@ -1017,7 +1016,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
|||||||
public void onKeyguardFadedAway() {
|
public void onKeyguardFadedAway() {
|
||||||
mNotificationContainer.postDelayed(() -> mNotificationShadeWindowController
|
mNotificationContainer.postDelayed(() -> mNotificationShadeWindowController
|
||||||
.setKeyguardFadingAway(false), 100);
|
.setKeyguardFadingAway(false), 100);
|
||||||
ViewGroupFadeHelper.reset(mNotificationPanelViewController.getView());
|
mNotificationPanelViewController.resetViewAlphas();
|
||||||
mCentralSurfaces.finishKeyguardFadingAway();
|
mCentralSurfaces.finishKeyguardFadingAway();
|
||||||
mBiometricUnlockController.finishKeyguardFadingAway();
|
mBiometricUnlockController.finishKeyguardFadingAway();
|
||||||
WindowManagerGlobal.getInstance().trimMemory(
|
WindowManagerGlobal.getInstance().trimMemory(
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ constructor(
|
|||||||
deviceStateManager.registerCallback(executor, FoldListener())
|
deviceStateManager.registerCallback(executor, FoldListener())
|
||||||
wakefulnessLifecycle.addObserver(this)
|
wakefulnessLifecycle.addObserver(this)
|
||||||
|
|
||||||
|
// TODO(b/254878364): remove this call to NPVC.getView()
|
||||||
centralSurfaces.notificationPanelViewController.view.repeatWhenAttached {
|
centralSurfaces.notificationPanelViewController.view.repeatWhenAttached {
|
||||||
repeatOnLifecycle(Lifecycle.State.STARTED) { listenForDozing(this) }
|
repeatOnLifecycle(Lifecycle.State.STARTED) { listenForDozing(this) }
|
||||||
}
|
}
|
||||||
@@ -157,6 +158,7 @@ constructor(
|
|||||||
// We don't need to wait for the scrim as it is already displayed
|
// We don't need to wait for the scrim as it is already displayed
|
||||||
// but we should wait for the initial animation preparations to be drawn
|
// but we should wait for the initial animation preparations to be drawn
|
||||||
// (setting initial alpha/translation)
|
// (setting initial alpha/translation)
|
||||||
|
// TODO(b/254878364): remove this call to NPVC.getView()
|
||||||
OneShotPreDrawListener.add(
|
OneShotPreDrawListener.add(
|
||||||
centralSurfaces.notificationPanelViewController.view,
|
centralSurfaces.notificationPanelViewController.view,
|
||||||
onReady
|
onReady
|
||||||
|
|||||||
@@ -355,7 +355,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
|
|
||||||
when(mStackScrollerController.getView()).thenReturn(mStackScroller);
|
when(mStackScrollerController.getView()).thenReturn(mStackScroller);
|
||||||
when(mStackScroller.generateLayoutParams(any())).thenReturn(new LayoutParams(0, 0));
|
when(mStackScroller.generateLayoutParams(any())).thenReturn(new LayoutParams(0, 0));
|
||||||
when(mNotificationPanelViewController.getView()).thenReturn(mNotificationPanelView);
|
|
||||||
when(mNotificationPanelView.getLayoutParams()).thenReturn(new LayoutParams(0, 0));
|
when(mNotificationPanelView.getLayoutParams()).thenReturn(new LayoutParams(0, 0));
|
||||||
when(powerManagerService.isInteractive()).thenReturn(true);
|
when(powerManagerService.isInteractive()).thenReturn(true);
|
||||||
when(mStackScroller.getActivatedChild()).thenReturn(null);
|
when(mStackScroller.getActivatedChild()).thenReturn(null);
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ class PhoneStatusBarViewControllerTest : SysuiTestCase() {
|
|||||||
@Before
|
@Before
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
MockitoAnnotations.initMocks(this)
|
MockitoAnnotations.initMocks(this)
|
||||||
`when`(notificationPanelViewController.view).thenReturn(panelView)
|
|
||||||
`when`(sysuiUnfoldComponent.getStatusBarMoveFromCenterAnimationController())
|
`when`(sysuiUnfoldComponent.getStatusBarMoveFromCenterAnimationController())
|
||||||
.thenReturn(moveFromCenterAnimation)
|
.thenReturn(moveFromCenterAnimation)
|
||||||
// create the view and controller on main thread as it requires main looper
|
// create the view and controller on main thread as it requires main looper
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import com.google.common.truth.Truth.assertThat
|
|||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.Mockito.`when`
|
|
||||||
import org.mockito.MockitoAnnotations
|
import org.mockito.MockitoAnnotations
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@@ -41,9 +40,6 @@ class PhoneStatusBarViewTest : SysuiTestCase() {
|
|||||||
@Before
|
@Before
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
MockitoAnnotations.initMocks(this)
|
MockitoAnnotations.initMocks(this)
|
||||||
// TODO(b/197137564): Setting up a panel view and its controller feels unnecessary when
|
|
||||||
// testing just [PhoneStatusBarView].
|
|
||||||
`when`(notificationPanelViewController.view).thenReturn(panelView)
|
|
||||||
|
|
||||||
view = PhoneStatusBarView(mContext, null)
|
view = PhoneStatusBarView(mContext, null)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ class FoldAodAnimationControllerTest : SysuiTestCase() {
|
|||||||
|
|
||||||
deviceStates = FoldableTestUtils.findDeviceStates(context)
|
deviceStates = FoldableTestUtils.findDeviceStates(context)
|
||||||
|
|
||||||
|
// TODO(b/254878364): remove this call to NPVC.getView()
|
||||||
whenever(notificationPanelViewController.view).thenReturn(viewGroup)
|
whenever(notificationPanelViewController.view).thenReturn(viewGroup)
|
||||||
whenever(viewGroup.viewTreeObserver).thenReturn(viewTreeObserver)
|
whenever(viewGroup.viewTreeObserver).thenReturn(viewTreeObserver)
|
||||||
whenever(wakefulnessLifecycle.lastSleepReason)
|
whenever(wakefulnessLifecycle.lastSleepReason)
|
||||||
|
|||||||
Reference in New Issue
Block a user