Merge "[DO NOT MERGE] Remove unused methods" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b5b18930fa
@@ -54,7 +54,6 @@ import android.graphics.ColorFilter;
|
|||||||
import android.graphics.Insets;
|
import android.graphics.Insets;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
import android.graphics.PointF;
|
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Region;
|
import android.graphics.Region;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@@ -3807,13 +3806,12 @@ public final class NotificationPanelViewController extends PanelViewController {
|
|||||||
*
|
*
|
||||||
* @param dozing {@code true} when dozing.
|
* @param dozing {@code true} when dozing.
|
||||||
* @param animate if transition should be animated.
|
* @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;
|
if (dozing == mDozing) return;
|
||||||
mView.setDozing(dozing);
|
mView.setDozing(dozing);
|
||||||
mDozing = dozing;
|
mDozing = dozing;
|
||||||
mNotificationStackScrollLayoutController.setDozing(mDozing, animate, wakeUpTouchLocation);
|
mNotificationStackScrollLayoutController.setDozing(mDozing, animate);
|
||||||
mKeyguardBottomArea.setDozing(mDozing, animate);
|
mKeyguardBottomArea.setDozing(mDozing, animate);
|
||||||
mKeyguardBottomAreaInteractorProvider.get().setAnimateDozingTransitions(animate);
|
mKeyguardBottomAreaInteractorProvider.get().setAnimateDozingTransitions(animate);
|
||||||
mKeyguardStatusBarViewController.setDozing(mDozing);
|
mKeyguardStatusBarViewController.setDozing(mDozing);
|
||||||
@@ -4741,7 +4739,7 @@ public final class NotificationPanelViewController extends PanelViewController {
|
|||||||
* change.
|
* change.
|
||||||
*/
|
*/
|
||||||
public void showAodUi() {
|
public void showAodUi() {
|
||||||
setDozing(true /* dozing */, false /* animate */, null);
|
setDozing(true /* dozing */, false /* animate */);
|
||||||
mStatusBarStateController.setUpcomingState(KEYGUARD);
|
mStatusBarStateController.setUpcomingState(KEYGUARD);
|
||||||
mEntryManager.updateNotifications("showAodUi");
|
mEntryManager.updateNotifications("showAodUi");
|
||||||
mStatusBarStateListener.onStateChanged(KEYGUARD);
|
mStatusBarStateListener.onStateChanged(KEYGUARD);
|
||||||
|
|||||||
@@ -302,11 +302,6 @@ public class StatusBarStateControllerImpl implements
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDozeAmount(float dozeAmount, boolean animated) {
|
|
||||||
setAndInstrumentDozeAmount(null, dozeAmount, animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated) {
|
public void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated) {
|
||||||
if (mDarkAnimator != null && mDarkAnimator.isRunning()) {
|
if (mDarkAnimator != null && mDarkAnimator.isRunning()) {
|
||||||
|
|||||||
@@ -98,14 +98,6 @@ public interface SysuiStatusBarStateController extends StatusBarStateController
|
|||||||
*/
|
*/
|
||||||
boolean setIsDozing(boolean isDozing);
|
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
|
* Changes the current doze amount, also starts the
|
||||||
* {@link com.android.internal.jank.InteractionJankMonitor InteractionJankMonitor} as possible.
|
* {@link com.android.internal.jank.InteractionJankMonitor InteractionJankMonitor} as possible.
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ import android.graphics.Color;
|
|||||||
import android.graphics.Outline;
|
import android.graphics.Outline;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.Path;
|
import android.graphics.Path;
|
||||||
import android.graphics.PointF;
|
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -4405,8 +4404,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
* See {@link AmbientState#setDozing}.
|
* See {@link AmbientState#setDozing}.
|
||||||
*/
|
*/
|
||||||
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
|
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
|
||||||
public void setDozing(boolean dozing, boolean animate,
|
public void setDozing(boolean dozing, boolean animate) {
|
||||||
@Nullable PointF touchWakeUpScreenLocation) {
|
|
||||||
if (mAmbientState.isDozing() == dozing) {
|
if (mAmbientState.isDozing() == dozing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import static com.android.systemui.statusbar.phone.NotificationIconAreaControlle
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.PointF;
|
|
||||||
import android.os.Trace;
|
import android.os.Trace;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -1235,8 +1234,8 @@ public class NotificationStackScrollLayoutController {
|
|||||||
mView.setAnimationsEnabled(enabled);
|
mView.setAnimationsEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDozing(boolean dozing, boolean animate, PointF wakeUpTouchLocation) {
|
public void setDozing(boolean dozing, boolean animate) {
|
||||||
mView.setDozing(dozing, animate, wakeUpTouchLocation);
|
mView.setDozing(dozing, animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPulsing(boolean pulsing, boolean animatePulse) {
|
public void setPulsing(boolean pulsing, boolean animatePulse) {
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ import android.content.pm.PackageManager;
|
|||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.PointF;
|
|
||||||
import android.hardware.devicestate.DeviceStateManager;
|
import android.hardware.devicestate.DeviceStateManager;
|
||||||
import android.metrics.LogMaker;
|
import android.metrics.LogMaker;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@@ -462,7 +461,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
DozeServiceHost mDozeServiceHost;
|
DozeServiceHost mDozeServiceHost;
|
||||||
private boolean mWakeUpComingFromTouch;
|
private boolean mWakeUpComingFromTouch;
|
||||||
private PointF mWakeUpTouchLocation;
|
|
||||||
private LightRevealScrim mLightRevealScrim;
|
private LightRevealScrim mLightRevealScrim;
|
||||||
private PowerButtonReveal mPowerButtonReveal;
|
private PowerButtonReveal mPowerButtonReveal;
|
||||||
|
|
||||||
@@ -619,8 +617,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
private int mLastCameraLaunchSource;
|
private int mLastCameraLaunchSource;
|
||||||
protected PowerManager.WakeLock mGestureWakeLock;
|
protected PowerManager.WakeLock mGestureWakeLock;
|
||||||
|
|
||||||
private final int[] mTmpInt2 = new int[2];
|
|
||||||
|
|
||||||
// Fingerprint (as computed by getLoggingFingerprint() of the last logged state.
|
// Fingerprint (as computed by getLoggingFingerprint() of the last logged state.
|
||||||
private int mLastLoggedStateFingerprint;
|
private int mLastLoggedStateFingerprint;
|
||||||
private boolean mIsLaunchingActivityOverLockscreen;
|
private boolean mIsLaunchingActivityOverLockscreen;
|
||||||
@@ -1446,16 +1442,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
mPowerManager.wakeUp(
|
mPowerManager.wakeUp(
|
||||||
time, PowerManager.WAKE_REASON_GESTURE, "com.android.systemui:" + why);
|
time, PowerManager.WAKE_REASON_GESTURE, "com.android.systemui:" + why);
|
||||||
mWakeUpComingFromTouch = true;
|
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();
|
mFalsingCollector.onScreenOnFromTouch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1972,7 +1958,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
PowerManager.WAKE_REASON_APPLICATION,
|
PowerManager.WAKE_REASON_APPLICATION,
|
||||||
"com.android.systemui:full_screen_intent");
|
"com.android.systemui:full_screen_intent");
|
||||||
mWakeUpComingFromTouch = false;
|
mWakeUpComingFromTouch = false;
|
||||||
mWakeUpTouchLocation = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3242,7 +3227,7 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
|| (mDozing && mDozeParameters.shouldControlScreenOff()
|
|| (mDozing && mDozeParameters.shouldControlScreenOff()
|
||||||
&& visibleNotOccludedOrWillBe);
|
&& visibleNotOccludedOrWillBe);
|
||||||
|
|
||||||
mNotificationPanelViewController.setDozing(mDozing, animate, mWakeUpTouchLocation);
|
mNotificationPanelViewController.setDozing(mDozing, animate);
|
||||||
updateQsExpansionEnabled();
|
updateQsExpansionEnabled();
|
||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
@@ -3573,7 +3558,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
|||||||
mLaunchCameraWhenFinishedWaking = false;
|
mLaunchCameraWhenFinishedWaking = false;
|
||||||
mDeviceInteractive = false;
|
mDeviceInteractive = false;
|
||||||
mWakeUpComingFromTouch = false;
|
mWakeUpComingFromTouch = false;
|
||||||
mWakeUpTouchLocation = null;
|
|
||||||
updateVisibleToUser();
|
updateVisibleToUser();
|
||||||
|
|
||||||
updateNotificationPanelTouchState();
|
updateNotificationPanelTouchState();
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ import android.content.ContentResolver;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.graphics.PointF;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
@@ -764,10 +763,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetDozing_notifiesNsslAndStateController() {
|
public void testSetDozing_notifiesNsslAndStateController() {
|
||||||
mNotificationPanelViewController.setDozing(true /* dozing */, false /* animate */,
|
mNotificationPanelViewController.setDozing(true /* dozing */, false /* animate */);
|
||||||
null /* touch */);
|
verify(mNotificationStackScrollLayoutController).setDozing(eq(true), eq(false));
|
||||||
verify(mNotificationStackScrollLayoutController)
|
|
||||||
.setDozing(eq(true), eq(false), eq(null));
|
|
||||||
assertThat(mStatusBarStateController.getDozeAmount()).isEqualTo(1f);
|
assertThat(mStatusBarStateController.getDozeAmount()).isEqualTo(1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1220,7 +1217,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
||||||
clearInvocations(mKeyguardStatusViewController);
|
clearInvocations(mKeyguardStatusViewController);
|
||||||
|
|
||||||
mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false, null);
|
mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false);
|
||||||
|
|
||||||
verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate= */ true);
|
verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate= */ true);
|
||||||
}
|
}
|
||||||
@@ -1234,7 +1231,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
||||||
clearInvocations(mKeyguardStatusViewController);
|
clearInvocations(mKeyguardStatusViewController);
|
||||||
|
|
||||||
mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false, null);
|
mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false);
|
||||||
|
|
||||||
verify(mKeyguardStatusViewController).displayClock(SMALL, /* animate= */ true);
|
verify(mKeyguardStatusViewController).displayClock(SMALL, /* animate= */ true);
|
||||||
}
|
}
|
||||||
@@ -1248,7 +1245,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
when(mMediaDataManager.hasActiveMedia()).thenReturn(true);
|
when(mMediaDataManager.hasActiveMedia()).thenReturn(true);
|
||||||
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
||||||
|
|
||||||
mNotificationPanelViewController.setDozing(true, false, null);
|
mNotificationPanelViewController.setDozing(true, false);
|
||||||
|
|
||||||
verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ false);
|
verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ false);
|
||||||
}
|
}
|
||||||
@@ -1562,8 +1559,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
when(mDozeParameters.getAlwaysOn()).thenReturn(dozingAlwaysOn);
|
when(mDozeParameters.getAlwaysOn()).thenReturn(dozingAlwaysOn);
|
||||||
mNotificationPanelViewController.setDozing(
|
mNotificationPanelViewController.setDozing(
|
||||||
/* dozing= */ dozing,
|
/* dozing= */ dozing,
|
||||||
/* animate= */ false,
|
/* animate= */ false
|
||||||
/* wakeUpTouchLocation= */ new PointF()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ import org.mockito.ArgumentMatchers.eq
|
|||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.Mockito.mock
|
import org.mockito.Mockito.mock
|
||||||
import org.mockito.Mockito.verify
|
import org.mockito.Mockito.verify
|
||||||
import org.mockito.MockitoAnnotations
|
|
||||||
import org.mockito.Mockito.`when` as whenever
|
import org.mockito.Mockito.`when` as whenever
|
||||||
|
import org.mockito.MockitoAnnotations
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidTestingRunner::class)
|
@RunWith(AndroidTestingRunner::class)
|
||||||
@@ -89,8 +89,8 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
|||||||
val listener = mock(StatusBarStateController.StateListener::class.java)
|
val listener = mock(StatusBarStateController.StateListener::class.java)
|
||||||
controller.addCallback(listener)
|
controller.addCallback(listener)
|
||||||
|
|
||||||
controller.setDozeAmount(0.5f, false /* animated */)
|
controller.setAndInstrumentDozeAmount(null, 0.5f, false /* animated */)
|
||||||
controller.setDozeAmount(0.5f, false /* animated */)
|
controller.setAndInstrumentDozeAmount(null, 0.5f, false /* animated */)
|
||||||
verify(listener).onDozeAmountChanged(eq(0.5f), anyFloat())
|
verify(listener).onDozeAmountChanged(eq(0.5f), anyFloat())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ class StatusBarStateControllerImplTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testSetDozeAmount_immediatelyChangesDozeAmount_lockscreenTransitionFromAod() {
|
fun testSetDozeAmount_immediatelyChangesDozeAmount_lockscreenTransitionFromAod() {
|
||||||
// Put controller in AOD state
|
// 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
|
// When waking from doze, CentralSurfaces#updateDozingState will update the dozing state
|
||||||
// before the doze amount changes
|
// before the doze amount changes
|
||||||
|
|||||||
Reference in New Issue
Block a user