Skip to content

Commit

Permalink
Request WRITE_EXTERNAL_STORAGE to fix the Android Lollipop problem.
Browse files Browse the repository at this point in the history
Even though it should not be necessary:
#5
  • Loading branch information
murraycu committed Nov 19, 2014
1 parent 18051ec commit 75aa986
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.murrayc.galaxyzoo.app" >

<!-- TODO: We shouldn't need these after SDK version 18, but Android 5.0 "Lollipop" (API 21) seems
to need them again.
See https://github.com/murraycu/android-galaxyzoo/issues/5 . -->
<!--
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />


<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,15 @@ private String createCacheFile(final String filename) {
Log.info("createFileUri(): subject id=" + subjectId +", file created: " + realFile.getAbsolutePath());
}
*/
} catch (UnsupportedOperationException e) {
} catch (final UnsupportedOperationException e) {
//This happens while running under ProviderTestCase2.
//so we just catch it and provide a useful value,
//so at least the other functionality can be tested.
//TODO: Find a way to let it succeed.
Log.error("createCacheFile(): Unsupported operation", e);
Log.error("createCacheFile(): Unsupported operation for filename=" + file.getAbsolutePath(), e);
return "testuri";
} catch (final IOException e) {
Log.error("createCacheFile(): IOException", e);
Log.error("createCacheFile(): IOException for filename=" + file.getAbsolutePath(), e);
return null;
}

Expand Down

0 comments on commit 75aa986

Please sign in to comment.