airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
197 stars 11 forks source link

Can't load OneDrive file on Android #3133

Open Policy56 opened 4 months ago

Policy56 commented 4 months ago

Problem Description

On an Android 14 tablet, it is possible to load file data from the file explorer with the browseForOpen method. It works fine in documents, on Google Drive files, but cannot recover a OneDrive file

Steps to Reproduce

protected function btn_openFile(event:MouseEvent):void
{
_fileToLoad=File.documentsDirectory;
_fileToLoad.addEventListener(Event.SELECT, docSelected);
_fileToOpen.addEventListener(Event.COMPLETE, onCompleteLoad);
_fileToLoad.addEventListener(PermissionEvent.PERMISSION_STATUS, permissionStatusAndroid);

_fileToLoad.requestPermission();
}

protected function permissionStatusAndroid(event:PermissionEvent):void
{
var pdfFilter:FileFilter=new FileFilter("PDF Files", "*.pdf");
_fileToOpen.browseForOpen("Select File", [pdfFilter]);
}

protected function docSelected(event:Event):void
{
    _fileToOpen.load();
}

protected function onCompleteLoad(event:Event):void
{
       /// This méthod il never call with OneDrive File
        trace ("onCompleteLoad");
}

Give us a minimal example:

Document file : image

Google Drive file : image

One Drive file : image

Error from errorHander : Error 2038

Policy56 commented 3 months ago

fixed using SAF ane : http://pol2095.free.fr/Android-Storage-Access-Framework/docs/ from @pol2095