{ "id": "154419", "key": "TIMOB-20251", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-02-10T04:15:13.000+0000", "created": "2016-01-19T22:53:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "merge-5.2.0", "module_android_6.0_Permissions", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "50433", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "154317", "key": "TIMOB-20235", "fields": { "summary": "Android 6.0: requestStoragePermission is needed for various use cases", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "50632", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "outwardIssue": { "id": "152675", "key": "TIMOB-19899", "fields": { "summary": "Android 6: Remote images not loading", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "50631", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "outwardIssue": { "id": "153624", "key": "TIMOB-20103", "fields": { "summary": "Remote images aren't loading on Android 6 ", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "50552", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "outwardIssue": { "id": "154315", "key": "TIMOB-20234", "fields": { "summary": "Streaming Audio not working on Android Marshmallow with Alloy", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "50532", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "154767", "key": "TIMOB-20353", "fields": { "summary": "TiResponseCache needs to be refactored for Android M", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "50707", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "155117", "key": "TIMOB-20470", "fields": { "summary": "Android 6.0 (Post 5.2.0 SDK): java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-02-26T14:29:05.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h6.Issue Description\r\nWhile trying to write the attachment content in the file and the directory used is temp_directory. As per the use case we have to save the content passed from the cloud server to the file and file is opened by using the intents. This approach is working fine for the os version upto Android 5.0 (lollipop) but on the Android 6.0 (Marshmallow) it’s failing. \r\n\r\nh6.Steps to reproduce\r\n1) Get sample attach to run on Android 5 device\r\n2) Monitor and watch logs. App works fine\r\n3) Get sample attach to run on Android 6 device\r\n4) Monitor and watch logs. App won't load file as expected.\r\n\r\nh6.Stack Trace\r\n{code}\r\n-- Start application log -----------------------------------------------------\r\n[INFO] : TiApplication: (main) [0,0] checkpoint, app created.\r\n[INFO] : TiApplication: (main) [58,58] Titanium 5.1.2 (2015/12/16 19:00 ca822b2)\r\n[INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default ''\r\n[INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default ''\r\n[WARN] : art: Suspending all threads took: 5.501ms\r\n[INFO] : art: Background sticky concurrent mark sweep GC freed 512(22KB) AllocSpace objects, 0(0B) LOS objects, 1% free, 2MB/2MB, paused 6.183ms total 22.877ms\r\n[INFO] : TiApplication: (main) [263,321] Titanium Javascript runtime: v8\r\n[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null\r\n[WARN] : V8Object: (KrollRuntimeThread) [249,249] Runtime disposed, cannot set property 'userAgent'\r\n[DEBUG] : APSAnalyticsModel: Creating Database appcAnalytics.db\r\n[WARN] : TiTempFileHelper: (main) [354,603] The external temp directory doesn't exist, skipping cleanup\r\n[DEBUG] : Module: Loading module: alloy -> Resources/alloy.js\r\n[DEBUG] : Module: Loading module: alloy/underscore -> Resources/alloy/underscore.js\r\n[DEBUG] : Module: Loading module: alloy/backbone -> Resources/alloy/backbone.js\r\n[DEBUG] : Module: Loading module: alloy/constants -> Resources/alloy/constants.js\r\n[DEBUG] : Module: Loading module: alloy/CFG -> Resources/alloy/CFG.js\r\n[DEBUG] : Module: Loading module: alloy/controllers/index -> Resources/alloy/controllers/index.js\r\n[DEBUG] : Module: Loading module: alloy/controllers/BaseController -> Resources/alloy/controllers/BaseController.js\r\n[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.example.Docx_pocActivity@b56e552\r\n[DEBUG] : OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true\r\n[DEBUG] : D/ : HostConnection::get() New Host Connection established 0xec8fdc10, tid 10299\r\n[DEBUG] : Window: Checkpoint: postWindowCreated()\r\n[DEBUG] : libEGL: loaded /system/lib/egl/libEGL_emulation.so\r\n[DEBUG] : libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so\r\n[DEBUG] : libEGL: loaded /system/lib/egl/libGLESv2_emulation.so\r\n[DEBUG] : D/ : HostConnection::get() New Host Connection established 0xed661cf0, tid 10318\r\n[INFO] : OpenGLRenderer: Initialized EGL, version 1.4\r\n[WARN] : EGL_emulation: eglSurfaceAttrib not implemented\r\n[WARN] : OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xf3d3d160, error=EGL_SUCCESS\r\n[TRACE] : updating tiapp metadata with Appcelerator Platform...\r\n[TRACE] : Uploaded tiapp metadata with Appcelerator Platform!\r\n[ERROR] : TiFileProxy: (KrollRuntimeThread) [11875,11875] IOException encountered\r\n[ERROR] : TiFileProxy: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.example/cache/_tmp/sample.doc: open failed: ENOENT (No such file or directory)\r\n[ERROR] : TiFileProxy: \tat libcore.io.IoBridge.open(IoBridge.java:452)\r\n[ERROR] : TiFileProxy: \tat java.io.FileOutputStream.(FileOutputStream.java:87)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.titanium.io.TiFile.getOutputStream(TiFile.java:273)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.titanium.io.TiFile.open(TiFile.java:336)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.titanium.io.TiFile.write(TiFile.java:382)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:284)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352)\r\n[ERROR] : TiFileProxy: \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n[ERROR] : TiFileProxy: \tat android.os.Looper.loop(Looper.java:148)\r\n[ERROR] : TiFileProxy: \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)\r\n[ERROR] : TiFileProxy: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)\r\n[ERROR] : TiFileProxy: \tat libcore.io.Posix.open(Native Method)\r\n[ERROR] : TiFileProxy: \tat libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)\r\n[ERROR] : TiFileProxy: \tat libcore.io.IoBridge.open(IoBridge.java:438)\r\n[ERROR] : TiFileProxy: \t... 13 more\r\n[ERROR] : Path/type is empty\r\n[INFO] : APSAnalyticsService: Analytics Service Started\r\n[INFO] : APSAnalyticsService: Stopping Analytics Service\r\n{code}", "attachment": [ { "id": "58032", "filename": "TIMOB-20251.zip", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-20T22:14:13.000+0000", "size": 9953634, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android 6.0: java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Node.js Version = 4.2.2 \r\nnpm Version = 2.14.7 \r\n\r\nTitanium CLI Version = 5.0.5 \r\nnode-appc Version = 0.2.31 \r\n\r\nTitanium SDK 5.1.2.GA", "closedSprints": [ { "id": 580, "state": "closed", "name": "2016 Sprint 3 SDK", "startDate": "2016-01-30T01:31:48.991Z", "endDate": "2016-02-13T01:31:00.000Z", "completeDate": "2016-02-15T05:32:40.725Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "375434", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This has something to do with file permissions model in Android M. It's something we are looking into now.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-28T17:18:22.000+0000", "updated": "2016-01-28T17:18:22.000+0000" }, { "id": "375809", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/7671\r\nmodify code to something like this:\r\n{code}\r\nfunction openDoc(e) {\r\n\tif (!Ti.Android.hasStoragePermission()) {\r\n \tTi.Android.requestStoragePermissions(function(e) {\r\n \topenDocument(\"sample.doc\");\r\n \t});\r\n\t} else {\r\n\t\topenDocument(\"sample.doc\");\r\n\r\n\t}\r\n}\r\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-03T00:33:51.000+0000", "updated": "2016-02-03T00:33:51.000+0000" }, { "id": "375819", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Master PR reviewed and merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-03T01:32:32.000+0000", "updated": "2016-02-03T01:32:32.000+0000" }, { "id": "375845", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "We keep all other permissions under related namespaces like {{Ti.Media.has...}}. Shouldn't this one live under {{Ti.Filesystem..}} ?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-03T08:56:12.000+0000", "updated": "2016-02-03T08:56:12.000+0000" }, { "id": "375870", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "I don't think this actually fixes the problem for Case 7777 since I am getting this error in TiResponseCache.java\r\n\r\n{code:javascript}\r\njava.io.FileNotFoundException: /storage/emulated/0/Android/data/com.meridian.android/cache/_tmp/remote-cache/3254c4bb31a1cc5d21043e49f0704efc1a84213c.hdr: open failed: ENOENT (No such file or directory)\r\n\tat libcore.io.IoBridge.open(IoBridge.java:452)\r\n\tat java.io.FileOutputStream.(FileOutputStream.java:87)\r\n\tat java.io.FileOutputStream.(FileOutputStream.java:72)\r\n\tat java.io.FileWriter.(FileWriter.java:42)\r\n\tat org.appcelerator.titanium.util.TiResponseCache.put(TiResponseCache.java:472)\r\n\tat com.android.okhttp.internal.huc.CacheAdapter.put(CacheAdapter.java:57)\r\n\tat com.android.okhttp.internal.http.HttpEngine.maybeCache(HttpEngine.java:554)\r\n\tat com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:826)\r\n\tat com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443)\r\n\tat com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)\r\n\tat com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:231)\r\n\tat com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)\r\n\tat com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java)\r\n\tat xxxxxx.chchcc.bссссс04410441(Unknown Source)\r\n\tat xxxxxx.chhchc.run(Unknown Source)\r\n\tat xxxxxx.hchchc.bссс0441044104410441(Unknown Source)\r\n\tat xxxxxx.chhhcc.b04410441ссс04410441(Unknown Source)\r\n\tat xxxxxx.jajaja.bЙЙ041904190419ЙЙ(Unknown Source)\r\n\tat xxxxxx.ijjjij.activate(Unknown Source)\r\n\tat ca.interac.flash.activate.ActivateImpl$2.doInBackground(ActivateImpl.java:174)\r\n\tat ca.interac.flash.activate.ActivateImpl$2.doInBackground(ActivateImpl.java:146)\r\n\tat android.os.AsyncTask$2.call(AsyncTask.java:295)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:237)\r\n\tat android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\r\n\tat java.lang.Thread.run(Thread.java:818)\r\nCaused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)\r\n\tat libcore.io.Posix.open(Native Method)\r\n\tat libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)\r\n\tat libcore.io.IoBridge.open(IoBridge.java:438)\r\n\t... 26 more\r\n{code}", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2016-02-03T14:17:03.000+0000", "updated": "2016-02-03T14:18:45.000+0000" }, { "id": "375899", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Colin, the responseCache error is probably due to lack of storage permission on Android 6.0 (Since you have to manually request for these permissions now). Please test the PR and let us know, thanks.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-03T18:35:28.000+0000", "updated": "2016-02-03T18:35:28.000+0000" }, { "id": "375909", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "Tested PR in Ti SDK 6.0.0.v20160202173231 and fails.\r\n\r\nCan we please get someone who understands what TiResponseCache is doing on this issue? I am using a third-party library that must be using URLConnection. Since Titanium defines a default ResponseCache (https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java#L440) any library that attempts an HTTP request will automatically be opted in to TiResponseCache without any control.\r\n\r\nIf a developer would just look at the stacktrace I provided they will see that the exception is rooted on line 472 (https://github.com/appcelerator/titanium_mobile/blob/bc85170157d3bebc5de1d61a9fe6e34bce84a8c9/android/titanium/src/java/org/appcelerator/titanium/util/TiResponseCache.java#L472) of TiResponseCache. Since TiResponseCache has not been affected by the PR it does not check if it has permissions before attempting to write the file.", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2016-02-03T19:32:56.000+0000", "updated": "2016-02-03T19:32:56.000+0000" }, { "id": "375911", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Colin, TiResponseCache is trying to cache the file, and in order to do that, it needs storage permission. The difference between Android 6.0 (failed version) and Android 5.0 (working - according to this ticket) is you need to manually request the permissions. Did you make changes to your code via my last comment before testing it? i.e make sure you request the permission before launching the HTTP request that would trigger the cache?\r\n\r\nIf the crash persists, it is likely due to a different problem. The test case provided in this ticket does not involve the use of TiResponseCache, and it is fixed with my PR. If you can provide us with a new test project that would reproduce your problem, we'll take a deeper look into it. Thanks,", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-03T20:12:52.000+0000", "updated": "2016-02-03T20:12:52.000+0000" }, { "id": "375919", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "If there isn't file permission then TiResponseCache shouldn't cache the file......................", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2016-02-03T20:15:30.000+0000", "updated": "2016-02-03T20:15:30.000+0000" }, { "id": "375924", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "I know the issue is with TiResponseCache because when I forked Titanium and removed TiResponseCache the problem went away.\r\n\r\nhttps://github.com/collinprice/titanium_mobile/commit/7a4ed274ce65e6f2ddb3f58e6e59466016339144\r\n\r\nAn app should not require storage permissions to make an HTTP request. Would you agree?", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2016-02-03T20:42:59.000+0000", "updated": "2016-02-03T20:42:59.000+0000" }, { "id": "375936", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~CollinPrice] The proposed change I am now suggesting is that if we do not have storage permissions, we won't cache the response. That could lead to a slowdown in network response times. Thoughts?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-03T22:27:58.000+0000", "updated": "2016-02-03T22:27:58.000+0000" }, { "id": "375938", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "After looking at the PR, [~fokkezb]'s suggestion to keep it in {{Ti.Filesystem}} makes sense as all the media related permissions are in {{Ti.Media}} & geolocation in {{Ti.geolocation}}.\r\nAlso, {{Ti.Android.hasStoragePermission()}} should be {{Ti.Android.hasStoragePermissions()}} (notice the \"s\" in permissions) to be in parity with other permissions for android 6.0.0.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-03T23:05:10.000+0000", "updated": "2016-02-03T23:05:23.000+0000" }, { "id": "376033", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "Ingo, having storage permissions is fine. Having no storage permission checks within TiResponseCache is the issue. Let me explain my use case and maybe the issue will become more apparent.\r\n\r\nI have created a Titanium native module that wraps a third-party library. I am basically just creating the bridge to the third-party library API. This third-party library performs HTTP requests within an Android service so I have no insight into these requests. Since Titanium registers a default ResponseCache, all HTTP requests that use URLConnection within the context of the app pass through the default ResponseCache. This third-party library doesn't care about caching but since it uses URLConnection it automatically uses it when it performs a request.\r\n\r\nBasically if you want to continue to use TiResponseCache just modify it so that if storage permissions aren't there do not cache. If a developer wants to use the cache they can manually prompt this new requestStoragePermissions API. I as the developer don't care about caching so I shouldn't have to worry about calling requestStoragePermissions.\r\n\r\nWhat do you think?", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2016-02-04T19:31:00.000+0000", "updated": "2016-02-04T19:31:00.000+0000" }, { "id": "376072", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "In hindsight, I think I'll +1 Fokke's suggestion on the namespace being moved to filesystem.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-05T01:17:12.000+0000", "updated": "2016-02-05T01:17:12.000+0000" }, { "id": "376326", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "New PR by Hieu (Master branch) https://github.com/appcelerator/titanium_mobile/pull/7689", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-09T12:22:42.000+0000", "updated": "2016-02-09T12:22:42.000+0000" }, { "id": "376328", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR merged into master.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-09T12:41:41.000+0000", "updated": "2016-02-09T12:41:41.000+0000" }, { "id": "376335", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hpham] [~msamah], yes, backport.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-09T14:07:52.000+0000", "updated": "2016-02-09T14:07:52.000+0000" }, { "id": "376397", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport PR: https://github.com/appcelerator/titanium_mobile/pull/7692", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-09T23:03:33.000+0000", "updated": "2016-02-09T23:03:33.000+0000" }, { "id": "376442", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Backport PR Merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-10T02:59:00.000+0000", "updated": "2016-02-10T02:59:00.000+0000" }, { "id": "376443", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR for removing unused imports:-\r\n5_2_X: https://github.com/appcelerator/titanium_mobile/pull/7693\r\nMaster: https://github.com/appcelerator/titanium_mobile/pull/7694", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-10T02:59:48.000+0000", "updated": "2016-02-10T02:59:48.000+0000" }, { "id": "376451", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "Reviewed and merged.", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-10T04:05:05.000+0000", "updated": "2016-02-10T04:05:05.000+0000" }, { "id": "376540", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the implementation & corrections.\r\n\r\n{{hasStoragePermissions()}} is inside Ti.Filesystem. Files or images in the filesystem can be accessed after permissions are granted.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.5.0.201602100601\r\nTi SDK : 5.2.0.v20160210100738\r\nTi CLI : 5.0.6\r\nAlloy : 1.7.33\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.3-2\r\nAppc CLI : 5.2.0-249\r\nNode: 4.2.2\r\nNexus 6P - Android 6.0.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-10T19:51:04.000+0000", "updated": "2016-02-10T19:51:04.000+0000" }, { "id": "377806", "author": { "name": "echeung@leviton.com", "key": "echeung@leviton.com", "displayName": "Eric Cheung", "active": true, "timeZone": "America/Havana" }, "body": "I played around with the 5.2.0 SDK and Nexus 6P... for the most part everything seems to work except for one case with runtime.\r\n\r\nif I use Ti.Filesystem.tempDirectory as my storage and created the permission checks, this still fails on first try even if you accept the Permission. I also believe the reporter's log show that his app is using the tempDirectory.\r\n\r\nSteps to recreate:\r\n* make sure it is a clean install (not overwriting)\r\n* Download file using tempDirectory storage\r\n* Use hasStoragePermissions() and requestStoragePermissions() to open the file\r\n* Accept the permission on popup.\r\n* Accessing the file in temp fails. (file does not exist)\r\n* Close the app\r\n* Check permission in settings > app permission (storage should be enabled)\r\n* Restart the app\r\n* Repeat the same step to download and open, accessing the file works in tempDirectory storage.\r\n\r\nIf I switch the tempDirectory to applicationDataDirectory, I do not run into the issue of having to restart the app to open the file.", "updateAuthor": { "name": "echeung@leviton.com", "key": "echeung@leviton.com", "displayName": "Eric Cheung", "active": true, "timeZone": "America/Havana" }, "created": "2016-02-24T20:53:55.000+0000", "updated": "2016-02-24T20:53:55.000+0000" }, { "id": "377974", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~echeung@leviton.com] Thank you for spotting this. Since this ticket is closed for the released 5.2.0, could you create a new ticket and link to this one? We can then triage and consider for 5.2.1 (cc [~cng])", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-26T09:40:26.000+0000", "updated": "2016-02-26T09:40:26.000+0000" }, { "id": "377981", "author": { "name": "echeung@leviton.com", "key": "echeung@leviton.com", "displayName": "Eric Cheung", "active": true, "timeZone": "America/Havana" }, "updateAuthor": { "name": "echeung@leviton.com", "key": "echeung@leviton.com", "displayName": "Eric Cheung", "active": true, "timeZone": "America/Havana" }, "created": "2016-02-26T14:24:04.000+0000", "updated": "2016-02-26T14:24:04.000+0000" } ], "maxResults": 34, "total": 34, "startAt": 0 } } }