app/permission: add documentation and storage permissions

Storage permissions enables the Android permissions
READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE.
This commit is contained in:
Greg Pomerantz
2019-11-25 13:39:35 -05:00
committed by Elias Naur
parent 99d97d2ef5
commit 8321745de9
6 changed files with 96 additions and 38 deletions
+2 -30
View File
@@ -67,35 +67,7 @@ Permissions
The packages under gioui.org/app/permission should be imported
by a Gio program or by one of its dependencies to indicate that specific
operating-system permissions are required. For example, if a Gio
program requires access to a device's Bluetooth interface, it
should import "gioui.org/app/permission/bluetooth" as follows:
package main
import (
"gioui.org/app"
_ "gioui.org/app/permission/bluetooth"
)
func main() {
...
}
Since there are no exported identifiers in the app/permission/bluetooth
package, the import uses the anonymous identifier (_) as the imported
package name.
As a special case, the gogio tool detects when a program directly or
indirectly depends on the "net" package from the Go standard library as an
indication that the program requires network access permissions. If a program
requires network permissions but does not directly or indirectly import
"net", it will be necessary to add the following code somewhere in the
program's source code:
import (
...
_ "net"
)
operating-system permissions are required. Please see documentation for
package gioui.org/app/permission for more information.
*/
package app