From 375a1bbb929ae5ce723e3466d8f0ea6d2a71f5de Mon Sep 17 00:00:00 2001 From: Jon Spivack Date: Wed, 24 Mar 2021 04:01:26 -0700 Subject: [PATCH] TaskOverlayFactoryGo: Minor updates for testability Made a few things public and marked them as @VisibleForTesting. Bug: 179738220 Test: atest -v LauncherGoGoogleRoboTests Change-Id: I231316ecf9282ad4d54038e218f44f062b3fa413 --- .../android/quickstep/TaskOverlayFactoryGo.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java index 36a4e7fa35..3a473449ae 100644 --- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java +++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java @@ -36,6 +36,8 @@ import android.os.SystemClock; import android.text.TextUtils; import android.util.Log; +import androidx.annotation.VisibleForTesting; + import com.android.launcher3.R; import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.TaskThumbnailView; @@ -51,6 +53,7 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { public static final String ACTION_SEARCH = "com.android.quickstep.ACTION_SEARCH"; public static final String ELAPSED_NANOS = "niu_actions_elapsed_realtime_nanos"; public static final String ACTIONS_URL = "niu_actions_app_url"; + private static final String ASSIST_KEY_CONTENT = "content"; private static final String TAG = "TaskOverlayFactoryGo"; // Empty constructor required for ResourceBasedOverride @@ -68,8 +71,6 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { * @param The type of View in which the overlay will be placed */ public static final class TaskOverlayGo extends TaskOverlay { - private static final String ASSIST_KEY_CONTENT = "content"; - private String mNIUPackageName; private int mTaskId; private Bundle mAssistData; @@ -122,7 +123,11 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { }); } - private void sendNIUIntent(String actionType) { + /** + * Creates and sends an Intent corresponding to the button that was clicked + */ + @VisibleForTesting + public void sendNIUIntent(String actionType) { Intent intent = createNIUIntent(actionType); mImageApi.shareAsDataWithExplicitIntent(/* crop */ null, intent); } @@ -178,6 +183,11 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { } } } + + @VisibleForTesting + public void setImageActionsAPI(ImageActionsApi imageActionsApi) { + mImageApi = imageActionsApi; + } } /**