Merge "Add manifest attribute for VR activities." into nyc-dev

This commit is contained in:
Ruben Brunk
2016-04-26 22:05:28 +00:00
committed by Android (Google) Code Review
8 changed files with 34 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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<ActivityInfo> CREATOR
@@ -972,6 +984,7 @@ public class ActivityInfo extends ComponentInfo
windowLayout = new WindowLayout(source);
}
resizeMode = source.readInt();
requestedVrComponent = source.readString();
}
/**

View File

@@ -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;

View File

@@ -552,6 +552,15 @@
should not be interrupted with other activities or notifications. -->
<attr name="immersive" format="boolean" />
<!-- Flag declaring that this activity will be run in VR mode, and specifying
the component of the VrListenerService that should be bound while this
Activity is visible if installed and enabled on this device. This is
equivalent to calling {@link android.app.Activity#setVrModeEnabled} with the
the given component name within this Activity. Declaring this will prevent
the system from leaving VR mode during an Activity transtion one VR activity
to another. -->
<attr name="enableVrMode" format="string" />
<!-- Specify the order in which content providers hosted by a process
are instantiated when that process is created. Not needed unless
you have providers with dependencies between each other, to make
@@ -1884,6 +1893,7 @@
For example, {@link android.R.attr#supportsPictureInPicture} activities are placed
in a task/stack that isn't focusable. This flag allows them to be focusable.-->
<attr name="alwaysFocusable" format="boolean" />
<attr name="enableVrMode" />
</declare-styleable>
<!-- The <code>activity-alias</code> tag declares a new

View File

@@ -2714,6 +2714,7 @@
<public type="attr" name="contentInsetStartWithNavigation" />
<public type="attr" name="contentInsetEndWithActions" />
<public type="attr" name="numberPickerStyle" />
<public type="attr" name="enableVrMode" />
<public type="style" name="Theme.Material.Light.DialogWhenLarge.DarkActionBar" />
<public type="style" name="Widget.Material.SeekBar.Discrete" />

View File

@@ -721,6 +721,9 @@ final class ActivityRecord {
}
immersive = (aInfo.flags & ActivityInfo.FLAG_IMMERSIVE) != 0;
requestedVrComponent = (aInfo.requestedVrComponent == null) ?
null : ComponentName.unflattenFromString(aInfo.requestedVrComponent);
} else {
realActivity = null;
taskAffinity = null;
@@ -732,6 +735,7 @@ final class ActivityRecord {
noDisplay = false;
mActivityType = APPLICATION_ACTIVITY_TYPE;
immersive = false;
requestedVrComponent = null;
}
}