summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quickstep/src/com/android/quickstep/views/TaskMenuView.java11
-rw-r--r--quickstep/src/com/android/quickstep/views/TaskView.java4
-rw-r--r--tests/src/com/android/launcher3/util/TestUtil.java7
3 files changed, 22 insertions, 0 deletions
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
index bea646a55..682152e9a 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
@@ -28,6 +28,7 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.MotionEvent;
+import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -280,4 +281,14 @@ public class TaskMenuView extends AbstractFloatingView {
Rect toRect = new Rect(0, 0, getWidth(), getHeight());
return new RoundedRectRevealOutlineProvider(radius, radius, fromRect, toRect);
}
+
+ public View findMenuItemByText(String text) {
+ for (int i = mOptionLayout.getChildCount() - 1; i >= 0; --i) {
+ final ViewGroup menuOptionView = (ViewGroup) mOptionLayout.getChildAt(i);
+ if (text.equals(menuOptionView.<TextView>findViewById(R.id.text).getText())) {
+ return menuOptionView;
+ }
+ }
+ return null;
+ }
}
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 71ca22db7..88e7ea8fd 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -207,6 +207,10 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
mDigitalWellBeingToast = findViewById(R.id.digital_well_being_toast);
}
+ public TaskMenuView getMenuView() {
+ return mMenuView;
+ }
+
/**
* Updates this task view to the given {@param task}.
*/
diff --git a/tests/src/com/android/launcher3/util/TestUtil.java b/tests/src/com/android/launcher3/util/TestUtil.java
index 1338dcb10..55e57440c 100644
--- a/tests/src/com/android/launcher3/util/TestUtil.java
+++ b/tests/src/com/android/launcher3/util/TestUtil.java
@@ -27,6 +27,8 @@ import java.io.IOException;
import java.io.InputStream;
public class TestUtil {
+ public static final String DUMMY_PACKAGE = "com.example.android.aardwolf";
+
public static void installDummyApp() throws IOException {
// Copy apk from resources to a local file and install from there.
final Resources resources = getContext().getResources();
@@ -48,4 +50,9 @@ public class TestUtil {
UiDevice.getInstance(getInstrumentation()).executeShellCommand("pm install " + apkFilename);
}
+
+ public static void uninstallDummyApp() throws IOException {
+ UiDevice.getInstance(getInstrumentation()).executeShellCommand(
+ "pm uninstall " + DUMMY_PACKAGE);
+ }
}