Disable task snapshots on svelte

Test: Boot low ram device, make sure cache stays empty
Bug: 31339431
Change-Id: I0fac1071f17fcd13872ef68f68eee2c793c6753c
This commit is contained in:
Jorim Jaggi
2017-02-22 17:56:40 +01:00
parent df0824ad4c
commit 3d73260a8d

View File

@@ -19,6 +19,7 @@ package com.android.server.wm;
import static android.app.ActivityManager.ENABLE_TASK_SNAPSHOTS;
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.ActivityManager.StackId;
import android.app.ActivityManager.TaskSnapshot;
import android.graphics.GraphicBuffer;
@@ -65,26 +66,22 @@ class TaskSnapshotController {
}
void onTransitionStarting() {
if (!ENABLE_TASK_SNAPSHOTS) {
return;
}
handleClosingApps(mService.mClosingApps);
}
/**
* Called when the visibility of an app changes outside of the regular app transition flow.
*/
void notifyAppVisibilityChanged(AppWindowToken appWindowToken, boolean visible) {
if (!ENABLE_TASK_SNAPSHOTS) {
return;
}
if (!visible) {
handleClosingApps(Sets.newArraySet(appWindowToken));
}
}
private void handleClosingApps(ArraySet<AppWindowToken> closingApps) {
if (!ENABLE_TASK_SNAPSHOTS || ActivityManager.isLowRamDeviceStatic()) {
return;
}
// We need to take a snapshot of the task if and only if all activities of the task are
// either closing or hidden.