diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java index 6502526dcc..bc38739d57 100644 --- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java +++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java @@ -50,7 +50,6 @@ import androidx.annotation.IntDef; import androidx.annotation.VisibleForTesting; import com.android.launcher3.BaseActivity; -import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.views.ArrowTipView; @@ -76,7 +75,7 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { public static final String ACTIONS_ERROR_CODE = "niu_actions_app_error_code"; public static final int ERROR_PERMISSIONS_STRUCTURE = 1; public static final int ERROR_PERMISSIONS_SCREENSHOT = 2; - private static final String NIU_ACTIONS_CONFIRMED = "launcher_go.niu_actions_confirmed"; + public static final String NIU_ACTIONS_CONFIRMED = "launcher_go.niu_actions_confirmed"; private static final String ASSIST_SETTINGS_ARGS_BUNDLE = ":settings:show_fragment_args"; private static final String ASSIST_SETTINGS_ARGS_KEY = ":settings:fragment_args_key"; private static final String ASSIST_SETTINGS_PREFERENCE_KEY = "default_assist"; @@ -87,10 +86,11 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { @Retention(SOURCE) @IntDef({PRIVACY_CONFIRMATION, ASSISTANT_NOT_SELECTED, ASSISTANT_NOT_SUPPORTED}) - private @interface DialogType{} - private static final int PRIVACY_CONFIRMATION = 0; - private static final int ASSISTANT_NOT_SELECTED = 1; - private static final int ASSISTANT_NOT_SUPPORTED = 2; + @VisibleForTesting + public @interface DialogType{} + public static final int PRIVACY_CONFIRMATION = 0; + public static final int ASSISTANT_NOT_SELECTED = 1; + public static final int ASSISTANT_NOT_SUPPORTED = 2; private AssistContentRequester mContentRequester; @@ -211,7 +211,8 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { Intent intent = createNIUIntent(actionType); // Only add and send the image if the appropriate permissions are held if (mAssistStructurePermitted && mAssistScreenshotPermitted) { - mImageApi.shareAsDataWithExplicitIntent(/* crop */ null, intent); + mImageApi.shareAsDataWithExplicitIntent(/* crop */ null, intent, + () -> showDialog(actionType, ASSISTANT_NOT_SUPPORTED)); } else { // If both permissions are disabled, the structure error code takes priority // The user must enable that one before they can enable screenshots @@ -301,7 +302,6 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { mImageApi = imageActionsApi; } - // TODO (b/192406446): Test that these dialogs are shown at the appropriate times private void showDialog(String action, @DialogType int type) { switch (type) { case PRIVACY_CONFIRMATION: @@ -334,7 +334,7 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { int bodyTextID, int button1TextID, View.OnClickListener button1Callback, int button2TextID, View.OnClickListener button2Callback) { - BaseDraggingActivity activity = BaseActivity.fromContext(getActionsView().getContext()); + BaseActivity activity = BaseActivity.fromContext(getActionsView().getContext()); LayoutInflater inflater = LayoutInflater.from(activity); View view = inflater.inflate(R.layout.niu_actions_dialog, /* root */ null); @@ -368,6 +368,11 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { mDialog.cancel(); } + @VisibleForTesting + public OverlayDialogGo getDialog() { + return mDialog; + } + private void onDialogClickSettings(View v) { mDialog.dismiss(); @@ -401,7 +406,11 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { } } - private static final class OverlayDialogGo extends AlertDialog { + /** + * Basic modal dialog for various user prompts + */ + @VisibleForTesting + public static final class OverlayDialogGo extends AlertDialog { private final String mAction; private final @DialogType int mType; diff --git a/quickstep/res/layout/taskbar_edu.xml b/quickstep/res/layout/taskbar_edu.xml index b7717b71be..ef57a53690 100644 --- a/quickstep/res/layout/taskbar_edu.xml +++ b/quickstep/res/layout/taskbar_edu.xml @@ -17,6 +17,7 @@ - + launcher:pageIndicator="@+id/content_page_indicator"> - + + + + + + + + + + + + + + + + + + + + +