Merge "Fix SnapshotTaskTests" into tm-dev

This commit is contained in:
Chavi Weingarten
2022-02-23 15:54:23 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 3 deletions

View File

@@ -382,6 +382,7 @@ message ActivityRecordProto {
optional bool in_size_compat_mode = 32; optional bool in_size_compat_mode = 32;
optional float min_aspect_ratio = 33; optional float min_aspect_ratio = 33;
optional bool provides_max_bounds = 34; optional bool provides_max_bounds = 34;
optional bool enable_recents_screenshot = 35;
} }
/* represents WindowToken */ /* represents WindowToken */

View File

@@ -148,6 +148,7 @@ import static com.android.server.wm.ActivityRecordProto.ALL_DRAWN;
import static com.android.server.wm.ActivityRecordProto.APP_STOPPED; import static com.android.server.wm.ActivityRecordProto.APP_STOPPED;
import static com.android.server.wm.ActivityRecordProto.CLIENT_VISIBLE; import static com.android.server.wm.ActivityRecordProto.CLIENT_VISIBLE;
import static com.android.server.wm.ActivityRecordProto.DEFER_HIDING_CLIENT; import static com.android.server.wm.ActivityRecordProto.DEFER_HIDING_CLIENT;
import static com.android.server.wm.ActivityRecordProto.ENABLE_RECENTS_SCREENSHOT;
import static com.android.server.wm.ActivityRecordProto.FILLS_PARENT; import static com.android.server.wm.ActivityRecordProto.FILLS_PARENT;
import static com.android.server.wm.ActivityRecordProto.FRONT_OF_TASK; import static com.android.server.wm.ActivityRecordProto.FRONT_OF_TASK;
import static com.android.server.wm.ActivityRecordProto.IN_SIZE_COMPAT_MODE; import static com.android.server.wm.ActivityRecordProto.IN_SIZE_COMPAT_MODE;
@@ -771,7 +772,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// Last visibility state we reported to the app token. // Last visibility state we reported to the app token.
boolean reportedVisible; boolean reportedVisible;
boolean mEnablePreviewScreenshots = true; boolean mEnableRecentsScreenshot = true;
// Information about an application starting window if displayed. // Information about an application starting window if displayed.
// Note: these are de-referenced before the starting window animates away. // Note: these are de-referenced before the starting window animates away.
@@ -5151,7 +5152,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
* See {@link Activity#setRecentsScreenshotEnabled}. * See {@link Activity#setRecentsScreenshotEnabled}.
*/ */
void setRecentsScreenshotEnabled(boolean enabled) { void setRecentsScreenshotEnabled(boolean enabled) {
mEnablePreviewScreenshots = enabled; mEnableRecentsScreenshot = enabled;
} }
/** /**
@@ -5163,7 +5164,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
* screenshot. * screenshot.
*/ */
boolean shouldUseAppThemeSnapshot() { boolean shouldUseAppThemeSnapshot() {
return !mEnablePreviewScreenshots || forAllWindows(WindowState::isSecureLocked, return !mEnableRecentsScreenshot || forAllWindows(WindowState::isSecureLocked,
true /* topToBottom */); true /* topToBottom */);
} }
@@ -9184,6 +9185,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// Only record if max bounds sandboxing is applied, if the caller has the necessary // Only record if max bounds sandboxing is applied, if the caller has the necessary
// permission to access the device configs. // permission to access the device configs.
proto.write(PROVIDES_MAX_BOUNDS, providesMaxBounds()); proto.write(PROVIDES_MAX_BOUNDS, providesMaxBounds());
proto.write(ENABLE_RECENTS_SCREENSHOT, mEnableRecentsScreenshot);
} }
@Override @Override