Skip to content

Commit 9e8b9d3

Browse files
author
Android Build Coastguard Worker
committed
Snap for 11135354 from 5092588 to udc-d2-release
Change-Id: I689a2035328157c8b7e98bd4b8f154bb60111842
2 parents 3c49504 + 5092588 commit 9e8b9d3

3 files changed

Lines changed: 23 additions & 16 deletions

File tree

common/device-side/interactive/src/main/java/com/android/interactive/Step.java

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import static com.android.interactive.Automator.AUTOMATION_FILE;
2323

2424
import android.graphics.PixelFormat;
25+
import android.os.Handler;
26+
import android.os.Looper;
2527
import android.util.Log;
2628
import android.view.Gravity;
2729
import android.view.LayoutInflater;
@@ -247,27 +249,32 @@ public boolean hasFailed() {
247249
* Adds a button to the interaction prompt.
248250
*/
249251
protected void addButton(String title, Runnable onClick) {
250-
Button btn = new Button(TestApis.context().instrumentedContext());
251-
btn.setText(title);
252-
btn.setOnClickListener(v -> onClick.run());
253-
254-
GridLayout layout = mInstructionView.findViewById(R.id.buttons);
255-
layout.addView(btn);
252+
// Push to UI thread to avoid animation issues when adding the button
253+
new Handler(Looper.getMainLooper()).post(() -> {
254+
Button btn = new Button(TestApis.context().instrumentedContext());
255+
btn.setText(title);
256+
btn.setOnClickListener(v -> onClick.run());
257+
258+
GridLayout layout = mInstructionView.findViewById(R.id.buttons);
259+
layout.addView(btn);
260+
});
256261
}
257262

258263
/**
259264
* Adds small button with a single up/down arrow, used for moving the text box to the
260265
* bottom of the screen in case it covers some critical area of the app
261266
*/
262-
263267
protected void addSwapButton() {
264-
Button btn = new Button(TestApis.context().instrumentedContext());
265-
// up/down arrow
266-
btn.setText("\u21F5");
267-
btn.setOnClickListener(v -> swap());
268-
269-
GridLayout layout = mInstructionView.findViewById(R.id.buttons);
270-
layout.addView(btn);
268+
// Push to UI thread to avoid animation issues when adding the button
269+
new Handler(Looper.getMainLooper()).post(() -> {
270+
Button btn = new Button(TestApis.context().instrumentedContext());
271+
// up/down arrow
272+
btn.setText("\u21F5");
273+
btn.setOnClickListener(v -> swap());
274+
275+
GridLayout layout = mInstructionView.findViewById(R.id.buttons);
276+
layout.addView(btn);
277+
});
271278
}
272279

273280
/**

tests/tests/hibernation/src/android/hibernation/cts/AppHibernationUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fun openUnusedAppsNotification() {
298298
expandNotificationsWatch(UiAutomatorUtils.getUiDevice())
299299
waitFindObject(uiAutomation, notifSelector).click()
300300
// In wear os, notification has one additional button to open it
301-
waitFindObject(uiAutomation, By.text("Open")).click()
301+
waitFindObject(uiAutomation, By.textContains("Open")).click()
302302
} else {
303303
val permissionPkg: String = InstrumentationRegistry.getTargetContext()
304304
.packageManager.permissionControllerPackageName

tests/tests/virtualdevice/src/android/virtualdevice/cts/sensor/VirtualSensorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class VirtualSensorTest {
9797
private static final String VIRTUAL_SENSOR_NAME = "VirtualAccelerometer";
9898
private static final String VIRTUAL_SENSOR_VENDOR = "VirtualDeviceVendor";
9999

100-
private static final int CUSTOM_SENSOR_TYPE = 9999;
100+
private static final int CUSTOM_SENSOR_TYPE = Sensor.TYPE_DEVICE_PRIVATE_BASE + 9999;
101101

102102
private static final int SENSOR_TIMEOUT_MILLIS = 1000;
103103

0 commit comments

Comments
 (0)