@@ -35,6 +35,7 @@ public class PatchingManager : INotifyPropertyChanged
35
35
private const int DebuggableAttributeResourceId = 16842767 ;
36
36
private const int LegacyStorageAttributeResourceId = 16844291 ;
37
37
private const int ValueAttributeResourceId = 16842788 ;
38
+ private const int AuthoritiesAttributeResourceId = 16842776 ;
38
39
39
40
/// <summary>
40
41
/// Compression level to use when adding files to the APK during patching.
@@ -191,6 +192,41 @@ private async Task PatchManifest(ApkZip apk)
191
192
addingFeatures . Add ( "oculus.software.handtracking" ) ;
192
193
}
193
194
195
+ if ( permissions . OpenXR )
196
+ {
197
+ Log . Information ( "Adding OpenXR permission . . ." ) ;
198
+
199
+ addingPermissions . AddRange ( new [ ] {
200
+ "org.khronos.openxr.permission.OPENXR" ,
201
+ "org.khronos.openxr.permission.OPENXR_SYSTEM" ,
202
+ } ) ;
203
+
204
+ AxmlElement providerElement = new ( "provider" ) {
205
+ Attributes = { new ( "authorities" , AndroidNamespaceUri , AuthoritiesAttributeResourceId , "org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" ) } ,
206
+ } ;
207
+ AxmlElement runtimeIntent = new ( "intent" ) {
208
+ Children = {
209
+ new ( "action" ) {
210
+ Attributes = { new ( "name" , AndroidNamespaceUri , NameAttributeResourceId , "org.khronos.openxr.OpenXRRuntimeService" ) } ,
211
+ } ,
212
+ } ,
213
+ } ;
214
+ AxmlElement layerIntent = new ( "intent" ) {
215
+ Children = {
216
+ new ( "action" ) {
217
+ Attributes = { new ( "name" , AndroidNamespaceUri , NameAttributeResourceId , "org.khronos.openxr.OpenXRApiLayerService" ) } ,
218
+ } ,
219
+ } ,
220
+ } ;
221
+ manifest . Children . Add ( new ( "queries" ) {
222
+ Children = {
223
+ providerElement ,
224
+ runtimeIntent ,
225
+ layerIntent ,
226
+ } ,
227
+ } ) ;
228
+ }
229
+
194
230
// Find which features and permissions already exist to avoid adding existing ones
195
231
var existingPermissions = GetExistingChildren ( manifest , "uses-permission" ) ;
196
232
var existingFeatures = GetExistingChildren ( manifest , "uses-feature" ) ;
0 commit comments