Fixed a bug where FilterWithCustomIntent could use the wrong package name

pull/14/head
Sam Bosley 12 years ago
parent 98316c71f9
commit 14376462d3

@ -103,14 +103,22 @@
<target name="setup-lite"> <target name="setup-lite">
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java" <replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="PACKAGE = .*" match="API_PACKAGE = .*"
replace="PACKAGE = &quot;com.todoroo.astridlite&quot;;" replace="API_PACKAGE = &quot;com.todoroo.astridlite&quot;;"
/>
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="ASTRID_PACKAGE = .*"
replace="ASTRID_PACKAGE = &quot;com.todoroo.astridlite&quot;;"
/> />
</target> </target>
<target name="teardown-lite"> <target name="teardown-lite">
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java" <replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="PACKAGE = .*" match="API_PACKAGE = .*"
replace="PACKAGE = &quot;com.todoroo.astrid&quot;;" replace="API_PACKAGE = &quot;com.todoroo.astrid&quot;;"
/>
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="ASTRID_PACKAGE = .*"
replace="ASTRID_PACKAGE = &quot;com.timsu.astrid&quot;;"
/> />
</target> </target>

@ -21,17 +21,22 @@ public class AstridApiConstants {
/** /**
* Astrid broadcast base package name * Astrid broadcast base package name
*/ */
public static final String PACKAGE = "com.todoroo.astrid"; public static final String API_PACKAGE = "com.todoroo.astrid";
/**
* Astrid app base package name
*/
public static final String ASTRID_PACKAGE = "com.timsu.astrid";
/** /**
* Permission for reading tasks and receiving to GET_FILTERS intent * Permission for reading tasks and receiving to GET_FILTERS intent
*/ */
public static final String PERMISSION_READ = PACKAGE + ".READ"; public static final String PERMISSION_READ = API_PACKAGE + ".READ";
/** /**
* Permission for writing and creating tasks * Permission for writing and creating tasks
*/ */
public static final String PERMISSION_WRITE = PACKAGE + ".WRITE"; public static final String PERMISSION_WRITE = API_PACKAGE + ".WRITE";
/** /**
* Name of Astrid's publicly readable preference store * Name of Astrid's publicly readable preference store
@ -82,34 +87,34 @@ public class AstridApiConstants {
/** /**
* Action name for broadcast intent requesting add-ons * Action name for broadcast intent requesting add-ons
*/ */
public static final String BROADCAST_REQUEST_ADDONS = PACKAGE + ".REQUEST_ADDONS"; public static final String BROADCAST_REQUEST_ADDONS = API_PACKAGE + ".REQUEST_ADDONS";
/** /**
* Action name for broadcast intent sending add-ons back to Astrid * Action name for broadcast intent sending add-ons back to Astrid
* <li> EXTRAS_RESPONSE an {@link Addon} object * <li> EXTRAS_RESPONSE an {@link Addon} object
*/ */
public static final String BROADCAST_SEND_ADDONS = PACKAGE + ".SEND_ADDONS"; public static final String BROADCAST_SEND_ADDONS = API_PACKAGE + ".SEND_ADDONS";
// --- Filters API // --- Filters API
/** /**
* Action name for broadcast intent requesting filters * Action name for broadcast intent requesting filters
*/ */
public static final String BROADCAST_REQUEST_FILTERS = PACKAGE + ".REQUEST_FILTERS"; public static final String BROADCAST_REQUEST_FILTERS = API_PACKAGE + ".REQUEST_FILTERS";
/** /**
* Action name for broadcast intent sending filters back to Astrid * Action name for broadcast intent sending filters back to Astrid
* <li> EXTRAS_ADDON your add-on identifier </li> * <li> EXTRAS_ADDON your add-on identifier </li>
* <li> EXTRAS_RESPONSE an array of {@link FilterListItem}s </li> * <li> EXTRAS_RESPONSE an array of {@link FilterListItem}s </li>
*/ */
public static final String BROADCAST_SEND_FILTERS = PACKAGE + ".SEND_FILTERS"; public static final String BROADCAST_SEND_FILTERS = API_PACKAGE + ".SEND_FILTERS";
// -- Custom criteria API // -- Custom criteria API
/** /**
* Action name for a broadcast intent requesting custom filter criteria (e.g. "Due by, Tagged, Tag contains", etc.) * Action name for a broadcast intent requesting custom filter criteria (e.g. "Due by, Tagged, Tag contains", etc.)
*/ */
public static final String BROADCAST_REQUEST_CUSTOM_FILTER_CRITERIA = PACKAGE + ".REQUEST_CUSTOM_FILTER_CRITERIA"; public static final String BROADCAST_REQUEST_CUSTOM_FILTER_CRITERIA = API_PACKAGE + ".REQUEST_CUSTOM_FILTER_CRITERIA";
/** /**
@ -117,7 +122,7 @@ public class AstridApiConstants {
* <li> EXTRAS_ADDON you add-on identifier * <li> EXTRAS_ADDON you add-on identifier
* <li> EXTRAS_RESPONSE an array of {@link CustomFilterCriterion} </li> * <li> EXTRAS_RESPONSE an array of {@link CustomFilterCriterion} </li>
*/ */
public static final String BROADCAST_SEND_CUSTOM_FILTER_CRITERIA = PACKAGE + ".SEND_CUSTOM_FILTER_CRITERIA"; public static final String BROADCAST_SEND_CUSTOM_FILTER_CRITERIA = API_PACKAGE + ".SEND_CUSTOM_FILTER_CRITERIA";
// --- Edit Controls API // --- Edit Controls API
@ -125,14 +130,14 @@ public class AstridApiConstants {
* Action name for broadcast intent requesting task edit controls * Action name for broadcast intent requesting task edit controls
* <li> EXTRAS_TASK_ID id of the task user is editing * <li> EXTRAS_TASK_ID id of the task user is editing
*/ */
public static final String BROADCAST_REQUEST_EDIT_CONTROLS = PACKAGE + ".REQUEST_EDIT_CONTROLS"; public static final String BROADCAST_REQUEST_EDIT_CONTROLS = API_PACKAGE + ".REQUEST_EDIT_CONTROLS";
/** /**
* Action name for broadcast intent sending task edit controls back to Astrid * Action name for broadcast intent sending task edit controls back to Astrid
* <li> EXTRAS_ADDON your add-on identifier * <li> EXTRAS_ADDON your add-on identifier
* <li> EXTRAS_RESPONSE a {@link RemoteViews} with your edit controls * <li> EXTRAS_RESPONSE a {@link RemoteViews} with your edit controls
*/ */
public static final String BROADCAST_SEND_EDIT_CONTROLS = PACKAGE + ".SEND_EDIT_CONTROLS"; public static final String BROADCAST_SEND_EDIT_CONTROLS = API_PACKAGE + ".SEND_EDIT_CONTROLS";
// --- Task Details API // --- Task Details API
@ -143,7 +148,7 @@ public class AstridApiConstants {
* <li> EXTRAS_TASK_ID id of the task * <li> EXTRAS_TASK_ID id of the task
* <li> EXTRAS_EXTENDED whether request is for standard or extended details * <li> EXTRAS_EXTENDED whether request is for standard or extended details
*/ */
public static final String BROADCAST_REQUEST_DETAILS = PACKAGE + ".REQUEST_DETAILS"; public static final String BROADCAST_REQUEST_DETAILS = API_PACKAGE + ".REQUEST_DETAILS";
/** /**
* Action name for broadcast intent sending details back to Astrid * Action name for broadcast intent sending details back to Astrid
@ -152,7 +157,7 @@ public class AstridApiConstants {
* <li> EXTRAS_EXTENDED whether request is for standard or extended details * <li> EXTRAS_EXTENDED whether request is for standard or extended details
* <li> EXTRAS_RESPONSE a String * <li> EXTRAS_RESPONSE a String
*/ */
public static final String BROADCAST_SEND_DETAILS = PACKAGE + ".SEND_DETAILS"; public static final String BROADCAST_SEND_DETAILS = API_PACKAGE + ".SEND_DETAILS";
// --- Sync Action API // --- Sync Action API
@ -160,14 +165,14 @@ public class AstridApiConstants {
* Action name for broadcast intent requesting a listing of active * Action name for broadcast intent requesting a listing of active
* sync actions users can activate from the menu * sync actions users can activate from the menu
*/ */
public static final String BROADCAST_REQUEST_SYNC_ACTIONS = PACKAGE + ".REQUEST_SYNC_ACTIONS"; public static final String BROADCAST_REQUEST_SYNC_ACTIONS = API_PACKAGE + ".REQUEST_SYNC_ACTIONS";
/** /**
* Action name for broadcast intent sending sync provider information back to Astrid * Action name for broadcast intent sending sync provider information back to Astrid
* <li> EXTRAS_ADDON your add-on identifier * <li> EXTRAS_ADDON your add-on identifier
* <li> EXTRAS_RESPONSE a {@link SyncAction} to invoke synchronization * <li> EXTRAS_RESPONSE a {@link SyncAction} to invoke synchronization
*/ */
public static final String BROADCAST_SEND_SYNC_ACTIONS = PACKAGE + ".SEND_SYNC_ACTIONS"; public static final String BROADCAST_SEND_SYNC_ACTIONS = API_PACKAGE + ".SEND_SYNC_ACTIONS";
// --- Task Decorations API // --- Task Decorations API
@ -175,7 +180,7 @@ public class AstridApiConstants {
* Action name for broadcast intent requesting task list decorations for a task * Action name for broadcast intent requesting task list decorations for a task
* <li> EXTRAS_TASK_ID id of the task * <li> EXTRAS_TASK_ID id of the task
*/ */
public static final String BROADCAST_REQUEST_DECORATIONS = PACKAGE + ".REQUEST_DECORATIONS"; public static final String BROADCAST_REQUEST_DECORATIONS = API_PACKAGE + ".REQUEST_DECORATIONS";
/** /**
* Action name for broadcast intent sending decorations back to Astrid * Action name for broadcast intent sending decorations back to Astrid
@ -183,7 +188,7 @@ public class AstridApiConstants {
* <li> EXTRAS_TASK_ID id of the task * <li> EXTRAS_TASK_ID id of the task
* <li> EXTRAS_RESPONSE a {@link TaskDecoration} * <li> EXTRAS_RESPONSE a {@link TaskDecoration}
*/ */
public static final String BROADCAST_SEND_DECORATIONS = PACKAGE + ".SEND_DECORATIONS"; public static final String BROADCAST_SEND_DECORATIONS = API_PACKAGE + ".SEND_DECORATIONS";
// --- Actions API // --- Actions API
@ -191,33 +196,33 @@ public class AstridApiConstants {
* Action name for intents to be displayed on task context menu * Action name for intents to be displayed on task context menu
* <li> EXTRAS_TASK_ID id of the task * <li> EXTRAS_TASK_ID id of the task
*/ */
public static final String ACTION_TASK_CONTEXT_MENU = PACKAGE + ".CONTEXT_MENU"; public static final String ACTION_TASK_CONTEXT_MENU = API_PACKAGE + ".CONTEXT_MENU";
/** /**
* Action name for intents to be displayed on Astrid's task list menu * Action name for intents to be displayed on Astrid's task list menu
* <li> EXTRAS_ADDON your add-on identifier * <li> EXTRAS_ADDON your add-on identifier
* <li> EXTRAS_RESPONSE an array of {@link Intent}s * <li> EXTRAS_RESPONSE an array of {@link Intent}s
*/ */
public static final String ACTION_TASK_LIST_MENU = PACKAGE + ".TASK_LIST_MENU"; public static final String ACTION_TASK_LIST_MENU = API_PACKAGE + ".TASK_LIST_MENU";
/** /**
* Action name for intents to be displayed in Astrid's settings. By default, * Action name for intents to be displayed in Astrid's settings. By default,
* your application will be put into the category named by your application, * your application will be put into the category named by your application,
* but you can add a string meta-data with name "category" to override this. * but you can add a string meta-data with name "category" to override this.
*/ */
public static final String ACTION_SETTINGS = PACKAGE + ".SETTINGS"; public static final String ACTION_SETTINGS = API_PACKAGE + ".SETTINGS";
// --- Events API // --- Events API
/** /**
* Action name for broadcast intent notifying add-ons that Astrid started up * Action name for broadcast intent notifying add-ons that Astrid started up
*/ */
public static final String BROADCAST_EVENT_STARTUP = PACKAGE + ".STARTUP"; public static final String BROADCAST_EVENT_STARTUP = API_PACKAGE + ".STARTUP";
/** /**
* Action name for broadcast intent notifying Astrid task list to refresh * Action name for broadcast intent notifying Astrid task list to refresh
*/ */
public static final String BROADCAST_EVENT_REFRESH = PACKAGE + ".REFRESH"; public static final String BROADCAST_EVENT_REFRESH = API_PACKAGE + ".REFRESH";
/** /**
* Action name for broadcast intent notifying Astrid to clear detail cache * Action name for broadcast intent notifying Astrid to clear detail cache
@ -225,20 +230,20 @@ public class AstridApiConstants {
* logging out of a sync provider). Use this call carefully, as loading * logging out of a sync provider). Use this call carefully, as loading
* details can degrade the performance of Astrid. * details can degrade the performance of Astrid.
*/ */
public static final String BROADCAST_EVENT_FLUSH_DETAILS = PACKAGE + ".FLUSH_DETAILS"; public static final String BROADCAST_EVENT_FLUSH_DETAILS = API_PACKAGE + ".FLUSH_DETAILS";
/** /**
* Action name for broadcast intent notifying that task was created or * Action name for broadcast intent notifying that task was created or
* title was changed * title was changed
* <li> EXTRAS_TASK_ID id of the task * <li> EXTRAS_TASK_ID id of the task
*/ */
public static final String BROADCAST_EVENT_TASK_LIST_UPDATED = PACKAGE + ".TASK_LIST_UPDATED"; public static final String BROADCAST_EVENT_TASK_LIST_UPDATED = API_PACKAGE + ".TASK_LIST_UPDATED";
/** /**
* Action name for broadcast intent notifying that task was completed * Action name for broadcast intent notifying that task was completed
* <li> EXTRAS_TASK_ID id of the task * <li> EXTRAS_TASK_ID id of the task
*/ */
public static final String BROADCAST_EVENT_TASK_COMPLETED = PACKAGE + ".TASK_COMPLETED"; public static final String BROADCAST_EVENT_TASK_COMPLETED = API_PACKAGE + ".TASK_COMPLETED";
/** /**
* Action name for broadcast intent notifying that task was created from repeating template * Action name for broadcast intent notifying that task was created from repeating template
@ -246,7 +251,7 @@ public class AstridApiConstants {
* <li> EXTRAS_OLD_DUE_DATE task old due date (could be 0) * <li> EXTRAS_OLD_DUE_DATE task old due date (could be 0)
* <li> EXTRAS_NEW_DUE_DATE task new due date (will not be 0) * <li> EXTRAS_NEW_DUE_DATE task new due date (will not be 0)
*/ */
public static final String BROADCAST_EVENT_TASK_REPEATED = PACKAGE + ".TASK_REPEATED"; public static final String BROADCAST_EVENT_TASK_REPEATED = API_PACKAGE + ".TASK_REPEATED";
/** /**
* Action name for broadcast intent notifying that a repeating task has passed its repeat_until value * Action name for broadcast intent notifying that a repeating task has passed its repeat_until value
@ -254,11 +259,11 @@ public class AstridApiConstants {
* <li> EXTRAS_OLD_DUE_DATE task old due date (could be 0) * <li> EXTRAS_OLD_DUE_DATE task old due date (could be 0)
* <li> EXTRAS_NEW_DUE_DATE task new due date (will not be 0) * <li> EXTRAS_NEW_DUE_DATE task new due date (will not be 0)
*/ */
public static final String BROADCAST_EVENT_TASK_REPEAT_FINISHED = PACKAGE + ".TASK_REPEAT_FINISHED"; public static final String BROADCAST_EVENT_TASK_REPEAT_FINISHED = API_PACKAGE + ".TASK_REPEAT_FINISHED";
/** /**
* Action name for broadcast intent notifying that tag was deleted * Action name for broadcast intent notifying that tag was deleted
*/ */
public static final String BROADCAST_EVENT_TAG_DELETED = PACKAGE + ".TAG_DELETED"; public static final String BROADCAST_EVENT_TAG_DELETED = API_PACKAGE + ".TAG_DELETED";
} }

@ -45,7 +45,7 @@ public class FilterWithCustomIntent extends Filter {
public Intent getCustomIntent() { public Intent getCustomIntent() {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra("filter", this); //$NON-NLS-1$ intent.putExtra("filter", this); //$NON-NLS-1$
intent.setComponent(new ComponentName("com.timsu.astrid", "com.todoroo.astrid.activity.TaskListActivity")); //$NON-NLS-1$ //$NON-NLS-2$ intent.setComponent(new ComponentName(AstridApiConstants.ASTRID_PACKAGE, "com.todoroo.astrid.activity.TaskListActivity")); //$NON-NLS-1$
if(customExtras != null) if(customExtras != null)
intent.putExtras(customExtras); intent.putExtras(customExtras);

@ -32,7 +32,7 @@ public class Metadata extends AbstractModel {
public static final Table TABLE = new Table("metadata", Metadata.class); public static final Table TABLE = new Table("metadata", Metadata.class);
/** content uri for this model */ /** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" + public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name); TABLE.name);
// --- properties // --- properties

@ -32,7 +32,7 @@ public class StoreObject extends AbstractModel {
public static final Table TABLE = new Table("store", StoreObject.class); public static final Table TABLE = new Table("store", StoreObject.class);
/** content uri for this model */ /** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" + public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name); TABLE.name);
// --- properties // --- properties

@ -33,7 +33,7 @@ public final class TagData extends RemoteModel {
public static final Table TABLE = new Table("tagdata", TagData.class); public static final Table TABLE = new Table("tagdata", TagData.class);
/** content uri for this model */ /** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" + public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name); TABLE.name);
// --- properties // --- properties

@ -38,7 +38,7 @@ public final class Task extends RemoteModel {
public static final Table TABLE = new Table("tasks", Task.class); public static final Table TABLE = new Table("tasks", Task.class);
/** content uri for this model */ /** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" + public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name); TABLE.name);
// --- properties // --- properties

@ -32,7 +32,7 @@ public class Update extends RemoteModel {
public static final Table TABLE = new Table("updates", Update.class); public static final Table TABLE = new Table("updates", Update.class);
/** content uri for this model */ /** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" + public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name); TABLE.name);
// --- properties // --- properties

@ -33,7 +33,7 @@ public final class User extends RemoteModel {
public static final Table TABLE = new Table("users", User.class); public static final Table TABLE = new Table("users", User.class);
/** content uri for this model */ /** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" + public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name); TABLE.name);
// --- properties // --- properties

@ -71,7 +71,7 @@ public class TagViewFragment extends TaskListFragment {
private static final String LAST_FETCH_KEY = "tag-fetch-"; //$NON-NLS-1$ private static final String LAST_FETCH_KEY = "tag-fetch-"; //$NON-NLS-1$
public static final String BROADCAST_TAG_ACTIVITY = AstridApiConstants.PACKAGE + ".TAG_ACTIVITY"; //$NON-NLS-1$ public static final String BROADCAST_TAG_ACTIVITY = AstridApiConstants.API_PACKAGE + ".TAG_ACTIVITY"; //$NON-NLS-1$
public static final String EXTRA_TAG_NAME = "tag"; //$NON-NLS-1$ public static final String EXTRA_TAG_NAME = "tag"; //$NON-NLS-1$
public static final String EXTRA_TAG_REMOTE_ID = "remoteId"; //$NON-NLS-1$ public static final String EXTRA_TAG_REMOTE_ID = "remoteId"; //$NON-NLS-1$

@ -11,7 +11,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
public class CalendarStartupReceiver extends BroadcastReceiver { public class CalendarStartupReceiver extends BroadcastReceiver {
public static final String BROADCAST_RESCHEDULE_CAL_ALARMS = AstridApiConstants.PACKAGE + ".SCHEDULE_CAL_REMINDERS"; //$NON-NLS-1$ public static final String BROADCAST_RESCHEDULE_CAL_ALARMS = AstridApiConstants.API_PACKAGE + ".SCHEDULE_CAL_REMINDERS"; //$NON-NLS-1$
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {

@ -33,7 +33,7 @@ public class ABTestEvent extends AbstractModel {
public static final Table TABLE = new Table("abtestevent", ABTestEvent.class); public static final Table TABLE = new Table("abtestevent", ABTestEvent.class);
/** content uri for this model */ /** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" + public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name); TABLE.name);

@ -123,7 +123,7 @@ public class Astrid3ContentProvider extends ContentProvider {
uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
for(Uri uri : new Uri[] { Task.CONTENT_URI, Metadata.CONTENT_URI, StoreObject.CONTENT_URI, Update.CONTENT_URI }) { for(Uri uri : new Uri[] { Task.CONTENT_URI, Metadata.CONTENT_URI, StoreObject.CONTENT_URI, Update.CONTENT_URI }) {
String authority = AstridApiConstants.PACKAGE; String authority = AstridApiConstants.API_PACKAGE;
String table = uri.toString(); String table = uri.toString();
table = table.substring(table.indexOf('/', 11) + 1); table = table.substring(table.indexOf('/', 11) + 1);

@ -59,7 +59,7 @@ public class SqlContentProvider extends ContentProvider {
static { static {
uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
uriMatcher.addURI(AstridApiConstants.PACKAGE + ".private", uriMatcher.addURI(AstridApiConstants.API_PACKAGE + ".private",
"sql", 0); "sql", 0);
} }

Loading…
Cancel
Save