From 3956b340d3336f4039ba15c244312bfa3d3ec36b Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 18 May 2012 16:45:42 -0700 Subject: [PATCH] Fixed some producteev in labs bugs --- .../com/todoroo/astrid/producteev/ProducteevUtilities.java | 7 ------- astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java b/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java index 190d853e1..dbc2fb699 100644 --- a/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java +++ b/astrid/plugin-src/com/todoroo/astrid/producteev/ProducteevUtilities.java @@ -1,7 +1,5 @@ package com.todoroo.astrid.producteev; -import android.text.TextUtils; - import com.timsu.astrid.R; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.sync.SyncProviderUtilities; @@ -78,9 +76,4 @@ public class ProducteevUtilities extends SyncProviderUtilities { return Preferences.getStringValue(R.string.producteev_PPr_email); } - @Override - public boolean isLoggedIn() { - return !TextUtils.isEmpty(getLoggedInUserName()); - } - } diff --git a/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java b/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java index ab43e2cc4..f1fdc3d04 100644 --- a/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java +++ b/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java @@ -35,6 +35,8 @@ import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.SyncAction; import com.todoroo.astrid.gtasks.GtasksPreferences; +import com.todoroo.astrid.producteev.ProducteevPreferences; +import com.todoroo.astrid.producteev.ProducteevUtilities; import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy; import com.todoroo.astrid.service.SyncV2Service; import com.todoroo.astrid.sync.SyncResultCallback; @@ -205,6 +207,11 @@ public class SyncActionHelper { && AmazonMarketStrategy.isKindleFire()) continue; + if (ProducteevPreferences.class.getName().equals( + resolveInfo.activityInfo.name) + && !ProducteevUtilities.INSTANCE.isLoggedIn() && !Preferences.getBoolean(R.string.p_third_party_addons, false)) + continue; + if (category.equals(desiredCategory)) { syncIntents.add(new IntentWithLabel(intent, resolveInfo.activityInfo.loadLabel(pm).toString()));