~eliasnaur/gio-patches

gio: app/permission/camera,cmd/gogio: add support for camera permission v1 PROPOSED

Sebastien Binet: 1
 app/permission/camera,cmd/gogio: add support for camera permission

 2 files changed, 22 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/13895/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gio] app/permission/camera,cmd/gogio: add support for camera permission Export this patch

Signed-off-by: Sebastien Binet <s@sbinet.org>
---
 app/permission/camera/main.go | 16 ++++++++++++++++
 cmd/gogio/permission.go       |  6 ++++++
 2 files changed, 22 insertions(+)
 create mode 100644 app/permission/camera/main.go

diff --git a/app/permission/camera/main.go b/app/permission/camera/main.go
new file mode 100644
index 0000000..db83b49
--- /dev/null
+++ b/app/permission/camera/main.go
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: Unlicense OR MIT

/*
Package camera implements permissions to access camera ardware.

Android

The following entries will be added to AndroidManifest.xml:

	<uses-permission android:name="android.permission.CAMERA"/>
    <uses-feature android:name="android.hardware.camera" android:required="false"/>

CAMERA is a "dangerous" permission. See documentation for package
gioui.org/app/permission for more information.
*/
package camera
diff --git a/cmd/gogio/permission.go b/cmd/gogio/permission.go
index 40303f5..d6f2db2 100644
--- a/cmd/gogio/permission.go
+++ b/cmd/gogio/permission.go
@@ -9,6 +9,9 @@ var AndroidPermissions = map[string][]string{
		"android.permission.BLUETOOTH_ADMIN",
		"android.permission.ACCESS_FINE_LOCATION",
	},
	"camera": {
		"android.permission.CAMERA",
	},
	"storage": {
		"android.permission.READ_EXTERNAL_STORAGE",
		"android.permission.WRITE_EXTERNAL_STORAGE",
@@ -21,4 +24,7 @@ var AndroidFeatures = map[string][]string{
		`name="android.hardware.bluetooth"`,
		`name="android.hardware.bluetooth_le"`,
	},
	"camera": {
		`name="android.hardware.camera"`,
	},
}
-- 
2.28.0
Thanks! https://gioui.org/commit/2f67fea.

Elias