Merge "Not using shell command to enable test provider" into sc-v2-dev
diff --git a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
index 65be624..b83e26e 100644
--- a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
+++ b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
@@ -17,7 +17,6 @@
import android.content.Context;
import android.content.res.Resources;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
@@ -86,12 +85,7 @@
mSpeedSomewhatFast = res.getDimension(R.dimen.motion_pause_detector_speed_somewhat_fast);
mSpeedFast = res.getDimension(R.dimen.motion_pause_detector_speed_fast);
mForcePauseTimeout = new Alarm();
- mForcePauseTimeout.setOnAlarmListener(alarm -> {
- if (TestProtocol.sDebugTracing) {
- Log.d(TestProtocol.MOTION_PAUSE_TIMEOUT, "onAlarm");
- }
- updatePaused(true /* isPaused */);
- });
+ mForcePauseTimeout.setOnAlarmListener(alarm -> updatePaused(true /* isPaused */));
mMakePauseHarderToTrigger = makePauseHarderToTrigger;
mVelocityProvider = new SystemVelocityProvider(axis);
}
@@ -128,9 +122,6 @@
long timeoutMs = TestProtocol.sForcePauseTimeout != null
? TestProtocol.sForcePauseTimeout
: mMakePauseHarderToTrigger ? HARDER_TRIGGER_TIMEOUT : FORCE_PAUSE_TIMEOUT;
- if (TestProtocol.sDebugTracing) {
- Log.d(TestProtocol.MOTION_PAUSE_TIMEOUT, "setAlarm: " + timeoutMs);
- }
mForcePauseTimeout.setAlarm(timeoutMs);
float newVelocity = mVelocityProvider.addMotionEvent(ev, ev.getPointerId(pointerIndex));
if (mPreviousVelocity != null) {
@@ -172,9 +163,6 @@
}
}
}
- if (TestProtocol.sDebugTracing) {
- Log.d(TestProtocol.MOTION_PAUSE_TIMEOUT, "checkMotionPaused: " + isPaused);
- }
updatePaused(isPaused);
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 164e755..e5e560a 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -37,7 +37,6 @@
import com.android.launcher3.tapl.OverviewActions;
import com.android.launcher3.tapl.OverviewTask;
import com.android.launcher3.ui.TaplTestsLauncher3;
-import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
import com.android.quickstep.views.RecentsView;
@@ -158,7 +157,6 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
- @ScreenRecord //b/193125090
public void testOverviewActions() throws Exception {
// Experimenting for b/165029151:
final Overview overview = mLauncher.pressHome().switchToOverview();
diff --git a/src/com/android/launcher3/testing/TestLogging.java b/src/com/android/launcher3/testing/TestLogging.java
index 6cdd3ca..103b565 100644
--- a/src/com/android/launcher3/testing/TestLogging.java
+++ b/src/com/android/launcher3/testing/TestLogging.java
@@ -17,6 +17,7 @@
package com.android.launcher3.testing;
import android.util.Log;
+import android.view.InputEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -48,17 +49,24 @@
}
}
+ private static void registerEventNotFromTest(InputEvent event) {
+ if (!sHadEventsNotFromTest && event.getDeviceId() != -1) {
+ sHadEventsNotFromTest = true;
+ Log.d(TestProtocol.PERMANENT_DIAG_TAG, "First event not from test: " + event);
+ }
+ }
+
public static void recordKeyEvent(String sequence, String message, KeyEvent event) {
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
recordEventSlow(sequence, message + ": " + event);
- if (event.getDeviceId() != -1) sHadEventsNotFromTest = true;
+ registerEventNotFromTest(event);
}
}
public static void recordMotionEvent(String sequence, String message, MotionEvent event) {
if (Utilities.IS_RUNNING_IN_TEST_HARNESS && event.getAction() != MotionEvent.ACTION_MOVE) {
recordEventSlow(sequence, message + ": " + event);
- if (event.getDeviceId() != -1) sHadEventsNotFromTest = true;
+ registerEventNotFromTest(event);
}
}
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java
index 38cbbe7..1c5b31b 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/TestProtocol.java
@@ -118,6 +118,5 @@
public static final String WORK_PROFILE_REMOVED = "b/159671700";
public static final String FALLBACK_ACTIVITY_NO_SET = "b/181019015";
public static final String THIRD_PARTY_LAUNCHER_NOT_SET = "b/187080582";
- public static final String MOTION_PAUSE_TIMEOUT = "b/194114179";
public static final String TASK_VIEW_ID_CRASH = "b/195430732";
}
diff --git a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
index d3a0190..57a6d3f 100644
--- a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
+++ b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
@@ -85,7 +85,7 @@
setBackgroundResource(R.drawable.pending_widget_bg);
setWillNotDraw(false);
- updateAppWidget(null);
+ super.updateAppWidget(null);
setOnClickListener(ItemClickHandler.INSTANCE);
if (info.pendingItemInfo == null) {
diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java
index a8ed154..bd444db 100644
--- a/src/com/android/launcher3/widget/WidgetCell.java
+++ b/src/com/android/launcher3/widget/WidgetCell.java
@@ -483,6 +483,20 @@
mAppWidgetHostViewPreview.measure(
makeMeasureSpec(MAX_MEASURE_SPEC_DIMENSION, MeasureSpec.UNSPECIFIED),
makeMeasureSpec(MAX_MEASURE_SPEC_DIMENSION, MeasureSpec.UNSPECIFIED));
+ if (mRemoteViewsPreview != null) {
+ // If RemoteViews contains multiple sizes, the best fit sized RemoteViews will be
+ // selected in onLayout. To work out the right measurement, let's layout and then
+ // measure again.
+ mAppWidgetHostViewPreview.layout(
+ /* left= */ 0,
+ /* top= */ 0,
+ /* right= */ mTargetPreviewWidth,
+ /* bottom= */ mTargetPreviewHeight);
+ mAppWidgetHostViewPreview.measure(
+ makeMeasureSpec(mTargetPreviewWidth, MeasureSpec.UNSPECIFIED),
+ makeMeasureSpec(mTargetPreviewHeight, MeasureSpec.UNSPECIFIED));
+
+ }
View widgetContent = mAppWidgetHostViewPreview.getChildAt(0);
int appWidgetContentWidth = widgetContent.getMeasuredWidth();
int appWidgetContentHeight = widgetContent.getMeasuredHeight();