diff --git a/api/src/com/todoroo/andlib/sql/Functions.java b/api/src/com/todoroo/andlib/sql/Functions.java index 558a93cf0..9c1ff4d72 100644 --- a/api/src/com/todoroo/andlib/sql/Functions.java +++ b/api/src/com/todoroo/andlib/sql/Functions.java @@ -34,10 +34,6 @@ public final class Functions { return new Field("(strftime('%s','now')*1000)"); } - public static Field fromNow(long millis) { - return new Field("(strftime('%s','now')*1000 + " + millis + ")"); - } - public static Field strftime(LongProperty field, String format) { return new Field("(strftime('" + format + "', datetime(" + field.toString() + "/1000, 'unixepoch', 'localtime')))"); } diff --git a/api/src/com/todoroo/andlib/utility/AndroidUtilities.java b/api/src/com/todoroo/andlib/utility/AndroidUtilities.java index d8e503779..43e73bf1f 100644 --- a/api/src/com/todoroo/andlib/utility/AndroidUtilities.java +++ b/api/src/com/todoroo/andlib/utility/AndroidUtilities.java @@ -562,38 +562,6 @@ public class AndroidUtilities { } } - /** - * From Android MyTracks project (http://mytracks.googlecode.com/). - * Licensed under the Apache Public License v2 - * - * @param activity - * @param id - * @return - */ - public static CharSequence readFile(Context activity, int id) { - BufferedReader in = null; - try { - in = new BufferedReader(new InputStreamReader( - activity.getResources().openRawResource(id))); - String line; - StringBuilder buffer = new StringBuilder(); - while ((line = in.readLine()) != null) { - buffer.append(line).append('\n'); - } - return buffer; - } catch (IOException e) { - return ""; //$NON-NLS-1$ - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - // Ignore - } - } - } - } - public static String readInputStream(InputStream input) { BufferedReader in = null; try { diff --git a/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java b/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java index 1531b40ae..391514436 100644 --- a/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java +++ b/api/src/com/todoroo/astrid/sync/SyncProviderUtilities.java @@ -70,11 +70,6 @@ abstract public class SyncProviderUtilities { return getPrefs().getString(getIdentifier() + PREF_TOKEN, null); } - /** - * Returns something like "Logged in as: user@gmail.com" - */ - abstract public String getLoggedInUserName(); - /** * Sets the authentication token. Set to null to clear. */ diff --git a/astrid/src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java b/astrid/src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java index da46ef292..c37f04a1f 100644 --- a/astrid/src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java +++ b/astrid/src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java @@ -182,7 +182,7 @@ public class ActFmInvoker { } } - public JSONObject postSync(String data, MultipartEntity entity, boolean changesHappened, String tok) throws IOException { + public JSONObject postSync(String data, MultipartEntity entity, String tok) throws IOException { try { String timeString = DateUtilities.timeToIso8601(DateUtilities.now(), true); diff --git a/astrid/src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java b/astrid/src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java index 3b7bcca6c..45ba10eb3 100644 --- a/astrid/src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java +++ b/astrid/src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java @@ -172,28 +172,4 @@ public class ActFmPreferenceService extends SyncProviderUtilities { Preferences.setBoolean(PREF_LOCAL_PREMIUM, false); Preferences.setBoolean(PREF_PREMIUM, false); } - - @Override - public String getLoggedInUserName() { - String name = Preferences.getStringValue(PREF_NAME); - if (TextUtils.isEmpty(name)) { - String firstName = Preferences.getStringValue(PREF_FIRST_NAME); - if (!TextUtils.isEmpty(firstName)) { - name = firstName; - } - - String lastName = Preferences.getStringValue(PREF_FIRST_NAME); - if (!TextUtils.isEmpty(lastName)) { - if (!TextUtils.isEmpty(name)) { - name += " "; //$NON-NLS-1$ - } - name += lastName; - } - - if (name == null) { - name = ""; //$NON-NLS-1$ - } - } - return name; - } } diff --git a/astrid/src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java b/astrid/src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java index 27c5087b2..c9ad3da24 100644 --- a/astrid/src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java +++ b/astrid/src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java @@ -281,13 +281,11 @@ public class ActFmSyncThread { if (!messageBatch.isEmpty() && checkForToken()) { JSONPayloadBuilder payload = new JSONPayloadBuilder(); MultipartEntity entity = new MultipartEntity(); - boolean containsChangesHappened = false; for (int i = 0; i < messageBatch.size(); i++) { ClientToServerMessage message = messageBatch.get(i); boolean success = payload.addMessage(message, entity); if (success) { if (message instanceof ChangesHappened) { - containsChangesHappened = true; } } else { messageBatch.remove(i); @@ -307,7 +305,7 @@ public class ActFmSyncThread { JSONArray errors = null; try { - JSONObject response = actFmInvoker.postSync(payload.closeAndReturnString(), entity, containsChangesHappened, token); + JSONObject response = actFmInvoker.postSync(payload.closeAndReturnString(), entity, token); // process responses String time = response.optString("time"); JSONArray serverMessagesJson = response.optJSONArray("messages"); diff --git a/astrid/src/com/todoroo/astrid/activity/Eula.java b/astrid/src/com/todoroo/astrid/activity/Eula.java deleted file mode 100644 index 1e4425d93..000000000 --- a/astrid/src/com/todoroo/astrid/activity/Eula.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.todoroo.astrid.activity; - -import android.app.Activity; - -import com.todoroo.andlib.service.Autowired; -import com.todoroo.andlib.service.DependencyInjectionService; -import com.todoroo.andlib.utility.Preferences; -import com.todoroo.astrid.service.TaskService; - -/** - * Displays an EULA ("End User License Agreement") that the user has to accept - * before using the application. Your application should call - * {@link Eula#showEula(android.app.Activity)} in the onCreate() method of the - * first activity. If the user accepts the EULA, it will never be shown again. - * If the user refuses, {@link android.app.Activity#finish()} is invoked on your - * activity. - */ -public final class Eula { - public static final String PREFERENCE_EULA_ACCEPTED = "eula.accepted"; //$NON-NLS-1$ - - @Autowired - TaskService taskService; - - private static void accept(Activity activity) { - if (activity instanceof EulaCallback) { - ((EulaCallback) activity).eulaAccepted(); - } - Preferences.setBoolean(PREFERENCE_EULA_ACCEPTED, true); - } - - private static void refuse(Activity activity) { - if (activity instanceof EulaCallback) { - ((EulaCallback) activity).eulaRefused(); - } - activity.finish(); - } - - public static interface EulaCallback { - public void eulaAccepted(); - - public void eulaRefused(); - } - - private Eula() { - // don't construct me - DependencyInjectionService.getInstance().inject(this); - } -} diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java index 5eb7db0a2..b026eff11 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java @@ -267,18 +267,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele return newFragment; } - /** - * Convenience method for calling instantiateWithFilterAndExtras(Filter, Bundle, Class) with - * TaskListFragment as the default component - * - * @param filter - * @param extras - * @return - */ - public static TaskListFragment instantiateWithFilterAndExtras(Filter filter, Bundle extras) { - return instantiateWithFilterAndExtras(filter, extras, null); - } - /** * Container Activity must implement this interface and we ensure that it * does during the onAttach() callback diff --git a/astrid/src/com/todoroo/astrid/gtasks/GtasksMetadataService.java b/astrid/src/com/todoroo/astrid/gtasks/GtasksMetadataService.java index 22dffa595..34177c23d 100644 --- a/astrid/src/com/todoroo/astrid/gtasks/GtasksMetadataService.java +++ b/astrid/src/com/todoroo/astrid/gtasks/GtasksMetadataService.java @@ -46,12 +46,6 @@ public final class GtasksMetadataService extends SyncMetadataService metadata) { - return new GtasksTaskContainer(task, metadata); - } - @Override public Criterion getLocalMatchCriteria(GtasksTaskContainer remoteTask) { return GtasksMetadata.ID.eq(remoteTask.gtaskMetadata.getValue(GtasksMetadata.ID)); diff --git a/astrid/src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java b/astrid/src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java index 823d88fe5..30f4e471b 100644 --- a/astrid/src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java +++ b/astrid/src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java @@ -56,9 +56,4 @@ public class GtasksPreferenceService extends SyncProviderUtilities { * Pref that is set once migration to new GTasks API has occurred */ public static final String PREF_MIGRATION_HAS_OCCURRED = IDENTIFIER + "_migrated"; //$NON-NLS-1$ - - @Override - public String getLoggedInUserName() { - return Preferences.getStringValue(PREF_USER_NAME); - } } diff --git a/astrid/src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java b/astrid/src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java index 06778c2d6..5a8d5c072 100644 --- a/astrid/src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java +++ b/astrid/src/com/todoroo/astrid/opencrx/OpencrxCoreUtils.java @@ -127,9 +127,4 @@ public class OpencrxCoreUtils extends SyncProviderUtilities { public int getSyncIntervalKey() { return 0; } - - @Override - public String getLoggedInUserName() { - return ""; //$NON-NLS-1$ - } } diff --git a/astrid/src/com/todoroo/astrid/service/MarketStrategy.java b/astrid/src/com/todoroo/astrid/service/MarketStrategy.java index e37247347..bbdaf12c0 100644 --- a/astrid/src/com/todoroo/astrid/service/MarketStrategy.java +++ b/astrid/src/com/todoroo/astrid/service/MarketStrategy.java @@ -34,18 +34,6 @@ public abstract class MarketStrategy { return false; } - public static class NoMarketStrategy extends MarketStrategy { - @Override - public Intent generateMarketLink(String packageName) { - return null; - } - - @Override - public String strategyId() { - return "no_market"; //$NON-NLS-1$ - } - } - public static class AndroidMarketStrategy extends MarketStrategy { @Override diff --git a/astrid/src/com/todoroo/astrid/service/UpgradeService.java b/astrid/src/com/todoroo/astrid/service/UpgradeService.java index 5fe1e731b..2c7d4ff66 100644 --- a/astrid/src/com/todoroo/astrid/service/UpgradeService.java +++ b/astrid/src/com/todoroo/astrid/service/UpgradeService.java @@ -27,7 +27,6 @@ import com.todoroo.astrid.actfm.sync.EmptyTitleOutstandingEntryMigration; import com.todoroo.astrid.actfm.sync.messages.ConvertSelfUserIdsToZero; import com.todoroo.astrid.actfm.sync.messages.NameMaps; import com.todoroo.astrid.activity.AstridActivity; -import com.todoroo.astrid.activity.Eula; import com.todoroo.astrid.activity.TaskListFragment; import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.core.PluginServices; @@ -718,7 +717,6 @@ public final class UpgradeService { if (gtasksPreferenceService.isLoggedIn()) { taskService.clearDetails(Criterion.all); } - Preferences.setBoolean(Eula.PREFERENCE_EULA_ACCEPTED, true); } if (from >= V3_0_0 && from < V3_6_0) { newVersionString(changeLog, "3.6.0 (11/13/10)", new String[]{ diff --git a/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java b/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java index d77dd03a4..f5b4ac8df 100644 --- a/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java +++ b/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java @@ -50,18 +50,12 @@ public class ContactListAdapter extends CursorAdapter { Email._ID, Email.CONTACT_ID, ContactsContract.Contacts.DISPLAY_NAME, Email.DATA }; - private boolean completeSharedTags = false; - public ContactListAdapter(Activity activity, Cursor c) { super(activity, c); mContent = activity.getContentResolver(); DependencyInjectionService.getInstance().inject(this); } - public void setCompleteSharedTags(boolean completeSharedTags) { - this.completeSharedTags = completeSharedTags; - } - @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { final LayoutInflater inflater = LayoutInflater.from(context); @@ -155,21 +149,7 @@ public class ContactListAdapter extends CursorAdapter { Cursor peopleCursor = mContent.query(uri, PEOPLE_PROJECTION, null, null, sort); - if (!completeSharedTags) { - return peopleCursor; - } - - Criterion crit = Criterion.all; - if (constraint != null) { - crit = Functions.upper(TagData.NAME).like("%" + constraint.toString().toUpperCase() + "%"); - } else { - crit = Criterion.none; - } - Cursor tagCursor = tagDataService.query(Query.select(TagData.ID, TagData.NAME, TagData.PICTURE, TagData.THUMB). - where(Criterion.and(TagData.USER_ID.eq(0), TagData.MEMBER_COUNT.gt(0), - crit)).orderBy(Order.desc(TagData.NAME))); - - return new MergeCursor(new Cursor[]{tagCursor, peopleCursor}); + return peopleCursor; } private final ContentResolver mContent; diff --git a/astrid/src/com/todoroo/astrid/utility/SyncMetadataService.java b/astrid/src/com/todoroo/astrid/utility/SyncMetadataService.java index 36db14127..c6d2a16b7 100644 --- a/astrid/src/com/todoroo/astrid/utility/SyncMetadataService.java +++ b/astrid/src/com/todoroo/astrid/utility/SyncMetadataService.java @@ -49,11 +49,6 @@ abstract public class SyncMetadataService { */ abstract public SyncProviderUtilities getUtilities(); - /** - * create a task container based on the given data - */ - abstract public TYPE createContainerFromLocalTask(Task task, ArrayList metadata); - /** * @return criterion for matching all metadata keys that your provider synchronizes */