diff --git a/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java b/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java index 6399a34fd..65c84a9c0 100644 --- a/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java @@ -23,7 +23,6 @@ import android.content.pm.ResolveInfo; import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.drawable.Drawable; -import android.os.BadParcelableException; import android.os.Bundle; import android.os.Parcelable; import android.text.TextUtils; @@ -55,20 +54,9 @@ import com.todoroo.astrid.api.FilterListHeader; import com.todoroo.astrid.api.FilterListItem; import com.todoroo.astrid.api.FilterWithUpdate; import com.todoroo.astrid.service.TaskService; -import com.todoroo.astrid.utility.Constants; public class FilterAdapter extends BaseExpandableListAdapter { - private static List filterExposerList; - - static { - // query astrids AndroidManifest.xml for all registered default-receivers to expose filters - PackageManager pm = ContextManager.getContext().getPackageManager(); - filterExposerList = pm.queryBroadcastReceivers( - new Intent(AstridApiConstants.BROADCAST_REQUEST_FILTERS), - PackageManager.MATCH_DEFAULT_ONLY); - } - // --- style constants public int filterStyle = R.style.TextAppearance_FLA_Filter; @@ -327,22 +315,6 @@ public class FilterAdapter extends BaseExpandableListAdapter { public class FilterReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - if (Constants.DEBUG_BLADE) { - // emulate the bug in the zte blade to not load the parcelable-array due to classloader-problems - try { - // normally caused by (with another message of course): - // final Parcelable[] filters = extras.getParcelableArray(AstridApiConstants.EXTRAS_RESPONSE); - throw new BadParcelableException(new ClassNotFoundException("ZTE Blade debug test!")); - } catch (Exception e) { - Log.e("receive-filter-" + //$NON-NLS-1$ - intent.getStringExtra(AstridApiConstants.EXTRAS_ADDON), - e.toString(), e); - } - -// setResultCode(Activity.RESULT_OK); - return; - } - try { Bundle extras = intent.getExtras(); extras.setClassLoader(FilterListHeader.class.getClassLoader()); @@ -390,6 +362,16 @@ public class FilterAdapter extends BaseExpandableListAdapter { * */ public class BladeFilterReceiver extends FilterReceiver { + private final List filterExposerList; + + public BladeFilterReceiver() { + // query astrids AndroidManifest.xml for all registered default-receivers to expose filters + PackageManager pm = ContextManager.getContext().getPackageManager(); + filterExposerList = pm.queryBroadcastReceivers( + new Intent(AstridApiConstants.BROADCAST_REQUEST_FILTERS), + PackageManager.MATCH_DEFAULT_ONLY); + } + @Override public void onReceive(Context context, Intent intent) { if (getGroupCount() == 0 && filterExposerList != null && filterExposerList.size()>0) { diff --git a/astrid/src/com/todoroo/astrid/utility/Constants.java b/astrid/src/com/todoroo/astrid/utility/Constants.java index ca9fbd26e..eb346a14d 100644 --- a/astrid/src/com/todoroo/astrid/utility/Constants.java +++ b/astrid/src/com/todoroo/astrid/utility/Constants.java @@ -36,12 +36,6 @@ public final class Constants { */ public static final boolean DEBUG = false; - /** - * Whether to turn on debugging for an emulated zte blade error (in the FilterReceiver) - * Only for testing purposes. Remember to set this to false for a standard release! - */ - public static final boolean DEBUG_BLADE = false; - /** * Astrid Help URL */