diff --git a/api/AndroidManifest.xml b/api/AndroidManifest.xml index c084e7d72..a26ca609e 100644 --- a/api/AndroidManifest.xml +++ b/api/AndroidManifest.xml @@ -5,7 +5,7 @@ ** See the file "LICENSE" for the full license governing this code. --> diff --git a/api/src/com/todoroo/andlib/service/ExceptionService.java b/api/src/com/todoroo/andlib/service/ExceptionService.java index 203245628..142a202fc 100644 --- a/api/src/com/todoroo/andlib/service/ExceptionService.java +++ b/api/src/com/todoroo/andlib/service/ExceptionService.java @@ -14,7 +14,7 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.util.Log; -import com.todoroo.astrid.api.R; +import org.astrid.api.R; /** * Exception handling utility class - reports and logs errors diff --git a/api/src/com/todoroo/andlib/utility/DateUtilities.java b/api/src/com/todoroo/andlib/utility/DateUtilities.java index 41d044054..43884ba79 100644 --- a/api/src/com/todoroo/andlib/utility/DateUtilities.java +++ b/api/src/com/todoroo/andlib/utility/DateUtilities.java @@ -16,7 +16,7 @@ import android.content.Context; import android.text.format.DateFormat; import android.text.format.DateUtils; -import com.todoroo.astrid.api.R; +import org.astrid.api.R; public class DateUtilities { diff --git a/api/src/com/todoroo/andlib/utility/DialogUtilities.java b/api/src/com/todoroo/andlib/utility/DialogUtilities.java index fb46c5316..ac9c4dffd 100644 --- a/api/src/com/todoroo/andlib/utility/DialogUtilities.java +++ b/api/src/com/todoroo/andlib/utility/DialogUtilities.java @@ -15,7 +15,7 @@ import android.content.DialogInterface; import android.view.View; import android.webkit.WebView; -import com.todoroo.astrid.api.R; +import org.astrid.api.R; public class DialogUtilities { diff --git a/api/src/com/todoroo/astrid/api/AstridApiConstants.java b/api/src/com/todoroo/astrid/api/AstridApiConstants.java index 5f7a499a9..4f691b911 100644 --- a/api/src/com/todoroo/astrid/api/AstridApiConstants.java +++ b/api/src/com/todoroo/astrid/api/AstridApiConstants.java @@ -21,12 +21,12 @@ public class AstridApiConstants { /** * Astrid broadcast base package name */ - public static final String API_PACKAGE = "com.todoroo.astrid"; + public static final String API_PACKAGE = "org.astrid"; /** * Astrid app base package name */ - public static final String ASTRID_PACKAGE = "com.timsu.astrid"; + public static final String ASTRID_PACKAGE = "org.astrid"; /** * Permission for reading tasks and receiving to GET_FILTERS intent diff --git a/api/src/com/todoroo/astrid/data/Task.java b/api/src/com/todoroo/astrid/data/Task.java index 49505c02c..5db3e87fa 100644 --- a/api/src/com/todoroo/astrid/data/Task.java +++ b/api/src/com/todoroo/astrid/data/Task.java @@ -21,7 +21,7 @@ import com.todoroo.andlib.data.Table; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.api.AstridApiConstants; -import com.todoroo.astrid.api.R; +import org.astrid.api.R; /** * Data Model which represents a task users need to accomplish. diff --git a/api/src/com/todoroo/astrid/sync/SyncProvider.java b/api/src/com/todoroo/astrid/sync/SyncProvider.java index 93ffd44ef..a177fc4e2 100644 --- a/api/src/com/todoroo/astrid/sync/SyncProvider.java +++ b/api/src/com/todoroo/astrid/sync/SyncProvider.java @@ -24,7 +24,7 @@ import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.ExceptionService; import com.todoroo.andlib.service.NotificationManager; import com.todoroo.andlib.utility.DialogUtilities; -import com.todoroo.astrid.api.R; +import org.astrid.api.R; import com.todoroo.astrid.data.Task; /** diff --git a/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java b/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java index da3c83d8f..2da5b5a52 100644 --- a/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java +++ b/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java @@ -27,7 +27,7 @@ import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.TodorooPreferenceActivity; -import com.todoroo.astrid.api.R; +import org.astrid.api.R; /** * Utility class for common synchronization action: displaying synchronization diff --git a/astrid/AndroidManifest.xml b/astrid/AndroidManifest.xml index 3fb5a5f4d..af95c93ea 100644 --- a/astrid/AndroidManifest.xml +++ b/astrid/AndroidManifest.xml @@ -5,13 +5,12 @@ ** See the file "LICENSE" for the full license governing this code. --> + package="org.astrid" + android:versionName="4.6.8" + android:versionCode="316"> - @@ -33,17 +32,12 @@ - - - - - @@ -53,34 +47,30 @@ - - + - - + - - - - - - + + - @@ -192,7 +182,7 @@ - + @@ -208,7 +198,7 @@ - + @@ -220,7 +210,7 @@ - + @@ -231,37 +221,37 @@ + android:readPermission="org.astrid.permission.READ_TASKS"/> + android:readPermission="org.astrid.READ" + android:writePermission="org.astrid.WRITE"/> + android:readPermission="org.astrid.READ" + android:writePermission="org.astrid.WRITE"/> - + - + @@ -271,7 +261,7 @@ - + @@ -286,25 +276,25 @@ - + - + - + - + @@ -312,7 +302,7 @@ - + @@ -324,7 +314,7 @@ - + @@ -333,7 +323,7 @@ - + @@ -343,13 +333,13 @@ - + - + @@ -375,17 +365,7 @@ - - - - - - - - - - - + @@ -405,13 +385,13 @@ android:theme="@style/Theme" android:configChanges="orientation|keyboardHidden"/> - + - + @@ -419,7 +399,7 @@ android:theme="@android:style/Theme.Dialog"/> - + @@ -432,13 +412,13 @@ - + - + @@ -452,19 +432,19 @@ - + - + - + @@ -472,7 +452,7 @@ - + @@ -483,7 +463,7 @@ - + @@ -505,7 +485,7 @@ - + @@ -520,7 +500,7 @@ - + @@ -532,19 +512,6 @@ - - - - - - - - - - - - - + - + - + @@ -595,7 +562,7 @@ - + @@ -615,7 +582,7 @@ - + diff --git a/astrid/common-src/com/commonsware/cwac/tlv/TouchListView.java b/astrid/common-src/com/commonsware/cwac/tlv/TouchListView.java index 8812a9229..b6bdec91f 100644 --- a/astrid/common-src/com/commonsware/cwac/tlv/TouchListView.java +++ b/astrid/common-src/com/commonsware/cwac/tlv/TouchListView.java @@ -33,7 +33,7 @@ import android.view.WindowManager; import android.widget.AdapterView; import android.widget.ImageView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.astrid.ui.ErrorCatchingListView; diff --git a/astrid/plugin-src/com/timsu/astrid/GCMIntentService.java b/astrid/plugin-src/com/timsu/astrid/GCMIntentService.java deleted file mode 100644 index 4cfe98487..000000000 --- a/astrid/plugin-src/com/timsu/astrid/GCMIntentService.java +++ /dev/null @@ -1,463 +0,0 @@ -package com.timsu.astrid; - -import java.io.IOException; - -import android.app.Notification; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.os.Build; -import android.provider.Settings.Secure; -import android.text.TextUtils; -import android.util.Log; - -import com.google.android.gcm.GCMBaseIntentService; -import com.google.android.gcm.GCMConstants; -import com.google.android.gcm.GCMRegistrar; -import com.todoroo.andlib.data.TodorooCursor; -import com.todoroo.andlib.service.Autowired; -import com.todoroo.andlib.service.ContextManager; -import com.todoroo.andlib.service.DependencyInjectionService; -import com.todoroo.andlib.service.NotificationManager; -import com.todoroo.andlib.service.NotificationManager.AndroidNotificationManager; -import com.todoroo.andlib.sql.Query; -import com.todoroo.andlib.sql.QueryTemplate; -import com.todoroo.andlib.utility.AndroidUtilities; -import com.todoroo.andlib.utility.DateUtilities; -import com.todoroo.andlib.utility.Preferences; -import com.todoroo.astrid.actfm.TagViewFragment; -import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; -import com.todoroo.astrid.actfm.sync.ActFmSyncService; -import com.todoroo.astrid.actfm.sync.ActFmSyncThread; -import com.todoroo.astrid.actfm.sync.messages.BriefMe; -import com.todoroo.astrid.activity.ShortcutActivity; -import com.todoroo.astrid.activity.TaskListActivity; -import com.todoroo.astrid.activity.TaskListFragment; -import com.todoroo.astrid.api.AstridApiConstants; -import com.todoroo.astrid.api.Filter; -import com.todoroo.astrid.api.FilterWithCustomIntent; -import com.todoroo.astrid.dao.UserActivityDao; -import com.todoroo.astrid.data.SyncFlags; -import com.todoroo.astrid.data.TagData; -import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.data.UserActivity; -import com.todoroo.astrid.reminders.Notifications; -import com.todoroo.astrid.service.AstridDependencyInjector; -import com.todoroo.astrid.service.TagDataService; -import com.todoroo.astrid.service.TaskService; -import com.todoroo.astrid.sync.SyncResultCallbackAdapter; -import com.todoroo.astrid.tags.TagFilterExposer; -import com.todoroo.astrid.utility.Constants; - -@SuppressWarnings("nls") -public class GCMIntentService extends GCMBaseIntentService { - - public static final String SENDER_ID = "1003855277730"; //$NON-NLS-1$ - public static final String PREF_REGISTRATION = "gcm_id"; - public static final String PREF_NEEDS_REGISTRATION = "gcm_needs_reg"; - public static final String PREF_NEEDS_RETRY = "gcm_needs_retry"; - - private static final String PREF_LAST_GCM = "c2dm_last"; - public static final String PREF_C2DM_REGISTRATION = "c2dm_key"; - - public static String getDeviceID() { - String id = Secure.getString(ContextManager.getContext().getContentResolver(), Secure.ANDROID_ID);; - if(AndroidUtilities.getSdkVersion() > 8) { //Gingerbread and above - //the following uses relection to get android.os.Build.SERIAL to avoid having to build with Gingerbread - try { - if(!Build.UNKNOWN.equals(Build.SERIAL)) { - id = Build.SERIAL; - } - } catch(Exception e) { - // Ah well - } - } - - if (TextUtils.isEmpty(id) || "9774d56d682e549c".equals(id)) { // check for failure or devices affected by the "9774d56d682e549c" bug - return null; - } - - return id; - } - - static { - AstridDependencyInjector.initialize(); - } - - @Autowired - private ActFmSyncService actFmSyncService; - - @Autowired - private ActFmPreferenceService actFmPreferenceService; - - @Autowired - private TaskService taskService; - - @Autowired - private TagDataService tagDataService; - - @Autowired - private UserActivityDao userActivityDao; - - public GCMIntentService() { - super(SENDER_ID); - DependencyInjectionService.getInstance().inject(this); - } - - - // ===================== Messaging =================== // - - private final SyncResultCallbackAdapter refreshOnlyCallback = new SyncResultCallbackAdapter() { - @Override - public void finished() { - ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); - } - }; - - private static final long MIN_MILLIS_BETWEEN_FULL_SYNCS = DateUtilities.ONE_HOUR; - - @Override - protected void onMessage(Context context, Intent intent) { - if (actFmPreferenceService.isLoggedIn()) { - if(intent.hasExtra("web_update")) { - handleWebUpdate(intent); - } else { - handleMessage(intent); - } - } - } - - /** Handle web task or list changed */ - protected void handleWebUpdate(Intent intent) { - if(intent.hasExtra("tag_id")) { - String uuid = intent.getStringExtra("tag_id"); - TodorooCursor cursor = tagDataService.query( - Query.select(TagData.PUSHED_AT).where(TagData.UUID.eq( - uuid))); - long pushedAt = 0; - try { - TagData tagData = new TagData(); - if(cursor.getCount() > 0) { - cursor.moveToNext(); - tagData.readFromCursor(cursor); - pushedAt = tagData.getValue(TagData.PUSHED_AT); - } - } finally { - cursor.close(); - } - ActFmSyncThread.getInstance().enqueueMessage(new BriefMe(TagData.class, uuid, pushedAt), ActFmSyncThread.DEFAULT_REFRESH_RUNNABLE); - } else if(intent.hasExtra("task_id")) { - String uuid = intent.getStringExtra("task_id"); - TodorooCursor cursor = taskService.query( - Query.select(Task.PROPERTIES).where(Task.UUID.eq( - uuid))); - long pushedAt = 0; - try { - final Task task = new Task(); - if(cursor.getCount() > 0) { - cursor.moveToNext(); - task.readFromCursor(cursor); - pushedAt = task.getValue(Task.PUSHED_AT); - } - ActFmSyncThread.getInstance().enqueueMessage(new BriefMe(Task.class, uuid, pushedAt), ActFmSyncThread.DEFAULT_REFRESH_RUNNABLE); - } finally { - cursor.close(); - } - } - } - - // --- message handling - - /** Handle message. Run on separate thread. */ - private void handleMessage(Intent intent) { - String message = intent.getStringExtra("alert"); - Context context = ContextManager.getContext(); - if(TextUtils.isEmpty(message)) { - return; - } - - long lastNotification = Preferences.getLong(PREF_LAST_GCM, 0); - if(DateUtilities.now() - lastNotification < 5000L) { - return; - } - Preferences.setLong(PREF_LAST_GCM, DateUtilities.now()); - Intent notifyIntent = null; - int notifId; - - final String user_id = intent.getStringExtra("oid"); - final String token_id = intent.getStringExtra("tid"); - // unregister - if (!actFmPreferenceService.isLoggedIn() || !ActFmPreferenceService.userId().equals(user_id)) { - new Thread() { - @Override - public void run() { - try { - actFmSyncService.invoke("user_unset_c2dm", "tid", token_id, "oid", user_id); - } catch (IOException e) { - // - } - } - }.start(); - return; - } - - - // fetch data - if(intent.hasExtra("tag_id")) { - notifyIntent = createTagIntent(context, intent); - notifId = intent.getStringExtra("tag_id").hashCode(); - } else if(intent.hasExtra("task_id")) { - notifyIntent = createTaskIntent(intent); - notifId = intent.getStringExtra("task_id").hashCode(); - } else { - return; - } - - if (notifyIntent == null) { - return; - } - - notifyIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - notifyIntent.putExtra(TaskListActivity.TOKEN_SOURCE, Constants.SOURCE_C2DM); - PendingIntent pendingIntent = PendingIntent.getActivity(context, - notifId, notifyIntent, 0); - - int icon = calculateIcon(intent); - - // create notification - NotificationManager nm = new AndroidNotificationManager(ContextManager.getContext()); - Notification notification = new Notification(icon, - message, System.currentTimeMillis()); - String title; - if(intent.hasExtra("title")) { - title = "Astrid: " + intent.getStringExtra("title"); - } else { - title = ContextManager.getString(R.string.app_name); - } - notification.setLatestEventInfo(ContextManager.getContext(), title, - message, pendingIntent); - notification.flags |= Notification.FLAG_AUTO_CANCEL; - - boolean sounds = !"false".equals(intent.getStringExtra("sound")); - notification.defaults = 0; - if(sounds && !Notifications.isQuietHours()) { - notification.defaults |= Notification.DEFAULT_SOUND; - notification.defaults |= Notification.DEFAULT_VIBRATE; - } - nm.notify(notifId, notification); - - if(intent.hasExtra("tag_id")) { - Intent broadcastIntent = new Intent(TagViewFragment.BROADCAST_TAG_ACTIVITY); - broadcastIntent.putExtras(intent); - ContextManager.getContext().sendBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ); - } - } - - private int calculateIcon(Intent intent) { - if(intent.hasExtra("type")) { - String type = intent.getStringExtra("type"); - if("f".equals(type)) { - return R.drawable.notif_c2dm_done; - } - if("s".equals(type)) { - return R.drawable.notif_c2dm_assign; - } - if("l".equals(type)) { - return R.drawable.notif_c2dm_assign; - } - } else { - String message = intent.getStringExtra("alert"); - if(message.contains(" finished ")) { - return R.drawable.notif_c2dm_done; - } - if(message.contains(" invited you to ")) { - return R.drawable.notif_c2dm_assign; - } - if(message.contains(" sent you ")) { - return R.drawable.notif_c2dm_assign; - } - } - return R.drawable.notif_c2dm_msg; - } - - private Intent createTaskIntent(Intent intent) { - String uuid = intent.getStringExtra("task_id"); - TodorooCursor cursor = taskService.query( - Query.select(Task.PROPERTIES).where(Task.UUID.eq( - uuid))); - long pushedAt = 0; - try { - final Task task = new Task(); - if(cursor.getCount() == 0) { - task.setValue(Task.TITLE, intent.getStringExtra("title")); - task.setValue(Task.UUID, intent.getStringExtra("task_id")); - task.setValue(Task.USER_ID, Task.USER_ID_UNASSIGNED); - task.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true); - taskService.save(task); - } else { - cursor.moveToNext(); - task.readFromCursor(cursor); - pushedAt = task.getValue(Task.PUSHED_AT); - } - ActFmSyncThread.getInstance().enqueueMessage(new BriefMe(Task.class, uuid, pushedAt), null); - - Filter filter = new Filter("", task.getValue(Task.TITLE), - new QueryTemplate().where(Task.ID.eq(task.getId())), - null); - - Intent launchIntent = ShortcutActivity.createIntent(filter); - return launchIntent; - } finally { - cursor.close(); - } - } - - private Intent createTagIntent(final Context context, final Intent intent) { - String uuid = intent.getStringExtra("tag_id"); - TodorooCursor cursor = tagDataService.query( - Query.select(TagData.PROPERTIES).where(TagData.UUID.eq( - uuid))); - long pushedAt = 0; - try { - final TagData tagData = new TagData(); - if(cursor.getCount() == 0) { - tagData.setValue(TagData.NAME, intent.getStringExtra("title")); - tagData.setValue(TagData.UUID, intent.getStringExtra("tag_id")); - tagData.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true); - tagDataService.save(tagData); - } else { - cursor.moveToNext(); - tagData.readFromCursor(cursor); - pushedAt = tagData.getValue(TagData.PUSHED_AT); - } - ActFmSyncThread.getInstance().enqueueMessage(new BriefMe(TagData.class, uuid, pushedAt), null); - - FilterWithCustomIntent filter = (FilterWithCustomIntent)TagFilterExposer.filterFromTagData(context, tagData); - - if(intent.hasExtra("activity_id")) { - UserActivity update = new UserActivity(); - update.setValue(UserActivity.UUID, intent.getStringExtra("activity_id")); - update.setValue(UserActivity.USER_UUID, intent.getStringExtra("user_id")); - - update.setValue(UserActivity.ACTION, "tag_comment"); - update.setValue(UserActivity.TARGET_NAME, intent.getStringExtra("title")); - String message = intent.getStringExtra("alert"); - if(message.contains(":")) { - message = message.substring(message.indexOf(':') + 2); - } - update.setValue(UserActivity.MESSAGE, message); - update.setValue(UserActivity.CREATED_AT, DateUtilities.now()); - update.setValue(UserActivity.TARGET_ID, intent.getStringExtra("tag_id")); - update.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true); - userActivityDao.createNew(update); - } - - if (filter != null) { - Intent launchIntent = new Intent(context, TaskListActivity.class); - launchIntent.putExtra(TaskListFragment.TOKEN_FILTER, filter); - filter.customExtras.putBoolean(TagViewFragment.TOKEN_START_ACTIVITY, shouldLaunchActivity(intent)); - launchIntent.putExtras(filter.customExtras); - - return launchIntent; - } else { - return null; - } - } finally { - cursor.close(); - } - } - - private boolean shouldLaunchActivity(Intent intent) { - if(intent.hasExtra("type")) { - String type = intent.getStringExtra("type"); - if("f".equals(type)) { - return true; - } - if("s".equals(type)) { - return false; - } - if("l".equals(type)) { - return false; - } - } else { - String message = intent.getStringExtra("alert"); - if(message.contains(" finished ")) { - return true; - } - if(message.contains(" invited you to ")) { - return false; - } - if(message.contains(" sent you ")) { - return false; - } - } - return true; - } - - // ==================== Registration ============== // - - public static final void register(Context context) { - try { - if (AndroidUtilities.getSdkVersion() >= 8) { - GCMRegistrar.checkDevice(context); - GCMRegistrar.checkManifest(context); - final String regId = GCMRegistrar.getRegistrationId(context); - if ("".equals(regId)) { - GCMRegistrar.register(context, GCMIntentService.SENDER_ID); - } else { - // TODO: Already registered--do something? - } - } - } catch (Exception e) { - // phone may not support gcm - Log.e("actfm-sync", "gcm-register", e); - } - } - - public static final void unregister(Context context) { - try { - if (AndroidUtilities.getSdkVersion() >= 8) { - GCMRegistrar.unregister(context); - } - } catch (Exception e) { - Log.e("actfm-sync", "gcm-unregister", e); - } - } - - @Override - protected void onRegistered(Context context, String registrationId) { - actFmSyncService.setGCMRegistration(registrationId); - } - - @Override - protected void onUnregistered(Context context, String registrationId) { - // Server can unregister automatically next time it tries to send a message - } - - - @Override - protected void onError(Context context, String intent) { - if ((GCMConstants.ERROR_AUTHENTICATION_FAILED.equals(intent) || GCMConstants.ERROR_ACCOUNT_MISSING.equals(intent)) - && !Preferences.getBoolean(PREF_NEEDS_RETRY, false)) { - Preferences.setBoolean(PREF_NEEDS_RETRY, true); - } - } - - // =========== Migration ============= // - - public static class GCMMigration { - @Autowired - private ActFmPreferenceService actFmPreferenceService; - - public GCMMigration() { - DependencyInjectionService.getInstance().inject(this); - } - - public void performMigration(Context context) { - if (actFmPreferenceService.isLoggedIn()) { - GCMIntentService.register(context); - } - } - } - -} diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmCameraModule.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmCameraModule.java index f335baeb4..3801a92ae 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmCameraModule.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmCameraModule.java @@ -22,7 +22,7 @@ import android.provider.MediaStore; import android.support.v4.app.Fragment; import android.widget.ArrayAdapter; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java index d882d953f..24e02542a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java @@ -27,7 +27,7 @@ import android.widget.TextView; import android.widget.Toast; import com.google.api.client.googleapis.extensions.android2.auth.GoogleAccountManager; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.DialogUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java index 6872e01f3..2c702df14 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java @@ -9,7 +9,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsActivity.java index af812cd4d..c07184bd1 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsActivity.java @@ -12,7 +12,7 @@ import android.widget.TextView; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.astrid.activity.AstridActivity; import com.todoroo.astrid.service.ThemeService; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsFragment.java index 1ffa34877..91be5bef6 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/CommentsFragment.java @@ -40,7 +40,7 @@ import com.actionbarsherlock.app.SherlockListFragment; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.astrid.actfm.ActFmCameraModule.CameraResultCallback; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java index 3e33d9dc3..3aa13b7bc 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java @@ -39,7 +39,7 @@ import android.widget.ListView; import android.widget.TextView; import com.commonsware.cwac.merge.MergeAdapter; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagCommentsFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagCommentsFragment.java index 421e3d188..3a883c85e 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagCommentsFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagCommentsFragment.java @@ -15,7 +15,7 @@ import android.view.ViewGroup; import android.widget.ListView; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java index 637761236..d994d2bd6 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java @@ -34,7 +34,7 @@ import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.view.Window; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java index e1988211b..02705f77f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java @@ -34,7 +34,7 @@ import android.widget.TextView; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TaskCommentsFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TaskCommentsFragment.java index 1c936b0a2..5d92d5759 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TaskCommentsFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TaskCommentsFragment.java @@ -5,7 +5,7 @@ import android.database.Cursor; import android.view.ViewGroup; import android.widget.ListView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.actfm.sync.ActFmSyncThread; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java index de58742bc..b20cac068 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java @@ -25,8 +25,7 @@ import org.json.JSONObject; import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.GCMIntentService; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.RestClient; @@ -190,22 +189,12 @@ public class ActFmInvoker { } } - public JSONObject postSync(String data, MultipartEntity entity, boolean changesHappened, String tok) throws IOException, - ActFmServiceException { + public JSONObject postSync(String data, MultipartEntity entity, boolean changesHappened, String tok) throws IOException { try { String timeString = DateUtilities.timeToIso8601(DateUtilities.now(), true); Object[] params = { "token", tok, "data", data, "time", timeString }; - if (changesHappened) { - String gcm = Preferences.getStringValue(GCMIntentService.PREF_REGISTRATION); - ActFmSyncThread.syncLog("Sending GCM token: " + gcm); - if (!TextUtils.isEmpty(gcm)) { - params = AndroidUtilities.addToArray(Object.class, params, "gcm", gcm); - entity.addPart("gcm", new StringBody(gcm)); - } - } - String request = createFetchUrl("api/" + API_VERSION, "synchronize", params); if (SYNC_DEBUG) { Log.e("act-fm-post", request); diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java index aac2936f7..6ee897eef 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmPreferenceService.java @@ -10,13 +10,11 @@ import org.json.JSONObject; import android.text.TextUtils; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.Preferences; -import com.todoroo.astrid.billing.BillingConstants; import com.todoroo.astrid.dao.RemoteModelDao; import com.todoroo.astrid.data.RemoteModel; import com.todoroo.astrid.service.PremiumUnlockService; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.sync.SyncProviderUtilities; import com.todoroo.astrid.utility.AstridPreferences; @@ -153,20 +151,7 @@ public class ActFmPreferenceService extends SyncProviderUtilities { } public static boolean isPremiumUser() { - if (Preferences.getBoolean(PremiumUnlockService.PREF_KILL_SWITCH, false)) { - return true; - } - - if (Preferences.getBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, false)) { - return Preferences.getBoolean(PREF_LOCAL_PREMIUM, false); - } - return Preferences.getBoolean(PREF_PREMIUM, false); - } - - public static void premiumLogout() { - Preferences.setBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, false); - Preferences.setBoolean(PREF_LOCAL_PREMIUM, false); - Preferences.setBoolean(PREF_PREMIUM, false); + return true; } @Override diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index 7e278711b..07ee67db2 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -6,21 +6,17 @@ package com.todoroo.astrid.actfm.sync; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.GCMIntentService; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.Preferences; -import com.todoroo.astrid.billing.BillingConstants; import com.todoroo.astrid.data.RemoteModel; import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.User; @@ -85,72 +81,6 @@ public final class ActFmSyncService { return result.optInt("time", 0); } - public void updateUserSubscriptionStatus(Runnable onSuccess, Runnable onRecoverableError, Runnable onInvalidToken) { - String purchaseToken = Preferences.getStringValue(BillingConstants.PREF_PURCHASE_TOKEN); - String productId = Preferences.getStringValue(BillingConstants.PREF_PRODUCT_ID); - try { - if (!checkForToken()) { - throw new ActFmServiceException("Not logged in", null); - } - - ArrayList params = new ArrayList(); - params.add("purchase_token"); params.add(purchaseToken); - params.add("product_id"); params.add(productId); - addAbTestEventInfo(params); - params.add("token"); params.add(token); - - actFmInvoker.invoke("premium_update_android", params.toArray(new Object[params.size()])); - Preferences.setBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, false); - if (onSuccess != null) { - onSuccess.run(); - } - } catch (Exception e) { - if (e instanceof ActFmServiceException) { - ActFmServiceException ae = (ActFmServiceException)e; - if (ae.result != null && ae.result.optString("status").equals("error")) { - if (ae.result.optString("code").equals("invalid_purchase_token")) { // Not a valid purchase--expired or duolicate - Preferences.setBoolean(ActFmPreferenceService.PREF_LOCAL_PREMIUM, false); - Preferences.setBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, false); - if (onInvalidToken != null) { - onInvalidToken.run(); - } - return; - } - } - } - Preferences.setBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, true); - if (onRecoverableError != null) { - onRecoverableError.run(); - } - } - } - - public void setGCMRegistration(String regId) { - try { - String deviceId = GCMIntentService.getDeviceID(); - String existingC2DM = Preferences.getStringValue(GCMIntentService.PREF_C2DM_REGISTRATION); - - ArrayList params = new ArrayList(); - params.add("gcm"); params.add(regId); - if (!TextUtils.isEmpty(deviceId)) { - params.add("device_id"); params.add(deviceId); - } - if (!TextUtils.isEmpty(existingC2DM)) { // Unregisters C2DM with the server for migration purposes - params.add("c2dm"); params.add(existingC2DM); - } - - invoke("user_set_gcm", params.toArray(new Object[params.size()])); - - Preferences.setString(GCMIntentService.PREF_REGISTRATION, regId); - Preferences.setString(GCMIntentService.PREF_C2DM_REGISTRATION, null); - Preferences.setString(GCMIntentService.PREF_NEEDS_REGISTRATION, null); - Preferences.setBoolean(GCMIntentService.PREF_NEEDS_RETRY, false); - } catch (IOException e) { - Preferences.setString(GCMIntentService.PREF_NEEDS_REGISTRATION, regId); - Log.e("gcm", "error-gcm-register", e); - } - } - // --- generic invokation /** invoke authenticated method against the server */ diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java index e28ef425a..1e8ab1d75 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java @@ -25,7 +25,7 @@ import android.net.NetworkInfo; import android.support.v4.app.NotificationCompat; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/MakeChanges.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/MakeChanges.java index e33741a02..6c662520a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/MakeChanges.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/MakeChanges.java @@ -11,7 +11,7 @@ import org.json.JSONObject; import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property.StringProperty; diff --git a/astrid/plugin-src/com/todoroo/astrid/alarms/AlarmControlSet.java b/astrid/plugin-src/com/todoroo/astrid/alarms/AlarmControlSet.java index 059005b1e..f0e13678b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/alarms/AlarmControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/alarms/AlarmControlSet.java @@ -16,7 +16,7 @@ import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.data.Metadata; diff --git a/astrid/plugin-src/com/todoroo/astrid/backup/BackupActivity.java b/astrid/plugin-src/com/todoroo/astrid/backup/BackupActivity.java index 3a3a35c4c..1b5a4d04c 100644 --- a/astrid/plugin-src/com/todoroo/astrid/backup/BackupActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/backup/BackupActivity.java @@ -11,7 +11,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.astrid.utility.Flags; diff --git a/astrid/plugin-src/com/todoroo/astrid/backup/BackupPreferences.java b/astrid/plugin-src/com/todoroo/astrid/backup/BackupPreferences.java index 33a9391cc..42d3a8c9c 100644 --- a/astrid/plugin-src/com/todoroo/astrid/backup/BackupPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/backup/BackupPreferences.java @@ -16,7 +16,7 @@ import android.preference.Preference.OnPreferenceClickListener; import android.view.View; import android.view.ViewGroup.OnHierarchyChangeListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.DateUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/backup/BackupService.java b/astrid/plugin-src/com/todoroo/astrid/backup/BackupService.java index 07ad05580..16212c61c 100644 --- a/astrid/plugin-src/com/todoroo/astrid/backup/BackupService.java +++ b/astrid/plugin-src/com/todoroo/astrid/backup/BackupService.java @@ -18,7 +18,7 @@ import android.content.Intent; import android.os.IBinder; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/backup/FilePickerBuilder.java b/astrid/plugin-src/com/todoroo/astrid/backup/FilePickerBuilder.java index be64e373e..4146392cf 100644 --- a/astrid/plugin-src/com/todoroo/astrid/backup/FilePickerBuilder.java +++ b/astrid/plugin-src/com/todoroo/astrid/backup/FilePickerBuilder.java @@ -13,7 +13,7 @@ import android.content.Context; import android.content.DialogInterface; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; @SuppressWarnings("nls") diff --git a/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlExporter.java b/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlExporter.java index ebf4aa49e..77e834f06 100644 --- a/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlExporter.java +++ b/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlExporter.java @@ -19,7 +19,7 @@ import android.util.Log; import android.util.Xml; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property.PropertyVisitor; diff --git a/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlImporter.java b/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlImporter.java index f51a7e2de..8c352a8eb 100644 --- a/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlImporter.java +++ b/astrid/plugin-src/com/todoroo/astrid/backup/TasksXmlImporter.java @@ -28,7 +28,7 @@ import android.util.Log; import android.view.WindowManager.BadTokenException; import com.google.ical.values.RRule; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property.PropertyVisitor; diff --git a/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java b/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java index 632354709..fcc46b409 100644 --- a/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java @@ -24,7 +24,7 @@ import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.AndroidUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java b/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java index 307bdb6a9..33a89dc0f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java +++ b/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java @@ -18,7 +18,7 @@ import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/core/CoreFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/core/CoreFilterExposer.java index 881e46b15..20d62fff4 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/CoreFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/CoreFilterExposer.java @@ -16,7 +16,7 @@ import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.sql.Join; diff --git a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java index 776a3cd99..7d0e02bb0 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java @@ -36,7 +36,7 @@ import android.widget.TextView; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property.CountProperty; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterAdapter.java b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterAdapter.java index e66eb7c0a..815c721ef 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterAdapter.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterAdapter.java @@ -22,7 +22,7 @@ import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.api.MultipleSelectCriterion; import com.todoroo.astrid.api.TextInputCriterion; import com.todoroo.astrid.core.CustomFilterActivity.CriterionInstance; diff --git a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterExposer.java index ee50afc9c..9a632d341 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterExposer.java @@ -16,7 +16,7 @@ import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/plugin-src/com/todoroo/astrid/core/DefaultsPreferences.java b/astrid/plugin-src/com/todoroo/astrid/core/DefaultsPreferences.java index 3f3afce33..fbdb1d6c8 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/DefaultsPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/DefaultsPreferences.java @@ -11,7 +11,7 @@ import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.andlib.utility.TodorooPreferenceActivity; diff --git a/astrid/plugin-src/com/todoroo/astrid/core/LinkActionExposer.java b/astrid/plugin-src/com/todoroo/astrid/core/LinkActionExposer.java index cf1302499..f3a011b76 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/LinkActionExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/LinkActionExposer.java @@ -21,7 +21,7 @@ import android.text.Spannable; import android.text.style.URLSpan; import android.text.util.Linkify; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.api.TaskAction; import com.todoroo.astrid.api.TaskDecoration; diff --git a/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java b/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java index beace6ce5..46ebbe640 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java @@ -14,8 +14,7 @@ import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceScreen; -import com.timsu.astrid.GCMIntentService; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; @@ -132,7 +131,6 @@ public class OldTaskPreferences extends TodorooPreferenceActivity { deleteDatabase(database.getName()); AstridPreferences.setPreferenceDefaults(); - GCMIntentService.unregister(OldTaskPreferences.this); System.exit(0); } diff --git a/astrid/plugin-src/com/todoroo/astrid/files/AACRecordingActivity.java b/astrid/plugin-src/com/todoroo/astrid/files/AACRecordingActivity.java index cf31e72c4..bc8e37c3b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/files/AACRecordingActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/files/AACRecordingActivity.java @@ -17,7 +17,7 @@ import android.view.View.OnClickListener; import android.widget.Chronometer; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.aacenc.AACRecorder; import com.todoroo.aacenc.AACRecorder.AACRecorderCallbacks; import com.todoroo.aacenc.AACToM4A; diff --git a/astrid/plugin-src/com/todoroo/astrid/files/FileExplore.java b/astrid/plugin-src/com/todoroo/astrid/files/FileExplore.java index 70df4efc2..bb349064b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/files/FileExplore.java +++ b/astrid/plugin-src/com/todoroo/astrid/files/FileExplore.java @@ -25,7 +25,7 @@ import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DialogUtilities; /** diff --git a/astrid/plugin-src/com/todoroo/astrid/files/FileUtilities.java b/astrid/plugin-src/com/todoroo/astrid/files/FileUtilities.java index 7de65a898..479549542 100644 --- a/astrid/plugin-src/com/todoroo/astrid/files/FileUtilities.java +++ b/astrid/plugin-src/com/todoroo/astrid/files/FileUtilities.java @@ -13,7 +13,7 @@ import java.util.concurrent.atomic.AtomicReference; import android.content.Context; import android.text.TextUtils; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.data.TaskAttachment; diff --git a/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java b/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java index 79adf8867..e2caa91eb 100644 --- a/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java @@ -31,7 +31,7 @@ import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.aacenc.RecognizerApi; import com.todoroo.aacenc.RecognizerApi.PlaybackExceptionHandler; import com.todoroo.andlib.data.TodorooCursor; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java index b295ff85f..e17a786f1 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java @@ -16,7 +16,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java index 46dbc9c96..456ca603f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmReceiver.java @@ -15,7 +15,7 @@ import android.net.Uri; import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmScheduler.java b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmScheduler.java index 766a0c04e..9e2a82784 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmScheduler.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarAlarmScheduler.java @@ -11,7 +11,7 @@ import android.database.Cursor; import android.net.Uri; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.utility.Constants; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarReminderActivity.java b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarReminderActivity.java index e0e50737e..8df1d1030 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarReminderActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarReminderActivity.java @@ -15,7 +15,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.AndroidUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarStartupReceiver.java b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarStartupReceiver.java index aad714676..77c7d47fe 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarStartupReceiver.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/CalendarStartupReceiver.java @@ -4,7 +4,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.api.AstridApiConstants; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/Calendars.java b/astrid/plugin-src/com/todoroo/astrid/gcal/Calendars.java index 0b4d47de2..13795f5c8 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/Calendars.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/Calendars.java @@ -17,7 +17,7 @@ import android.preference.ListPreference; import android.provider.CalendarContract; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/GCalControlSet.java b/astrid/plugin-src/com/todoroo/astrid/gcal/GCalControlSet.java index 6dcaf03d2..a780e43d3 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/GCalControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/GCalControlSet.java @@ -27,7 +27,7 @@ import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.ExceptionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/GCalHelper.java b/astrid/plugin-src/com/todoroo/astrid/gcal/GCalHelper.java index 14e0afa85..75cc95ccb 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/GCalHelper.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/GCalHelper.java @@ -16,7 +16,7 @@ import android.text.TextUtils; import android.text.format.Time; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java b/astrid/plugin-src/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java index 4a685fab4..adb24807c 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java +++ b/astrid/plugin-src/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java @@ -14,7 +14,7 @@ import android.net.Uri; import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.core.PluginServices; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksCustomFilterCriteriaExposer.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksCustomFilterCriteriaExposer.java index a27cce1c2..75d9cf758 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksCustomFilterCriteriaExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksCustomFilterCriteriaExposer.java @@ -12,7 +12,7 @@ import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksFilterExposer.java index b67451aff..7ef95fe5f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksFilterExposer.java @@ -14,7 +14,7 @@ import android.content.Intent; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListAdder.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListAdder.java index feec51f08..e37626418 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListAdder.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListAdder.java @@ -15,7 +15,7 @@ import android.text.TextUtils; import android.widget.EditText; import android.widget.FrameLayout; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.DialogUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListFragment.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListFragment.java index a6c8bbd5c..70d93da42 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksListFragment.java @@ -12,7 +12,7 @@ import android.os.Bundle; import android.widget.TextView; import com.actionbarsherlock.view.Menu; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java index 2ba7c1aea..1a074d6fb 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferenceService.java @@ -5,7 +5,7 @@ */ package com.todoroo.astrid.gtasks; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.sync.SyncProviderUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java index 144bc2353..6b8b80257 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksPreferences.java @@ -10,7 +10,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.DialogUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksSyncActionExposer.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksSyncActionExposer.java index 24991f2fa..a5733faf9 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksSyncActionExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/GtasksSyncActionExposer.java @@ -10,7 +10,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/api/GtasksInvoker.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/api/GtasksInvoker.java index 1e6497e43..f266aa30f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/api/GtasksInvoker.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/api/GtasksInvoker.java @@ -17,7 +17,7 @@ import com.google.api.services.tasks.Tasks.TasksOperations.Move; import com.google.api.services.tasks.model.Task; import com.google.api.services.tasks.model.TaskList; import com.google.api.services.tasks.model.TaskLists; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksLoginActivity.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksLoginActivity.java index 6acdcf418..5cf98b8f8 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksLoginActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksLoginActivity.java @@ -27,7 +27,7 @@ import android.widget.TextView; import android.widget.Toast; import com.google.api.client.googleapis.extensions.android2.auth.GoogleAccountManager; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksTokenValidator.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksTokenValidator.java index 99017d879..018492977 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksTokenValidator.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/auth/GtasksTokenValidator.java @@ -16,7 +16,7 @@ import android.content.Intent; import android.os.Bundle; import com.google.api.client.googleapis.extensions.android2.auth.GoogleAccountManager; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.gtasks.GtasksPreferenceService; diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java index 62617a8e3..0884f65da 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java @@ -18,7 +18,7 @@ import android.app.Activity; import android.text.TextUtils; import com.google.api.services.tasks.model.Tasks; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java index 6dbd2b462..ce0b9b84e 100644 --- a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java +++ b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java @@ -18,7 +18,7 @@ import android.view.View; import android.widget.ListView; import android.widget.Spinner; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.astrid.activity.AddOnActivity; diff --git a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java index 68552194b..395e5530a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java +++ b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java @@ -13,7 +13,7 @@ import android.os.Bundle; import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java index d0e111069..736ff42ee 100644 --- a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java @@ -43,7 +43,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/plugin-src/com/todoroo/astrid/notes/NotesDecorationExposer.java b/astrid/plugin-src/com/todoroo/astrid/notes/NotesDecorationExposer.java index e149d1f8b..3d4dde574 100644 --- a/astrid/plugin-src/com/todoroo/astrid/notes/NotesDecorationExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/notes/NotesDecorationExposer.java @@ -9,7 +9,7 @@ import android.app.PendingIntent; import android.content.Intent; import android.widget.RemoteViews; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.api.TaskDecoration; diff --git a/astrid/plugin-src/com/todoroo/astrid/notes/NotesDetailExposer.java b/astrid/plugin-src/com/todoroo/astrid/notes/NotesDetailExposer.java index 2029523fc..bdc2e2cbf 100644 --- a/astrid/plugin-src/com/todoroo/astrid/notes/NotesDetailExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/notes/NotesDetailExposer.java @@ -11,7 +11,7 @@ import android.content.Context; import android.content.Intent; import android.text.TextUtils; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.sql.Order; import com.todoroo.andlib.sql.Query; diff --git a/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java b/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java index 5938720d7..b4800f2cc 100644 --- a/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java @@ -17,7 +17,7 @@ import android.widget.AutoCompleteTextView; import android.widget.Spinner; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property.LongProperty; import com.todoroo.andlib.data.Property.StringProperty; import com.todoroo.andlib.data.TodorooCursor; diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java index 687ca7d27..646e67e50 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java @@ -17,7 +17,7 @@ import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.text.TextUtils; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.sql.Criterion; diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterMode.java b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterMode.java index 1e3977ab0..7fddaae7b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterMode.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterMode.java @@ -2,7 +2,7 @@ package com.todoroo.astrid.people; import android.content.Context; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.activity.FilterListFragment; import com.todoroo.astrid.activity.FilterModeSpec; import com.todoroo.astrid.activity.TaskListFragment; diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PeopleListFragment.java b/astrid/plugin-src/com/todoroo/astrid/people/PeopleListFragment.java index a66223301..89b2ac81d 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PeopleListFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PeopleListFragment.java @@ -7,7 +7,7 @@ package com.todoroo.astrid.people; import android.app.Activity; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.activity.FilterListFragment; import com.todoroo.astrid.adapter.FilterAdapter; import com.todoroo.astrid.utility.AstridPreferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java index 03ea2a0c0..54daca437 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java @@ -18,7 +18,7 @@ import android.view.ViewGroup; import android.widget.TextView; import com.actionbarsherlock.view.Menu; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.utility.DateUtilities; diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java b/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java index 266235293..33ee0e254 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java @@ -21,7 +21,7 @@ import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.Spinner; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java index 187739263..c1b98a589 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java @@ -25,7 +25,7 @@ import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementFragment.java b/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementFragment.java index cacaaddcf..8362a37c5 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementFragment.java @@ -11,7 +11,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.activity.TaskListFragment; import com.todoroo.astrid.service.ThemeService; diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementReceiver.java b/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementReceiver.java index b4053f9a6..d93033321 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementReceiver.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/ReengagementReceiver.java @@ -17,7 +17,7 @@ import android.graphics.Color; import android.os.Bundle; import android.text.TextUtils; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderDialog.java b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderDialog.java index d333aa22e..a40eb9612 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderDialog.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderDialog.java @@ -29,7 +29,7 @@ import android.widget.TextView; import android.widget.TimePicker; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java index f487d7af4..691a2cf12 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderPreferences.java @@ -8,7 +8,7 @@ package com.todoroo.astrid.reminders; import android.content.res.Resources; import android.preference.Preference; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.andlib.utility.TodorooPreferenceActivity; diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderService.java b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderService.java index bc250296f..07f2cd1e6 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderService.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/ReminderService.java @@ -17,7 +17,7 @@ import android.content.SharedPreferences.Editor; import android.content.res.Resources; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatControlSet.java b/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatControlSet.java index 1bf6c47f3..ed4fc23d7 100644 --- a/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatControlSet.java @@ -32,7 +32,7 @@ import com.google.ical.values.Frequency; import com.google.ical.values.RRule; import com.google.ical.values.Weekday; import com.google.ical.values.WeekdayNum; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.ExceptionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatDetailExposer.java b/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatDetailExposer.java index ad89759e3..edddef85a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatDetailExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatDetailExposer.java @@ -17,7 +17,7 @@ import android.content.res.Resources; import com.google.ical.values.Frequency; import com.google.ical.values.RRule; import com.google.ical.values.WeekdayNum; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.core.PluginServices; import com.todoroo.astrid.data.Task; diff --git a/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatsPlugin.java b/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatsPlugin.java index c416ea9f1..c523c13a3 100644 --- a/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatsPlugin.java +++ b/astrid/plugin-src/com/todoroo/astrid/repeats/RepeatsPlugin.java @@ -9,7 +9,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.api.Addon; import com.todoroo.astrid.api.AstridApiConstants; diff --git a/astrid/plugin-src/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java b/astrid/plugin-src/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java index a3645de57..e92ffd51d 100644 --- a/astrid/plugin-src/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java +++ b/astrid/plugin-src/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java @@ -18,7 +18,7 @@ import android.widget.ListView; import com.commonsware.cwac.tlv.TouchListView.DropListener; import com.commonsware.cwac.tlv.TouchListView.GrabberClickListener; import com.commonsware.cwac.tlv.TouchListView.SwipeListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java b/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java index c7c774f7a..0b5d96677 100644 --- a/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java +++ b/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java @@ -24,7 +24,7 @@ import android.widget.ListView; import com.commonsware.cwac.tlv.TouchListView.DropListener; import com.commonsware.cwac.tlv.TouchListView.GrabberClickListener; import com.commonsware.cwac.tlv.TouchListView.SwipeListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksListFragment.java b/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksListFragment.java index a3b1601c0..a9dd47a5d 100644 --- a/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksListFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksListFragment.java @@ -9,7 +9,7 @@ import android.os.Bundle; import android.view.View; import android.view.ViewGroup; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.astrid.activity.TaskListFragment; import com.todoroo.astrid.adapter.TaskAdapter; diff --git a/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java b/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java index 142c1bcd8..04ea157dd 100644 --- a/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java @@ -8,7 +8,7 @@ package com.todoroo.astrid.subtasks; import android.view.View; import android.view.ViewGroup; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.astrid.actfm.TagViewFragment; import com.todoroo.astrid.adapter.TaskAdapter; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/TagCustomFilterCriteriaExposer.java b/astrid/plugin-src/com/todoroo/astrid/tags/TagCustomFilterCriteriaExposer.java index 03ae4df4b..fb56f03cf 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/TagCustomFilterCriteriaExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/TagCustomFilterCriteriaExposer.java @@ -12,7 +12,7 @@ import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.sql.Join; import com.todoroo.andlib.sql.Query; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/TagFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/tags/TagFilterExposer.java index 4195c1ca6..e1d8f64a1 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/TagFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/TagFilterExposer.java @@ -22,7 +22,7 @@ import android.text.TextUtils; import android.widget.EditText; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/TagService.java b/astrid/plugin-src/com/todoroo/astrid/tags/TagService.java index 95564f635..950db9885 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/TagService.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/TagService.java @@ -17,7 +17,7 @@ import android.content.Intent; import android.text.TextUtils; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property.CountProperty; import com.todoroo.andlib.data.TodorooCursor; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/TagsControlSet.java b/astrid/plugin-src/com/todoroo/astrid/tags/TagsControlSet.java index 3d5634d26..a2ee8889f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/TagsControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/TagsControlSet.java @@ -27,7 +27,7 @@ import android.widget.ListView; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java index e70ae0eb8..d84f20835 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java @@ -2,7 +2,7 @@ package com.todoroo.astrid.tags.reusable; import android.content.Context; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.activity.FilterListFragment; import com.todoroo.astrid.activity.FilterModeSpec; import com.todoroo.astrid.activity.TaskListFragment; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFragment.java b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFragment.java index 895be9ccf..2bbdccdfa 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedListFragment.java @@ -2,7 +2,7 @@ package com.todoroo.astrid.tags.reusable; import android.app.Activity; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.activity.FilterListFragment; import com.todoroo.astrid.adapter.FilterAdapter; import com.todoroo.astrid.utility.AstridPreferences; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java index c7c21451f..08a50131b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java @@ -14,7 +14,7 @@ import android.widget.Toast; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.sql.Query; diff --git a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/ReusableTaskAdapter.java b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/ReusableTaskAdapter.java index 0477326f5..02510d95a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/tags/reusable/ReusableTaskAdapter.java +++ b/astrid/plugin-src/com/todoroo/astrid/tags/reusable/ReusableTaskAdapter.java @@ -11,7 +11,7 @@ import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.activity.TaskListFragment; diff --git a/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java b/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java index 3a660991f..6d1db0ac2 100644 --- a/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java @@ -18,7 +18,7 @@ import android.widget.Chronometer.OnChronometerTickListener; import android.widget.ImageView; import android.widget.LinearLayout; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.helper.TaskEditControlSet; diff --git a/astrid/plugin-src/com/todoroo/astrid/timers/TimerControlSet.java b/astrid/plugin-src/com/todoroo/astrid/timers/TimerControlSet.java index 282068ac7..74c165f8e 100644 --- a/astrid/plugin-src/com/todoroo/astrid/timers/TimerControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/timers/TimerControlSet.java @@ -12,7 +12,7 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property.IntegerProperty; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.helper.TaskEditControlSet; diff --git a/astrid/plugin-src/com/todoroo/astrid/timers/TimerDecorationExposer.java b/astrid/plugin-src/com/todoroo/astrid/timers/TimerDecorationExposer.java index db9104394..a89e35ab5 100644 --- a/astrid/plugin-src/com/todoroo/astrid/timers/TimerDecorationExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/timers/TimerDecorationExposer.java @@ -13,7 +13,7 @@ import android.text.format.DateUtils; import android.view.View; import android.widget.RemoteViews; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.api.AstridApiConstants; diff --git a/astrid/plugin-src/com/todoroo/astrid/timers/TimerFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/timers/TimerFilterExposer.java index be07002fc..985a2ba0a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/timers/TimerFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/timers/TimerFilterExposer.java @@ -12,7 +12,7 @@ import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.sql.Query; import com.todoroo.andlib.sql.QueryTemplate; diff --git a/astrid/plugin-src/com/todoroo/astrid/timers/TimerPlugin.java b/astrid/plugin-src/com/todoroo/astrid/timers/TimerPlugin.java index 41a6fe94f..5e73c5284 100644 --- a/astrid/plugin-src/com/todoroo/astrid/timers/TimerPlugin.java +++ b/astrid/plugin-src/com/todoroo/astrid/timers/TimerPlugin.java @@ -12,7 +12,7 @@ import android.content.Context; import android.content.Intent; import android.content.res.Resources; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.NotificationManager; import com.todoroo.andlib.service.NotificationManager.AndroidNotificationManager; diff --git a/astrid/res/layout/assigned_adapter_row.xml b/astrid/res/layout/assigned_adapter_row.xml index 61c8dcddf..ee34fed48 100644 --- a/astrid/res/layout/assigned_adapter_row.xml +++ b/astrid/res/layout/assigned_adapter_row.xml @@ -5,7 +5,7 @@ ** See the file "LICENSE" for the full license governing this code. --> diff --git a/astrid/res/layout/control_set_deadline.xml b/astrid/res/layout/control_set_deadline.xml index 7c52e2ad4..4eee9e79b 100644 --- a/astrid/res/layout/control_set_deadline.xml +++ b/astrid/res/layout/control_set_deadline.xml @@ -6,7 +6,7 @@ --> diff --git a/astrid/res/layout/tag_updates_fragment.xml b/astrid/res/layout/tag_updates_fragment.xml index beece8b78..328e905ec 100644 --- a/astrid/res/layout/tag_updates_fragment.xml +++ b/astrid/res/layout/tag_updates_fragment.xml @@ -5,7 +5,7 @@ ** See the file "LICENSE" for the full license governing this code. --> diff --git a/astrid/res/layout/task_adapter_row.xml b/astrid/res/layout/task_adapter_row.xml index 62efbfdf8..f6769b7c2 100644 --- a/astrid/res/layout/task_adapter_row.xml +++ b/astrid/res/layout/task_adapter_row.xml @@ -6,7 +6,7 @@ --> diff --git a/astrid/res/layout/web_service_row.xml b/astrid/res/layout/web_service_row.xml index 65a764308..ee7cf18cd 100644 --- a/astrid/res/layout/web_service_row.xml +++ b/astrid/res/layout/web_service_row.xml @@ -5,7 +5,7 @@ ** See the file "LICENSE" for the full license governing this code. --> diff --git a/astrid/src-legacy/com/timsu/astrid/data/enums/Importance.java b/astrid/src-legacy/com/timsu/astrid/data/enums/Importance.java index b99b18257..b45ec85d8 100644 --- a/astrid/src-legacy/com/timsu/astrid/data/enums/Importance.java +++ b/astrid/src-legacy/com/timsu/astrid/data/enums/Importance.java @@ -5,7 +5,7 @@ */ package com.timsu.astrid.data.enums; -import com.timsu.astrid.R; +import org.astrid.R; public enum Importance { // MOST IMPORTANT diff --git a/astrid/src-legacy/com/timsu/astrid/data/task/AbstractTaskModel.java b/astrid/src-legacy/com/timsu/astrid/data/task/AbstractTaskModel.java index 2c203774b..10be901ee 100644 --- a/astrid/src-legacy/com/timsu/astrid/data/task/AbstractTaskModel.java +++ b/astrid/src-legacy/com/timsu/astrid/data/task/AbstractTaskModel.java @@ -14,7 +14,7 @@ import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; -import com.timsu.astrid.R; +import org.astrid.R; import com.timsu.astrid.data.LegacyAbstractController; import com.timsu.astrid.data.LegacyAbstractModel; import com.timsu.astrid.data.enums.Importance; diff --git a/astrid/src-legacy/com/timsu/astrid/utilities/LegacyTasksXmlExporter.java b/astrid/src-legacy/com/timsu/astrid/utilities/LegacyTasksXmlExporter.java index 9f124728a..119f91a7e 100644 --- a/astrid/src-legacy/com/timsu/astrid/utilities/LegacyTasksXmlExporter.java +++ b/astrid/src-legacy/com/timsu/astrid/utilities/LegacyTasksXmlExporter.java @@ -23,7 +23,7 @@ import android.util.Log; import android.util.Xml; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.timsu.astrid.data.alerts.AlertController; import com.timsu.astrid.data.sync.SyncDataController; import com.timsu.astrid.data.sync.SyncMapping; diff --git a/astrid/src/com/android/vending/billing/IMarketBillingService.aidl b/astrid/src/com/android/vending/billing/IMarketBillingService.aidl deleted file mode 100644 index 6884b41f6..000000000 --- a/astrid/src/com/android/vending/billing/IMarketBillingService.aidl +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * 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.android.vending.billing; - -import android.os.Bundle; - -interface IMarketBillingService { - /** Given the arguments in bundle form, returns a bundle for results. */ - Bundle sendBillingRequest(in Bundle bundle); -} diff --git a/astrid/src/com/todoroo/astrid/activity/AboutActivity.java b/astrid/src/com/todoroo/astrid/activity/AboutActivity.java index b8194be1a..bc5a23769 100644 --- a/astrid/src/com/todoroo/astrid/activity/AboutActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/AboutActivity.java @@ -23,7 +23,7 @@ import android.text.Spanned; import android.text.method.LinkMovementMethod; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; /** * Displays an About dialog. diff --git a/astrid/src/com/todoroo/astrid/activity/AddOnActivity.java b/astrid/src/com/todoroo/astrid/activity/AddOnActivity.java index 6e711ea62..1013e3302 100644 --- a/astrid/src/com/todoroo/astrid/activity/AddOnActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/AddOnActivity.java @@ -21,7 +21,7 @@ import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar.Tab; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.astrid.adapter.AddOnAdapter; diff --git a/astrid/src/com/todoroo/astrid/activity/AstridActivity.java b/astrid/src/com/todoroo/astrid/activity/AstridActivity.java index 03b396526..72379d49f 100644 --- a/astrid/src/com/todoroo/astrid/activity/AstridActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/AstridActivity.java @@ -20,7 +20,7 @@ import android.widget.EditText; import android.widget.Toast; import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.aacenc.RecognizerApi.RecognizerApiListener; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java b/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java index 846e2514e..46d16180e 100644 --- a/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java +++ b/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java @@ -23,7 +23,7 @@ import android.widget.TextView; import com.commonsware.cwac.tlv.TouchListView; import com.commonsware.cwac.tlv.TouchListView.DropListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.Preferences; public class BeastModePreferences extends ListActivity { diff --git a/astrid/src/com/todoroo/astrid/activity/DefaultFilterMode.java b/astrid/src/com/todoroo/astrid/activity/DefaultFilterMode.java index d0588cd0e..b4cb43baf 100644 --- a/astrid/src/com/todoroo/astrid/activity/DefaultFilterMode.java +++ b/astrid/src/com/todoroo/astrid/activity/DefaultFilterMode.java @@ -2,7 +2,7 @@ package com.todoroo.astrid.activity; import android.content.Context; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.FilterListItem; import com.todoroo.astrid.core.CoreFilterExposer; diff --git a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java index de3ea4753..42c94c38d 100644 --- a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java +++ b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java @@ -27,7 +27,7 @@ import android.preference.PreferenceManager; import android.preference.PreferenceScreen; import android.text.TextUtils; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/src/com/todoroo/astrid/activity/Eula.java b/astrid/src/com/todoroo/astrid/activity/Eula.java index 58dec29b4..87b297ac4 100644 --- a/astrid/src/com/todoroo/astrid/activity/Eula.java +++ b/astrid/src/com/todoroo/astrid/activity/Eula.java @@ -20,7 +20,7 @@ import android.app.AlertDialog; import android.content.DialogInterface; import android.content.SharedPreferences; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.AndroidUtilities; diff --git a/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java b/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java index 4666b03ba..142034e5f 100644 --- a/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java @@ -41,7 +41,7 @@ import android.widget.Toast; import com.actionbarsherlock.app.SherlockListFragment; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.ExceptionService; diff --git a/astrid/src/com/todoroo/astrid/activity/FilterShortcutActivity.java b/astrid/src/com/todoroo/astrid/activity/FilterShortcutActivity.java index 048bfd4dd..5c7ee6fc5 100644 --- a/astrid/src/com/todoroo/astrid/activity/FilterShortcutActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/FilterShortcutActivity.java @@ -13,7 +13,7 @@ import android.view.View; import android.widget.Button; import android.widget.ListView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.astrid.adapter.FilterAdapter; import com.todoroo.astrid.api.Filter; diff --git a/astrid/src/com/todoroo/astrid/activity/ShortcutActivity.java b/astrid/src/com/todoroo/astrid/activity/ShortcutActivity.java index 97c674cb7..94bb466cd 100644 --- a/astrid/src/com/todoroo/astrid/activity/ShortcutActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/ShortcutActivity.java @@ -14,7 +14,7 @@ import android.content.ContentValues; import android.content.Intent; import android.os.Bundle; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.sql.QueryTemplate; import com.todoroo.andlib.utility.AndroidUtilities; diff --git a/astrid/src/com/todoroo/astrid/activity/SortSelectionActivity.java b/astrid/src/com/todoroo/astrid/activity/SortSelectionActivity.java index f3640efb0..2fbc071af 100644 --- a/astrid/src/com/todoroo/astrid/activity/SortSelectionActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/SortSelectionActivity.java @@ -13,7 +13,7 @@ import android.view.View; import android.widget.CheckBox; import android.widget.RadioButton; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.core.SortHelper; /** diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java index 26e85c6cf..f06707fbc 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java @@ -11,7 +11,7 @@ import android.view.KeyEvent; import android.widget.TextView; import com.actionbarsherlock.app.ActionBar; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java index c42d57b5c..a2da5c8d5 100755 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java @@ -55,7 +55,7 @@ import com.actionbarsherlock.app.SherlockFragment; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.ExceptionService; diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditViewPager.java b/astrid/src/com/todoroo/astrid/activity/TaskEditViewPager.java index 3dbb38610..60dd0c390 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditViewPager.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditViewPager.java @@ -13,7 +13,7 @@ import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.View; -import com.timsu.astrid.R; +import org.astrid.R; import com.viewpagerindicator.TitleProvider; public class TaskEditViewPager extends PagerAdapter implements TitleProvider { diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index fe716617a..2518b361a 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -33,7 +33,7 @@ import android.widget.PopupWindow.OnDismissListener; import android.widget.TextView; import com.actionbarsherlock.app.ActionBar; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.sql.QueryTemplate; diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java index 6f0fde5dd..c5ad87da0 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java @@ -51,7 +51,7 @@ import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockListFragment; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/src/com/todoroo/astrid/adapter/AddOnAdapter.java b/astrid/src/com/todoroo/astrid/adapter/AddOnAdapter.java index fec7d22ef..f1ac80a50 100644 --- a/astrid/src/com/todoroo/astrid/adapter/AddOnAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/AddOnAdapter.java @@ -23,7 +23,7 @@ import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.data.AddOn; import com.todoroo.astrid.utility.Constants; diff --git a/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java b/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java index 341e08354..c661f5512 100644 --- a/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/FilterAdapter.java @@ -40,7 +40,7 @@ import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index 71961d47a..49d67e872 100644 --- a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java @@ -55,7 +55,7 @@ import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property.IntegerProperty; import com.todoroo.andlib.data.Property.LongProperty; diff --git a/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java b/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java index 57931b3e4..1081730fc 100644 --- a/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java @@ -42,7 +42,7 @@ import android.view.ViewGroup.LayoutParams; import android.widget.CursorAdapter; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property.StringProperty; import com.todoroo.andlib.data.TodorooCursor; diff --git a/astrid/src/com/todoroo/astrid/billing/AstridPurchaseObserver.java b/astrid/src/com/todoroo/astrid/billing/AstridPurchaseObserver.java deleted file mode 100644 index 72f18f109..000000000 --- a/astrid/src/com/todoroo/astrid/billing/AstridPurchaseObserver.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.todoroo.astrid.billing; - -import android.app.Activity; -import android.content.DialogInterface; -import android.os.Handler; -import android.util.Log; - -import com.timsu.astrid.R; -import com.todoroo.andlib.service.Autowired; -import com.todoroo.andlib.service.DependencyInjectionService; -import com.todoroo.andlib.utility.DialogUtilities; -import com.todoroo.andlib.utility.Preferences; -import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; -import com.todoroo.astrid.actfm.sync.ActFmSyncService; -import com.todoroo.astrid.billing.BillingConstants.PurchaseState; -import com.todoroo.astrid.billing.BillingConstants.ResponseCode; -import com.todoroo.astrid.billing.BillingService.RequestPurchase; -import com.todoroo.astrid.billing.BillingService.RestoreTransactions; - -@SuppressWarnings("nls") -public abstract class AstridPurchaseObserver extends PurchaseObserver { - - @Autowired - private ActFmSyncService actFmSyncService; - - @Autowired - private ActFmPreferenceService actFmPreferenceService; - - public interface RestoreTransactionsListener { - public void restoreTransactionsResponse(ResponseCode responseCode); - } - - private RestoreTransactionsListener restoreTransactionsListener; - - /** - * A {@link PurchaseObserver} is used to get callbacks when Android Market sends - * messages to this application so that we can update the UI. - */ - public AstridPurchaseObserver(Activity activity, Handler handler) { - super(activity, handler); - DependencyInjectionService.getInstance().inject(this); - } - - public void setRestoreTransactionsListener(RestoreTransactionsListener listener) { - this.restoreTransactionsListener = listener; - } - - @Override - public void onBillingSupported(boolean supported, String type) { - if (BillingConstants.DEBUG) { - Log.i(TAG, "supported: " + supported); - } - if (type != null && type.equals(BillingConstants.ITEM_TYPE_SUBSCRIPTION)) { - if (supported) { - billingSupportedCallback(); - } else { - billingNotSupportedCallback(); - } - } else { - subscriptionsNotSupportedCallback(); - } - } - - protected abstract void billingSupportedCallback(); - - protected abstract void billingNotSupportedCallback(); - - protected abstract void subscriptionsNotSupportedCallback(); - - - @Override - public void onPurchaseStateChange(PurchaseState purchaseState, final String itemId, - int quantity, long purchaseTime, String developerPayload, final String purchaseToken) { - if (BillingConstants.DEBUG) { - Log.i(TAG, "onPurchaseStateChange() itemId: " + itemId + " " + purchaseState); - } - - Preferences.setString(BillingConstants.PREF_PRODUCT_ID, itemId); - Preferences.setString(BillingConstants.PREF_PURCHASE_TOKEN, purchaseToken); - - if (purchaseState == PurchaseState.PURCHASED) { - new Thread() { - @Override - public void run() { - Preferences.setBoolean(ActFmPreferenceService.PREF_LOCAL_PREMIUM, true); - if (actFmPreferenceService.isLoggedIn()) { - actFmSyncService.updateUserSubscriptionStatus(new Runnable() { - @Override - public void run() { // On Success - Preferences.setBoolean(ActFmPreferenceService.PREF_PREMIUM, true); - mActivity.runOnUiThread(new Runnable() { - @Override - public void run() { - DialogUtilities.okDialog(mActivity, mActivity.getString(R.string.DLG_information_title), - 0, mActivity.getString(R.string.premium_success), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - mActivity.finish(); - } - }); - } - }); - } - }, new Runnable() { // On Recoverable error - @Override - public void run() { - mActivity.runOnUiThread(new Runnable() { - @Override - public void run() { - DialogUtilities.okDialog(mActivity, mActivity.getString(R.string.DLG_information_title), - 0, mActivity.getString(R.string.premium_success_with_server_error), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - mActivity.finish(); - } - }); - } - }); - } - }, new Runnable() { // On invalid token - @Override - public void run() { - DialogUtilities.okDialog(mActivity, mActivity.getString(R.string.DLG_information_title), - 0, mActivity.getString(R.string.premium_verification_error), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - mActivity.finish(); - } - }); - } - }); - } else { - Preferences.setBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, true); - } - } - }.start(); - } else if (purchaseState == PurchaseState.REFUNDED) { - new Thread() { - @Override - public void run() { - Preferences.setBoolean(ActFmPreferenceService.PREF_LOCAL_PREMIUM, false); - if (actFmPreferenceService.isLoggedIn()) { - actFmSyncService.updateUserSubscriptionStatus(null, null, null); - } - } - }.start(); - } - } - - @Override - public void onRequestPurchaseResponse(RequestPurchase request, - ResponseCode responseCode) { - if (BillingConstants.DEBUG) { - Log.d(TAG, request.mProductId + ": " + responseCode); - } - if (responseCode == ResponseCode.RESULT_OK) { - if (BillingConstants.DEBUG) { - Log.i(TAG, "purchase was successfully sent to server"); - } - } else if (responseCode == ResponseCode.RESULT_USER_CANCELED) { - if (BillingConstants.DEBUG) { - Log.i(TAG, "user canceled purchase"); - } - } else { - if (BillingConstants.DEBUG) { - Log.i(TAG, "purchase failed"); - } - } - } - - @Override - public void onRestoreTransactionsResponse(RestoreTransactions request, - ResponseCode responseCode) { - if (responseCode == ResponseCode.RESULT_OK) { - if (BillingConstants.DEBUG) { - Log.d(TAG, "completed RestoreTransactions request"); - } - // Update the shared preferences so that we don't perform - // a RestoreTransactions again. - Preferences.setBoolean(BillingConstants.PREF_TRANSACTIONS_INITIALIZED, true); - } else { - if (BillingConstants.DEBUG) { - Log.d(TAG, "RestoreTransactions error: " + responseCode); - } - } - if (restoreTransactionsListener != null) { - restoreTransactionsListener.restoreTransactionsResponse(responseCode); - } - } - -} diff --git a/astrid/src/com/todoroo/astrid/billing/Base64.java b/astrid/src/com/todoroo/astrid/billing/Base64.java deleted file mode 100644 index 077456611..000000000 --- a/astrid/src/com/todoroo/astrid/billing/Base64.java +++ /dev/null @@ -1,571 +0,0 @@ -// Portions copyright 2002, 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.billing; - -// This code was converted from code at http://iharder.sourceforge.net/base64/ -// Lots of extraneous features were removed. -/* The original code said: - *

