diff --git a/api/current.txt b/api/current.txt index c738a2b3ed3ed..f267789600e64 100644 --- a/api/current.txt +++ b/api/current.txt @@ -513,6 +513,7 @@ package android { field public static final int elevation = 16843840; // 0x1010440 field public static final int ellipsize = 16842923; // 0x10100ab field public static final int ems = 16843096; // 0x1010158 + field public static final int enableVrMode = 16844072; // 0x1010528 field public static final int enabled = 16842766; // 0x101000e field public static final int end = 16843996; // 0x10104dc field public static final int endColor = 16843166; // 0x101019e diff --git a/api/system-current.txt b/api/system-current.txt index 1c7248c807d12..5a62d98e2f556 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -617,6 +617,7 @@ package android { field public static final int elevation = 16843840; // 0x1010440 field public static final int ellipsize = 16842923; // 0x10100ab field public static final int ems = 16843096; // 0x1010158 + field public static final int enableVrMode = 16844072; // 0x1010528 field public static final int enabled = 16842766; // 0x101000e field public static final int end = 16843996; // 0x10104dc field public static final int endColor = 16843166; // 0x101019e diff --git a/api/test-current.txt b/api/test-current.txt index 40505a1ce6e77..25e58e2780c2a 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -513,6 +513,7 @@ package android { field public static final int elevation = 16843840; // 0x1010440 field public static final int ellipsize = 16842923; // 0x10100ab field public static final int ems = 16843096; // 0x1010158 + field public static final int enableVrMode = 16844072; // 0x1010528 field public static final int enabled = 16842766; // 0x101000e field public static final int end = 16843996; // 0x10104dc field public static final int endColor = 16843166; // 0x101019e diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 0f4cbbba707b1..167befc089dd3 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -190,6 +190,13 @@ public class ActivityInfo extends ComponentInfo */ public int resizeMode; + /** + * Name of the VrListenerService component to run for this activity. + * @see android.R.attr#enableVrMode + * @hide + */ + public String requestedVrComponent; + /** * Bit in {@link #flags} indicating whether this activity is able to * run in multiple processes. If @@ -794,6 +801,7 @@ public class ActivityInfo extends ComponentInfo lockTaskLaunchMode = orig.lockTaskLaunchMode; windowLayout = orig.windowLayout; resizeMode = orig.resizeMode; + requestedVrComponent = orig.requestedVrComponent; } /** @@ -896,6 +904,9 @@ public class ActivityInfo extends ComponentInfo + windowLayout.heightFraction + ", " + windowLayout.gravity); } pw.println(prefix + "resizeMode=" + resizeModeToString(resizeMode)); + if (requestedVrComponent != null) { + pw.println(prefix + "requestedVrComponent=" + requestedVrComponent); + } super.dumpBack(pw, prefix, flags); } @@ -939,6 +950,7 @@ public class ActivityInfo extends ComponentInfo dest.writeInt(0); } dest.writeInt(resizeMode); + dest.writeString(requestedVrComponent); } public static final Parcelable.Creator CREATOR @@ -972,6 +984,7 @@ public class ActivityInfo extends ComponentInfo windowLayout = new WindowLayout(source); } resizeMode = source.readInt(); + requestedVrComponent = source.readString(); } /** diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 54091db797790..65020224914c7 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -3532,6 +3532,9 @@ public class PackageParser { a.info.encryptionAware = a.info.directBootAware = sa.getBoolean( R.styleable.AndroidManifestActivity_directBootAware, false); + + a.info.requestedVrComponent = + sa.getString(R.styleable.AndroidManifestActivity_enableVrMode); } else { a.info.launchMode = ActivityInfo.LAUNCH_MULTIPLE; a.info.configChanges = 0; diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index e040bea3d9656..cd7df8713e506 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -552,6 +552,15 @@ should not be interrupted with other activities or notifications. --> + + + +