Merge "Make ActivityInfo.preferMinimalPostProcessing a flag" into rvc-dev

This commit is contained in:
Galia Peycheva
2020-03-05 15:45:06 +00:00
committed by Android (Google) Code Review
10 changed files with 19 additions and 61 deletions

View File

@@ -11368,6 +11368,7 @@ package android.content.pm {
field public static final int FLAG_IMMERSIVE = 2048; // 0x800
field public static final int FLAG_MULTIPROCESS = 1; // 0x1
field public static final int FLAG_NO_HISTORY = 128; // 0x80
field public static final int FLAG_PREFER_MINIMAL_POST_PROCESSING = 33554432; // 0x2000000
field public static final int FLAG_RELINQUISH_TASK_IDENTITY = 4096; // 0x1000
field public static final int FLAG_RESUME_WHILE_PAUSING = 16384; // 0x4000
field public static final int FLAG_SINGLE_USER = 1073741824; // 0x40000000
@@ -11405,7 +11406,6 @@ package android.content.pm {
field public String parentActivityName;
field public String permission;
field public int persistableMode;
field public boolean preferMinimalPostProcessing;
field public int screenOrientation;
field public int softInputMode;
field public String targetActivity;

View File

@@ -7943,7 +7943,8 @@ public class Activity extends ContextThemeWrapper
mCurrentConfig = config;
mWindow.setColorMode(info.colorMode);
mWindow.setPreferMinimalPostProcessing(info.preferMinimalPostProcessing);
mWindow.setPreferMinimalPostProcessing(
(info.flags & ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING) != 0);
setAutofillOptions(application.getAutofillOptions());
setContentCaptureOptions(application.getContentCaptureOptions());

View File

@@ -289,43 +289,6 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
@ColorMode
public int colorMode = COLOR_MODE_DEFAULT;
/**
* Value for {@link #preferMinimalPostProcessing} indicating that by default
* minimal post processing is not preferred.
*
* @see android.R.attr#preferMinimalPostProcessing
* @hide
*/
public static final boolean MINIMAL_POST_PROCESSING_DEFAULT = false;
/**
* Indicates whether the activity wants the connected display to do minimal post processing on
* the produced image or video frames. This will only be requested if this activity's main
* window is visible on the screen.
*
* <p>This setting should be used when low latency has a higher priority than image enhancement
* processing (e.g. for games or video conferencing).
*
* <p>If the Display sink is connected via HDMI, the device will begin to send infoframes with
* Auto Low Latency Mode enabled and Game Content Type. This will switch the connected display
* to a minimal image processing mode (if available), which reduces latency, improving the user
* experience for gaming or video conferencing applications. For more information, see HDMI 2.1
* specification.
*
* <p>If the Display sink has an internal connection or uses some other protocol than HDMI,
* effects may be similar but implementation-defined.
*
* <p>The ability to switch to a mode with minimal post proessing may be disabled by a user
* setting in the system settings menu. In that case, this field is ignored and the display will
* remain in its current mode.
*
* <p>Set from attribute {@link android.R.attr#preferMinimalPostProcessing}.
*
* @see android.view.WindowManager.LayoutParams#preferMinimalPostProcessing
* @see android.view.Display#isMinimalPostProcessingSupported
*/
public boolean preferMinimalPostProcessing = MINIMAL_POST_PROCESSING_DEFAULT;
/**
* Bit in {@link #flags} indicating whether this activity is able to
* run in multiple processes. If
@@ -505,6 +468,13 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
*/
public static final int FLAG_TURN_SCREEN_ON = 0x1000000;
/**
* Bit in {@link #flags} indicating whether the display should preferably be switched to a
* minimal post processing mode.
* See {@link android.R.attr#preferMinimalPostProcessing}
*/
public static final int FLAG_PREFER_MINIMAL_POST_PROCESSING = 0x2000000;
/**
* @hide Bit in {@link #flags}: If set, this component will only be seen
* by the system user. Only works with broadcast receivers. Set from the
@@ -1041,7 +1011,6 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
requestedVrComponent = orig.requestedVrComponent;
rotationAnimation = orig.rotationAnimation;
colorMode = orig.colorMode;
preferMinimalPostProcessing = orig.preferMinimalPostProcessing;
maxAspectRatio = orig.maxAspectRatio;
minAspectRatio = orig.minAspectRatio;
}
@@ -1269,7 +1238,6 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
dest.writeInt(colorMode);
dest.writeFloat(maxAspectRatio);
dest.writeFloat(minAspectRatio);
dest.writeBoolean(preferMinimalPostProcessing);
}
/**
@@ -1388,7 +1356,6 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
colorMode = source.readInt();
maxAspectRatio = source.readFloat();
minAspectRatio = source.readFloat();
preferMinimalPostProcessing = source.readBoolean();
}
/**

View File

@@ -4180,7 +4180,6 @@ public class PackageParser {
a.info.directBootAware = false;
a.info.rotationAnimation = ROTATION_ANIMATION_UNSPECIFIED;
a.info.colorMode = ActivityInfo.COLOR_MODE_DEFAULT;
a.info.preferMinimalPostProcessing = ActivityInfo.MINIMAL_POST_PROCESSING_DEFAULT;
if (hardwareAccelerated) {
a.info.flags |= ActivityInfo.FLAG_HARDWARE_ACCELERATED;
}
@@ -4395,9 +4394,10 @@ public class PackageParser {
a.info.colorMode = sa.getInt(R.styleable.AndroidManifestActivity_colorMode,
ActivityInfo.COLOR_MODE_DEFAULT);
a.info.preferMinimalPostProcessing = sa.getBoolean(
R.styleable.AndroidManifestActivity_preferMinimalPostProcessing,
ActivityInfo.MINIMAL_POST_PROCESSING_DEFAULT);
if (sa.getBoolean(
R.styleable.AndroidManifestActivity_preferMinimalPostProcessing, false)) {
a.info.flags |= ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING;
}
if (sa.getBoolean(R.styleable.AndroidManifestActivity_showWhenLocked, false)) {
a.info.flags |= ActivityInfo.FLAG_SHOW_WHEN_LOCKED;

View File

@@ -451,7 +451,6 @@ public class PackageInfoWithoutStateUtils {
ai.requestedVrComponent = a.getRequestedVrComponent();
ai.rotationAnimation = a.getRotationAnimation();
ai.colorMode = a.getColorMode();
ai.preferMinimalPostProcessing = a.isPreferMinimalPostProcessing();
ai.windowLayout = a.getWindowLayout();
ai.metaData = a.getMetaData();
ai.applicationInfo = applicationInfo;

View File

@@ -78,8 +78,6 @@ public class ParsedActivity extends ParsedMainComponent {
int rotationAnimation = -1;
int colorMode;
boolean preferMinimalPostProcessing;
@Nullable
ActivityInfo.WindowLayout windowLayout;
@@ -135,7 +133,6 @@ public class ParsedActivity extends ParsedMainComponent {
activity.setDirectBootAware(false);
activity.rotationAnimation = ROTATION_ANIMATION_UNSPECIFIED;
activity.colorMode = ActivityInfo.COLOR_MODE_DEFAULT;
activity.preferMinimalPostProcessing = ActivityInfo.MINIMAL_POST_PROCESSING_DEFAULT;
if (hardwareAccelerated) {
activity.setFlags(activity.getFlags() | ActivityInfo.FLAG_HARDWARE_ACCELERATED);
}
@@ -285,7 +282,6 @@ public class ParsedActivity extends ParsedMainComponent {
dest.writeString(this.requestedVrComponent);
dest.writeInt(this.rotationAnimation);
dest.writeInt(this.colorMode);
dest.writeBoolean(this.preferMinimalPostProcessing);
dest.writeBundle(this.metaData);
if (windowLayout != null) {
@@ -328,7 +324,6 @@ public class ParsedActivity extends ParsedMainComponent {
this.requestedVrComponent = in.readString();
this.rotationAnimation = in.readInt();
this.colorMode = in.readInt();
this.preferMinimalPostProcessing = in.readBoolean();
this.metaData = in.readBundle();
if (in.readBoolean()) {
windowLayout = new ActivityInfo.WindowLayout(in);
@@ -438,10 +433,6 @@ public class ParsedActivity extends ParsedMainComponent {
return colorMode;
}
public boolean isPreferMinimalPostProcessing() {
return preferMinimalPostProcessing;
}
@Nullable
public ActivityInfo.WindowLayout getWindowLayout() {
return windowLayout;

View File

@@ -129,12 +129,12 @@ public class ParsedActivityUtils {
| flag(ActivityInfo.FLAG_RESUME_WHILE_PAUSING, R.styleable.AndroidManifestActivity_resumeWhilePausing, sa)
| flag(ActivityInfo.FLAG_SHOW_WHEN_LOCKED, R.styleable.AndroidManifestActivity_showWhenLocked, sa)
| flag(ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE, R.styleable.AndroidManifestActivity_supportsPictureInPicture, sa)
| flag(ActivityInfo.FLAG_TURN_SCREEN_ON, R.styleable.AndroidManifestActivity_turnScreenOn, sa);
| flag(ActivityInfo.FLAG_TURN_SCREEN_ON, R.styleable.AndroidManifestActivity_turnScreenOn, sa)
| flag(ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING, R.styleable.AndroidManifestActivity_preferMinimalPostProcessing, sa);
activity.privateFlags |= flag(ActivityInfo.FLAG_INHERIT_SHOW_WHEN_LOCKED, R.styleable.AndroidManifestActivity_inheritShowWhenLocked, sa);
activity.colorMode = sa.getInt(R.styleable.AndroidManifestActivity_colorMode, ActivityInfo.COLOR_MODE_DEFAULT);
activity.preferMinimalPostProcessing = sa.getBoolean(R.styleable.AndroidManifestActivity_preferMinimalPostProcessing, ActivityInfo.MINIMAL_POST_PROCESSING_DEFAULT);
activity.documentLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_documentLaunchMode, ActivityInfo.DOCUMENT_LAUNCH_NONE);
activity.launchMode = sa.getInt(R.styleable.AndroidManifestActivity_launchMode, ActivityInfo.LAUNCH_MULTIPLE);
activity.lockTaskLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0);

View File

@@ -1255,7 +1255,7 @@ public abstract class Window {
* <p>The ability to switch to a mode with minimal post proessing may be disabled by a user
* setting in the system settings menu. In that case, this method does nothing.
*
* @see android.content.pm.ActivityInfo#preferMinimalPostProcessing
* @see android.content.pm.ActivityInfo#FLAG_PREFER_MINIMAL_POST_PROCESSING
* @see android.view.Display#isMinimalPostProcessingSupported
* @see android.view.WindowManager.LayoutParams#preferMinimalPostProcessing
*

View File

@@ -2777,7 +2777,7 @@ public interface WindowManager extends ViewManager {
* setting in the system settings menu. In that case, this field is ignored and the display
* will remain in its current mode.
*
* @see android.content.pm.ActivityInfo#preferMinimalPostProcessing
* @see android.content.pm.ActivityInfo#FLAG_PREFER_MINIMAL_POST_PROCESSING
* @see android.view.Display#isMinimalPostProcessingSupported
* @see android.view.Window#setPreferMinimalPostProcessing
*/

View File

@@ -2656,7 +2656,7 @@
this field is ignored and the display will remain in its current
mode.
<p> See {@link android.content.pm.ActivityInfo #preferMinimalPostProcessing} -->
<p> See {@link android.content.pm.ActivityInfo#FLAG_PREFER_MINIMAL_POST_PROCESSING} -->
<attr name="preferMinimalPostProcessing" format="boolean"/>
</declare-styleable>