Example usage for android.os Bundle EMPTY

List of usage examples for android.os Bundle EMPTY

Introduction

In this page you can find the example usage for android.os Bundle EMPTY.

Prototype

Bundle EMPTY

To view the source code for android.os Bundle EMPTY.

Click Source Link

Usage

From source file:org.peterbaldwin.vlcremote.fragment.BrowseFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mAdapter = new DirectoryAdapter(getActivity());
    setListAdapter(mAdapter);//from ww  w . j a va 2 s.com
    registerForContextMenu(getListView());
    if (getMediaServer() != null) {
        getLoaderManager().initLoader(Data.DIRECTORY, Bundle.EMPTY, this);
    }
}

From source file:com.goliathonline.android.kegbot.service.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    Log.d(TAG, "onHandleIntent(intent=" + intent.toString() + ")");

    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
    if (receiver != null)
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);

    final Context context = this;
    final SharedPreferences prefs = getSharedPreferences(Prefs.IOSCHED_SYNC, Context.MODE_PRIVATE);
    final int localVersion = prefs.getInt(Prefs.LOCAL_VERSION, VERSION_NONE);

    try {/*from  ww w.j  a va2  s  . c  o m*/
        // Bulk of sync work, performed by executing several fetches from
        // local and online sources.

        final long startLocal = System.currentTimeMillis();
        final boolean localParse = localVersion < VERSION_CURRENT;
        Log.d(TAG, "found localVersion=" + localVersion + " and VERSION_CURRENT=" + VERSION_CURRENT);
        if (localParse) {

            // Parse values from local cache first, since spreadsheet copy
            // or network might be down.
            //mLocalExecutor.execute(context, "cache-drinks.json", new RemoteDrinksHandler());
            //mLocalExecutor.execute(context, "cache-speakers.xml", new RemoteSpeakersHandler());
            //mLocalExecutor.execute(context, "cache-vendors.xml", new RemoteVendorsHandler());

            // Save local parsed version
            prefs.edit().putInt(Prefs.LOCAL_VERSION, VERSION_CURRENT).commit();
        }
        Log.d(TAG, "local sync took " + (System.currentTimeMillis() - startLocal) + "ms");

        // Always hit remote spreadsheet for any updates
        final long startRemote = System.currentTimeMillis();
        mRemoteExecutor.executeGet(PrefsHelper.getAPIUrl(getBaseContext()) + "/events",
                new RemoteJsonHandler(mRemoteExecutor));
        Log.d(TAG, "remote sync took " + (System.currentTimeMillis() - startRemote) + "ms");

    } catch (Exception e) {
        Log.e(TAG, "Problem while syncing", e);

        if (receiver != null) {
            // Pass back error to surface listener
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            receiver.send(STATUS_ERROR, bundle);
        }
    }

    // Announce success to any surface listener
    Log.d(TAG, "sync finished");
    if (receiver != null)
        receiver.send(STATUS_FINISHED, Bundle.EMPTY);
}

