wonjsohn / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

Permission issue on accessing system resource such as Public Directories #519

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Execute the following code snipet

private void createFile() {

    File path = Environment.getExternalStoragePublicDirectory(
                         Environment.DIRECTORY_DOCUMENTS);
    File file = new File(path, "DemoFile.txt");

    System.out.println(file.getAbsolutePath());

    file.setWritable(true);

    if ( !file.canWrite() ) { 
           System.out.println("createFile() - Write Lock"); 
        }

        if ( !file.canRead() ) { 
           System.out.println("createFile() - Read Lock"); 
        }

    System.out.println("createFile() - exit");
}

What is the expected output? What do you see instead? A file created that would 
have read and write access. The file object created was not able to be read or 
written two.

What version of the product are you using? On what operating system?
XE17 (API19)

Please provide any additional information below.

1) Attempts to changing permission on the file object from the Activity does 
not result in any joy. Examining the path location of the file object via ADB 
indicates that the owner is root, sdcard_rw) permission for all directories are 
read and execute only (-write) for "all users".  

2) Similar behavior of when creating an Audio Listener - Creating an audio 
listener fails on "startListening(intent)". The API onError is called with a 
"9" indicating insufficient permission. Updates the XML with use-permissions 
had no effect.

Original issue reported on code.google.com by kasful...@gmail.com on 16 May 2014 at 12:29