diff options
| author | 2022-08-24 11:43:54 +0000 | |
|---|---|---|
| committer | 2022-08-24 11:43:54 +0000 | |
| commit | 8aa8ea4d975b9dbfb13789620fb4786c25159c05 (patch) | |
| tree | 3942ca09b9c18d78dcd7a5420f8b85bcebb39c99 | |
| parent | f8da4974232ae3c45c641d09cd124a71375dccd5 (diff) | |
| parent | d7f4587281229433f1f4b29f8080142103a35a8b (diff) | |
Merge "Remove unused methods"
8 files changed, 17 insertions, 56 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 7a4c87766114..9ca09ed6d70e 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -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); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java index 0280e0b729a9..c04bc8289f81 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java @@ -303,11 +303,6 @@ public class StatusBarStateControllerImpl implements } @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()) { if (animated && mDozeAmountTarget == dozeAmount) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java b/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java index 2b3190159ecd..2cc77384fb2a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java @@ -99,14 +99,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. * diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 952bafbe6eb3..79d883b32a98 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -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; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index 9998fe41b775..3f6586c37b5d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -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) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 6f067591256a..e444e0a1e2c5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -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(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java index 95211c0c8ec8..32fa6e45bc37 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java @@ -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 ); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt index be631afdd1a9..1d8e5dec5c50 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateControllerImplTest.kt @@ -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 |