- * I am placing this code in the Public Domain. Do with it as you will. - * This software comes with no guarantees or warranties but with - * plenty of well-wishing instead! - * Please visit - * http://iharder.net/xmlizable - * periodically to check for updates or to contribute improvements. - *

- * - * @author Robert Harder - * @author rharder@usa.net - * @version 1.3 - */ - -/** - * Base64 converter class. This code is not a complete MIME encoder; - * it simply converts binary data to base64 data and back. - * - *

Note {@link CharBase64} is a GWT-compatible implementation of this - * class. - */ -public class Base64 { - /** Specify encoding (value is {@code true}). */ - public final static boolean ENCODE = true; - - /** Specify decoding (value is {@code false}). */ - public final static boolean DECODE = false; - - /** The equals sign (=) as a byte. */ - private final static byte EQUALS_SIGN = (byte) '='; - - /** The new line character (\n) as a byte. */ - private final static byte NEW_LINE = (byte) '\n'; - - /** - * The 64 valid Base64 values. - */ - private final static byte[] ALPHABET = - {(byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', - (byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', - (byte) 'L', (byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P', - (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U', - (byte) 'V', (byte) 'W', (byte) 'X', (byte) 'Y', (byte) 'Z', - (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', - (byte) 'f', (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j', - (byte) 'k', (byte) 'l', (byte) 'm', (byte) 'n', (byte) 'o', - (byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't', - (byte) 'u', (byte) 'v', (byte) 'w', (byte) 'x', (byte) 'y', - (byte) 'z', (byte) '0', (byte) '1', (byte) '2', (byte) '3', - (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', - (byte) '9', (byte) '+', (byte) '/'}; - - /** - * The 64 valid web safe Base64 values. - */ - private final static byte[] WEBSAFE_ALPHABET = - {(byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', - (byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', - (byte) 'L', (byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P', - (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U', - (byte) 'V', (byte) 'W', (byte) 'X', (byte) 'Y', (byte) 'Z', - (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', - (byte) 'f', (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j', - (byte) 'k', (byte) 'l', (byte) 'm', (byte) 'n', (byte) 'o', - (byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't', - (byte) 'u', (byte) 'v', (byte) 'w', (byte) 'x', (byte) 'y', - (byte) 'z', (byte) '0', (byte) '1', (byte) '2', (byte) '3', - (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', - (byte) '9', (byte) '-', (byte) '_'}; - - /** - * Translates a Base64 value to either its 6-bit reconstruction value - * or a negative number indicating some other meaning. - **/ - private final static byte[] DECODABET = {-9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 0 - 8 - -5, -5, // Whitespace: Tab and Linefeed - -9, -9, // Decimal 11 - 12 - -5, // Whitespace: Carriage Return - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 14 - 26 - -9, -9, -9, -9, -9, // Decimal 27 - 31 - -5, // Whitespace: Space - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 33 - 42 - 62, // Plus sign at decimal 43 - -9, -9, -9, // Decimal 44 - 46 - 63, // Slash at decimal 47 - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, // Numbers zero through nine - -9, -9, -9, // Decimal 58 - 60 - -1, // Equals sign at decimal 61 - -9, -9, -9, // Decimal 62 - 64 - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, // Letters 'A' through 'N' - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // Letters 'O' through 'Z' - -9, -9, -9, -9, -9, -9, // Decimal 91 - 96 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, // Letters 'a' through 'm' - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, // Letters 'n' through 'z' - -9, -9, -9, -9, -9 // Decimal 123 - 127 - /* ,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 128 - 139 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 140 - 152 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 153 - 165 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 166 - 178 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 179 - 191 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 192 - 204 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 205 - 217 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 218 - 230 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 231 - 243 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 // Decimal 244 - 255 */ - }; - - /** The web safe decodabet */ - private final static byte[] WEBSAFE_DECODABET = - {-9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 0 - 8 - -5, -5, // Whitespace: Tab and Linefeed - -9, -9, // Decimal 11 - 12 - -5, // Whitespace: Carriage Return - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 14 - 26 - -9, -9, -9, -9, -9, // Decimal 27 - 31 - -5, // Whitespace: Space - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 33 - 44 - 62, // Dash '-' sign at decimal 45 - -9, -9, // Decimal 46-47 - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, // Numbers zero through nine - -9, -9, -9, // Decimal 58 - 60 - -1, // Equals sign at decimal 61 - -9, -9, -9, // Decimal 62 - 64 - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, // Letters 'A' through 'N' - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // Letters 'O' through 'Z' - -9, -9, -9, -9, // Decimal 91-94 - 63, // Underscore '_' at decimal 95 - -9, // Decimal 96 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, // Letters 'a' through 'm' - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, // Letters 'n' through 'z' - -9, -9, -9, -9, -9 // Decimal 123 - 127 - /* ,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 128 - 139 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 140 - 152 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 153 - 165 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 166 - 178 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 179 - 191 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 192 - 204 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 205 - 217 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 218 - 230 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 231 - 243 - -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 // Decimal 244 - 255 */ - }; - - // Indicates white space in encoding - private final static byte WHITE_SPACE_ENC = -5; - // Indicates equals sign in encoding - private final static byte EQUALS_SIGN_ENC = -1; - - /** Defeats instantiation. */ - private Base64() { - } - - /* ******** E N C O D I N G M E T H O D S ******** */ - - /** - * Encodes up to three bytes of the array source - * and writes the resulting four Base64 bytes to destination. - * The source and destination arrays can be manipulated - * anywhere along their length by specifying - * srcOffset and destOffset. - * This method does not check to make sure your arrays - * are large enough to accommodate srcOffset + 3 for - * the source array or destOffset + 4 for - * the destination array. - * The actual number of significant bytes in your array is - * given by numSigBytes. - * - * @param source the array to convert - * @param srcOffset the index where conversion begins - * @param numSigBytes the number of significant bytes in your array - * @param destination the array to hold the conversion - * @param destOffset the index where output will be put - * @param alphabet is the encoding alphabet - * @return the destination array - * @since 1.3 - */ - private static byte[] encode3to4(byte[] source, int srcOffset, - int numSigBytes, byte[] destination, int destOffset, byte[] alphabet) { - // 1 2 3 - // 01234567890123456789012345678901 Bit position - // --------000000001111111122222222 Array position from threeBytes - // --------| || || || | Six bit groups to index alphabet - // >>18 >>12 >> 6 >> 0 Right shift necessary - // 0x3f 0x3f 0x3f Additional AND - - // Create buffer with zero-padding if there are only one or two - // significant bytes passed in the array. - // We have to shift left 24 in order to flush out the 1's that appear - // when Java treats a value as negative that is cast from a byte to an int. - int inBuff = - (numSigBytes > 0 ? ((source[srcOffset] << 24) >>> 8) : 0) - | (numSigBytes > 1 ? ((source[srcOffset + 1] << 24) >>> 16) : 0) - | (numSigBytes > 2 ? ((source[srcOffset + 2] << 24) >>> 24) : 0); - - switch (numSigBytes) { - case 3: - destination[destOffset] = alphabet[(inBuff >>> 18)]; - destination[destOffset + 1] = alphabet[(inBuff >>> 12) & 0x3f]; - destination[destOffset + 2] = alphabet[(inBuff >>> 6) & 0x3f]; - destination[destOffset + 3] = alphabet[(inBuff) & 0x3f]; - return destination; - case 2: - destination[destOffset] = alphabet[(inBuff >>> 18)]; - destination[destOffset + 1] = alphabet[(inBuff >>> 12) & 0x3f]; - destination[destOffset + 2] = alphabet[(inBuff >>> 6) & 0x3f]; - destination[destOffset + 3] = EQUALS_SIGN; - return destination; - case 1: - destination[destOffset] = alphabet[(inBuff >>> 18)]; - destination[destOffset + 1] = alphabet[(inBuff >>> 12) & 0x3f]; - destination[destOffset + 2] = EQUALS_SIGN; - destination[destOffset + 3] = EQUALS_SIGN; - return destination; - default: - return destination; - } // end switch - } // end encode3to4 - - /** - * Encodes a byte array into Base64 notation. - * Equivalent to calling - * {@code encodeBytes(source, 0, source.length)} - * - * @param source The data to convert - * @since 1.4 - */ - public static String encode(byte[] source) { - return encode(source, 0, source.length, ALPHABET, true); - } - - /** - * Encodes a byte array into web safe Base64 notation. - * - * @param source The data to convert - * @param doPadding is {@code true} to pad result with '=' chars - * if it does not fall on 3 byte boundaries - */ - public static String encodeWebSafe(byte[] source, boolean doPadding) { - return encode(source, 0, source.length, WEBSAFE_ALPHABET, doPadding); - } - - /** - * Encodes a byte array into Base64 notation. - * - * @param source the data to convert - * @param off offset in array where conversion should begin - * @param len length of data to convert - * @param alphabet the encoding alphabet - * @param doPadding is {@code true} to pad result with '=' chars - * if it does not fall on 3 byte boundaries - * @since 1.4 - */ - public static String encode(byte[] source, int off, int len, byte[] alphabet, - boolean doPadding) { - byte[] outBuff = encode(source, off, len, alphabet, Integer.MAX_VALUE); - int outLen = outBuff.length; - - // If doPadding is false, set length to truncate '=' - // padding characters - while (doPadding == false && outLen > 0) { - if (outBuff[outLen - 1] != '=') { - break; - } - outLen -= 1; - } - - return new String(outBuff, 0, outLen); - } - - /** - * Encodes a byte array into Base64 notation. - * - * @param source the data to convert - * @param off offset in array where conversion should begin - * @param len length of data to convert - * @param alphabet is the encoding alphabet - * @param maxLineLength maximum length of one line. - * @return the BASE64-encoded byte array - */ - public static byte[] encode(byte[] source, int off, int len, byte[] alphabet, - int maxLineLength) { - int lenDiv3 = (len + 2) / 3; // ceil(len / 3) - int len43 = lenDiv3 * 4; - byte[] outBuff = new byte[len43 // Main 4:3 - + (len43 / maxLineLength)]; // New lines - - int d = 0; - int e = 0; - int len2 = len - 2; - int lineLength = 0; - for (; d < len2; d += 3, e += 4) { - - // The following block of code is the same as - // encode3to4( source, d + off, 3, outBuff, e, alphabet ); - // but inlined for faster encoding (~20% improvement) - int inBuff = - ((source[d + off] << 24) >>> 8) - | ((source[d + 1 + off] << 24) >>> 16) - | ((source[d + 2 + off] << 24) >>> 24); - outBuff[e] = alphabet[(inBuff >>> 18)]; - outBuff[e + 1] = alphabet[(inBuff >>> 12) & 0x3f]; - outBuff[e + 2] = alphabet[(inBuff >>> 6) & 0x3f]; - outBuff[e + 3] = alphabet[(inBuff) & 0x3f]; - - lineLength += 4; - if (lineLength == maxLineLength) { - outBuff[e + 4] = NEW_LINE; - e++; - lineLength = 0; - } // end if: end of line - } // end for: each piece of array - - if (d < len) { - encode3to4(source, d + off, len - d, outBuff, e, alphabet); - - lineLength += 4; - if (lineLength == maxLineLength) { - // Add a last newline - outBuff[e + 4] = NEW_LINE; - e++; - } - e += 4; - } - - assert (e == outBuff.length); - return outBuff; - } - - - /* ******** D E C O D I N G M E T H O D S ******** */ - - - /** - * Decodes four bytes from array source - * and writes the resulting bytes (up to three of them) - * to destination. - * The source and destination arrays can be manipulated - * anywhere along their length by specifying - * srcOffset and destOffset. - * This method does not check to make sure your arrays - * are large enough to accommodate srcOffset + 4 for - * the source array or destOffset + 3 for - * the destination array. - * This method returns the actual number of bytes that - * were converted from the Base64 encoding. - * - * - * @param source the array to convert - * @param srcOffset the index where conversion begins - * @param destination the array to hold the conversion - * @param destOffset the index where output will be put - * @param decodabet the decodabet for decoding Base64 content - * @return the number of decoded bytes converted - * @since 1.3 - */ - private static int decode4to3(byte[] source, int srcOffset, - byte[] destination, int destOffset, byte[] decodabet) { - // Example: Dk== - if (source[srcOffset + 2] == EQUALS_SIGN) { - int outBuff = - ((decodabet[source[srcOffset]] << 24) >>> 6) - | ((decodabet[source[srcOffset + 1]] << 24) >>> 12); - - destination[destOffset] = (byte) (outBuff >>> 16); - return 1; - } else if (source[srcOffset + 3] == EQUALS_SIGN) { - // Example: DkL= - int outBuff = - ((decodabet[source[srcOffset]] << 24) >>> 6) - | ((decodabet[source[srcOffset + 1]] << 24) >>> 12) - | ((decodabet[source[srcOffset + 2]] << 24) >>> 18); - - destination[destOffset] = (byte) (outBuff >>> 16); - destination[destOffset + 1] = (byte) (outBuff >>> 8); - return 2; - } else { - // Example: DkLE - int outBuff = - ((decodabet[source[srcOffset]] << 24) >>> 6) - | ((decodabet[source[srcOffset + 1]] << 24) >>> 12) - | ((decodabet[source[srcOffset + 2]] << 24) >>> 18) - | ((decodabet[source[srcOffset + 3]] << 24) >>> 24); - - destination[destOffset] = (byte) (outBuff >> 16); - destination[destOffset + 1] = (byte) (outBuff >> 8); - destination[destOffset + 2] = (byte) (outBuff); - return 3; - } - } // end decodeToBytes - - - /** - * Decodes data from Base64 notation. - * - * @param s the string to decode (decoded in default encoding) - * @return the decoded data - * @since 1.4 - */ - public static byte[] decode(String s) throws Base64DecoderException { - byte[] bytes = s.getBytes(); - return decode(bytes, 0, bytes.length); - } - - /** - * Decodes data from web safe Base64 notation. - * Web safe encoding uses '-' instead of '+', '_' instead of '/' - * - * @param s the string to decode (decoded in default encoding) - * @return the decoded data - */ - public static byte[] decodeWebSafe(String s) throws Base64DecoderException { - byte[] bytes = s.getBytes(); - return decodeWebSafe(bytes, 0, bytes.length); - } - - /** - * Decodes Base64 content in byte array format and returns - * the decoded byte array. - * - * @param source The Base64 encoded data - * @return decoded data - * @since 1.3 - * @throws Base64DecoderException - */ - public static byte[] decode(byte[] source) throws Base64DecoderException { - return decode(source, 0, source.length); - } - - /** - * Decodes web safe Base64 content in byte array format and returns - * the decoded data. - * Web safe encoding uses '-' instead of '+', '_' instead of '/' - * - * @param source the string to decode (decoded in default encoding) - * @return the decoded data - */ - public static byte[] decodeWebSafe(byte[] source) - throws Base64DecoderException { - return decodeWebSafe(source, 0, source.length); - } - - /** - * Decodes Base64 content in byte array format and returns - * the decoded byte array. - * - * @param source the Base64 encoded data - * @param off the offset of where to begin decoding - * @param len the length of characters to decode - * @return decoded data - * @since 1.3 - * @throws Base64DecoderException - */ - public static byte[] decode(byte[] source, int off, int len) - throws Base64DecoderException { - return decode(source, off, len, DECODABET); - } - - /** - * Decodes web safe Base64 content in byte array format and returns - * the decoded byte array. - * Web safe encoding uses '-' instead of '+', '_' instead of '/' - * - * @param source the Base64 encoded data - * @param off the offset of where to begin decoding - * @param len the length of characters to decode - * @return decoded data - */ - public static byte[] decodeWebSafe(byte[] source, int off, int len) - throws Base64DecoderException { - return decode(source, off, len, WEBSAFE_DECODABET); - } - - /** - * Decodes Base64 content using the supplied decodabet and returns - * the decoded byte array. - * - * @param source the Base64 encoded data - * @param off the offset of where to begin decoding - * @param len the length of characters to decode - * @param decodabet the decodabet for decoding Base64 content - * @return decoded data - */ - @SuppressWarnings("nls") - public static byte[] decode(byte[] source, int off, int len, byte[] decodabet) - throws Base64DecoderException { - int len34 = len * 3 / 4; - byte[] outBuff = new byte[2 + len34]; // Upper limit on size of output - int outBuffPosn = 0; - - byte[] b4 = new byte[4]; - int b4Posn = 0; - int i = 0; - byte sbiCrop = 0; - byte sbiDecode = 0; - for (i = 0; i < len; i++) { - sbiCrop = (byte) (source[i + off] & 0x7f); // Only the low seven bits - sbiDecode = decodabet[sbiCrop]; - - if (sbiDecode >= WHITE_SPACE_ENC) { // White space Equals sign or better - if (sbiDecode >= EQUALS_SIGN_ENC) { - // An equals sign (for padding) must not occur at position 0 or 1 - // and must be the last byte[s] in the encoded value - if (sbiCrop == EQUALS_SIGN) { - int bytesLeft = len - i; - byte lastByte = (byte) (source[len - 1 + off] & 0x7f); - if (b4Posn == 0 || b4Posn == 1) { - throw new Base64DecoderException( - "invalid padding byte '=' at byte offset " + i); - } else if ((b4Posn == 3 && bytesLeft > 2) - || (b4Posn == 4 && bytesLeft > 1)) { - throw new Base64DecoderException( - "padding byte '=' falsely signals end of encoded value " - + "at offset " + i); - } else if (lastByte != EQUALS_SIGN && lastByte != NEW_LINE) { - throw new Base64DecoderException( - "encoded value has invalid trailing byte"); - } - break; - } - - b4[b4Posn++] = sbiCrop; - if (b4Posn == 4) { - outBuffPosn += decode4to3(b4, 0, outBuff, outBuffPosn, decodabet); - b4Posn = 0; - } - } - } else { - throw new Base64DecoderException("Bad Base64 input character at " + i - + ": " + source[i + off] + "(decimal)"); - } - } - - // Because web safe encoding allows non padding base64 encodes, we - // need to pad the rest of the b4 buffer with equal signs when - // b4Posn != 0. There can be at most 2 equal signs at the end of - // four characters, so the b4 buffer must have two or three - // characters. This also catches the case where the input is - // padded with EQUALS_SIGN - if (b4Posn != 0) { - if (b4Posn == 1) { - throw new Base64DecoderException("single trailing character at offset " - + (len - 1)); - } - b4[b4Posn++] = EQUALS_SIGN; - outBuffPosn += decode4to3(b4, 0, outBuff, outBuffPosn, decodabet); - } - - byte[] out = new byte[outBuffPosn]; - System.arraycopy(outBuff, 0, out, 0, outBuffPosn); - return out; - } -} diff --git a/astrid/src/com/todoroo/astrid/billing/Base64DecoderException.java b/astrid/src/com/todoroo/astrid/billing/Base64DecoderException.java deleted file mode 100644 index af51d1c0f..000000000 --- a/astrid/src/com/todoroo/astrid/billing/Base64DecoderException.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2002, 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.billing; - -/** - * Exception thrown when encountering an invalid Base64 input character. - * - * @author nelson - */ -public class Base64DecoderException extends Exception { - public Base64DecoderException() { - super(); - } - - public Base64DecoderException(String s) { - super(s); - } - - private static final long serialVersionUID = 1L; -} diff --git a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java deleted file mode 100644 index 8947b19ca..000000000 --- a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java +++ /dev/null @@ -1,323 +0,0 @@ -package com.todoroo.astrid.billing; - -import java.util.Locale; - -import android.app.AlertDialog; -import android.app.Dialog; -import android.app.ProgressDialog; -import android.content.DialogInterface; -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.os.Handler; -import android.text.Html; -import android.text.Spanned; -import android.util.DisplayMetrics; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.webkit.WebView; -import android.widget.Button; -import android.widget.ImageView; -import android.widget.ImageView.ScaleType; -import android.widget.LinearLayout; -import android.widget.TextView; - -import com.actionbarsherlock.app.ActionBar; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.MenuItem; -import com.timsu.astrid.R; -import com.todoroo.andlib.service.Autowired; -import com.todoroo.andlib.service.DependencyInjectionService; -import com.todoroo.andlib.utility.DialogUtilities; -import com.todoroo.andlib.utility.Preferences; -import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; -import com.todoroo.astrid.billing.BillingConstants.ResponseCode; -import com.todoroo.astrid.service.ThemeService; - -public class BillingActivity extends SherlockFragmentActivity implements AstridPurchaseObserver.RestoreTransactionsListener { - - private static final int DIALOG_CANNOT_CONNECT_ID = 1; - private static final int DIALOG_BILLING_NOT_SUPPORTED_ID = 2; - private static final int DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID = 3; - - private Handler handler; - private BillingService billingService; - private AstridPurchaseObserver purchaseObserver; - private Button buyMonth; - private Button buyYear; - private TextView restorePurchases; - - private ProgressDialog restoreTransactionsDialog; - - @Autowired private ActFmPreferenceService actFmPreferenceService; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - ThemeService.applyTheme(this); - DependencyInjectionService.getInstance().inject(this); - super.onCreate(savedInstanceState); - setContentView(R.layout.billing_activity); - - setupActionBar(); - - setupButtons(); - - setupText(); - - handler = new Handler(); - billingService = new BillingService(); - billingService.setContext(this); - purchaseObserver = new AstridPurchaseObserver(this, handler) { - @Override - protected void billingSupportedCallback() { - restoreTransactions(false); - buyMonth.setEnabled(true); - buyYear.setEnabled(true); - restorePurchases.setEnabled(true); - } - - @Override - protected void billingNotSupportedCallback() { - showDialog(DIALOG_BILLING_NOT_SUPPORTED_ID); - } - - @Override - protected void subscriptionsNotSupportedCallback() { - showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); - } - }; - purchaseObserver.setRestoreTransactionsListener(this); - } - - private void setupActionBar() { - ActionBar actionBar = getSupportActionBar(); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowTitleEnabled(false); - - actionBar.setDisplayShowCustomEnabled(true); - actionBar.setCustomView(R.layout.header_title_view); - ((TextView) actionBar.getCustomView().findViewById(R.id.title)).setText(R.string.premium_billing_title); - } - - @Override - protected void onStart() { - super.onStart(); - ResponseHandler.register(purchaseObserver); - } - - @Override - protected void onStop() { - super.onStop(); - ResponseHandler.unregister(purchaseObserver); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - billingService.unbind(); - } - - @Override - protected void onResume() { - super.onResume(); - if (!actFmPreferenceService.isLoggedIn()) { - // Prompt to log in, but this shouldn't happen anyways since we hide the entry path to this screen when not logged in - DialogUtilities.okDialog(this, getString(R.string.premium_login_prompt), - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - finish(); - } - }); - } else if (!billingService.checkBillingSupported(BillingConstants.ITEM_TYPE_SUBSCRIPTION)) { - showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); - } else if (ActFmPreferenceService.isPremiumUser()) { - DialogUtilities.okDialog(this, getString(R.string.premium_already_subscribed), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - finish(); - } - }); - } - } - - private void setupButtons() { - buyMonth = (Button) findViewById(R.id.premium_buy_month); - buyYear = (Button) findViewById(R.id.premium_buy_year); - restorePurchases = (TextView) findViewById(R.id.check_for_purchases); - - buyMonth.setEnabled(false); - buyYear.setEnabled(false); - restorePurchases.setEnabled(false); - - if (!Preferences.getBoolean(BillingConstants.PREF_TRANSACTIONS_INITIALIZED, false)) { - restorePurchases.setVisibility(View.GONE); - } - - buyMonth.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (!billingService.requestPurchase(BillingConstants.PRODUCT_ID_MONTHLY, - BillingConstants.ITEM_TYPE_SUBSCRIPTION, null)) { - showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); - } - } - }); - - buyYear.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (!billingService.requestPurchase(BillingConstants.PRODUCT_ID_YEARLY, - BillingConstants.ITEM_TYPE_SUBSCRIPTION, null)) { - showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); - } - } - }); - - restorePurchases.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - restoreTransactions(true); - } - }); - } - - @SuppressWarnings("nls") - private void setupText() { - int[] bullets = new int[] { R.string.premium_description_1, /* R.string.premium_description_2,*/ R.string.premium_description_3, - R.string.premium_description_4, R.string.premium_description_5, R.string.premium_description_6 - }; - - StringBuilder builder = new StringBuilder("

    "); - - for (int i = 0; i < bullets.length; i++) { - String curr = getString(bullets[i]); - if (curr.contains("\n")) { - curr = curr.replace("\n", "
    "); - } - builder.append("
  • ").append(curr); - - builder.append("
  • \n"); - } - - builder.append("
"); - - WebView list = (WebView) findViewById(R.id.premium_bullets); - list.loadDataWithBaseURL("file:///android_asset/", builder.toString(), "text/html", "utf-8", null); - list.setBackgroundColor(0); - - View speechBubbleBackground = findViewById(R.id.speech_bubble_container); - speechBubbleBackground.setBackgroundColor(0); - - DisplayMetrics metrics = getResources().getDisplayMetrics(); - ImageView icon = (ImageView) findViewById(R.id.astridIcon); - - int dim = (int) (80 * metrics.density); - icon.setLayoutParams(new LinearLayout.LayoutParams(dim, dim)); - icon.setScaleType(ScaleType.FIT_CENTER); - - TextView speechBubble = (TextView) findViewById(R.id.reminder_message); - - // Construct speech bubble text - String html = String.format("%s %s", - getString(R.string.premium_speech_bubble_1), - Integer.toHexString(getResources().getColor(R.color.red_theme_color) - 0xff000000), - getString(R.string.premium_speech_bubble_2)); - Spanned spanned = Html.fromHtml(html); - speechBubble.setText(spanned); - speechBubble.setTextSize(17); - } - - /** - * Replaces the language and/or country of the device into the given string. - * The pattern "%lang%" will be replaced by the device's language code and - * the pattern "%region%" will be replaced with the device's country code. - * - * @param str the string to replace the language/country within - * @return a string containing the local language and region codes - */ - @SuppressWarnings("nls") - private String replaceLanguageAndRegion(String str) { - // Substitute language and or region if present in string - if (str.contains("%lang%") || str.contains("%region%")) { - Locale locale = Locale.getDefault(); - str = str.replace("%lang%", locale.getLanguage().toLowerCase()); - str = str.replace("%region%", locale.getCountry().toLowerCase()); - } - return str; - } - - @Override - protected Dialog onCreateDialog(int id) { - switch (id) { - case DIALOG_CANNOT_CONNECT_ID: - return createDialog(R.string.cannot_connect_title, - R.string.cannot_connect_message); - case DIALOG_BILLING_NOT_SUPPORTED_ID: - return createDialog(R.string.billing_not_supported_title, - R.string.billing_not_supported_message); - case DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID: - return createDialog(R.string.subscriptions_not_supported_title, - R.string.subscriptions_not_supported_message); - default: - return null; - } - } - - @SuppressWarnings("nls") - private Dialog createDialog(int titleId, int messageId) { - String helpUrl = "http://market.android.com/support/bin/answer.py?answer=1050566&hl=%lang%&dl=%region%"; - helpUrl = replaceLanguageAndRegion(helpUrl); - if (BillingConstants.DEBUG) { - Log.i("billing-activity-url", helpUrl); //$NON-NLS-1$ - } - final Uri helpUri = Uri.parse(helpUrl); - - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(titleId) - .setIcon(android.R.drawable.stat_sys_warning) - .setMessage(messageId) - .setCancelable(false) - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - finish(); - } - }) - .setNegativeButton(R.string.subscriptions_learn_more, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - Intent intent = new Intent(Intent.ACTION_VIEW, helpUri); - startActivity(intent); - } - }); - return builder.create(); - } - - private void restoreTransactions(boolean force) { - boolean initialized = Preferences.getBoolean(BillingConstants.PREF_TRANSACTIONS_INITIALIZED, false); - if (!initialized || force) { - billingService.restoreTransactions(); - } - if (force) { - restoreTransactionsDialog = DialogUtilities.progressDialog(this, getString(R.string.premium_checking_for_purchases)); - } - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if (item.getItemId() == android.R.id.home) { - finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - - @Override - public void restoreTransactionsResponse(ResponseCode responseCode) { - DialogUtilities.dismissDialog(this, restoreTransactionsDialog); - restoreTransactionsDialog = null; - } -} diff --git a/astrid/src/com/todoroo/astrid/billing/BillingConstants.java b/astrid/src/com/todoroo/astrid/billing/BillingConstants.java deleted file mode 100644 index 464554f22..000000000 --- a/astrid/src/com/todoroo/astrid/billing/BillingConstants.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.todoroo.astrid.billing; - -import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; -import com.todoroo.astrid.utility.Constants; - - -@SuppressWarnings("nls") -public class BillingConstants { - - /** This is the action we use to bind to the MarketBillingService. */ - public static final String MARKET_BILLING_SERVICE_ACTION = "com.android.vending.billing.MarketBillingService.BIND"; - - // Intent actions that we send from the BillingReceiver to the - // BillingService. Defined by this application. - public static final String ACTION_CONFIRM_NOTIFICATION = "com.timsu.astrid.subscriptions.CONFIRM_NOTIFICATION"; - public static final String ACTION_GET_PURCHASE_INFORMATION = "com.timsu.astrid.subscriptions.GET_PURCHASE_INFORMATION"; - public static final String ACTION_RESTORE_TRANSACTIONS = "com.timsu.astrid.subscriptions.RESTORE_TRANSACTIONS"; - - // Intent actions that we receive in the BillingReceiver from Market. - // These are defined by Market and cannot be changed. - public static final String ACTION_NOTIFY = "com.android.vending.billing.IN_APP_NOTIFY"; - public static final String ACTION_RESPONSE_CODE = "com.android.vending.billing.RESPONSE_CODE"; - public static final String ACTION_PURCHASE_STATE_CHANGED = "com.android.vending.billing.PURCHASE_STATE_CHANGED"; - - // These are the names of the extras that are passed in an intent from - // Market to this application and cannot be changed. - public static final String NOTIFICATION_ID = "notification_id"; - public static final String INAPP_SIGNED_DATA = "inapp_signed_data"; - public static final String INAPP_SIGNATURE = "inapp_signature"; - public static final String INAPP_REQUEST_ID = "request_id"; - public static final String INAPP_RESPONSE_CODE = "response_code"; - - // These are the names of the fields in the request bundle. - public static final String BILLING_REQUEST_METHOD = "BILLING_REQUEST"; - public static final String BILLING_REQUEST_API_VERSION = "API_VERSION"; - public static final String BILLING_REQUEST_PACKAGE_NAME = "PACKAGE_NAME"; - public static final String BILLING_REQUEST_ITEM_ID = "ITEM_ID"; - public static final String BILLING_REQUEST_ITEM_TYPE = "ITEM_TYPE"; - public static final String BILLING_REQUEST_DEVELOPER_PAYLOAD = "DEVELOPER_PAYLOAD"; - public static final String BILLING_REQUEST_NOTIFY_IDS = "NOTIFY_IDS"; - public static final String BILLING_REQUEST_NONCE = "NONCE"; - - public static final String BILLING_RESPONSE_RESPONSE_CODE = "RESPONSE_CODE"; - public static final String BILLING_RESPONSE_PURCHASE_INTENT = "PURCHASE_INTENT"; - public static final String BILLING_RESPONSE_REQUEST_ID = "REQUEST_ID"; - public static final long BILLING_RESPONSE_INVALID_REQUEST_ID = -1; - - // These are the types supported in the IAB v2 - public static final String ITEM_TYPE_INAPP = "inapp"; - public static final String ITEM_TYPE_SUBSCRIPTION = "subs"; - - - public static final String PRODUCT_ID_MONTHLY = "com.timsu.astrid.premium_monthly"; - public static final String PRODUCT_ID_YEARLY = "com.timsu.astrid.premium_yearly"; - - public static final String PREF_PRODUCT_ID = ActFmPreferenceService.IDENTIFIER + "_inapp_product_id"; - public static final String PREF_PURCHASE_TOKEN = ActFmPreferenceService.IDENTIFIER + "_inapp_purchase_token"; - public static final String PREF_NEEDS_SERVER_UPDATE = ActFmPreferenceService.IDENTIFIER + "_inapp_needs_server_update"; - public static final String PREF_TRANSACTIONS_INITIALIZED = "premium_transactions_initialized"; //$NON-NLS-1$ - - public static final char PUB_KEY_OBFUSCATION_CHAR = '!'; - public static final char PUB_KEY_REPLACE_CHAR = 'B'; - public static final String PUB_KEY_OBFUSCATED = "pubkey"; - - public static final boolean DEBUG = false || Constants.DEBUG; - - // The response codes for a request, defined by Android Market. - public enum ResponseCode { - RESULT_OK, - RESULT_USER_CANCELED, - RESULT_SERVICE_UNAVAILABLE, - RESULT_BILLING_UNAVAILABLE, - RESULT_ITEM_UNAVAILABLE, - RESULT_DEVELOPER_ERROR, - RESULT_ERROR; - - // Converts from an ordinal value to the ResponseCode - public static ResponseCode valueOf(int index) { - ResponseCode[] values = ResponseCode.values(); - if (index < 0 || index >= values.length) { - return RESULT_ERROR; - } - return values[index]; - } - } - - // The possible states of an in-app purchase, as defined by Android Market. - public enum PurchaseState { - // Responses to requestPurchase or restoreTransactions. - PURCHASED, // User was charged for the order. - CANCELED, // The charge failed on the server. (NOT THE SAME AS CANCELING A SUBSCRIPTION) - REFUNDED, // User received a refund for the order. - EXPIRED; // Subscription expired due to non-payment or cancellation - - // Converts from an ordinal value to the PurchaseState - public static PurchaseState valueOf(int index) { - PurchaseState[] values = PurchaseState.values(); - if (index < 0 || index >= values.length) { - return CANCELED; - } - return values[index]; - } - } -} diff --git a/astrid/src/com/todoroo/astrid/billing/BillingReceiver.java b/astrid/src/com/todoroo/astrid/billing/BillingReceiver.java deleted file mode 100644 index 81602c520..000000000 --- a/astrid/src/com/todoroo/astrid/billing/BillingReceiver.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.todoroo.astrid.billing; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -import com.todoroo.astrid.billing.BillingConstants.ResponseCode; - -public class BillingReceiver extends BroadcastReceiver { - private static final String TAG = "billing-receiver"; //$NON-NLS-1$ - - /** - * This is the entry point for all asynchronous messages sent from Android Market to - * the application. This method forwards the messages on to the - * {@link BillingService}, which handles the communication back to Android Market. - * The {@link BillingService} also reports state changes back to the application through - * the {@link ResponseHandler}. - */ - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - if (BillingConstants.ACTION_PURCHASE_STATE_CHANGED.equals(action)) { - String signedData = intent.getStringExtra(BillingConstants.INAPP_SIGNED_DATA); - String signature = intent.getStringExtra(BillingConstants.INAPP_SIGNATURE); - purchaseStateChanged(context, signedData, signature); - } else if (BillingConstants.ACTION_NOTIFY.equals(action)) { - String notifyId = intent.getStringExtra(BillingConstants.NOTIFICATION_ID); - if (BillingConstants.DEBUG) { - Log.i(TAG, "notifyId: " + notifyId); //$NON-NLS-1$ - } - notify(context, notifyId); - } else if (BillingConstants.ACTION_RESPONSE_CODE.equals(action)) { - long requestId = intent.getLongExtra(BillingConstants.INAPP_REQUEST_ID, -1); - int responseCodeIndex = intent.getIntExtra(BillingConstants.INAPP_RESPONSE_CODE, - ResponseCode.RESULT_ERROR.ordinal()); - checkResponseCode(context, requestId, responseCodeIndex); - } else { - Log.w(TAG, "unexpected action: " + action); //$NON-NLS-1$ - } - } - - /** - * This is called when Android Market sends information about a purchase state - * change. The signedData parameter is a plaintext JSON string that is - * signed by the server with the developer's private key. The signature - * for the signed data is passed in the signature parameter. - * @param context the context - * @param signedData the (unencrypted) JSON string - * @param signature the signature for the signedData - */ - private void purchaseStateChanged(Context context, String signedData, String signature) { - Intent intent = new Intent(BillingConstants.ACTION_PURCHASE_STATE_CHANGED); - intent.setClass(context, BillingService.class); - intent.putExtra(BillingConstants.INAPP_SIGNED_DATA, signedData); - intent.putExtra(BillingConstants.INAPP_SIGNATURE, signature); - context.startService(intent); - } - - /** - * This is called when Android Market sends a "notify" message indicating that transaction - * information is available. The request includes a nonce (random number used once) that - * we generate and Android Market signs and sends back to us with the purchase state and - * other transaction details. This BroadcastReceiver cannot bind to the - * MarketBillingService directly so it starts the {@link BillingService}, which does the - * actual work of sending the message. - * - * @param context the context - * @param notifyId the notification ID - */ - private void notify(Context context, String notifyId) { - Intent intent = new Intent(BillingConstants.ACTION_GET_PURCHASE_INFORMATION); - intent.setClass(context, BillingService.class); - intent.putExtra(BillingConstants.NOTIFICATION_ID, notifyId); - context.startService(intent); - } - - /** - * This is called when Android Market sends a server response code. The BillingService can - * then report the status of the response if desired. - * - * @param context the context - * @param requestId the request ID that corresponds to a previous request - * @param responseCodeIndex the ResponseCode ordinal value for the request - */ - private void checkResponseCode(Context context, long requestId, int responseCodeIndex) { - Intent intent = new Intent(BillingConstants.ACTION_RESPONSE_CODE); - intent.setClass(context, BillingService.class); - intent.putExtra(BillingConstants.INAPP_REQUEST_ID, requestId); - intent.putExtra(BillingConstants.INAPP_RESPONSE_CODE, responseCodeIndex); - context.startService(intent); - } -} diff --git a/astrid/src/com/todoroo/astrid/billing/BillingService.java b/astrid/src/com/todoroo/astrid/billing/BillingService.java deleted file mode 100644 index 0c6f7ab55..000000000 --- a/astrid/src/com/todoroo/astrid/billing/BillingService.java +++ /dev/null @@ -1,612 +0,0 @@ -package com.todoroo.astrid.billing; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; - -import android.app.PendingIntent; -import android.app.Service; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.os.Bundle; -import android.os.IBinder; -import android.os.RemoteException; -import android.util.Log; - -import com.android.vending.billing.IMarketBillingService; -import com.todoroo.astrid.billing.BillingConstants.PurchaseState; -import com.todoroo.astrid.billing.BillingConstants.ResponseCode; -import com.todoroo.astrid.billing.Security.VerifiedPurchase; - -@SuppressWarnings("nls") -public class BillingService extends Service implements ServiceConnection { - private static final String TAG = "billing-service"; - - /** The service connection to the remote MarketBillingService. */ - private static IMarketBillingService mService; - - /** - * The list of requests that are pending while we are waiting for the - * connection to the MarketBillingService to be established. - */ - private static LinkedList mPendingRequests = new LinkedList(); - - /** - * The list of requests that we have sent to Android Market but for which we have - * not yet received a response code. The HashMap is indexed by the - * request Id that each request receives when it executes. - */ - private static HashMap mSentRequests = - new HashMap(); - - /** - * The base class for all requests that use the MarketBillingService. - * Each derived class overrides the run() method to call the appropriate - * service interface. If we are already connected to the MarketBillingService, - * then we call the run() method directly. Otherwise, we bind - * to the service and save the request on a queue to be run later when - * the service is connected. - */ - abstract class BillingRequest { - private final int mStartId; - protected long mRequestId; - - public BillingRequest(int startId) { - mStartId = startId; - } - - public int getStartId() { - return mStartId; - } - - /** - * Run the request, starting the connection if necessary. - * @return true if the request was executed or queued; false if there - * was an error starting the connection - */ - public boolean runRequest() { - if (runIfConnected()) { - return true; - } - - if (bindToMarketBillingService()) { - // Add a pending request to run when the service is connected. - mPendingRequests.add(this); - return true; - } - return false; - } - - /** - * Try running the request directly if the service is already connected. - * @return true if the request ran successfully; false if the service - * is not connected or there was an error when trying to use it - */ - public boolean runIfConnected() { - if (BillingConstants.DEBUG) { - Log.d(TAG, getClass().getSimpleName()); - } - if (mService != null) { - try { - mRequestId = run(); - if (BillingConstants.DEBUG) { - Log.d(TAG, "request id: " + mRequestId); - } - if (mRequestId >= 0) { - mSentRequests.put(mRequestId, this); - } - return true; - } catch (RemoteException e) { - onRemoteException(e); - } - } - return false; - } - - /** - * Called when a remote exception occurs while trying to execute the - * {@link #run()} method. The derived class can override this to - * execute exception-handling code. - * @param e the exception - */ - protected void onRemoteException(RemoteException e) { - Log.w(TAG, "remote billing service crashed"); - mService = null; - } - - /** - * The derived class must implement this method. - * @throws RemoteException - */ - abstract protected long run() throws RemoteException; - - /** - * This is called when Android Market sends a response code for this - * request. - * @param responseCode the response code - */ - protected void responseCodeReceived(ResponseCode responseCode) { - // - } - - protected Bundle makeRequestBundle(String method) { - Bundle request = new Bundle(); - request.putString(BillingConstants.BILLING_REQUEST_METHOD, method); - request.putInt(BillingConstants.BILLING_REQUEST_API_VERSION, 2); - request.putString(BillingConstants.BILLING_REQUEST_PACKAGE_NAME, getPackageName()); - return request; - } - - protected void logResponseCode(String method, Bundle response) { - ResponseCode responseCode = ResponseCode.valueOf( - response.getInt(BillingConstants.BILLING_RESPONSE_RESPONSE_CODE)); - if (BillingConstants.DEBUG) { - Log.e(TAG, method + " received " + responseCode.toString()); - } - } - } - - /** - * Wrapper class that checks if in-app billing is supported. - * - * Note: Support for subscriptions implies support for one-time purchases. However, the opposite - * is not true. - * - * Developers may want to perform two checks if both one-time and subscription products are - * available. - */ - class CheckBillingSupported extends BillingRequest { - public String mProductType = null; - - /** Constructor - * - * Note: Support for subscriptions implies support for one-time purchases. However, the - * opposite is not true. - * - * Developers may want to perform two checks if both one-time and subscription products are - * available. - * - * @pram itemType Either BillingConstants.ITEM_TYPE_INAPP or BillingConstants.ITEM_TYPE_SUBSCRIPTION, indicating - * the type of item support is being checked for. - */ - public CheckBillingSupported(String itemType) { - super(-1); - mProductType = itemType; - } - - @Override - protected long run() throws RemoteException { - Bundle request = makeRequestBundle("CHECK_BILLING_SUPPORTED"); - if (mProductType != null) { - request.putString(BillingConstants.BILLING_REQUEST_ITEM_TYPE, mProductType); - } - Bundle response = mService.sendBillingRequest(request); - int responseCode = response.getInt(BillingConstants.BILLING_RESPONSE_RESPONSE_CODE); - if (BillingConstants.DEBUG) { - Log.i(TAG, "CheckBillingSupported response code: " + - ResponseCode.valueOf(responseCode)); - } - boolean billingSupported = (responseCode == ResponseCode.RESULT_OK.ordinal()); - ResponseHandler.checkBillingSupportedResponse(billingSupported, mProductType); - return BillingConstants.BILLING_RESPONSE_INVALID_REQUEST_ID; - } - } - - /** - * Wrapper class that requests a purchase. - */ - class RequestPurchase extends BillingRequest { - public final String mProductId; - public final String mDeveloperPayload; - public final String mProductType; - - /** Constructor - * - * @param itemId The ID of the item to be purchased. Will be assumed to be a one-time - * purchase. - * @param itemType Either BillingConstants.ITEM_TYPE_INAPP or BillingConstants.ITEM_TYPE_SUBSCRIPTION, - * indicating the type of item type support is being checked for. - * @param developerPayload Optional data. - */ - public RequestPurchase(String itemId, String itemType, String developerPayload) { - // This object is never created as a side effect of starting this - // service so we pass -1 as the startId to indicate that we should - // not stop this service after executing this request. - super(-1); - mProductId = itemId; - mDeveloperPayload = developerPayload; - mProductType = itemType; - } - - @Override - protected long run() throws RemoteException { - Bundle request = makeRequestBundle("REQUEST_PURCHASE"); - request.putString(BillingConstants.BILLING_REQUEST_ITEM_ID, mProductId); - request.putString(BillingConstants.BILLING_REQUEST_ITEM_TYPE, mProductType); - // Note that the developer payload is optional. - if (mDeveloperPayload != null) { - request.putString(BillingConstants.BILLING_REQUEST_DEVELOPER_PAYLOAD, mDeveloperPayload); - } - Bundle response = mService.sendBillingRequest(request); - PendingIntent pendingIntent - = response.getParcelable(BillingConstants.BILLING_RESPONSE_PURCHASE_INTENT); - if (pendingIntent == null) { - Log.e(TAG, "Error with requestPurchase"); - return BillingConstants.BILLING_RESPONSE_INVALID_REQUEST_ID; - } - - Intent intent = new Intent(); - ResponseHandler.buyPageIntentResponse(pendingIntent, intent); - return response.getLong(BillingConstants.BILLING_RESPONSE_REQUEST_ID, - BillingConstants.BILLING_RESPONSE_INVALID_REQUEST_ID); - } - - @Override - protected void responseCodeReceived(ResponseCode responseCode) { - ResponseHandler.responseCodeReceived(BillingService.this, this, responseCode); - } - } - - /** - * Wrapper class that confirms a list of notifications to the server. - */ - class ConfirmNotifications extends BillingRequest { - final String[] mNotifyIds; - - public ConfirmNotifications(int startId, String[] notifyIds) { - super(startId); - mNotifyIds = notifyIds; - } - - @Override - protected long run() throws RemoteException { - Bundle request = makeRequestBundle("CONFIRM_NOTIFICATIONS"); - request.putStringArray(BillingConstants.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds); - Bundle response = mService.sendBillingRequest(request); - logResponseCode("confirmNotifications", response); - return response.getLong(BillingConstants.BILLING_RESPONSE_REQUEST_ID, - BillingConstants.BILLING_RESPONSE_INVALID_REQUEST_ID); - } - } - - /** - * Wrapper class that sends a GET_PURCHASE_INFORMATION message to the server. - */ - class GetPurchaseInformation extends BillingRequest { - long mNonce; - final String[] mNotifyIds; - - public GetPurchaseInformation(int startId, String[] notifyIds) { - super(startId); - mNotifyIds = notifyIds; - } - - @Override - protected long run() throws RemoteException { - mNonce = Security.generateNonce(); - - Bundle request = makeRequestBundle("GET_PURCHASE_INFORMATION"); - request.putLong(BillingConstants.BILLING_REQUEST_NONCE, mNonce); - request.putStringArray(BillingConstants.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds); - Bundle response = mService.sendBillingRequest(request); - logResponseCode("getPurchaseInformation", response); - return response.getLong(BillingConstants.BILLING_RESPONSE_REQUEST_ID, - BillingConstants.BILLING_RESPONSE_INVALID_REQUEST_ID); - } - - @Override - protected void onRemoteException(RemoteException e) { - super.onRemoteException(e); - Security.removeNonce(mNonce); - } - } - - /** - * Wrapper class that sends a RESTORE_TRANSACTIONS message to the server. - */ - class RestoreTransactions extends BillingRequest { - long mNonce; - - public RestoreTransactions() { - // This object is never created as a side effect of starting this - // service so we pass -1 as the startId to indicate that we should - // not stop this service after executing this request. - super(-1); - } - - @Override - protected long run() throws RemoteException { - mNonce = Security.generateNonce(); - - Bundle request = makeRequestBundle("RESTORE_TRANSACTIONS"); - request.putLong(BillingConstants.BILLING_REQUEST_NONCE, mNonce); - Bundle response = mService.sendBillingRequest(request); - logResponseCode("restoreTransactions", response); - return response.getLong(BillingConstants.BILLING_RESPONSE_REQUEST_ID, - BillingConstants.BILLING_RESPONSE_INVALID_REQUEST_ID); - } - - @Override - protected void onRemoteException(RemoteException e) { - super.onRemoteException(e); - Security.removeNonce(mNonce); - } - - @Override - protected void responseCodeReceived(ResponseCode responseCode) { - ResponseHandler.responseCodeReceived(BillingService.this, this, responseCode); - } - } - - public BillingService() { - super(); - } - - public void setContext(Context context) { - attachBaseContext(context); - } - - /** - * We don't support binding to this service, only starting the service. - */ - @Override - public IBinder onBind(Intent intent) { - return null; - } - - @Override - public void onStart(Intent intent, int startId) { - handleCommand(intent, startId); - } - - /** - * The {@link BillingReceiver} sends messages to this service using intents. - * Each intent has an action and some extra arguments specific to that action. - * @param intent the intent containing one of the supported actions - * @param startId an identifier for the invocation instance of this service - */ - public void handleCommand(Intent intent, int startId) { - if (intent == null) { - return; - } - String action = intent.getAction(); - if (BillingConstants.DEBUG) { - Log.i(TAG, "handleCommand() action: " + action); - } - if (BillingConstants.ACTION_CONFIRM_NOTIFICATION.equals(action)) { - String[] notifyIds = intent.getStringArrayExtra(BillingConstants.NOTIFICATION_ID); - confirmNotifications(startId, notifyIds); - } else if (BillingConstants.ACTION_GET_PURCHASE_INFORMATION.equals(action)) { - String notifyId = intent.getStringExtra(BillingConstants.NOTIFICATION_ID); - getPurchaseInformation(startId, new String[] { notifyId }); - } else if (BillingConstants.ACTION_PURCHASE_STATE_CHANGED.equals(action)) { - String signedData = intent.getStringExtra(BillingConstants.INAPP_SIGNED_DATA); - String signature = intent.getStringExtra(BillingConstants.INAPP_SIGNATURE); - purchaseStateChanged(startId, signedData, signature); - } else if (BillingConstants.ACTION_RESPONSE_CODE.equals(action)) { - long requestId = intent.getLongExtra(BillingConstants.INAPP_REQUEST_ID, -1); - int responseCodeIndex = intent.getIntExtra(BillingConstants.INAPP_RESPONSE_CODE, - ResponseCode.RESULT_ERROR.ordinal()); - ResponseCode responseCode = ResponseCode.valueOf(responseCodeIndex); - checkResponseCode(requestId, responseCode); - } - } - - /** - * Binds to the MarketBillingService and returns true if the bind - * succeeded. - * @return true if the bind succeeded; false otherwise - */ - private boolean bindToMarketBillingService() { - try { - if (BillingConstants.DEBUG) { - Log.i(TAG, "binding to Market billing service"); - } - boolean bindResult = bindService( - new Intent(BillingConstants.MARKET_BILLING_SERVICE_ACTION), - this, // ServiceConnection. - Context.BIND_AUTO_CREATE); - - if (bindResult) { - return true; - } else { - Log.e(TAG, "Could not bind to service."); - } - } catch (SecurityException e) { - Log.e(TAG, "Security exception: " + e); - } - return false; - } - - /** - * Checks if in-app billing is supported. - * @pram itemType Either BillingConstants.ITEM_TYPE_INAPP or BillingConstants.ITEM_TYPE_SUBSCRIPTION, indicating the - * type of item support is being checked for. - * @return true if supported; false otherwise - */ - public boolean checkBillingSupported(String itemType) { - return new CheckBillingSupported(itemType).runRequest(); - } - - /** - * Requests that the given item be offered to the user for purchase. When - * the purchase succeeds (or is canceled) the {@link BillingReceiver} - * receives an intent with the action {@link BillingConstants#ACTION_NOTIFY}. - * Returns false if there was an error trying to connect to Android Market. - * @param productId an identifier for the item being offered for purchase - * @param itemType Either BillingConstants.ITEM_TYPE_INAPP or BillingConstants.ITEM_TYPE_SUBSCRIPTION, indicating - * the type of item type support is being checked for. - * @param developerPayload a payload that is associated with a given - * purchase, if null, no payload is sent - * @return false if there was an error connecting to Android Market - */ - public boolean requestPurchase(String productId, String itemType, String developerPayload) { - return new RequestPurchase(productId, itemType, developerPayload).runRequest(); - } - - /** - * Requests transaction information for all managed items. Call this only when the - * application is first installed or after a database wipe. Do NOT call this - * every time the application starts up. - * @return false if there was an error connecting to Android Market - */ - public boolean restoreTransactions() { - return new RestoreTransactions().runRequest(); - } - - /** - * Confirms receipt of a purchase state change. Each {@code notifyId} is - * an opaque identifier that came from the server. This method sends those - * identifiers back to the MarketBillingService, which ACKs them to the - * server. Returns false if there was an error trying to connect to the - * MarketBillingService. - * @param startId an identifier for the invocation instance of this service - * @param notifyIds a list of opaque identifiers associated with purchase - * state changes. - * @return false if there was an error connecting to Market - */ - private boolean confirmNotifications(int startId, String[] notifyIds) { - return new ConfirmNotifications(startId, notifyIds).runRequest(); - } - - /** - * Gets the purchase information. This message includes a list of - * notification IDs sent to us by Android Market, which we include in - * our request. The server responds with the purchase information, - * encoded as a JSON string, and sends that to the {@link BillingReceiver} - * in an intent with the action {@link BillingConstants#ACTION_PURCHASE_STATE_CHANGED}. - * Returns false if there was an error trying to connect to the MarketBillingService. - * - * @param startId an identifier for the invocation instance of this service - * @param notifyIds a list of opaque identifiers associated with purchase - * state changes - * @return false if there was an error connecting to Android Market - */ - private boolean getPurchaseInformation(int startId, String[] notifyIds) { - return new GetPurchaseInformation(startId, notifyIds).runRequest(); - } - - /** - * Verifies that the data was signed with the given signature, and calls - * {@link ResponseHandler#purchaseResponse(Context, PurchaseState, String, String, long)} - * for each verified purchase. - * @param startId an identifier for the invocation instance of this service - * @param signedData the signed JSON string (signed, not encrypted) - * @param signature the signature for the data, signed with the private key - */ - private void purchaseStateChanged(int startId, String signedData, String signature) { - ArrayList purchases; - purchases = Security.verifyPurchase(signedData, signature); - if (purchases == null) { - return; - } - - ArrayList notifyList = new ArrayList(); - for (VerifiedPurchase vp : purchases) { - if (vp.notificationId != null) { - notifyList.add(vp.notificationId); - } - ResponseHandler.purchaseResponse(this, vp.purchaseState, vp.productId, - vp.orderId, vp.purchaseTime, vp.developerPayload, vp.purchaseToken); - } - if (!notifyList.isEmpty()) { - String[] notifyIds = notifyList.toArray(new String[notifyList.size()]); - confirmNotifications(startId, notifyIds); - } - } - - /** - * This is called when we receive a response code from Android Market for a request - * that we made. This is used for reporting various errors and for - * acknowledging that an order was sent to the server. This is NOT used - * for any purchase state changes. All purchase state changes are received - * in the {@link BillingReceiver} and passed to this service, where they are - * handled in {@link #purchaseStateChanged(int, String, String)}. - * @param requestId a number that identifies a request, assigned at the - * time the request was made to Android Market - * @param responseCode a response code from Android Market to indicate the state - * of the request - */ - private void checkResponseCode(long requestId, ResponseCode responseCode) { - BillingRequest request = mSentRequests.get(requestId); - if (request != null) { - if (BillingConstants.DEBUG) { - Log.d(TAG, request.getClass().getSimpleName() + ": " + responseCode); - } - request.responseCodeReceived(responseCode); - } - mSentRequests.remove(requestId); - } - - /** - * Runs any pending requests that are waiting for a connection to the - * service to be established. This runs in the main UI thread. - */ - private void runPendingRequests() { - int maxStartId = -1; - BillingRequest request; - while ((request = mPendingRequests.peek()) != null) { - if (request.runIfConnected()) { - // Remove the request - mPendingRequests.remove(); - - // Remember the largest startId, which is the most recent - // request to start this service. - if (maxStartId < request.getStartId()) { - maxStartId = request.getStartId(); - } - } else { - // The service crashed, so restart it. Note that this leaves - // the current request on the queue. - bindToMarketBillingService(); - return; - } - } - - // If we get here then all the requests ran successfully. If maxStartId - // is not -1, then one of the requests started the service, so we can - // stop it now. - if (maxStartId >= 0) { - if (BillingConstants.DEBUG) { - Log.i(TAG, "stopping service, startId: " + maxStartId); - } - stopSelf(maxStartId); - } - } - - /** - * This is called when we are connected to the MarketBillingService. - * This runs in the main UI thread. - */ - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - if (BillingConstants.DEBUG) { - Log.d(TAG, "Billing service connected"); - } - mService = IMarketBillingService.Stub.asInterface(service); - runPendingRequests(); - } - - /** - * This is called when we are disconnected from the MarketBillingService. - */ - @Override - public void onServiceDisconnected(ComponentName name) { - Log.w(TAG, "Billing service disconnected"); - mService = null; - } - - /** - * Unbinds from the MarketBillingService. Call this when the application - * terminates to avoid leaking a ServiceConnection. - */ - public void unbind() { - try { - unbindService(this); - } catch (IllegalArgumentException e) { - // This might happen if the service was disconnected - } - } -} diff --git a/astrid/src/com/todoroo/astrid/billing/PurchaseObserver.java b/astrid/src/com/todoroo/astrid/billing/PurchaseObserver.java deleted file mode 100644 index 39767995e..000000000 --- a/astrid/src/com/todoroo/astrid/billing/PurchaseObserver.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. - -package com.todoroo.astrid.billing; - -import java.lang.reflect.Method; - -import android.app.Activity; -import android.app.PendingIntent; -import android.app.PendingIntent.CanceledException; -import android.content.Context; -import android.content.Intent; -import android.content.IntentSender; -import android.os.Handler; -import android.util.Log; - -import com.todoroo.astrid.billing.BillingConstants.PurchaseState; -import com.todoroo.astrid.billing.BillingConstants.ResponseCode; -import com.todoroo.astrid.billing.BillingService.RequestPurchase; -import com.todoroo.astrid.billing.BillingService.RestoreTransactions; - -/** - * An interface for observing changes related to purchases. The main application - * extends this class and registers an instance of that derived class with - * {@link ResponseHandler}. The main application implements the callbacks - * {@link #onBillingSupported(boolean)} and - * {@link #onPurchaseStateChange(PurchaseState, String, int, long)}. These methods - * are used to update the UI. - */ -public abstract class PurchaseObserver { - protected static final String TAG = "purchase-observer"; //$NON-NLS-1$ - protected final Activity mActivity; - private final Handler mHandler; - private Method mStartIntentSender; - private final Object[] mStartIntentSenderArgs = new Object[5]; - private static final Class[] START_INTENT_SENDER_SIG = new Class[] { - IntentSender.class, Intent.class, int.class, int.class, int.class - }; - - public PurchaseObserver(Activity activity, Handler handler) { - mActivity = activity; - mHandler = handler; - initCompatibilityLayer(); - } - - /** - * This is the callback that is invoked when Android Market responds to the - * {@link BillingService#checkBillingSupported()} request. - * @param supported true if in-app billing is supported. - */ - public abstract void onBillingSupported(boolean supported, String type); - - /** - * This is the callback that is invoked when an item is purchased, - * refunded, or canceled. It is the callback invoked in response to - * calling {@link BillingService#requestPurchase(String)}. It may also - * be invoked asynchronously when a purchase is made on another device - * (if the purchase was for a Market-managed item), or if the purchase - * was refunded, or the charge was canceled. This handles the UI - * update. The database update is handled in - * {@link ResponseHandler#purchaseResponse(Context, PurchaseState, - * String, String, long)}. - * @param purchaseState the purchase state of the item - * @param itemId a string identifying the item (the "SKU") - * @param quantity the current quantity of this item after the purchase - * @param purchaseTime the time the product was purchased, in - * milliseconds since the epoch (Jan 1, 1970) - */ - public abstract void onPurchaseStateChange(PurchaseState purchaseState, - String itemId, int quantity, long purchaseTime, String developerPayload, String purchaseToken); - - /** - * This is called when we receive a response code from Market for a - * RequestPurchase request that we made. This is NOT used for any - * purchase state changes. All purchase state changes are received in - * {@link #onPurchaseStateChange(PurchaseState, String, int, long)}. - * This is used for reporting various errors, or if the user backed out - * and didn't purchase the item. The possible response codes are: - * RESULT_OK means that the order was sent successfully to the server. - * The onPurchaseStateChange() will be invoked later (with a - * purchase state of PURCHASED or CANCELED) when the order is - * charged or canceled. This response code can also happen if an - * order for a Market-managed item was already sent to the server. - * RESULT_USER_CANCELED means that the user didn't buy the item. - * RESULT_SERVICE_UNAVAILABLE means that we couldn't connect to the - * Android Market server (for example if the data connection is down). - * RESULT_BILLING_UNAVAILABLE means that in-app billing is not - * supported yet. - * RESULT_ITEM_UNAVAILABLE means that the item this app offered for - * sale does not exist (or is not published) in the server-side - * catalog. - * RESULT_ERROR is used for any other errors (such as a server error). - */ - public abstract void onRequestPurchaseResponse(RequestPurchase request, - ResponseCode responseCode); - - /** - * This is called when we receive a response code from Android Market for a - * RestoreTransactions request that we made. A response code of - * RESULT_OK means that the request was successfully sent to the server. - */ - public abstract void onRestoreTransactionsResponse(RestoreTransactions request, - ResponseCode responseCode); - - private void initCompatibilityLayer() { - try { - mStartIntentSender = mActivity.getClass().getMethod("startIntentSender", //$NON-NLS-1$ - START_INTENT_SENDER_SIG); - } catch (SecurityException e) { - mStartIntentSender = null; - } catch (NoSuchMethodException e) { - mStartIntentSender = null; - } - } - - void startBuyPageActivity(PendingIntent pendingIntent, Intent intent) { - if (mStartIntentSender != null) { - // This is on Android 2.0 and beyond. The in-app buy page activity - // must be on the activity stack of the application. - try { - // This implements the method call: - // mActivity.startIntentSender(pendingIntent.getIntentSender(), - // intent, 0, 0, 0); - mStartIntentSenderArgs[0] = pendingIntent.getIntentSender(); - mStartIntentSenderArgs[1] = intent; - mStartIntentSenderArgs[2] = Integer.valueOf(0); - mStartIntentSenderArgs[3] = Integer.valueOf(0); - mStartIntentSenderArgs[4] = Integer.valueOf(0); - mStartIntentSender.invoke(mActivity, mStartIntentSenderArgs); - } catch (Exception e) { - Log.e(TAG, "error starting activity", e); //$NON-NLS-1$ - } - } else { - // This is on Android version 1.6. The in-app buy page activity must be on its - // own separate activity stack instead of on the activity stack of - // the application. - try { - pendingIntent.send(mActivity, 0 /* code */, intent); - } catch (CanceledException e) { - Log.e(TAG, "error starting activity", e); //$NON-NLS-1$ - } - } - } - - /** - * Updates the UI after the database has been updated. This method runs - * in a background thread so it has to post a Runnable to run on the UI - * thread. - * @param purchaseState the purchase state of the item - * @param itemId a string identifying the item - * @param quantity the quantity of items in this purchase - */ - void postPurchaseStateChange(final PurchaseState purchaseState, final String itemId, - final int quantity, final long purchaseTime, final String developerPayload, final String purchaseToken) { - mHandler.post(new Runnable() { - @Override - public void run() { - onPurchaseStateChange( - purchaseState, itemId, quantity, purchaseTime, developerPayload, purchaseToken); - } - }); - } -} diff --git a/astrid/src/com/todoroo/astrid/billing/ResponseHandler.java b/astrid/src/com/todoroo/astrid/billing/ResponseHandler.java deleted file mode 100644 index 4321742a7..000000000 --- a/astrid/src/com/todoroo/astrid/billing/ResponseHandler.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. - -package com.todoroo.astrid.billing; - - -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -import com.todoroo.astrid.billing.BillingConstants.PurchaseState; -import com.todoroo.astrid.billing.BillingConstants.ResponseCode; -import com.todoroo.astrid.billing.BillingService.RequestPurchase; -import com.todoroo.astrid.billing.BillingService.RestoreTransactions; - -/** - * This class contains the methods that handle responses from Android Market. The - * implementation of these methods is specific to a particular application. - * The methods in this example update the database and, if the main application - * has registered a {@llink PurchaseObserver}, will also update the UI. An - * application might also want to forward some responses on to its own server, - * and that could be done here (in a background thread) but this example does - * not do that. - * - * You should modify and obfuscate this code before using it. - */ -public class ResponseHandler { - private static final String TAG = "response-handler"; //$NON-NLS-1$ - - /** - * This is a static instance of {@link PurchaseObserver} that the - * application creates and registers with this class. The PurchaseObserver - * is used for updating the UI if the UI is visible. - */ - private static PurchaseObserver sPurchaseObserver; - - /** - * Registers an observer that updates the UI. - * @param observer the observer to register - */ - public static synchronized void register(PurchaseObserver observer) { - sPurchaseObserver = observer; - } - - /** - * Unregisters a previously registered observer. - * @param observer the previously registered observer. - */ - public static synchronized void unregister(PurchaseObserver observer) { - sPurchaseObserver = null; - } - - /** - * Notifies the application of the availability of the MarketBillingService. - * This method is called in response to the application calling - * {@link BillingService#checkBillingSupported()}. - * @param supported true if in-app billing is supported. - */ - public static void checkBillingSupportedResponse(boolean supported, String type) { - if (sPurchaseObserver != null) { - sPurchaseObserver.onBillingSupported(supported, type); - } - } - - /** - * Starts a new activity for the user to buy an item for sale. This method - * forwards the intent on to the PurchaseObserver (if it exists) because - * we need to start the activity on the activity stack of the application. - * - * @param pendingIntent a PendingIntent that we received from Android Market that - * will create the new buy page activity - * @param intent an intent containing a request id in an extra field that - * will be passed to the buy page activity when it is created - */ - public static void buyPageIntentResponse(PendingIntent pendingIntent, Intent intent) { - if (sPurchaseObserver == null) { - if (BillingConstants.DEBUG) { - Log.d(TAG, "UI is not running"); //$NON-NLS-1$ - } - return; - } - sPurchaseObserver.startBuyPageActivity(pendingIntent, intent); - } - - /** - * Notifies the application of purchase state changes. The application - * can offer an item for sale to the user via - * {@link BillingService#requestPurchase(String)}. The BillingService - * calls this method after it gets the response. Another way this method - * can be called is if the user bought something on another device running - * this same app. Then Android Market notifies the other devices that - * the user has purchased an item, in which case the BillingService will - * also call this method. Finally, this method can be called if the item - * was refunded. - * @param purchaseState the state of the purchase request (PURCHASED, - * CANCELED, or REFUNDED) - * @param productId a string identifying a product for sale - * @param orderId a string identifying the order - * @param purchaseTime the time the product was purchased, in milliseconds - * since the epoch (Jan 1, 1970) - * @param developerPayload the developer provided "payload" associated with - * the order - */ - public static void purchaseResponse( - final Context context, final PurchaseState purchaseState, final String productId, - final String orderId, final long purchaseTime, final String developerPayload, final String purchaseToken) { - - new Thread(new Runnable() { - @Override - public void run() { - - // This needs to be synchronized because the UI thread can change the - // value of sPurchaseObserver. - synchronized(ResponseHandler.class) { - if (sPurchaseObserver != null) { - sPurchaseObserver.postPurchaseStateChange( - purchaseState, productId, 1, purchaseTime, developerPayload, purchaseToken); - } - } - } - }).start(); - } - - /** - * This is called when we receive a response code from Android Market for a - * RequestPurchase request that we made. This is used for reporting various - * errors and also for acknowledging that an order was sent successfully to - * the server. This is NOT used for any purchase state changes. All - * purchase state changes are received in the {@link BillingReceiver} and - * are handled in {@link Security#verifyPurchase(String, String)}. - * @param context the context - * @param request the RequestPurchase request for which we received a - * response code - * @param responseCode a response code from Market to indicate the state - * of the request - */ - public static void responseCodeReceived(Context context, RequestPurchase request, - ResponseCode responseCode) { - if (sPurchaseObserver != null) { - sPurchaseObserver.onRequestPurchaseResponse(request, responseCode); - } - } - - /** - * This is called when we receive a response code from Android Market for a - * RestoreTransactions request. - * @param context the context - * @param request the RestoreTransactions request for which we received a - * response code - * @param responseCode a response code from Market to indicate the state - * of the request - */ - public static void responseCodeReceived(Context context, RestoreTransactions request, - ResponseCode responseCode) { - if (sPurchaseObserver != null) { - sPurchaseObserver.onRestoreTransactionsResponse(request, responseCode); - } - } -} diff --git a/astrid/src/com/todoroo/astrid/billing/Security.java b/astrid/src/com/todoroo/astrid/billing/Security.java deleted file mode 100644 index d230dbab1..000000000 --- a/astrid/src/com/todoroo/astrid/billing/Security.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. - -package com.todoroo.astrid.billing; - -import java.security.PublicKey; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.HashSet; - -import com.todoroo.astrid.billing.BillingConstants.PurchaseState; - - -/** - * This is a stub class - * @author Sam - */ -@SuppressWarnings("nls") -public class Security { - private static final String TAG = "Security"; - - private static final String KEY_FACTORY_ALGORITHM = "RSA"; - private static final String SIGNATURE_ALGORITHM = "SHA1withRSA"; - private static final SecureRandom RANDOM = new SecureRandom(); - - private static HashSet sKnownNonces = new HashSet(); - - /** - * A class to hold the verified purchase information. - */ - public static class VerifiedPurchase { - public PurchaseState purchaseState; - public String notificationId; - public String productId; - public String orderId; - public long purchaseTime; - public String developerPayload; - public String purchaseToken; - - public VerifiedPurchase(PurchaseState purchaseState, String notificationId, - String productId, String orderId, long purchaseTime, String developerPayload, String purchaseToken) { - this.purchaseState = purchaseState; - this.notificationId = notificationId; - this.productId = productId; - this.orderId = orderId; - this.purchaseTime = purchaseTime; - this.developerPayload = developerPayload; - this.purchaseToken = purchaseToken; - } - } - - /** Generates a nonce (a random number used once). */ - public static long generateNonce() { - long nonce = RANDOM.nextLong(); - sKnownNonces.add(nonce); - return nonce; - } - - public static void removeNonce(long nonce) { - sKnownNonces.remove(nonce); - } - - public static boolean isNonceKnown(long nonce) { - return sKnownNonces.contains(nonce); - } - - public static ArrayList verifyPurchase(String signedData, String signature) { - return null; - } - - private static String constructPublicKey() { - return ""; - } - - public static PublicKey generatePublicKey(String encodedPublicKey) { - return null; - } - - public static boolean verify(PublicKey publicKey, String signedData, String signature) { - return false; - } -} diff --git a/astrid/src/com/todoroo/astrid/dao/TaskDao.java b/astrid/src/com/todoroo/astrid/dao/TaskDao.java index 750f57329..263c3644a 100644 --- a/astrid/src/com/todoroo/astrid/dao/TaskDao.java +++ b/astrid/src/com/todoroo/astrid/dao/TaskDao.java @@ -10,7 +10,7 @@ import android.content.Context; import android.content.Intent; import android.database.sqlite.SQLiteConstraintException; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java b/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java index 53c38a74e..4eead87e4 100644 --- a/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java +++ b/astrid/src/com/todoroo/astrid/helper/SyncActionHelper.java @@ -22,7 +22,7 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.widget.ArrayAdapter; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/src/com/todoroo/astrid/helper/TaskEditControlSet.java b/astrid/src/com/todoroo/astrid/helper/TaskEditControlSet.java index db3d373de..1d72fd88e 100644 --- a/astrid/src/com/todoroo/astrid/helper/TaskEditControlSet.java +++ b/astrid/src/com/todoroo/astrid/helper/TaskEditControlSet.java @@ -13,7 +13,7 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.Button; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.ui.EditDialogOkBackground; diff --git a/astrid/src/com/todoroo/astrid/service/AddOnService.java b/astrid/src/com/todoroo/astrid/service/AddOnService.java index 3d1ad81a6..9245004d1 100644 --- a/astrid/src/com/todoroo/astrid/service/AddOnService.java +++ b/astrid/src/com/todoroo/astrid/service/AddOnService.java @@ -11,7 +11,7 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/src/com/todoroo/astrid/service/Astrid2To3UpgradeHelper.java b/astrid/src/com/todoroo/astrid/service/Astrid2To3UpgradeHelper.java index e22c75b3b..8fad4d153 100644 --- a/astrid/src/com/todoroo/astrid/service/Astrid2To3UpgradeHelper.java +++ b/astrid/src/com/todoroo/astrid/service/Astrid2To3UpgradeHelper.java @@ -19,7 +19,7 @@ import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import com.google.ical.values.RRule; -import com.timsu.astrid.R; +import org.astrid.R; import com.timsu.astrid.utilities.LegacyTasksXmlExporter; import com.todoroo.andlib.data.AbstractModel; import com.todoroo.andlib.data.DatabaseDao; diff --git a/astrid/src/com/todoroo/astrid/service/MarketStrategy.java b/astrid/src/com/todoroo/astrid/service/MarketStrategy.java index afe2d293f..f3f8ce202 100644 --- a/astrid/src/com/todoroo/astrid/service/MarketStrategy.java +++ b/astrid/src/com/todoroo/astrid/service/MarketStrategy.java @@ -8,7 +8,7 @@ package com.todoroo.astrid.service; import android.content.Intent; import android.net.Uri; -import com.timsu.astrid.R; +import org.astrid.R; public abstract class MarketStrategy { diff --git a/astrid/src/com/todoroo/astrid/service/StartupService.java b/astrid/src/com/todoroo/astrid/service/StartupService.java index 56112d972..cc59d8e2e 100644 --- a/astrid/src/com/todoroo/astrid/service/StartupService.java +++ b/astrid/src/com/todoroo/astrid/service/StartupService.java @@ -25,7 +25,7 @@ import android.media.AudioManager; import android.util.Log; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.DatabaseDao.ModelUpdateListener; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/src/com/todoroo/astrid/service/ThemeService.java b/astrid/src/com/todoroo/astrid/service/ThemeService.java index e49ac7d87..687f04648 100644 --- a/astrid/src/com/todoroo/astrid/service/ThemeService.java +++ b/astrid/src/com/todoroo/astrid/service/ThemeService.java @@ -10,7 +10,7 @@ import android.graphics.PixelFormat; import android.text.TextUtils; import android.view.WindowManager; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/src/com/todoroo/astrid/service/UpdateMessagePreference.java b/astrid/src/com/todoroo/astrid/service/UpdateMessagePreference.java index 85a9fcd41..2c11e1c0f 100644 --- a/astrid/src/com/todoroo/astrid/service/UpdateMessagePreference.java +++ b/astrid/src/com/todoroo/astrid/service/UpdateMessagePreference.java @@ -10,7 +10,7 @@ import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceActivity; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.Preferences; public class UpdateMessagePreference extends PreferenceActivity { diff --git a/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java b/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java index b9ab4a2be..8b24a9e72 100644 --- a/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java +++ b/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java @@ -33,7 +33,7 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property.StringProperty; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; diff --git a/astrid/src/com/todoroo/astrid/service/UpgradeService.java b/astrid/src/com/todoroo/astrid/service/UpgradeService.java index c9e590844..db8f96a7e 100644 --- a/astrid/src/com/todoroo/astrid/service/UpgradeService.java +++ b/astrid/src/com/todoroo/astrid/service/UpgradeService.java @@ -13,8 +13,7 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; -import com.timsu.astrid.GCMIntentService; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; @@ -259,7 +258,6 @@ public final class UpgradeService { } } new AstridNewSyncMigrator().performMigration(); - new GCMIntentService.GCMMigration().performMigration(UpgradeActivity.this); } if (from < V4_6_2) { diff --git a/astrid/src/com/todoroo/astrid/ui/AstridDialog.java b/astrid/src/com/todoroo/astrid/ui/AstridDialog.java index b861a23fe..d94aace22 100644 --- a/astrid/src/com/todoroo/astrid/ui/AstridDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/AstridDialog.java @@ -6,7 +6,7 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.activity.AstridActivity; public class AstridDialog extends Dialog { diff --git a/astrid/src/com/todoroo/astrid/ui/AstridTimePicker.java b/astrid/src/com/todoroo/astrid/ui/AstridTimePicker.java index 3cedf0a00..585650de9 100644 --- a/astrid/src/com/todoroo/astrid/ui/AstridTimePicker.java +++ b/astrid/src/com/todoroo/astrid/ui/AstridTimePicker.java @@ -19,7 +19,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.LinearLayout; import android.widget.ToggleButton; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; diff --git a/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java b/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java index a84bff18c..2bade318c 100644 --- a/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java @@ -15,7 +15,7 @@ import android.view.ViewGroup.LayoutParams; import android.view.Window; import android.widget.Button; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.ui.CalendarView.OnSelectedDateListener; public class CalendarDialog extends Dialog implements OnClickListener, OnSelectedDateListener { diff --git a/astrid/src/com/todoroo/astrid/ui/CalendarView.java b/astrid/src/com/todoroo/astrid/ui/CalendarView.java index bdc0899f8..dd5efeaf2 100644 --- a/astrid/src/com/todoroo/astrid/ui/CalendarView.java +++ b/astrid/src/com/todoroo/astrid/ui/CalendarView.java @@ -30,7 +30,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.WindowManager; -import com.timsu.astrid.R; +import org.astrid.R; public class CalendarView extends View { diff --git a/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java b/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java index 41f661afd..c3e5a09c6 100644 --- a/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java +++ b/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java @@ -28,7 +28,7 @@ import android.widget.CursorAdapter; import android.widget.ImageView; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/src/com/todoroo/astrid/ui/ContactsAutoComplete.java b/astrid/src/com/todoroo/astrid/ui/ContactsAutoComplete.java index e378b2050..2febb8308 100644 --- a/astrid/src/com/todoroo/astrid/ui/ContactsAutoComplete.java +++ b/astrid/src/com/todoroo/astrid/ui/ContactsAutoComplete.java @@ -12,7 +12,7 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.widget.AutoCompleteTextView; -import com.timsu.astrid.R; +import org.astrid.R; public class ContactsAutoComplete extends AutoCompleteTextView { diff --git a/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java b/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java index 280f34fd3..1be020aa5 100644 --- a/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java @@ -13,7 +13,7 @@ import android.view.Window; import android.view.WindowManager.LayoutParams; import android.widget.Button; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.service.ThemeService; public class DateAndTimeDialog extends Dialog { diff --git a/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java b/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java index 98614d2ea..6926368ef 100644 --- a/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java +++ b/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java @@ -20,7 +20,7 @@ import android.view.View; import android.widget.LinearLayout; import android.widget.ToggleButton; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.data.Task; diff --git a/astrid/src/com/todoroo/astrid/ui/DateChangedAlerts.java b/astrid/src/com/todoroo/astrid/ui/DateChangedAlerts.java index e733a45a6..60799e7e6 100644 --- a/astrid/src/com/todoroo/astrid/ui/DateChangedAlerts.java +++ b/astrid/src/com/todoroo/astrid/ui/DateChangedAlerts.java @@ -26,7 +26,7 @@ import android.widget.TextView; import com.google.ical.values.Frequency; import com.google.ical.values.RRule; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; diff --git a/astrid/src/com/todoroo/astrid/ui/DeadlineControlSet.java b/astrid/src/com/todoroo/astrid/ui/DeadlineControlSet.java index 60de35895..451006704 100644 --- a/astrid/src/com/todoroo/astrid/ui/DeadlineControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/DeadlineControlSet.java @@ -18,7 +18,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.astrid.data.Task; diff --git a/astrid/src/com/todoroo/astrid/ui/DeadlineNumberPicker.java b/astrid/src/com/todoroo/astrid/ui/DeadlineNumberPicker.java index 1e24ffab4..4038c934b 100644 --- a/astrid/src/com/todoroo/astrid/ui/DeadlineNumberPicker.java +++ b/astrid/src/com/todoroo/astrid/ui/DeadlineNumberPicker.java @@ -8,7 +8,7 @@ package com.todoroo.astrid.ui; import android.content.Context; import android.util.AttributeSet; -import com.timsu.astrid.R; +import org.astrid.R; public class DeadlineNumberPicker extends NumberPicker { diff --git a/astrid/src/com/todoroo/astrid/ui/DeadlineTimePickerDialog.java b/astrid/src/com/todoroo/astrid/ui/DeadlineTimePickerDialog.java index 0d1b6801c..0a6cf1dab 100644 --- a/astrid/src/com/todoroo/astrid/ui/DeadlineTimePickerDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/DeadlineTimePickerDialog.java @@ -33,7 +33,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.TimePicker; import android.widget.TimePicker.OnTimeChangedListener; -import com.timsu.astrid.R; +import org.astrid.R; /** * A dialog that prompts the user for the time of day using a {@link TimePicker}. diff --git a/astrid/src/com/todoroo/astrid/ui/DraggableListView.java b/astrid/src/com/todoroo/astrid/ui/DraggableListView.java index 93cd04b16..6f684d76e 100644 --- a/astrid/src/com/todoroo/astrid/ui/DraggableListView.java +++ b/astrid/src/com/todoroo/astrid/ui/DraggableListView.java @@ -40,7 +40,7 @@ import com.commonsware.cwac.tlv.TouchListView.DragListener; import com.commonsware.cwac.tlv.TouchListView.DropListener; import com.commonsware.cwac.tlv.TouchListView.GrabberClickListener; import com.commonsware.cwac.tlv.TouchListView.SwipeListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.utility.Flags; public class DraggableListView extends ListView { diff --git a/astrid/src/com/todoroo/astrid/ui/EditNotesControlSet.java b/astrid/src/com/todoroo/astrid/ui/EditNotesControlSet.java index 1f49a58af..9405d45be 100644 --- a/astrid/src/com/todoroo/astrid/ui/EditNotesControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/EditNotesControlSet.java @@ -16,7 +16,7 @@ import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.service.ThemeService; diff --git a/astrid/src/com/todoroo/astrid/ui/EditTitleControlSet.java b/astrid/src/com/todoroo/astrid/ui/EditTitleControlSet.java index d1930d20e..b59067f74 100644 --- a/astrid/src/com/todoroo/astrid/ui/EditTitleControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/EditTitleControlSet.java @@ -16,7 +16,7 @@ import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import android.widget.EditText; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.AndroidUtilities; diff --git a/astrid/src/com/todoroo/astrid/ui/FeedbackPromptDialogs.java b/astrid/src/com/todoroo/astrid/ui/FeedbackPromptDialogs.java index b1b3c1a16..cf2a861f4 100644 --- a/astrid/src/com/todoroo/astrid/ui/FeedbackPromptDialogs.java +++ b/astrid/src/com/todoroo/astrid/ui/FeedbackPromptDialogs.java @@ -5,7 +5,7 @@ import android.net.Uri; import android.view.View; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.activity.AstridActivity; public class FeedbackPromptDialogs { diff --git a/astrid/src/com/todoroo/astrid/ui/FragmentPopover.java b/astrid/src/com/todoroo/astrid/ui/FragmentPopover.java index 981f4fb9d..f7d46227d 100644 --- a/astrid/src/com/todoroo/astrid/ui/FragmentPopover.java +++ b/astrid/src/com/todoroo/astrid/ui/FragmentPopover.java @@ -19,7 +19,7 @@ import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.FrameLayout; -import com.timsu.astrid.R; +import org.astrid.R; public class FragmentPopover extends QuickActionWidget { diff --git a/astrid/src/com/todoroo/astrid/ui/HideUntilControlSet.java b/astrid/src/com/todoroo/astrid/ui/HideUntilControlSet.java index 311530437..7dd2826d7 100644 --- a/astrid/src/com/todoroo/astrid/ui/HideUntilControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/HideUntilControlSet.java @@ -18,7 +18,7 @@ import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.data.Task; diff --git a/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java b/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java index 093e049ac..96a14eb44 100644 --- a/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java @@ -16,7 +16,7 @@ import android.widget.CompoundButton; import android.widget.LinearLayout; import android.widget.ToggleButton; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.helper.TaskEditControlSet; import com.todoroo.astrid.service.ThemeService; diff --git a/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java b/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java index 6cf8b3bba..991f49dc8 100644 --- a/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java +++ b/astrid/src/com/todoroo/astrid/ui/MainMenuPopover.java @@ -19,7 +19,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.ui.TouchInterceptingFrameLayout.InterceptTouchListener; diff --git a/astrid/src/com/todoroo/astrid/ui/NNumberPickerDialog.java b/astrid/src/com/todoroo/astrid/ui/NNumberPickerDialog.java index 2128a5065..a3deaabd6 100644 --- a/astrid/src/com/todoroo/astrid/ui/NNumberPickerDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/NNumberPickerDialog.java @@ -19,7 +19,7 @@ import android.widget.FrameLayout.LayoutParams; import android.widget.LinearLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; /** Dialog box with an arbitrary number of number pickers */ public class NNumberPickerDialog extends AlertDialog implements OnClickListener { diff --git a/astrid/src/com/todoroo/astrid/ui/NumberPicker.java b/astrid/src/com/todoroo/astrid/ui/NumberPicker.java index 02cb4dd1b..457c9567e 100644 --- a/astrid/src/com/todoroo/astrid/ui/NumberPicker.java +++ b/astrid/src/com/todoroo/astrid/ui/NumberPicker.java @@ -23,7 +23,7 @@ import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; @SuppressWarnings({"nls","unused"}) diff --git a/astrid/src/com/todoroo/astrid/ui/NumberPickerButton.java b/astrid/src/com/todoroo/astrid/ui/NumberPickerButton.java index d32cba4c1..0c38feff2 100644 --- a/astrid/src/com/todoroo/astrid/ui/NumberPickerButton.java +++ b/astrid/src/com/todoroo/astrid/ui/NumberPickerButton.java @@ -11,7 +11,7 @@ import android.view.KeyEvent; import android.view.MotionEvent; import android.widget.ImageButton; -import com.timsu.astrid.R; +import org.astrid.R; /** * This class exists purely to cancel long click events. diff --git a/astrid/src/com/todoroo/astrid/ui/NumberPickerDialog.java b/astrid/src/com/todoroo/astrid/ui/NumberPickerDialog.java index b380e1e51..c57521aec 100644 --- a/astrid/src/com/todoroo/astrid/ui/NumberPickerDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/NumberPickerDialog.java @@ -12,7 +12,7 @@ import android.content.DialogInterface.OnClickListener; import android.view.LayoutInflater; import android.view.View; -import com.timsu.astrid.R; +import org.astrid.R; public class NumberPickerDialog extends AlertDialog implements OnClickListener { diff --git a/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java b/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java index e187762c5..02dd165f0 100644 --- a/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java +++ b/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java @@ -28,7 +28,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; diff --git a/astrid/src/com/todoroo/astrid/ui/PopupControlSet.java b/astrid/src/com/todoroo/astrid/ui/PopupControlSet.java index 5b0bf3161..fea0a8691 100644 --- a/astrid/src/com/todoroo/astrid/ui/PopupControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/PopupControlSet.java @@ -16,7 +16,7 @@ import android.view.ViewGroup.LayoutParams; import android.view.Window; import android.widget.Button; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.astrid.data.Task; diff --git a/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java b/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java index 21c9d633f..7d36ba6c1 100644 --- a/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java +++ b/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java @@ -30,7 +30,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; diff --git a/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java b/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java index 22236b25a..f97cf1dd4 100644 --- a/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java @@ -13,7 +13,7 @@ import android.widget.ArrayAdapter; import android.widget.CheckBox; import android.widget.Spinner; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.helper.TaskEditControlSet; diff --git a/astrid/src/com/todoroo/astrid/ui/ReminderControlSet.java b/astrid/src/com/todoroo/astrid/ui/ReminderControlSet.java index eef028e5b..e9ec0b7c9 100644 --- a/astrid/src/com/todoroo/astrid/ui/ReminderControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/ReminderControlSet.java @@ -20,7 +20,7 @@ import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.astrid.alarms.AlarmControlSet; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.service.ThemeService; diff --git a/astrid/src/com/todoroo/astrid/ui/TaskListFragmentPager.java b/astrid/src/com/todoroo/astrid/ui/TaskListFragmentPager.java index c01796725..e6f4932c3 100644 --- a/astrid/src/com/todoroo/astrid/ui/TaskListFragmentPager.java +++ b/astrid/src/com/todoroo/astrid/ui/TaskListFragmentPager.java @@ -14,7 +14,7 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.activity.TaskListFragment; diff --git a/astrid/src/com/todoroo/astrid/ui/TimeDurationControlSet.java b/astrid/src/com/todoroo/astrid/ui/TimeDurationControlSet.java index 76b5909e0..acc957a5a 100644 --- a/astrid/src/com/todoroo/astrid/ui/TimeDurationControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/TimeDurationControlSet.java @@ -11,7 +11,7 @@ import android.text.format.DateUtils; import android.view.View; import android.widget.TextView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.Property.IntegerProperty; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.astrid.data.Task; diff --git a/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java b/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java index d02e3955e..33dc4e8b9 100644 --- a/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java +++ b/astrid/src/com/todoroo/astrid/utility/AstridDefaultPreferenceSpec.java @@ -5,7 +5,7 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content.res.Resources; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.activity.BeastModePreferences; diff --git a/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java b/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java index 15c7449ad..88db5f91e 100644 --- a/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java +++ b/astrid/src/com/todoroo/astrid/utility/AstridLitePreferenceSpec.java @@ -5,7 +5,7 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content.res.Resources; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.activity.BeastModePreferences; diff --git a/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java b/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java index c53fe7d0d..8da29b855 100644 --- a/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java +++ b/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java @@ -9,7 +9,7 @@ package com.todoroo.astrid.utility; import android.content.Context; import android.content.SharedPreferences; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.sql.Query; diff --git a/astrid/src/com/todoroo/astrid/utility/Constants.java b/astrid/src/com/todoroo/astrid/utility/Constants.java index fd6e932f3..967a4266c 100644 --- a/astrid/src/com/todoroo/astrid/utility/Constants.java +++ b/astrid/src/com/todoroo/astrid/utility/Constants.java @@ -15,7 +15,7 @@ public final class Constants { /** * Application Package */ - public static final String PACKAGE = "com.timsu.astrid"; + public static final String PACKAGE = "org.astrid"; /** * Whether this is an OEM installation diff --git a/astrid/src/com/todoroo/astrid/utility/ResourceDrawableCache.java b/astrid/src/com/todoroo/astrid/utility/ResourceDrawableCache.java index 151ec7b7a..e02931c09 100644 --- a/astrid/src/com/todoroo/astrid/utility/ResourceDrawableCache.java +++ b/astrid/src/com/todoroo/astrid/utility/ResourceDrawableCache.java @@ -3,7 +3,7 @@ package com.todoroo.astrid.utility; import android.content.res.Resources; import android.graphics.drawable.Drawable; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; /** diff --git a/astrid/src/com/todoroo/astrid/voice/VoiceInputAssistant.java b/astrid/src/com/todoroo/astrid/voice/VoiceInputAssistant.java index b71abfe9c..9561e59dc 100644 --- a/astrid/src/com/todoroo/astrid/voice/VoiceInputAssistant.java +++ b/astrid/src/com/todoroo/astrid/voice/VoiceInputAssistant.java @@ -21,7 +21,7 @@ import android.view.View.OnClickListener; import android.widget.EditText; import android.widget.ImageButton; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DialogUtilities; diff --git a/astrid/src/com/todoroo/astrid/voice/VoiceRecognizer.java b/astrid/src/com/todoroo/astrid/voice/VoiceRecognizer.java index 73cebe3c0..04d344859 100644 --- a/astrid/src/com/todoroo/astrid/voice/VoiceRecognizer.java +++ b/astrid/src/com/todoroo/astrid/voice/VoiceRecognizer.java @@ -20,7 +20,7 @@ import android.widget.EditText; import android.widget.ImageButton; import android.widget.Toast; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.aacenc.ContextManager; import com.todoroo.aacenc.RecognizerApi; import com.todoroo.aacenc.RecognizerApi.RecognizerApiListener; diff --git a/astrid/src/com/todoroo/astrid/widget/TasksWidget.java b/astrid/src/com/todoroo/astrid/widget/TasksWidget.java index 11133e5bd..b8515866b 100644 --- a/astrid/src/com/todoroo/astrid/widget/TasksWidget.java +++ b/astrid/src/com/todoroo/astrid/widget/TasksWidget.java @@ -24,7 +24,7 @@ import android.view.View; import android.view.WindowManager; import android.widget.RemoteViews; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; diff --git a/astrid/src/com/todoroo/astrid/widget/WidgetConfigActivity.java b/astrid/src/com/todoroo/astrid/widget/WidgetConfigActivity.java index c317841e8..7d47d1f74 100644 --- a/astrid/src/com/todoroo/astrid/widget/WidgetConfigActivity.java +++ b/astrid/src/com/todoroo/astrid/widget/WidgetConfigActivity.java @@ -15,7 +15,7 @@ import android.view.View; import android.widget.Button; import android.widget.ListView; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.adapter.FilterAdapter; diff --git a/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java b/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java index 69ed982c2..88b9aca7b 100644 --- a/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java +++ b/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java @@ -16,7 +16,7 @@ import com.google.ical.values.Frequency; import com.google.ical.values.RRule; import com.google.ical.values.Weekday; import com.google.ical.values.WeekdayNum; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.sql.Query; diff --git a/tests-sync/src/com/todoroo/astrid/sync/repeats/RepeatTestsGtasksSync.java b/tests-sync/src/com/todoroo/astrid/sync/repeats/RepeatTestsGtasksSync.java index 5b7177564..31a6fc827 100644 --- a/tests-sync/src/com/todoroo/astrid/sync/repeats/RepeatTestsGtasksSync.java +++ b/tests-sync/src/com/todoroo/astrid/sync/repeats/RepeatTestsGtasksSync.java @@ -18,7 +18,7 @@ import android.os.Bundle; import com.google.api.client.googleapis.extensions.android2.auth.GoogleAccountManager; import com.google.api.services.tasks.model.Tasks; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; diff --git a/tests/src/com/todoroo/andlib/test/TranslationTests.java b/tests/src/com/todoroo/andlib/test/TranslationTests.java index 27b0e107d..27bd038c8 100644 --- a/tests/src/com/todoroo/andlib/test/TranslationTests.java +++ b/tests/src/com/todoroo/andlib/test/TranslationTests.java @@ -16,7 +16,7 @@ import java.util.Locale; import android.content.res.Resources; -import com.timsu.astrid.R; +import org.astrid.R; /** * Tests translations for consistency with the default values. You must diff --git a/tests/src/com/todoroo/astrid/backup/BackupServiceTests.java b/tests/src/com/todoroo/astrid/backup/BackupServiceTests.java index c3f6d7536..69f8c31af 100644 --- a/tests/src/com/todoroo/astrid/backup/BackupServiceTests.java +++ b/tests/src/com/todoroo/astrid/backup/BackupServiceTests.java @@ -11,7 +11,7 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.astrid.backup.BackupService.BackupDirectorySetting; diff --git a/tests/src/com/todoroo/astrid/reminders/NotificationTests.java b/tests/src/com/todoroo/astrid/reminders/NotificationTests.java index ada98430c..a3ad324ff 100644 --- a/tests/src/com/todoroo/astrid/reminders/NotificationTests.java +++ b/tests/src/com/todoroo/astrid/reminders/NotificationTests.java @@ -10,7 +10,7 @@ import java.util.Date; import android.app.Notification; import android.content.Intent; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.NotificationManager; import com.todoroo.andlib.utility.DateUtilities; diff --git a/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java b/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java index 70de96bc1..f4dbd7136 100644 --- a/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java +++ b/tests/src/com/todoroo/astrid/repeats/NewRepeatTests.java @@ -16,7 +16,7 @@ import com.google.ical.values.Frequency; import com.google.ical.values.RRule; import com.google.ical.values.Weekday; import com.google.ical.values.WeekdayNum; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.sql.Query; diff --git a/tests/src/com/todoroo/astrid/service/TitleParserTest.java b/tests/src/com/todoroo/astrid/service/TitleParserTest.java index c925cceb6..2b47bf2d6 100644 --- a/tests/src/com/todoroo/astrid/service/TitleParserTest.java +++ b/tests/src/com/todoroo/astrid/service/TitleParserTest.java @@ -12,7 +12,7 @@ import java.util.Date; import com.google.ical.values.Frequency; import com.google.ical.values.RRule; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.test.DatabaseTestCase; diff --git a/tests/src/com/todoroo/astrid/test/AstridTranslationTests.java b/tests/src/com/todoroo/astrid/test/AstridTranslationTests.java index 822077c69..ee4ca66a5 100644 --- a/tests/src/com/todoroo/astrid/test/AstridTranslationTests.java +++ b/tests/src/com/todoroo/astrid/test/AstridTranslationTests.java @@ -11,7 +11,7 @@ import java.util.Locale; import android.content.res.Resources; -import com.timsu.astrid.R; +import org.astrid.R; import com.todoroo.andlib.test.TranslationTests; public class AstridTranslationTests extends TranslationTests {