Add "all files access" permission to the Android permissions dialog

This commit is contained in:
James Babcock committed 2026-10-03 13:08:58 -07:00
1 parent 68625fad1e
commit ed20f63322
1 file changed
+16 -5
+16 -5
View File
@@ -13,6 +13,7 @@ import {
} from "../g2/android-permissions"; } from "../g2/android-permissions";
import { ensureCalendarPermission, hasCalendarPermission } from "../native/calendar-permissions"; import { ensureCalendarPermission, hasCalendarPermission } from "../native/calendar-permissions";
import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization"; import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization";
import { hasAllFilesAccess, requestAllFilesAccess } from "../native/file-access";
import { isNotificationListenerEnabled, requestNotificationListenerAccess } from "../native/notification-access"; import { isNotificationListenerEnabled, requestNotificationListenerAccess } from "../native/notification-access";
type PermissionDefinition = { type PermissionDefinition = {
@@ -26,9 +27,10 @@ type PermissionDefinition = {
}; };
/** /**
* Battery Optimization and Read Notifications are not runtime permissions: * Battery Optimization, Read Notifications and All Files Access are not
* their request() opens a system screen, so the granted state can only be * runtime permissions: their request() opens a system screen, so the granted
* re-checked when the app resumes (the page refreshes on Application.resume). * state can only be re-checked when the app resumes (the page refreshes on
* Application.resume).
*/ */
const ANDROID_PERMISSIONS: PermissionDefinition[] = [ const ANDROID_PERMISSIONS: PermissionDefinition[] = [
{ {
@@ -89,6 +91,14 @@ const ANDROID_PERMISSIONS: PermissionDefinition[] = [
isGranted: hasCalendarPermission, isGranted: hasCalendarPermission,
request: ensureCalendarPermission, request: ensureCalendarPermission,
}, },
{
id: "all-files-access",
title: "All Files Access",
description: "Needed to browse and view files in the Files app on the glasses.",
optional: true,
isGranted: hasAllFilesAccess,
request: requestAllFilesAccess,
},
]; ];
const PERMISSIONS: PermissionDefinition[] = global.isIOS ? [{ const PERMISSIONS: PermissionDefinition[] = global.isIOS ? [{
@@ -132,8 +142,9 @@ export class PermissionsViewModel extends Observable {
} }
/** /**
* Battery Optimization and Read Notifications grant flows leave the app for * Battery Optimization, Read Notifications and All Files Access grant flows
* a system screen; re-check everything whenever the app comes back. * leave the app for a system screen; re-check everything whenever the app
* comes back.
*/ */
private readonly onAppResume = (): void => this.refresh(); private readonly onAppResume = (): void => this.refresh();