From source file:ca.mudar.mtlaucasou.services.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
    if (receiver != null) {
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);
    }/*from  w  w  w.j  av a  2 s .co m*/

    final Context context = this;

    try {
        // Bulk of sync work, performed by executing several fetches from
        // local and online sources.

        final long startLocal = System.currentTimeMillis();

        /**
         * Five Assets files to load, so progress goes by 20%.
         */
        Bundle bundle = new Bundle();
        bundle.putInt(Const.KEY_BUNDLE_PROGRESS_INCREMENT, 20);

        // Parse values from local cache first, since SecurityServices copy
        // or network might be down.

        receiver.send(STATUS_RUNNING, bundle);
        mLocalExecutor.execute(context, KmlLocalAssets.FIRE_HALLS,
                new RemotePlacemarksHandler(FireHalls.CONTENT_URI, true));

        receiver.send(STATUS_RUNNING, bundle);
        mLocalExecutor.execute(context, KmlLocalAssets.SPVM_STATIONS,
                new RemotePlacemarksHandler(SpvmStations.CONTENT_URI, true));

        receiver.send(STATUS_RUNNING, bundle);
        mLocalExecutor.execute(context, KmlLocalAssets.WATER_SUPPLIES,
                new RemotePlacemarksHandler(WaterSupplies.CONTENT_URI));

        receiver.send(STATUS_RUNNING, bundle);
        mLocalExecutor.execute(context, KmlLocalAssets.EMERGENCY_HOSTELS,
                new RemotePlacemarksHandler(EmergencyHostels.CONTENT_URI));

        receiver.send(STATUS_RUNNING, bundle);
        mLocalExecutor.execute(context, KmlLocalAssets.CONDITIONED_PLACES,
                new RemotePlacemarksHandler(ConditionedPlaces.CONTENT_URI));

        Log.v(TAG, "Sync duration: " + (System.currentTimeMillis() - startLocal) + " ms");

        // TODO: update data from remote source
        // Always hit remote SecurityServices for any updates
        // final long startRemote = System.currentTimeMillis();
        // mRemoteExecutor
        // .executeGet(WORKSHEETS_URL, new
        // RemoteSecurityServicesHandler(mRemoteExecutor));
        // Log.d(TAG, "remote sync took " + (System.currentTimeMillis() -
        // startRemote) + "ms");

    } catch (Exception e) {
        Log.e(TAG, e.getMessage());

        if (receiver != null) {
            /**
             * Pass back error to surface listener
             */
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            receiver.send(STATUS_ERROR, bundle);
        }
    }

    if (receiver != null) {
        receiver.send(STATUS_FINISHED, Bundle.EMPTY);
    }
}

From source file:ca.mudar.parkcatcher.service.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    final boolean isLocal = intent.getBooleanExtra(Const.INTENT_EXTRA_SERVICE_LOCAL, false);
    final boolean isRemote = intent.getBooleanExtra(Const.INTENT_EXTRA_SERVICE_REMOTE, false);

    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
    if (receiver != null) {
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);
    }/*ww w  .  jav  a  2 s.  com*/

    try {
        // Bulk of sync work, performed by executing several fetches from
        // local and online sources.
        if (isLocal) {
            syncLocal();
            ((ParkingApp) getApplicationContext()).setHasLoadedData(true);
        }
        if (isRemote) {
            syncRemote();
            ((ParkingApp) getApplicationContext()).setHasLoadedData(true);
        }

    } catch (HandlerException e) {
        e.printStackTrace();

        if (receiver != null) {
            /**
             * Pass back error to surface listener
             */
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            receiver.send(STATUS_ERROR, bundle);
        }
    }

    if (receiver != null) {
        receiver.send(STATUS_FINISHED, Bundle.EMPTY);
    }
}

