Introduce Translate intent.
Action: ACTION_TRANSLATE
Text: EXTRA_TEXT
TODO: Consider introducing a "translate" schema to pass the text to
translate instead of using a string extra to define this.
Bug: 116020587
Test: manually tested by selecting foreign language text and watching
for a "Translate" action.
Change-Id: I046157f4b3e1aa60afaf3f123fdeecf406f712dc
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 10c6bc6..de19bc0 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -3586,6 +3586,17 @@
public static final String
ACTION_OPEN_DOCUMENT_TREE = "android.intent.action.OPEN_DOCUMENT_TREE";
+
+ /**
+ * Activity Action: Perform text translation.
+ * <p>
+ * Input: {@link #EXTRA_TEXT getCharSequence(EXTRA_TEXT)} is the text to translate.
+ * <p>
+ * Output: nothing.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_TRANSLATE = "android.intent.action.TRANSLATE";
+
/**
* Broadcast Action: List of dynamic sensor is changed due to new sensor being connected or
* exisiting sensor being disconnected.