Remove unused methods
Cleaning up some unused code Test: atest StatusBarStateControllerImplTest NotificationPanelViewControllerTest Bug: 242853098 Change-Id: I071247716ffe03cffebaf24031c7b201bf727fbc
This commit is contained in:
@@ -54,7 +54,6 @@ import android.graphics.ColorFilter;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -3752,13 +3751,12 @@ public final class NotificationPanelViewController extends PanelViewController {
|
||||
*
|
||||
* @param dozing {@code true} when dozing.
|
||||
* @param animate if transition should be animated.
|
||||
* @param wakeUpTouchLocation touch event location - if woken up by SLPI sensor.
|
||||
*/
|
||||
public void setDozing(boolean dozing, boolean animate, PointF wakeUpTouchLocation) {
|
||||
public void setDozing(boolean dozing, boolean animate) {
|
||||
if (dozing == mDozing) return;
|
||||
mView.setDozing(dozing);
|
||||
mDozing = dozing;
|
||||
mNotificationStackScrollLayoutController.setDozing(mDozing, animate, wakeUpTouchLocation);
|
||||
mNotificationStackScrollLayoutController.setDozing(mDozing, animate);
|
||||
mKeyguardBottomArea.setDozing(mDozing, animate);
|
||||
mKeyguardBottomAreaInteractorProvider.get().setAnimateDozingTransitions(animate);
|
||||
mKeyguardStatusBarViewController.setDozing(mDozing);
|
||||
@@ -4683,7 +4681,7 @@ public final class NotificationPanelViewController extends PanelViewController {
|
||||
* change.
|
||||
*/
|
||||
public void showAodUi() {
|
||||
setDozing(true /* dozing */, false /* animate */, null);
|
||||
setDozing(true /* dozing */, false /* animate */);
|
||||
mStatusBarStateController.setUpcomingState(KEYGUARD);
|
||||
mEntryManager.updateNotifications("showAodUi");
|
||||
mStatusBarStateListener.onStateChanged(KEYGUARD);
|
||||
|
||||
@@ -302,11 +302,6 @@ public class StatusBarStateControllerImpl implements
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDozeAmount(float dozeAmount, boolean animated) {
|
||||
setAndInstrumentDozeAmount(null, dozeAmount, animated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated) {
|
||||
if (mDarkAnimator != null && mDarkAnimator.isRunning()) {
|
||||
|
||||
@@ -98,14 +98,6 @@ public interface SysuiStatusBarStateController extends StatusBarStateController
|
||||
*/
|
||||
boolean setIsDozing(boolean isDozing);
|
||||
|
||||
/**
|
||||
* Changes the current doze amount.
|
||||
*
|
||||
* @param dozeAmount New doze/dark amount.
|
||||
* @param animated If change should be animated or not. This will cancel current animations.
|
||||
*/
|
||||
void setDozeAmount(float dozeAmount, boolean animated);
|
||||
|
||||
/**
|
||||
* Changes the current doze amount, also starts the
|
||||
* {@link com.android.internal.jank.InteractionJankMonitor InteractionJankMonitor} as possible.
|
||||
|
||||
@@ -42,7 +42,6 @@ import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
@@ -4405,8 +4404,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
||||
* See {@link AmbientState#setDozing}.
|
||||
*/
|
||||
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
|
||||
public void setDozing(boolean dozing, boolean animate,
|
||||
@Nullable PointF touchWakeUpScreenLocation) {
|
||||
public void setDozing(boolean dozing, boolean animate) {
|
||||
if (mAmbientState.isDozing() == dozing) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import static com.android.systemui.statusbar.phone.NotificationIconAreaControlle
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.PointF;
|
||||
import android.os.Trace;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
@@ -1235,8 +1234,8 @@ public class NotificationStackScrollLayoutController {
|
||||
mView.setAnimationsEnabled(enabled);
|
||||
}
|
||||
|
||||
public void setDozing(boolean dozing, boolean animate, PointF wakeUpTouchLocation) {
|
||||
mView.setDozing(dozing, animate, wakeUpTouchLocation);
|
||||
public void setDozing(boolean dozing, boolean animate) {
|
||||
mView.setDozing(dozing, animate);
|
||||
}
|
||||
|
||||
public void setPulsing(boolean pulsing, boolean animatePulse) {
|
||||
|
||||
@@ -67,7 +67,6 @@ import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.PointF;
|
||||
import android.hardware.devicestate.DeviceStateManager;
|
||||
import android.metrics.LogMaker;
|
||||
import android.net.Uri;
|
||||
@@ -446,7 +445,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
@VisibleForTesting
|
||||
DozeServiceHost mDozeServiceHost;
|
||||
private boolean mWakeUpComingFromTouch;
|
||||
private PointF mWakeUpTouchLocation;
|
||||
private LightRevealScrim mLightRevealScrim;
|
||||
private PowerButtonReveal mPowerButtonReveal;
|
||||
|
||||
@@ -603,8 +601,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
private int mLastCameraLaunchSource;
|
||||
protected PowerManager.WakeLock mGestureWakeLock;
|
||||
|
||||
private final int[] mTmpInt2 = new int[2];
|
||||
|
||||
// Fingerprint (as computed by getLoggingFingerprint() of the last logged state.
|
||||
private int mLastLoggedStateFingerprint;
|
||||
private boolean mIsLaunchingActivityOverLockscreen;
|
||||
@@ -1430,16 +1426,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
mPowerManager.wakeUp(
|
||||
time, PowerManager.WAKE_REASON_GESTURE, "com.android.systemui:" + why);
|
||||
mWakeUpComingFromTouch = true;
|
||||
|
||||
// NOTE, the incoming view can sometimes be the entire container... unsure if
|
||||
// this location is valuable enough
|
||||
if (where != null) {
|
||||
where.getLocationInWindow(mTmpInt2);
|
||||
mWakeUpTouchLocation = new PointF(mTmpInt2[0] + where.getWidth() / 2,
|
||||
mTmpInt2[1] + where.getHeight() / 2);
|
||||
} else {
|
||||
mWakeUpTouchLocation = new PointF(-1, -1);
|
||||
}
|
||||
mFalsingCollector.onScreenOnFromTouch();
|
||||
}
|
||||
}
|
||||
@@ -1955,7 +1941,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
PowerManager.WAKE_REASON_APPLICATION,
|
||||
"com.android.systemui:full_screen_intent");
|
||||
mWakeUpComingFromTouch = false;
|
||||
mWakeUpTouchLocation = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3225,7 +3210,7 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
|| (mDozing && mDozeParameters.shouldControlScreenOff()
|
||||
&& visibleNotOccludedOrWillBe);
|
||||
|
||||
mNotificationPanelViewController.setDozing(mDozing, animate, mWakeUpTouchLocation);
|
||||
mNotificationPanelViewController.setDozing(mDozing, animate);
|
||||
updateQsExpansionEnabled();
|
||||
Trace.endSection();
|
||||
}
|
||||
@@ -3556,7 +3541,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
mLaunchCameraWhenFinishedWaking = false;
|
||||
mDeviceInteractive = false;
|
||||
mWakeUpComingFromTouch = false;
|
||||
mWakeUpTouchLocation = null;
|
||||
updateVisibleToUser();
|
||||
|
||||
updateNotificationPanelTouchState();
|
||||
|
||||
@@ -47,7 +47,6 @@ import android.content.ContentResolver;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.database.ContentObserver;
|
||||
import android.graphics.PointF;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.PowerManager;
|
||||
@@ -764,10 +763,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void testSetDozing_notifiesNsslAndStateController() {
|
||||
mNotificationPanelViewController.setDozing(true /* dozing */, false /* animate */,
|
||||
null /* touch */);
|
||||
verify(mNotificationStackScrollLayoutController)
|
||||
.setDozing(eq(true), eq(false), eq(null));
|
||||
mNotificationPanelViewController.setDozing(true /* dozing */, false /* animate */);
|
||||
verify(mNotificationStackScrollLayoutController).setDozing(eq(true), eq(false));
|
||||
assertThat(mStatusBarStateController.getDozeAmount()).isEqualTo(1f);
|
||||
}
|
||||
|
||||
@@ -1219,9 +1216,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
||||
clearInvocations(mKeyguardStatusViewController);
|
||||
|
||||
mNotificationPanelViewController.setDozing(true, false, null);
|
||||
|
||||
verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ true);
|
||||
mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false);
|
||||
verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate= */ true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1233,7 +1229,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
when(mMediaDataManager.hasActiveMedia()).thenReturn(true);
|
||||
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
||||
|
||||
mNotificationPanelViewController.setDozing(true, false, null);
|
||||
mNotificationPanelViewController.setDozing(true, false);
|
||||
|
||||
verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ false);
|
||||
}
|
||||
@@ -1547,8 +1543,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
when(mDozeParameters.getAlwaysOn()).thenReturn(dozingAlwaysOn);
|
||||
mNotificationPanelViewController.setDozing(
|
||||
/* dozing= */ dozing,
|
||||
/* animate= */ false,
|
||||
/* wakeUpTouchLocation= */ new PointF()
|
||||
/* animate= */ false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ import org.mockito.ArgumentMatchers.eq
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.mock
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.MockitoAnnotations
|
||||
import org.mockito.Mockito.`when` as whenever
|
||||
import org.mockito.MockitoAnnotations
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner::class)
|
||||
@@ -89,8 +89,8 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
||||
val listener = mock(StatusBarStateController.StateListener::class.java)
|
||||
controller.addCallback(listener)
|
||||
|
||||
controller.setDozeAmount(0.5f, false /* animated */)
|
||||
controller.setDozeAmount(0.5f, false /* animated */)
|
||||
controller.setAndInstrumentDozeAmount(null, 0.5f, false /* animated */)
|
||||
controller.setAndInstrumentDozeAmount(null, 0.5f, false /* animated */)
|
||||
verify(listener).onDozeAmountChanged(eq(0.5f), anyFloat())
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun testSetDozeAmount_immediatelyChangesDozeAmount_lockscreenTransitionFromAod() {
|
||||
// Put controller in AOD state
|
||||
controller.setDozeAmount(1f, false)
|
||||
controller.setAndInstrumentDozeAmount(null, 1f, false)
|
||||
|
||||
// When waking from doze, CentralSurfaces#updateDozingState will update the dozing state
|
||||
// before the doze amount changes
|
||||
|
||||
Reference in New Issue
Block a user