From source file:net.peterkuterna.android.apps.devoxxsched.service.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
    if (receiver != null)
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);

    final Context context = this;
    final SharedPreferences syncServicePrefs = getSharedPreferences(SyncPrefs.DEVOXXSCHED_SYNC,
            Context.MODE_PRIVATE);
    final int localVersion = syncServicePrefs.getInt(SyncPrefs.LOCAL_VERSION, VERSION_NONE);
    final long lastRemoteSync = syncServicePrefs.getLong(SyncPrefs.LAST_REMOTE_SYNC, 0);

    try {//from  w w  w  . j  ava  2  s .  co m
        // Bulk of sync work, performed by executing several fetches from
        // local and online sources.

        final long startLocal = System.currentTimeMillis();
        final boolean localParse = localVersion < VERSION_LOCAL;
        Log.d(TAG, "found localVersion=" + localVersion + " and VERSION_LOCAL=" + VERSION_LOCAL);
        if (localParse) {
            // Parse values from local cache first
            mLocalExecutor.execute(R.xml.search_suggest, new LocalSearchSuggestHandler());
            mLocalExecutor.execute(context, "cache-rooms.json", new RemoteRoomsHandler());
            mLocalExecutor.execute(context, "cache-presentationtypes.json", new RemoteSessionTypesHandler());
            mLocalExecutor.execute(context, "cache-speakers.json", new RemoteSpeakersHandler());
            mLocalExecutor.execute(context, "cache-presentations.json", new RemoteSessionsHandler());
            mLocalExecutor.execute(context, "cache-schedule.json", new RemoteScheduleHandler());

            // Save local parsed version
            syncServicePrefs.edit().putInt(SyncPrefs.LOCAL_VERSION, VERSION_LOCAL).commit();
        }
        Log.d(TAG, "local sync took " + (System.currentTimeMillis() - startLocal) + "ms");

        final long startRemote = System.currentTimeMillis();
        boolean performRemoteSync = performRemoteSync(mResolver, mHttpClient, intent, context);
        if (performRemoteSync) {
            // Parse values from REST interface
            ArrayList<RequestHash> result = mRemoteExecutor.executeGet(new String[] { Constants.ROOMS_URL, },
                    new RemoteRoomsHandler());
            for (RequestHash requestHash : result) {
                SyncUtils.updateLocalMd5(mResolver, requestHash.getUrl(), requestHash.getMd5());
            }
            result = mRemoteExecutor.executeGet(new String[] { Constants.LABS_PRESENTATION_TYPES_URL, },
                    new RemoteSessionTypesHandler());
            for (RequestHash requestHash : result) {
                SyncUtils.updateLocalMd5(mResolver, requestHash.getUrl(), requestHash.getMd5());
            }
            result = mRemoteExecutor.executeGet(
                    new String[] { Constants.SPEAKERS_URL, Constants.LABS_SPEAKERS_URL, },
                    new RemoteSpeakersHandler());
            for (RequestHash requestHash : result) {
                SyncUtils.updateLocalMd5(mResolver, requestHash.getUrl(), requestHash.getMd5());
            }
            result = mRemoteExecutor.executeGet(
                    new String[] { Constants.PRESENTATIONS_URL, Constants.LABS_PRESENTATIONS_URL, },
                    new RemoteSessionsHandler());
            for (RequestHash requestHash : result) {
                SyncUtils.updateLocalMd5(mResolver, requestHash.getUrl(), requestHash.getMd5());
            }
            result = mRemoteExecutor.executeGet(
                    new String[] { Constants.SCHEDULE_URL, Constants.LABS_SCHEDULE_URL, },
                    new RemoteScheduleHandler());
            for (RequestHash requestHash : result) {
                SyncUtils.updateLocalMd5(mResolver, requestHash.getUrl(), requestHash.getMd5());
            }

            // Save last remote sync time
            syncServicePrefs.edit().putLong(SyncPrefs.LAST_REMOTE_SYNC, startRemote).commit();
            // Save remote parsed version
            syncServicePrefs.edit().putInt(SyncPrefs.LOCAL_VERSION, VERSION_REMOTE).commit();
        }
        Log.d(TAG, "remote sync took " + (System.currentTimeMillis() - startRemote) + "ms");

        if (!localParse && performRemoteSync) {
            NotificationUtils.cancelNotifications(context);
            NotificationUtils.notifyNewSessions(context, getContentResolver());
            NotificationUtils.notifyChangedStarredSessions(context, getContentResolver());
        }
    } catch (Exception e) {
        Log.e(TAG, "Problem while syncing", e);

        if (receiver != null) {
            // Pass back error to surface listener
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            receiver.send(STATUS_ERROR, bundle);
        }
    }

    // Announce success to any surface listener
    Log.d(TAG, "sync finished");
    if (receiver != null)
        receiver.send(STATUS_FINISHED, Bundle.EMPTY);
}

From source file:andlabs.lounge.service.LoungeServiceImpl.java

public void setMessageHandler(MessageHandler pMessageHandler) {
    mMessageHandler = pMessageHandler;/*from w  ww.  ja v  a 2  s.  c om*/
    Message message = Message.obtain();
    message.what = 42;
    message.setData(Bundle.EMPTY);
    mMessageHandler.send(message);
}

