Q:

Why querying google cloud files returns an empty list?

My android app creates an app data file with this method
 public Task<String> createFile() {
        return Tasks.call(mExecutor, () -> {
            File metadata = new File()
                    .setParents(Collections.singletonList("appDataFolder"))
                    .setName("profile.json");

            java.io.File filePath = new java.io.File(Gdx.files.getLocalStoragePath() + "/profile.json");
            FileContent mediaContent = new FileContent("application/json", filePath);
            File file = mDriveService.files().create(metadata, mediaContent)
                    .setFields("id")
                    .execute();
            if (file == null) {
                throw new IOException("Null result when requesting file creation.");
            }

            return file.getId();
        });
    }

But when i query my google drive files with this
public Task<FileList> queryFiles() {
    return Tasks.call(mExecutor, () -> mDriveService.files().list().setSpaces("drive").execute());
}

the list is empty even though the file has been successfully created...
On console.developers.google.com I have added the following scope '../auth/drive.appdata'
One last thing, I have 3 google accounts and on one of them, I can successfully read the app data file that I uploaded, all my other accounts returns empty lists but there is this one account where I did various tests about cloud file handling and I somehow successfully created a file that I can read.

A:

I found the solution !
the problem was here
public Task<FileList> queryFiles() {
    return Tasks.call(mExecutor, () -> mDriveService.files().list().setSpaces("drive").execute());
}

the solution is
public Task<FileList> queryFiles() {
    return Tasks.call(mExecutor, () -> mDriveService.files().list().setSpaces("appDataFolder").execute());
}

Querying the "drive" space seemed to not get the app data folder so I changed "drive" to "appDataFolder"

