Revert "Disabled task snapshot for TV"
Bug: 62360140
Bug: 62040693
This reverts commit 4256422eb6.
Change-Id: Id89de52c9ad25ef7b3163bd8b4a0c44f97631431
This commit is contained in:
@@ -17,13 +17,15 @@
|
||||
package com.android.server.wm;
|
||||
|
||||
import static android.app.ActivityManager.ENABLE_TASK_SNAPSHOTS;
|
||||
import static android.graphics.Bitmap.Config.ARGB_8888;
|
||||
import static android.graphics.Bitmap.Config.HARDWARE;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityManager.StackId;
|
||||
import android.app.ActivityManager.TaskSnapshot;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.GraphicBuffer;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Environment;
|
||||
@@ -36,11 +38,11 @@ import android.view.WindowManager.LayoutParams;
|
||||
import android.view.WindowManagerPolicy.ScreenOffListener;
|
||||
import android.view.WindowManagerPolicy.StartingSurface;
|
||||
|
||||
import com.google.android.collect.Sets;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.server.wm.TaskSnapshotSurface.SystemBarBackgroundPainter;
|
||||
|
||||
import com.google.android.collect.Sets;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
@@ -87,16 +89,9 @@ class TaskSnapshotController {
|
||||
private final ArraySet<Task> mTmpTasks = new ArraySet<>();
|
||||
private final Handler mHandler = new Handler();
|
||||
|
||||
/**
|
||||
* Flag indicating whether we are running on an Android TV device.
|
||||
*/
|
||||
private final boolean mIsRunningOnTv;
|
||||
|
||||
TaskSnapshotController(WindowManagerService service) {
|
||||
mService = service;
|
||||
mCache = new TaskSnapshotCache(mService, mLoader);
|
||||
mIsRunningOnTv = mService.mContext.getPackageManager().hasSystemFeature(
|
||||
PackageManager.FEATURE_LEANBACK);
|
||||
}
|
||||
|
||||
void systemReady() {
|
||||
@@ -117,7 +112,7 @@ class TaskSnapshotController {
|
||||
}
|
||||
|
||||
private void handleClosingApps(ArraySet<AppWindowToken> closingApps) {
|
||||
if (shouldDisableSnapshots()) {
|
||||
if (!ENABLE_TASK_SNAPSHOTS || ActivityManager.isLowRamDeviceStatic()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -193,10 +188,6 @@ class TaskSnapshotController {
|
||||
1f /* scale */);
|
||||
}
|
||||
|
||||
private boolean shouldDisableSnapshots() {
|
||||
return !ENABLE_TASK_SNAPSHOTS || ActivityManager.isLowRamDeviceStatic() || mIsRunningOnTv;
|
||||
}
|
||||
|
||||
private Rect minRect(Rect rect1, Rect rect2) {
|
||||
return new Rect(Math.min(rect1.left, rect2.left),
|
||||
Math.min(rect1.top, rect2.top),
|
||||
@@ -310,7 +301,7 @@ class TaskSnapshotController {
|
||||
* Called when screen is being turned off.
|
||||
*/
|
||||
void screenTurningOff(ScreenOffListener listener) {
|
||||
if (shouldDisableSnapshots()) {
|
||||
if (!ENABLE_TASK_SNAPSHOTS || ActivityManager.isLowRamDeviceStatic()) {
|
||||
listener.onScreenOff();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user