From source file:com.google.android.apps.iosched.service.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    Log.d(TAG, "onHandleIntent(intent=" + intent.toString() + ")");

    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
    if (receiver != null)
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);

    final Context context = this;
    final SharedPreferences prefs = getSharedPreferences(Prefs.IOSCHED_SYNC, Context.MODE_PRIVATE);
    final int localVersion = prefs.getInt(Prefs.LOCAL_VERSION, VERSION_NONE);

    try {/*from  ww  w .  jav  a  2s .  c om*/
        // Bulk of sync work, performed by executing several fetches from
        // local and online sources.

        final long startLocal = System.currentTimeMillis();
        final boolean localParse = localVersion < VERSION_CURRENT;
        Log.d(TAG, "found localVersion=" + localVersion + " and VERSION_CURRENT=" + VERSION_CURRENT);
        if (localParse) {
            // Load static local data
            mLocalExecutor.execute(R.xml.blocks, new LocalBlocksHandler());
            mLocalExecutor.execute(R.xml.rooms, new LocalRoomsHandler());
            mLocalExecutor.execute(R.xml.tracks, new LocalTracksHandler());
            mLocalExecutor.execute(R.xml.search_suggest, new LocalSearchSuggestHandler());
            mLocalExecutor.execute(R.xml.sessions, new LocalSessionsHandler());

            // Parse values from local cache first, since spreadsheet copy
            // or network might be down.
            mLocalExecutor.execute(context, "cache-sessions.xml", new RemoteSessionsHandler());
            mLocalExecutor.execute(context, "cache-speakers.xml", new RemoteSpeakersHandler());
            mLocalExecutor.execute(context, "cache-vendors.xml", new RemoteVendorsHandler());

            // Save local parsed version
            prefs.edit().putInt(Prefs.LOCAL_VERSION, VERSION_CURRENT).commit();
        }
        Log.d(TAG, "local sync took " + (System.currentTimeMillis() - startLocal) + "ms");

        // Always hit remote spreadsheet for any updates
        final long startRemote = System.currentTimeMillis();
        mRemoteExecutor.executeGet(WORKSHEETS_URL, new RemoteWorksheetsHandler(mRemoteExecutor));
        Log.d(TAG, "remote sync took " + (System.currentTimeMillis() - startRemote) + "ms");

    } catch (Exception e) {
        Log.e(TAG, "Problem while syncing", e);

        if (receiver != null) {
            // Pass back error to surface listener
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            receiver.send(STATUS_ERROR, bundle);
        }
    }

    // Announce success to any surface listener
    Log.d(TAG, "sync finished");
    if (receiver != null)
        receiver.send(STATUS_FINISHED, Bundle.EMPTY);
}

