Automated import from //branches/donutburger/...@140966,140966
diff --git a/core/java/com/android/internal/widget/EditStyledText.java b/core/java/com/android/internal/widget/EditStyledText.java
index b7af4e4..1eba5c2 100644
--- a/core/java/com/android/internal/widget/EditStyledText.java
+++ b/core/java/com/android/internal/widget/EditStyledText.java
@@ -16,6 +16,8 @@
package com.android.internal.widget;
+import java.util.ArrayList;
+
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
@@ -323,7 +325,7 @@
}
/**
- * Check editing is started.
+ * Check whether editing is started or not.
*
* @return Whether editing is started or not.
*/
@@ -331,6 +333,11 @@
return mManager.isEditting();
}
+ /**
+ * Check whether SoftKey is Blocked or not.
+ *
+ * @return whether SoftKey is Blocked or not.
+ */
public boolean isSoftKeyBlocked() {
return mManager.isSoftKeyBlocked();
}
@@ -353,6 +360,15 @@
return mManager.getSelectState();
}
+ @Override
+ public Bundle getInputExtras(boolean create) {
+ Bundle bundle = super.getInputExtras(create);
+ if (bundle != null) {
+ bundle.putBoolean("allowEmoji", true);
+ }
+ return bundle;
+ }
+
/**
* Get the state of the selection.
*
@@ -363,6 +379,18 @@
}
/**
+ * Get the state of the selection.
+ *
+ * @param uris
+ * The array of used uris.
+ * @return The state of the selection.
+ */
+ public String getHtml(ArrayList<Uri> uris) {
+ mConverter.getUriArray(uris, this.getText());
+ return mConverter.getConvertedBody();
+ }
+
+ /**
* Initialize members.
*/
private void init() {
@@ -423,15 +451,6 @@
}
}
- @Override
- public Bundle getInputExtras(boolean create) {
- Bundle bundle = super.getInputExtras(create);
- if (bundle != null) {
- bundle.putBoolean("allowEmoji", true);
- }
- return bundle;
- }
-
/**
* EditorManager manages the flow and status of editing actions.
*/
@@ -1011,6 +1030,27 @@
}
return htmlBody;
}
+
+ public void getUriArray(ArrayList<Uri> uris, Editable text) {
+ uris.clear();
+ if (DBG) {
+ Log.d(LOG_TAG, "--- getUriArray:");
+ }
+ int len = text.length();
+ int next;
+ for (int i = 0; i < text.length(); i = next) {
+ next = text.nextSpanTransition(i, len, ImageSpan.class);
+ ImageSpan[] images = text.getSpans(i, next, ImageSpan.class);
+ for (int j = 0; j < images.length; j++) {
+ if (DBG) {
+ Log.d(LOG_TAG, "--- getUriArray: foundArray" +
+ ((ImageSpan) images[j]).getSource());
+ }
+ uris.add(Uri.parse(
+ ((ImageSpan) images[j]).toString()));
+ }
+ }
+ }
}
private class StyledTextToast {