Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E49F419FF3 for ; Mon, 25 Apr 2016 21:12:29 +0000 (UTC) Received: (qmail 88584 invoked by uid 500); 25 Apr 2016 21:12:29 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 88550 invoked by uid 500); 25 Apr 2016 21:12:29 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 88539 invoked by uid 99); 25 Apr 2016 21:12:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Apr 2016 21:12:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 251CCDFE16; Mon, 25 Apr 2016 21:12:29 +0000 (UTC) From: riknoll To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-plugin-file pull request: CB-11142: Fix the NeedPermission... Content-Type: text/plain Message-Id: <20160425211229.251CCDFE16@git1-us-west.apache.org> Date: Mon, 25 Apr 2016 21:12:29 +0000 (UTC) Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-plugin-file/pull/179#discussion_r60990249 --- Diff: README.md --- @@ -273,6 +273,15 @@ Listing asset directories is really slow on Android. You can speed it up though, adding `src/android/build-extras.gradle` to the root of your android project (also requires cordova-android@4.0.0 or greater). +### Permisson to write to external storage when it's not mounted + +Marshmallow requires the apps to ask for permissions when reading/writing to external locations. By default, your app has permission to write to +`cordova.file.applicationStorageDirectory` and `cordova.file.externalApplicationStorageDirectory`, with the latter becoming available when the external storage +is mounted and available to use. When the external storage is mounted, the plugin would check if the path of the file being handled falls within these +directories and would ask for permission if it's not so. However when the external storage is not mounted, `cordova.file.externalApplicationStorageDirectory` +is not available and the plugin would only be able to check the file path wrt `cordova.file.applicationStorageDirectory`. So if your app tries to write to +externalApplicationStorageDirectory when the external storage is not mounted, the plugin would still ask for permission and then fail since that path is not available. --- End diff -- Don't bother explaining why it fails. Just state the behavior and say that it is "due to a limitation in Android". That is, we never request runtime permission for those two directories unless external storage is not mounted. Also, clarify that this is only on Marshmallow. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org