From source file:org.ietf.ietfsched.service.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
    if (debbug)/*from ww w .ja v  a2 s .c  o  m*/
        Log.d(TAG, "Receiver is = " + receiver);
    if (receiver != null)
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);
    final Context context = this;
    final SharedPreferences prefs = getSharedPreferences(Prefs.IETFSCHED_SYNC, Context.MODE_PRIVATE);
    final int localVersion = prefs.getInt(Prefs.LOCAL_VERSION, VERSION_NONE);
    //      final int lastLength = prefs.getInt(Prefs.LAST_LENGTH, VERSION_NONE);
    final String lastEtag = prefs.getString(Prefs.LAST_ETAG, "");
    //      final long startLocal = System.currentTimeMillis();

    //boolean localParse = localVersion < VERSION_CURRENT;
    boolean localParse = false;
    Log.d(TAG, "found localVersion=" + localVersion + " and VERSION_CURRENT=" + VERSION_CURRENT);
    boolean remoteParse = true;
    //      int remoteLength = -1;
    String remoteEtag = "";

    try {
        String htmlURL = BASE_URL + "agenda.csv";
        if (debbug)
            Log.d(TAG, "HEAD " + htmlURL);
        remoteEtag = mRemoteExecutor.executeHead(htmlURL);
        if (debbug)
            Log.d(TAG, "HEAD " + htmlURL + " " + remoteEtag);
        if (remoteEtag == null) {
            Log.d(TAG, "Error connection, cannot retrieve any information from" + htmlURL);
            remoteParse = false;
        } else {
            remoteParse = !remoteEtag.equals(lastEtag);
        }
    } catch (Exception e) {
        remoteParse = false;
        e.printStackTrace();
    }

    // HACK FOR TESTS PURPOSES. TO REMOVE 
    //      Log.w(TAG, "For tests purposes, only the local parsing is activated");
    //      remoteParse = false;
    //      localParse = true;
    // HACK FIN.   

    if (!remoteParse && !localParse) {
        Log.d(TAG, "Already synchronized");
        if (receiver != null)
            receiver.send(STATUS_FINISHED, Bundle.EMPTY);
        return;
    }

    if (remoteParse) {
        String csvURL = BASE_URL + "agenda.csv";
        try {
            if (debbug)
                Log.d(TAG, csvURL);
            InputStream agenda = mRemoteExecutor.executeGet(csvURL);
            mLocalExecutor.execute(agenda);
            prefs.edit().putString(Prefs.LAST_ETAG, remoteEtag).commit();
            prefs.edit().putInt(Prefs.LOCAL_VERSION, VERSION_CURRENT).commit();
            localParse = false;
            Log.d(TAG, "remote sync finished");
            if (receiver != null)
                receiver.send(STATUS_FINISHED, Bundle.EMPTY);
        } catch (Exception e) {
            Log.e(TAG, "Error HTTP request " + csvURL, e);
            if (!localParse) {
                final Bundle bundle = new Bundle();
                bundle.putString(Intent.EXTRA_TEXT, "Connection error. No updates.");
                if (receiver != null) {
                    receiver.send(STATUS_ERROR, bundle);
                }
            }
        }
    }

    if (localParse) {
        try {
            mLocalExecutor.execute(context, "agenda-83.csv");
            Log.d(TAG, "local sync finished");
            prefs.edit().putInt(Prefs.LOCAL_VERSION, VERSION_CURRENT).commit();
            if (receiver != null)
                receiver.send(STATUS_FINISHED, Bundle.EMPTY);
        } catch (Exception e) {
            e.printStackTrace();
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            if (receiver != null) {
                receiver.send(STATUS_ERROR, bundle);
            }
        }
    }
}

From source file:com.google.android.apps.iosched2.service.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    Log.d(TAG, "onHandleIntent(intent=" + intent.toString() + ")");

    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);
    if (receiver != null)
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);

    final Context context = this;
    final SharedPreferences prefs = getSharedPreferences(Prefs.SCHED_SYNC, Context.MODE_PRIVATE);
    final int localVersion = prefs.getInt(Prefs.LOCAL_VERSION, VERSION_NONE);

    try {/*from  w  w w  .j a va  2  s  .c om*/
        // Bulk of sync work, performed by executing several fetches from
        // local and online sources.

        final long startLocal = System.currentTimeMillis();
        final boolean localParse = localVersion < VERSION_CURRENT;
        Log.d(TAG, "found localVersion=" + localVersion + " and VERSION_CURRENT=" + VERSION_CURRENT);
        if (localParse) {
            // Load static local data
            mLocalExecutor.execute(Setup.BLOCKS_XML, new LocalBlocksHandler());
            mLocalExecutor.execute(Setup.ROOMS_XML, new LocalRoomsHandler());

            //                  mLocalExecutor.execute(R.xml.blocks, new LocalBlocksHandler());
            //                  mLocalExecutor.execute(R.xml.rooms, new LocalRoomsHandler());

            mLocalExecutor.execute(R.xml.tracks, new LocalTracksHandler());
            mLocalExecutor.execute(R.xml.search_suggest, new LocalSearchSuggestHandler());
            mLocalExecutor.execute(R.xml.sessions, new LocalSessionsHandler());

            // Parse values from local cache first, since spreadsheet copy
            // or network might be down.
            mLocalExecutor.execute(context, Setup.EVENT_PREFIX + "cache-sessions.xml",
                    new RemoteSessionsHandler());
            mLocalExecutor.execute(context, Setup.EVENT_PREFIX + "cache-speakers.xml",
                    new RemoteSpeakersHandler());

            if (Setup.FEATURE_VENDORS_ON) {
                mLocalExecutor.execute(context, Setup.EVENT_PREFIX + "cache-vendors.xml",
                        new RemoteVendorsHandler());
            }
            // Save local parsed version
            prefs.edit().putInt(Prefs.LOCAL_VERSION, VERSION_CURRENT).commit();
        }
        Log.d(TAG, "local sync took " + (System.currentTimeMillis() - startLocal) + "ms");

        // Always hit remote spreadsheet for any updates
        final long startRemote = System.currentTimeMillis();
        mRemoteExecutor.executeGet(WORKSHEETS_URL, new RemoteWorksheetsHandler(mRemoteExecutor));
        Log.d(TAG, "remote sync took " + (System.currentTimeMillis() - startRemote) + "ms");

    } catch (Exception e) {
        Log.e(TAG, "Problem while syncing", e);

        if (receiver != null) {
            // Pass back error to surface listener
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            receiver.send(STATUS_ERROR, bundle);
        }
    }

    // Announce success to any surface listener
    Log.d(TAG, "sync finished");
    if (receiver != null)
        receiver.send(STATUS_FINISHED, Bundle.EMPTY);
}

