commit 0dc50cc4927180d078a60a0ff40e6c3e23991ba0 Author: Nathan Freitas nathan@freitas.net Date: Fri May 2 00:39:59 2014 -0400
add log max size feature --- src/org/torproject/android/Orbot.java | 4 ++++ src/org/torproject/android/TorConstants.java | 3 +++ 2 files changed, 7 insertions(+)
diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java index 4524857..21f304d 100644 --- a/src/org/torproject/android/Orbot.java +++ b/src/org/torproject/android/Orbot.java @@ -178,6 +178,10 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic private void appendLogTextAndScroll(String text) { if(mTxtOrbotLog != null){ + + if (mTxtOrbotLog.getText().length() > MAX_LOG_LENGTH) + mTxtOrbotLog.setText(""); + mTxtOrbotLog.append(text + "\n"); final Layout layout = mTxtOrbotLog.getLayout(); if(layout != null){ diff --git a/src/org/torproject/android/TorConstants.java b/src/org/torproject/android/TorConstants.java index 834f20d..36cdf48 100644 --- a/src/org/torproject/android/TorConstants.java +++ b/src/org/torproject/android/TorConstants.java @@ -53,4 +53,7 @@ public interface TorConstants { public final static String PREF_DISABLE_NETWORK = "pref_disable_network"; public final static String PREF_TOR_SHARED_PREFS = "org.torproject.android_preferences"; + + public final static int MAX_LOG_LENGTH = 10000; + }
tor-commits@lists.torproject.org