+ * sendMaps and newMap -> {@link SendMapsActivity} + *
+ * sendMaps and !newMap -> {@link ChooseMapActivity} + *
+ * !sendMaps && sendFusionTables -> {@link SendFusionTablesActivity} + *
+ * !sendMaps && !sendFusionTables && sendDocs -> {@link SendDocsActivity} + *
+ * !sendMaps && !sendFusionTables && !sendDocs -> {@link UploadResultActivity}
+ *
+ * @param account the chosen account
+ */
+ private void startNextActivity(Account account) {
+ sendRequest.setAccount(account);
+
+ Class> next;
+ if (sendRequest.isSendMaps()) {
+ next = sendRequest.isNewMap() ? SendMapsActivity.class : ChooseMapActivity.class;
+ } else if (sendRequest.isSendFusionTables()) {
+ next = SendFusionTablesActivity.class;
+ } else if (sendRequest.isSendDocs()) {
+ next = SendDocsActivity.class;
+ } else {
+ next = UploadResultActivity.class;
+ }
+ Intent intent = new Intent(this, next)
+ .putExtra(SendRequest.SEND_REQUEST_KEY, sendRequest);
+ startActivity(intent);
+ finish();
+ }
+}
\ No newline at end of file
diff --git a/MyTracks/src/com/google/android/apps/mytracks/io/sendtogoogle/SendActivity.java b/MyTracks/src/com/google/android/apps/mytracks/io/sendtogoogle/SendActivity.java
deleted file mode 100644
index c53f36302..000000000
--- a/MyTracks/src/com/google/android/apps/mytracks/io/sendtogoogle/SendActivity.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright 2011 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.google.android.apps.mytracks.io.sendtogoogle;
-
-import static com.google.android.apps.mytracks.Constants.TAG;
-
-import com.google.android.apps.analytics.GoogleAnalyticsTracker;
-import com.google.android.apps.mytracks.Constants;
-import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
-import com.google.android.apps.mytracks.content.Track;
-import com.google.android.apps.mytracks.io.docs.SendDocsActivity;
-import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
-import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesUtils;
-import com.google.android.apps.mytracks.io.maps.ChooseMapActivity;
-import com.google.android.apps.mytracks.io.maps.SendMapsActivity;
-import com.google.android.apps.mytracks.io.maps.SendMapsUtils;
-import com.google.android.apps.mytracks.util.SystemUtils;
-import com.google.android.maps.mytracks.R;
-
-import android.accounts.Account;
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.util.Log;
-
-/**
- * Helper activity for managing the sending of tracks to Google services.
- *
- * @author Rodrigo Damazio
- */
-public class SendActivity extends Activity {
-
- // Items in the intent that starts the activity.
- public static final String TRACK_ID = "trackId";
- public static final String SHARE_URL = "shareUrl";
- public static final String SEND_MAPS = "sendMaps";
- public static final String SEND_FUSION_TABLES = "sendFusionTables";
- public static final String SEND_DOCS = "sendDocs";
- public static final String CREATE_MAP = "createMap";
-
- // Keys for saved state variables.
- private static final String STATE_STATE = "state";
- private static final String STATE_ACCOUNT = "account";
- private static final String STATE_MAP_ID = "mapId";
- private static final String STATE_DOCS_SUCCESS = "docsSuccess";
- private static final String STATE_FUSION_TABLES_SUCCESS = "fusionTablesSuccess";
- private static final String STATE_MAPS_SUCCESS = "mapsSuccess";
-
- /** States for the state machine that defines the upload process. */
- private enum SendState {
- CHOOSE_ACCOUNT,
- CHOOSE_MAP,
- START,
- SEND_TO_MAPS,
- SEND_TO_MAPS_DONE,
- SEND_TO_FUSION_TABLES,
- SEND_TO_FUSION_TABLES_DONE,
- SEND_TO_DOCS,
- SEND_TO_DOCS_DONE,
- SHOW_RESULTS,
- FINISH,
- DONE,
- NOT_READY
- }
-
- // Set in Activity.onCreate
- private MyTracksProviderUtils providerUtils;
- private GoogleAnalyticsTracker tracker;
-
- // Send request information. Set by the intent that starts the activity.
- private long sendTrackId;
- private boolean shareRequest;
- private boolean sendToMaps;
- private boolean sendToMapsNewMap;
- private boolean sendToFusionTables;
- private boolean sendToDocs;
-
- // Current sending state.
- private SendState currentState;
-
- // Authentication information.
- private Account account;
-
- // Map id from choosing a Google Map
- private String mapId;
-
- // Send result information. Used by the results dialog.
- private boolean sendToMapsSuccess;
- private boolean sendToFusionTablesSuccess;
- private boolean sendToDocsSuccess;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- Log.d(TAG, "SendActivity.onCreate");
- super.onCreate(savedInstanceState);
-
- if (!handleIntent()) {
- finish();
- return;
- }
-
- providerUtils = MyTracksProviderUtils.Factory.get(this);
-
- tracker = GoogleAnalyticsTracker.getInstance();
- // Start the tracker in manual dispatch mode...
- tracker.start(getString(R.string.my_tracks_analytics_id),
- getApplicationContext());
- tracker.setProductVersion("android-mytracks",
- SystemUtils.getMyTracksVersion(this));
-
- resetState();
-
- if (savedInstanceState != null) {
- restoreInstanceState(savedInstanceState);
- }
-
- // If we had the instance restored after it was done, reset it.
- if (currentState == SendState.DONE) {
- finish();
- return;
- }
-
- // Execute the state machine, at the start or restored state.
- Log.w(TAG, "Starting at state " + currentState);
- executeStateMachine(currentState);
- }
-
- private boolean handleIntent() {
- Intent intent = getIntent();
- sendTrackId = intent.getLongExtra(TRACK_ID, -1L);
- if (sendTrackId == -1L) {
- return false;
- }
- sendToMaps = intent.getBooleanExtra(SEND_MAPS, false);
- sendToFusionTables = intent.getBooleanExtra(SEND_FUSION_TABLES, false);
- sendToDocs = intent.getBooleanExtra(SEND_DOCS, false);
- if (!sendToMaps && !sendToFusionTables && !sendToDocs) {
- return false;
- }
- sendToMapsNewMap = intent.getBooleanExtra(CREATE_MAP, true);
- return true;
- }
-
- private void restoreInstanceState(Bundle savedInstanceState) {
- currentState = SendState.values()[savedInstanceState.getInt(STATE_STATE)];
- account = savedInstanceState.getParcelable(STATE_ACCOUNT);
- mapId = savedInstanceState.getString(STATE_MAP_ID);
- sendToMapsSuccess = savedInstanceState.getBoolean(STATE_MAPS_SUCCESS);
- sendToFusionTablesSuccess = savedInstanceState.getBoolean(STATE_FUSION_TABLES_SUCCESS);
- sendToDocsSuccess = savedInstanceState.getBoolean(STATE_DOCS_SUCCESS);
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- outState.putInt(STATE_STATE, currentState.ordinal());
- outState.putParcelable(STATE_ACCOUNT, account);
- outState.putString(STATE_MAP_ID, mapId);
- outState.putBoolean(STATE_MAPS_SUCCESS, sendToMapsSuccess);
- outState.putBoolean(STATE_FUSION_TABLES_SUCCESS, sendToFusionTablesSuccess);
- outState.putBoolean(STATE_DOCS_SUCCESS, sendToDocsSuccess);
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- Log.d(TAG, "SendActivity.onStop, state=" + currentState);
- tracker.dispatch();
- tracker.stop();
- }
-
- private void executeStateMachine(SendState startState) {
- currentState = startState;
-
- // If a state handler returns NOT_READY, it means it's waiting for some
- // event, and will call this method again when it happens.
- while (currentState != SendState.DONE &&
- currentState != SendState.NOT_READY) {
- Log.d(TAG, "Executing state " + currentState);
- currentState = executeState(currentState);
- Log.d(TAG, "New state is " + currentState);
- }
- }
-
- private SendState executeState(SendState state) {
- switch (state) {
- case CHOOSE_ACCOUNT:
- return chooseAccount();
- case CHOOSE_MAP:
- return chooseMap();
- case START:
- return startSend();
- case SEND_TO_MAPS:
- return sendToGoogleMaps();
- case SEND_TO_MAPS_DONE:
- return onSendToGoogleMapsDone();
- case SEND_TO_FUSION_TABLES:
- return sendToFusionTables();
- case SEND_TO_FUSION_TABLES_DONE:
- return onSendToFusionTablesDone();
- case SEND_TO_DOCS:
- return sendToGoogleDocs();
- case SEND_TO_DOCS_DONE:
- return onSendToGoogleDocsDone();
- case SHOW_RESULTS:
- return onSendToGoogleDone();
- case FINISH:
- return onAllDone();
- default:
- Log.e(TAG, "Reached a non-executable state");
- return null;
- }
- }
-
- private SendState chooseAccount() {
- Intent intent = new Intent(this, AccountChooserActivity.class);
- startActivityForResult(intent, Constants.CHOOSE_ACCOUNT);
- return SendState.NOT_READY;
- }
-
- /**
- * Initiates the process to send tracks to google.
- * This is called once the user has selected sending options via the
- * SendToGoogleDialog.
- */
- private SendState startSend() {
- if (sendToMaps) {
- return SendState.SEND_TO_MAPS;
- } else if (sendToFusionTables) {
- return SendState.SEND_TO_FUSION_TABLES;
- } else if (sendToDocs) {
- return SendState.SEND_TO_DOCS;
- } else {
- Log.w(TAG, "Nowhere to upload to");
- return SendState.FINISH;
- }
- }
-
- private SendState chooseMap() {
- if (!sendToMapsNewMap) {
- Intent intent = new Intent(this, ChooseMapActivity.class)
- .putExtra(ChooseMapActivity.ACCOUNT, account);
- startActivityForResult(intent, Constants.CHOOSE_MAP);
- return SendState.NOT_READY;
- } else {
- return SendState.START;
- }
- }
-
- private SendState sendToGoogleMaps() {
- tracker.trackPageView("/send/maps");
- Intent intent = new Intent(this, SendMapsActivity.class)
- .putExtra(SendMapsActivity.ACCOUNT, account)
- .putExtra(SendMapsActivity.TRACK_ID, sendTrackId)
- .putExtra(SendMapsActivity.MAP_ID, mapId);
- startActivityForResult(intent, Constants.SEND_MAPS);
- return SendState.NOT_READY;
- }
-
- private SendState onSendToGoogleMapsDone() {
- if (sendToFusionTables) {
- return SendState.SEND_TO_FUSION_TABLES;
- } else if (sendToDocs) {
- return SendState.SEND_TO_DOCS;
- } else {
- return SendState.SHOW_RESULTS;
- }
- }
-
- private SendState sendToFusionTables() {
- tracker.trackPageView("/send/fusion_tables");
- Intent intent = new Intent(this, SendFusionTablesActivity.class)
- .putExtra(SendFusionTablesActivity.ACCOUNT, account)
- .putExtra(SendFusionTablesActivity.TRACK_ID, sendTrackId);
- startActivityForResult(intent, Constants.SEND_FUSION_TABLES);
- return SendState.NOT_READY;
- }
-
- private SendState onSendToFusionTablesDone() {
- if (sendToDocs) {
- return SendState.SEND_TO_DOCS;
- } else {
- return SendState.SHOW_RESULTS;
- }
- }
-
- private SendState sendToGoogleDocs() {
- tracker.trackPageView("/send/docs");
- Intent intent = new Intent(this, SendDocsActivity.class)
- .putExtra(SendFusionTablesActivity.ACCOUNT, account)
- .putExtra(SendFusionTablesActivity.TRACK_ID, sendTrackId);
- startActivityForResult(intent, Constants.SEND_DOCS);
- return SendState.NOT_READY;
- }
-
- private SendState onSendToGoogleDocsDone() {
- return SendState.SHOW_RESULTS;
- }
-
- private SendState onSendToGoogleDone() {
- tracker.dispatch();
- Track track = providerUtils.getTrack(sendTrackId);
- String mapsUrl = sendToMaps && sendToMapsSuccess ? SendMapsUtils.getMapUrl(track) : null;
- String fusionTablesUrl = sendToFusionTables && sendToFusionTablesSuccess
- ? SendFusionTablesUtils.getMapUrl(track) : null;
- Intent intent = new Intent(this, UploadResultActivity.class)
- .putExtra(UploadResultActivity.HAS_MAPS_RESULT, sendToMaps)
- .putExtra(UploadResultActivity.HAS_FUSION_TABLES_RESULT, sendToFusionTables)
- .putExtra(UploadResultActivity.HAS_DOCS_RESULT, sendToDocs)
- .putExtra(UploadResultActivity.MAPS_SUCCESS, sendToMapsSuccess)
- .putExtra(UploadResultActivity.FUSION_TABLES_SUCCESS, sendToFusionTablesSuccess)
- .putExtra(UploadResultActivity.DOCS_SUCCESS, sendToDocsSuccess)
- .putExtra(UploadResultActivity.SHARE_REQUEST, shareRequest)
- .putExtra(UploadResultActivity.MAPS_URL, mapsUrl)
- .putExtra(UploadResultActivity.FUSION_TABLES_URL, fusionTablesUrl);
- startActivity(intent);
- return SendState.FINISH;
- }
-
- private SendState onAllDone() {
- finish();
- return SendState.DONE;
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode,
- final Intent results) {
- SendState nextState = null;
- switch (requestCode) {
- case Constants.CHOOSE_ACCOUNT: {
- if (resultCode == RESULT_CANCELED) {
- nextState = SendState.FINISH;
- break;
- }
- account = results.getParcelableExtra(AccountChooserActivity.ACCOUNT);
- if (account == null) {
- nextState = SendState.FINISH;
- break;
- }
- nextState = SendState.CHOOSE_MAP;
- break;
- }
- case Constants.CHOOSE_MAP: {
- if (resultCode == RESULT_CANCELED) {
- nextState = SendState.FINISH;
- break;
- }
- mapId = results.getStringExtra(ChooseMapActivity.MAP_ID);
- if (mapId == null) {
- nextState = SendState.FINISH;
- break;
- }
- nextState = SendState.START;
- break;
- }
- case Constants.SEND_MAPS: {
- if (resultCode == RESULT_CANCELED) {
- nextState = SendState.FINISH;
- break;
- }
- sendToMapsSuccess = results.getBooleanExtra(SendMapsActivity.SUCCESS, false);
- nextState = SendState.SEND_TO_MAPS_DONE;
- break;
- }
- case Constants.SEND_FUSION_TABLES: {
- if (resultCode == RESULT_CANCELED) {
- nextState = SendState.FINISH;
- break;
- }
- sendToFusionTablesSuccess = results.getBooleanExtra(
- SendFusionTablesActivity.SUCCESS, false);
- nextState = SendState.SEND_TO_FUSION_TABLES_DONE;
- break;
- }
- case Constants.SEND_DOCS: {
- if (resultCode == RESULT_CANCELED) {
- nextState = SendState.FINISH;
- break;
- }
- sendToDocsSuccess = results.getBooleanExtra(SendDocsActivity.SUCCESS, false);
- nextState = SendState.SEND_TO_DOCS_DONE;
- break;
- }
- default: {
- Log.e(TAG, "Unrequested result: " + requestCode);
- return;
- }
- }
-
- if (nextState != null) {
- executeStateMachine(nextState);
- }
- }
-
- /**
- * Resets status information for sending to Maps/Fusion Tables/Docs.
- */
- private void resetState() {
- currentState = SendState.CHOOSE_ACCOUNT;
- account = null;
- mapId = null;
- sendToMapsSuccess = false;
- sendToFusionTablesSuccess = false;
- sendToDocsSuccess = false;
- }
-}
diff --git a/MyTracks/src/com/google/android/apps/mytracks/io/sendtogoogle/SendRequest.java b/MyTracks/src/com/google/android/apps/mytracks/io/sendtogoogle/SendRequest.java
new file mode 100644
index 000000000..a5be3b24d
--- /dev/null
+++ b/MyTracks/src/com/google/android/apps/mytracks/io/sendtogoogle/SendRequest.java
@@ -0,0 +1,294 @@
+/*
+ * Copyright 2012 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.google.android.apps.mytracks.io.sendtogoogle;
+
+import android.accounts.Account;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Send request states for sending a track to Google Maps, Google Fusion Tables,
+ * and Google Docs.
+ *
+ * @author Jimmy Shih
+ */
+public class SendRequest implements Parcelable {
+
+ public static final String SEND_REQUEST_KEY = "sendRequest";
+
+ private long trackId = -1L;
+ private boolean showMaps = false;
+ private boolean showFusionTables = false;
+ private boolean showDocs = false;
+ private boolean sendMaps = false;
+ private boolean sendFusionTables = false;
+ private boolean sendDocs = false;
+ private boolean newMap = false;
+ private Account account = null;
+ private String mapId = null;
+ private boolean mapsSuccess = false;
+ private boolean docsSuccess = false;
+ private boolean fusionTablesSuccess = false;
+
+ /**
+ * Creates a new send request.
+ *
+ * @param trackId the track id
+ * @param showMaps true to show the Google Maps option
+ * @param showFusionTables true to show the Google Fusion Tables option
+ * @param showDocs true to show the Google Docs option
+ */
+ public SendRequest(long trackId, boolean showMaps, boolean showFusionTables, boolean showDocs) {
+ this.trackId = trackId;
+ this.showMaps = showMaps;
+ this.showFusionTables = showFusionTables;
+ this.showDocs = showDocs;
+ }
+
+ /**
+ * Get the track id.
+ */
+ public long getTrackId() {
+ return trackId;
+ }
+
+ /**
+ * True if showing the send to Google Maps option.
+ */
+ public boolean isShowMaps() {
+ return showMaps;
+ }
+
+ /**
+ * True if showing the send to Google Fusion Tables option.
+ */
+ public boolean isShowFusionTables() {
+ return showFusionTables;
+ }
+
+ /**
+ * True if showing the send to Google Docs option.
+ */
+ public boolean isShowDocs() {
+ return showDocs;
+ }
+
+ /**
+ * True if showing all the send options.
+ */
+ public boolean isShowAll() {
+ return showMaps && showFusionTables && showDocs;
+ }
+
+ /**
+ * True if the user has selected the send to Google Maps option.
+ */
+ public boolean isSendMaps() {
+ return sendMaps;
+ }
+
+ /**
+ * Sets the send to Google Maps option.
+ *
+ * @param sendMaps true if the user has selected the send to Google Maps
+ * option
+ */
+ public void setSendMaps(boolean sendMaps) {
+ this.sendMaps = sendMaps;
+ }
+
+ /**
+ * True if the user has selected the send to Google Fusion Tables option.
+ */
+ public boolean isSendFusionTables() {
+ return sendFusionTables;
+ }
+
+ /**
+ * Sets the send to Google Fusion Tables option.
+ *
+ * @param sendFusionTables true if the user has selected the send to Google
+ * Fusion Tables option
+ */
+ public void setSendFusionTables(boolean sendFusionTables) {
+ this.sendFusionTables = sendFusionTables;
+ }
+
+ /**
+ * True if the user has selected the send to Google Docs option.
+ */
+ public boolean isSendDocs() {
+ return sendDocs;
+ }
+
+ /**
+ * Sets the send to Google Docs option.
+ *
+ * @param sendDocs true if the user has selected the send to Google Docs
+ * option
+ */
+ public void setSendDocs(boolean sendDocs) {
+ this.sendDocs = sendDocs;
+ }
+
+ /**
+ * True if the user has selected to create a new Google Maps.
+ */
+ public boolean isNewMap() {
+ return newMap;
+ }
+
+ /**
+ * Sets the new map option.
+ *
+ * @param newMap true if the user has selected to create a new Google Maps.
+ */
+ public void setNewMap(boolean newMap) {
+ this.newMap = newMap;
+ }
+
+ /**
+ * Gets the account.
+ */
+ public Account getAccount() {
+ return account;
+ }
+
+ /**
+ * Sets the account.
+ *
+ * @param account the account
+ */
+ public void setAccount(Account account) {
+ this.account = account;
+ }
+
+ /**
+ * Gets the selected map id if the user has selected to send a track to an
+ * existing Google Maps.
+ */
+ public String getMapId() {
+ return mapId;
+ }
+
+ /**
+ * Sets the map id.
+ *
+ * @param mapId the map id
+ */
+ public void setMapId(String mapId) {
+ this.mapId = mapId;
+ }
+
+ /**
+ * True if sending to Google Maps is success.
+ */
+ public boolean isMapsSuccess() {
+ return mapsSuccess;
+ }
+
+ /**
+ * Sets the Google Maps result.
+ *
+ * @param mapsSuccess true if sending to Google Maps is success
+ */
+ public void setMapsSuccess(boolean mapsSuccess) {
+ this.mapsSuccess = mapsSuccess;
+ }
+
+ /**
+ * True if sending to Google Fusion Tables is success.
+ */
+ public boolean isFusionTablesSuccess() {
+ return fusionTablesSuccess;
+ }
+
+ /**
+ * Sets the Google Fusion Tables result.
+ *
+ * @param fusionTablesSuccess true if sending to Google Fusion Tables is
+ * success
+ */
+ public void setFusionTablesSuccess(boolean fusionTablesSuccess) {
+ this.fusionTablesSuccess = fusionTablesSuccess;
+ }
+
+ /**
+ * True if sending to Google Docs is success.
+ */
+ public boolean isDocsSuccess() {
+ return docsSuccess;
+ }
+
+ /**
+ * Sets the Google Docs result.
+ *
+ * @param docsSuccess true if sending to Google Docs is success
+ */
+ public void setDocsSuccess(boolean docsSuccess) {
+ this.docsSuccess = docsSuccess;
+ }
+
+ private SendRequest(Parcel in) {
+ trackId = in.readLong();
+ showMaps = in.readByte() == 1;
+ showFusionTables = in.readByte() == 1;
+ showDocs = in.readByte() == 1;
+ sendMaps = in.readByte() == 1;
+ sendFusionTables = in.readByte() == 1;
+ sendDocs = in.readByte() == 1;
+ newMap = in.readByte() == 1;
+ account = in.readParcelable(null);
+ mapId = in.readString();
+ mapsSuccess = in.readByte() == 1;
+ fusionTablesSuccess = in.readByte() == 1;
+ docsSuccess = in.readByte() == 1;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeLong(trackId);
+ out.writeByte((byte) (showMaps ? 1 : 0));
+ out.writeByte((byte) (showFusionTables ? 1 : 0));
+ out.writeByte((byte) (showDocs ? 1 : 0));
+ out.writeByte((byte) (sendMaps ? 1 : 0));
+ out.writeByte((byte) (sendFusionTables ? 1 : 0));
+ out.writeByte((byte) (sendDocs ? 1 : 0));
+ out.writeByte((byte) (newMap ? 1 : 0));
+ out.writeParcelable(account, 0);
+ out.writeString(mapId);
+ out.writeByte((byte) (mapsSuccess ? 1 : 0));
+ out.writeByte((byte) (fusionTablesSuccess ? 1 : 0));
+ out.writeByte((byte) (docsSuccess ? 1 : 0));
+ }
+
+ public static final Parcelable.Creator