• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.view;
18 
19 import android.annotation.FlaggedApi;
20 
21 /**
22  * Class for XR-specific window properties to put in application manifests.
23  */
24 @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
25 public final class XrWindowProperties {
26     /** @hide */
XrWindowProperties()27     private XrWindowProperties() {}
28 
29     /**
30      * Application and Activity level
31      * {@link android.content.pm.PackageManager.Property PackageManager.Property} for an app to
32      * inform the system of the activity launch mode in XR. When it is declared at the application
33      * level, all activities are set to the defined value, unless it is overridden at the activity
34      * level.
35      *
36      * <p>The default value is {@link #XR_ACTIVITY_START_MODE_UNDEFINED}.
37      *
38      * <p>The available values are:
39      * <ul>
40      *   <li>{@link #XR_ACTIVITY_START_MODE_FULL_SPACE_UNMANAGED}
41      *   <li>{@link #XR_ACTIVITY_START_MODE_FULL_SPACE_MANAGED}
42      *   <li>{@link #XR_ACTIVITY_START_MODE_HOME_SPACE}
43      *   <li>{@link #XR_ACTIVITY_START_MODE_UNDEFINED}
44      * </ul>
45      *
46      * <p><b>Syntax:</b>
47      * <pre>
48      * &lt;application&gt;
49      *   &lt;property
50      *     android:name="android.window.PROPERTY_ACTIVITY_XR_START_MODE"
51      *     android:value="XR_ACTIVITY_START_MODE_FULL_SPACE_UNMANAGED|
52      *                    XR_ACTIVITY_START_MODE_FULL_SPACE_MANAGED|
53      *                    XR_ACTIVITY_START_MODE_HOME_SPACE|
54      *                    XR_ACTIVITY_START_MODE_UNDEFINED"/&gt;
55      * &lt;/application&gt;
56      * </pre>
57      */
58     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
59     public static final String PROPERTY_XR_ACTIVITY_START_MODE =
60             "android.window.PROPERTY_XR_ACTIVITY_START_MODE";
61 
62     /**
63      * Defines the value to launch an activity in unmanaged full space mode in XR, where the
64      * activity itself is rendering the space and controls its own scene graph. This should be used
65      * for all activities that use OpenXR to render.
66      *
67      * @see #PROPERTY_XR_ACTIVITY_START_MODE
68      */
69     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
70     public static final String XR_ACTIVITY_START_MODE_FULL_SPACE_UNMANAGED =
71             "XR_ACTIVITY_START_MODE_FULL_SPACE_UNMANAGED";
72 
73     /**
74      * The default value if not specified. If used, the actual launching mode will be determined by
75      * the system based on the launching activity's current mode and the launching flags.  When
76      * {@link #PROPERTY_XR_ACTIVITY_START_MODE} is used at the application level, apps can use this
77      * value to reset at individual activity level.
78      *
79      * @see #PROPERTY_XR_ACTIVITY_START_MODE
80      */
81     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
82     public static final String XR_ACTIVITY_START_MODE_UNDEFINED =
83             "XR_ACTIVITY_START_MODE_UNDEFINED";
84 
85     /**
86      * Defines the value to launch an activity in
87      * <a href="https://developer.android.com/develop/xr/jetpack-xr-sdk/transition-home-space-to-full-space">managed
88      * full space mode</a> in XR, where the system is rendering the activity from a scene graph.
89      *
90      * @see #PROPERTY_XR_ACTIVITY_START_MODE
91      */
92     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
93     public static final String XR_ACTIVITY_START_MODE_FULL_SPACE_MANAGED =
94             "XR_ACTIVITY_START_MODE_FULL_SPACE_MANAGED";
95 
96     /**
97      * Defines the value to launch an activity in
98      * <a href="https://developer.android.com/develop/xr/jetpack-xr-sdk/transition-home-space-to-full-space">home
99      * space mode</a> in XR.
100      *
101      * @see #PROPERTY_XR_ACTIVITY_START_MODE
102      */
103     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
104     public static final String XR_ACTIVITY_START_MODE_HOME_SPACE =
105             "XR_ACTIVITY_START_MODE_HOME_SPACE";
106 
107     /**
108      * Application and Activity level
109      * {@link android.content.pm.PackageManager.Property PackageManager.Property} for an app to
110      * inform the system of the type of safety boundary recommended for the activity. When it is
111      * declared at the application level, all activities are set to the defined value, unless it is
112      * overridden at the activity level. When not declared, the system will not enforce any
113      * recommendations for a type of safety boundary and will continue to use the type that is
114      * currently in use.
115      *
116      * <p>The default value is {@link #XR_BOUNDARY_TYPE_NO_RECOMMENDATION}.
117      *
118      * <p>The available values are:
119      * <ul>
120      *   <li>{@link #XR_BOUNDARY_TYPE_LARGE}
121      *   <li>{@link #XR_BOUNDARY_TYPE_NO_RECOMMENDATION}
122      * </ul>
123      *
124      * <p><b>Syntax:</b>
125      * <pre>
126      * &lt;application&gt;
127      *   &lt;property
128      *     android:name="android.window.PROPERTY_XR_BOUNDARY_TYPE_RECOMMENDED"
129      *     android:value="XR_BOUNDARY_TYPE_LARGE|
130      *                    XR_BOUNDARY_TYPE_NO_RECOMMENDATION"/&gt;
131      * &lt;/application&gt;
132      * </pre>
133      */
134     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
135     public static final String PROPERTY_XR_BOUNDARY_TYPE_RECOMMENDED =
136             "android.window.PROPERTY_XR_BOUNDARY_TYPE_RECOMMENDED";
137 
138     /**
139      * Defines the value to launch an activity with no recommendations for the type of safety
140      * boundary. The system will continue to use the type of safety boundary that is currently
141      * in use.
142      *
143      * @see #PROPERTY_XR_BOUNDARY_TYPE_RECOMMENDED
144      */
145     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
146     public static final String XR_BOUNDARY_TYPE_NO_RECOMMENDATION =
147             "XR_BOUNDARY_TYPE_NO_RECOMMENDATION";
148 
149     /**
150      * Defines the value to launch an activity with a large boundary recommended. This is useful for
151      * activities which expect users to be moving around. The system will ask the user to use a
152      * larger size for their safety boundary and check that their space is clear, if the larger
153      * size is not already in use. This larger size will be determined by the system.
154      *
155      * @see #PROPERTY_XR_BOUNDARY_TYPE_RECOMMENDED
156      */
157     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
158     public static final String XR_BOUNDARY_TYPE_LARGE = "XR_BOUNDARY_TYPE_LARGE";
159 
160     /**
161      * Application and Activity level
162      * {@link android.content.pm.PackageManager.Property PackageManager.Property} to inform the
163      * system if it should play a system provided default animation when the app requests to enter
164      * or exit <a
165      * href="https://developer.android.com/develop/xr/jetpack-xr-sdk/transition-home-space-to-full-space">managed
166      * full space mode</a> in XR. When set to {@code true}, the system provided default animation is
167      * not played and the app is responsible for playing a custom enter or exit animation. When it
168      * is declared at the application level, all activities are set to the defined value, unless it
169      * is overridden at the activity level.
170      *
171      * <p>The default value is {@code false}.
172      *
173      * <p><b>Syntax:</b>
174      * <pre>
175      * &lt;application&gt;
176      *   &lt;property
177      *     android:name="android.window.PROPERTY_XR_USES_CUSTOM_FULL_SPACE_MANAGED_ANIMATION"
178      *     android:value="false|true"/&gt;
179      * &lt;/application&gt;
180      * </pre>
181      */
182     @FlaggedApi(android.xr.Flags.FLAG_XR_MANIFEST_ENTRIES)
183     public static final String PROPERTY_XR_USES_CUSTOM_FULL_SPACE_MANAGED_ANIMATION =
184             "android.window.PROPERTY_XR_USES_CUSTOM_FULL_SPACE_MANAGED_ANIMATION";
185 }
186