Login  Register

Android 7.0 throws MODE_WORLD_READABLE no longer supported

Posted by philjord on Mar 21, 2017; 8:11am
URL: https://forum.jogamp.org/Android-7-0-throws-MODE-WORLD-READABLE-no-longer-supported-tp4037808.html

Hi,
I've just started to get error on Android 7.0 devices I call the font loader

jogamp.graph.font.UbuntuFontLoader.get(UbuntuFontLoader.java)

For rendering with Newt

That call throws
 
java.io.IOException: Problem loading font Ubuntu-R.ttf, stream jogamp/graph/font/fonts/ubuntu/Ubuntu-R.ttf

And it's all caused by

Caused by: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
        at android.app.ContextImpl.checkMode(ContextImpl.java:2134)
        at android.app.ContextImpl.getDir(ContextImpl.java:1955)
        at android.content.ContextWrapper.getDir(ContextWrapper.java:278)
        at jogamp.common.os.android.AndroidUtilsImpl.getTempRoot(AndroidUtilsImpl.java)

A quick stack overflow shows MODE_WORLD_READABLE should be replaced by MODE_PRIVATE

I suspect this is going to cause serious troubles for Jogl on Android as devices move to Android 7

Does anyone have any advice on this? Should I just log a bug, or is it already known?

As far as I can tell this is the only use of that mode in the code, and it doesn't need to be sharable data anyway. My work around is to take that class out of the jar and swap the mode in my project.