AI-generated Key Takeaways
-
The
UserPrefsclass stores user preferences, such as controller handedness and enabled runtime features, and remains valid until the GVR context is destroyed. -
It provides methods to get the user's preferred controller hand (left or right) and check if a specific runtime feature is enabled.
-
Runtime features can be enabled or disabled by the user and may persist while the activity is running, but could be changed when the activity stops.
-
Developers can use the
requestFeaturesmethod of theGvrApiclass to prompt users to enable or disable runtime features.
Contains information about user preferences. This object will remain valid until the GVR context (wrapped by GvrApi) is destroyed.
Nested Classes
| class | UserPrefs.ControllerHandedness | The hand the user prefers to hold the controller in. | |
| enum | UserPrefs.RuntimeFeature | These are features that may be available on some devices but can be enabled or disabled by the user. | |
Public Methods
| int |
getControllerHandedness()
Returns the current controller handedness setting.
|
| boolean |
isFeatureEnabled(UserPrefs.RuntimeFeature feature)
Queries whether a particular runtime feature is currently enabled.
|
Inherited Methods
Public Methods
public int getControllerHandedness ()
Returns the current controller handedness setting. Will be either ControllerHandedness.RIGHT_HANDED or ControllerHandedness.LEFT_HANDED.
public boolean isFeatureEnabled (UserPrefs.RuntimeFeature feature)
Queries whether a particular runtime feature is currently enabled. Use requestFeatures(UserPrefs.RuntimeFeature[], UserPrefs.RuntimeFeature[], android.app.PendingIntent) to ask the user to enable it. If a feature is enabled by the user,
it will remain enabled while the Activity is running. However, it may be disabled by the user
when the Activity is stopped.
Parameters
| feature | The UserPrefs.RuntimeFeature being queried. |
|---|
Returns
- true if feature is currently enabled.