merge branches

This commit is contained in:
Jimmy Shih
2013-02-19 13:31:15 -08:00
parent 13ed536065
commit c4fd180f40
14 changed files with 113 additions and 91 deletions
@@ -76,7 +76,7 @@ public class SendDriveAsyncTask extends AbstractSendAsyncTask {
return false;
}
Drive drive = SyncUtils.getDriveService(credential);
String folderId = SyncUtils.getMyTracksFolder(context, drive);
String folderId = SyncUtils.getMyTracksFolder(context, drive).getId();
if (folderId == null) {
return false;
}
@@ -113,7 +113,7 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter {
driveAccountName = account.name;
}
String folderId = SyncUtils.getMyTracksFolder(context, drive);
String folderId = SyncUtils.getMyTracksFolder(context, drive).getId();
if (folderId == null) {
return;
}
@@ -153,20 +153,20 @@ public class SyncUtils {
* @param context the context
* @param drive the drive
*/
public static String getMyTracksFolder(Context context, Drive drive) throws IOException {
public static File getMyTracksFolder(Context context, Drive drive) throws IOException {
String folderName = context.getString(R.string.my_tracks_app_name);
List list = drive.files()
.list().setQ(String.format(Locale.US, MY_TRACKS_FOLDER_QUERY, folderName));
FileList result = list.execute();
for (File file : result.getItems()) {
if (file.getSharedWithMeDate() == null) {
return file.getId();
return file;
}
}
File file = new File();
file.setTitle(folderName);
file.setMimeType(FOLDER_MIME_TYPE);
return drive.files().insert(file).execute().getId();
return drive.files().insert(file).execute();
}
/**