AIR 24 File.requestPermission throws error #1069 on Android 6.0.1
We're attempting to use the new permissions functions in AIR 24 to access files on "external" storage on Android. However, when we call requestPermission() on a File object, it throws error #1069 (property not found). We're using AIR 24.0.0.181 (a custom build provided by Adobe for a specific fix that didn't make it in time for the AIR 24 release). Any clues on what's wrong here?
Example code:
function downloadInfo(obbDir:File, infoURL:String) : void {
var infoFile:File = obbDir.resolvePath(fileName);
if (File.permissionStatus == PermissionStatus.GRANTED) {
beginInfoDownload(infoFile, infoURL);
} else {
// need to ask for filesystem permissions
infoFile.addEventListener(PermissionEvent.PERMISSION_STATUS, function(e:PermissionEvent):void {
if (e.status == PermissionStatus.GRANTED) {
beginInfoDownload(infoFile, infoURL);
} else {
// permission denied
trace("Filesystem permission denied by user");
setTimeout(function():void {
dispatchEvent(new Event(PERMISSION_REFUSED));
}, 1);
}
});
try {
infoFile.requestPermission();
} catch(e:Error) {
trace("Error requesting file permissions: " + e.message);
setTimeout(function():void {
dispatchEvent(new Event(PERMISSION_REFUSED)); // for now, treat like it was refused
}, 1);
}
}
}
