Skip to content
Browse files

Merge branch 'master' into 3.2-MAINT

* master:
  Improved accessibility for next/prev buttons     (reported by a screenreader user)
  We've been seeing a lot of FCs on htmlifcation of large messages due to running out of memory during our heavy HTMLification. Try to be a bit lighter on the poor RAM if a plain text message is big.
  • Loading branch information...
1 parent 472b2d9 commit aa494796b4c5e2b405fbafac4b10d9e785197b48 @obra obra committed
View
4 res/layout-land/message_view.xml
@@ -62,6 +62,7 @@
<Button
android:id="@+id/previous_scrolling"
android:text="@string/message_view_prev_action"
+ android:contentDescription="@string/previous_action"
android:textSize="35dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
@@ -88,6 +89,7 @@
<Button
android:id="@+id/next_scrolling"
android:text="@string/message_view_next_action"
+ android:contentDescription="@string/next_action"
android:textSize="35dip"
android:layout_height="wrap_content"
android:layout_width="0dip"
@@ -136,6 +138,7 @@
<Button
android:id="@+id/previous"
android:text="@string/message_view_prev_action"
+ android:contentDescription="@string/previous_action"
android:textSize="35dip"
android:layout_height="wrap_content"
android:padding="0dip"
@@ -162,6 +165,7 @@
<Button
android:id="@+id/next"
android:text="@string/message_view_next_action"
+ android:contentDescription="@string/next_action"
android:textSize="35dip"
android:padding="0dip"
android:layout_height="wrap_content"
View
3 res/layout/message_view.xml
@@ -86,6 +86,7 @@
<Button
android:id="@+id/previous_scrolling"
android:text="@string/message_view_prev_action"
+ android:contentDescription="@string/previous_action"
android:textSize="35dip"
android:padding="0dip"
android:layout_height="wrap_content"
@@ -149,6 +150,7 @@
<Button
android:id="@+id/previous"
android:text="@string/message_view_prev_action"
+ android:contentDescription="@string/previous_action"
android:textSize="35dip"
android:padding="0dip"
android:layout_height="wrap_content"
@@ -165,6 +167,7 @@
<Button
android:id="@+id/next"
android:text="@string/message_view_next_action"
+ android:contentDescription="@string/next_action"
android:textSize="35dip"
android:padding="0dip"
android:layout_height="wrap_content"
View
1 res/values/strings.xml
@@ -42,6 +42,7 @@
<!-- Actions will be used as buttons and in menu items -->
<string name="next_action">Next</string> <!-- Used as part of a multi-step process -->
+ <string name="previous_action">Previous</string> <!-- Used as part of a multi-step process -->
<string name="okay_action">OK</string> <!-- User to confirm acceptance of dialog boxes, warnings, errors, etc. -->
<string name="cancel_action">Cancel</string>
<string name="send_action">Send</string>
View
14 src/com/fsck/k9/mail/store/LocalStore.java
@@ -48,6 +48,8 @@
private static final int DB_VERSION = 39;
private static final Flag[] PERMANENT_FLAGS = { Flag.DELETED, Flag.X_DESTROYED, Flag.SEEN, Flag.FLAGGED };
+ private static final int MAX_SMART_HTMLIFY_MESSAGE_LENGTH = 1024 * 256 ;
+
private String mPath;
private SQLiteDatabase mDb;
private File mAttachmentsDir;
@@ -2433,6 +2435,18 @@ public String markupContent(String text, String html)
public String htmlifyString(String text)
{
+ // Our HTMLification code is somewhat memory intensive
+ // and was causing lots of OOM errors on the market
+ // if the message is big and plain text, just do
+ // a trivial htmlification
+ if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH)
+ {
+ return "<html><head/><body>" +
+ htmlifyMessageHeader() +
+ text +
+ htmlifyMessageFooter() +
+ "</body></html>";
+ }
StringReader reader = new StringReader(text);
StringBuilder buff = new StringBuilder(text.length() + 512);
int c = 0;

0 comments on commit aa49479

Please sign in to comment.
Something went wrong with that request. Please try again.