From source file:com.kuacm.expo2013.service.SyncService.java

@Override
protected void onHandleIntent(Intent intent) {
    Log.d(TAG, "onHandleIntent(intent=" + intent.toString() + ")");

    final ResultReceiver receiver = intent.getParcelableExtra(EXTRA_STATUS_RECEIVER);

    if (receiver != null)
        receiver.send(STATUS_RUNNING, Bundle.EMPTY);

    final Context context = this;
    final SharedPreferences prefs = getSharedPreferences(Prefs.IOSCHED_SYNC, Context.MODE_PRIVATE);
    final int localVersion = prefs.getInt(Prefs.LOCAL_VERSION, VERSION_NONE);

    try {//from  w w w  .j a  va  2s.com
        // Bulk of sync work, performed by executing several fetches from
        // local and online sources.

        final long startLocal = System.currentTimeMillis();
        final boolean localParse = localVersion < VERSION_CURRENT;
        Log.d(TAG, "found localVersion=" + localVersion + " and VERSION_CURRENT=" + VERSION_CURRENT);
        if (localParse) {
            // Load static local data
            mLocalExecutor.execute(R.xml.blocks, new LocalBlocksHandler());
            mLocalExecutor.execute(R.xml.rooms, new LocalRoomsHandler());
            mLocalExecutor.execute(R.xml.tracks, new LocalTracksHandler());
            mLocalExecutor.execute(R.xml.search_suggest, new LocalSearchSuggestHandler());
            mLocalExecutor.execute(R.xml.sessions, new LocalSessionsHandler());

            // Parse values from local cache first, since spreadsheet copy
            // or network might be down.
            mLocalExecutor.execute(context, "cache-sessions.xml", new RemoteSessionsHandler());
            mLocalExecutor.execute(context, "cache-speakers.xml", new RemoteSpeakersHandler());
            mLocalExecutor.execute(context, "cache-vendors.xml", new RemoteVendorsHandler());

            // Save local parsed version
            prefs.edit().putInt(Prefs.LOCAL_VERSION, VERSION_CURRENT).commit();
        }
        Log.d(TAG, "local sync took " + (System.currentTimeMillis() - startLocal) + "ms");

        // Always hit remote spreadsheet for any updates
        final long startRemote = System.currentTimeMillis();

        mRemoteExecutor.executeGet(WORKSHEETS_URL, new RemoteWorksheetsHandler(mRemoteExecutor));

        Log.d(TAG, "remote sync took " + (System.currentTimeMillis() - startRemote) + "ms");

    } catch (Exception e) {
        Log.e(TAG, "Problem while syncing", e);

        if (receiver != null) {
            // Pass back error to surface listener
            final Bundle bundle = new Bundle();
            bundle.putString(Intent.EXTRA_TEXT, e.toString());
            receiver.send(STATUS_ERROR, bundle);
        }
    }

    // Announce success to any surface listener
    Log.d(TAG, "sync finished");
    if (receiver != null)
        receiver.send(STATUS_FINISHED, Bundle.EMPTY);
}