Loading packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.os.Build; import android.platform.test.annotations.EnableFlags; import android.testing.TestableLooper; import android.view.HapticFeedbackConstants; Loading @@ -41,6 +42,7 @@ import com.android.systemui.flags.DisableSceneContainer; import com.google.android.msdl.data.model.MSDLToken; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; Loading @@ -59,6 +61,8 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test @EnableFlags(com.android.systemui.Flags.FLAG_SHADE_EXPANDS_ON_STATUS_BAR_LONG_PRESS) public void onStatusBarLongPress_shadeExpands() { //TODO(b/394977231) delete this temporary workaround used only by tests Assume.assumeFalse(Build.HARDWARE.equals("cutf_cvm")); long downTime = 42L; // Start touch session with down event onTouchEvent(MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN, 1f, 1f, 0)); Loading @@ -85,6 +89,8 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test @EnableFlags(com.android.systemui.Flags.FLAG_SHADE_EXPANDS_ON_STATUS_BAR_LONG_PRESS) public void onStatusBarLongPress_qsExpands() { //TODO(b/394977231) delete this temporary workaround used only by tests Assume.assumeFalse(Build.HARDWARE.equals("cutf_cvm")); long downTime = 42L; // Start with shade already expanded mNotificationPanelViewController.setExpandedFraction(1F); Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +8 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.graphics.RenderEffect; import android.graphics.Shader; import android.os.Build; import android.os.Bundle; import android.os.Trace; import android.util.IndentingPrintWriter; Loading Loading @@ -241,6 +242,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private static final String COUNTER_PANEL_OPEN_PEEK = "panel_open_peek"; private static final Rect M_DUMMY_DIRTY_RECT = new Rect(0, 0, 1, 1); private static final Rect EMPTY_RECT = new Rect(); //TODO(b/394977231) delete this temporary workaround used only by tests private static final boolean DISABLE_LONG_PRESS_EXPAND = Build.HARDWARE.equals("cutf_cvm"); /** * Whether the Shade should animate to reflect Back gesture progress. * To minimize latency at runtime, we cache this, else we'd be reading it every time Loading Loading @@ -2202,6 +2205,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Deprecated public void onStatusBarLongPress(MotionEvent event) { Log.i(TAG, "Status Bar was long pressed."); if (DISABLE_LONG_PRESS_EXPAND) { //TODO(b/394977231) delete this temporary workaround used only by tests Log.i(TAG, "Ignoring status Bar long press on virtualized test device."); return; } ShadeExpandsOnStatusBarLongPress.assertInNewMode(); mStatusBarLongPressDowntime = event.getDownTime(); if (isTracking()) { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.os.Build; import android.platform.test.annotations.EnableFlags; import android.testing.TestableLooper; import android.view.HapticFeedbackConstants; Loading @@ -41,6 +42,7 @@ import com.android.systemui.flags.DisableSceneContainer; import com.google.android.msdl.data.model.MSDLToken; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; Loading @@ -59,6 +61,8 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test @EnableFlags(com.android.systemui.Flags.FLAG_SHADE_EXPANDS_ON_STATUS_BAR_LONG_PRESS) public void onStatusBarLongPress_shadeExpands() { //TODO(b/394977231) delete this temporary workaround used only by tests Assume.assumeFalse(Build.HARDWARE.equals("cutf_cvm")); long downTime = 42L; // Start touch session with down event onTouchEvent(MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN, 1f, 1f, 0)); Loading @@ -85,6 +89,8 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test @EnableFlags(com.android.systemui.Flags.FLAG_SHADE_EXPANDS_ON_STATUS_BAR_LONG_PRESS) public void onStatusBarLongPress_qsExpands() { //TODO(b/394977231) delete this temporary workaround used only by tests Assume.assumeFalse(Build.HARDWARE.equals("cutf_cvm")); long downTime = 42L; // Start with shade already expanded mNotificationPanelViewController.setExpandedFraction(1F); Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +8 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.graphics.RenderEffect; import android.graphics.Shader; import android.os.Build; import android.os.Bundle; import android.os.Trace; import android.util.IndentingPrintWriter; Loading Loading @@ -241,6 +242,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private static final String COUNTER_PANEL_OPEN_PEEK = "panel_open_peek"; private static final Rect M_DUMMY_DIRTY_RECT = new Rect(0, 0, 1, 1); private static final Rect EMPTY_RECT = new Rect(); //TODO(b/394977231) delete this temporary workaround used only by tests private static final boolean DISABLE_LONG_PRESS_EXPAND = Build.HARDWARE.equals("cutf_cvm"); /** * Whether the Shade should animate to reflect Back gesture progress. * To minimize latency at runtime, we cache this, else we'd be reading it every time Loading Loading @@ -2202,6 +2205,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Deprecated public void onStatusBarLongPress(MotionEvent event) { Log.i(TAG, "Status Bar was long pressed."); if (DISABLE_LONG_PRESS_EXPAND) { //TODO(b/394977231) delete this temporary workaround used only by tests Log.i(TAG, "Ignoring status Bar long press on virtualized test device."); return; } ShadeExpandsOnStatusBarLongPress.assertInNewMode(); mStatusBarLongPressDowntime = event.getDownTime(); if (isTracking()) { Loading