Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95378192 authored by Matthew Ng's avatar Matthew Ng
Browse files

Enable tasksnap shots on low ram devices

Turned on the flag to allow task snap shots to work on low ram devices.

Test: manual - use gobo device and should see the snapshots in recents
Bug: 62251652
Bug: 63940837
Change-Id: I9e9ccb11bd82a0f8cfc121796838fe8db4be4366
parent ed0c5cf4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -102,6 +102,11 @@ class TaskSnapshotController {
     */
    private final boolean mIsRunningOnIoT;

    /**
     * Flag indicating whether we are running on an Android Wear device.
     */
    private final boolean mIsRunningOnWear;

    TaskSnapshotController(WindowManagerService service) {
        mService = service;
        mCache = new TaskSnapshotCache(mService, mLoader);
@@ -109,6 +114,8 @@ class TaskSnapshotController {
                PackageManager.FEATURE_LEANBACK);
        mIsRunningOnIoT = mService.mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_EMBEDDED);
        mIsRunningOnWear = mService.mContext.getPackageManager().hasSystemFeature(
            PackageManager.FEATURE_WATCH);
    }

    void systemReady() {
@@ -213,8 +220,7 @@ class TaskSnapshotController {
    }

    private boolean shouldDisableSnapshots() {
        return !ENABLE_TASK_SNAPSHOTS || ActivityManager.isLowRamDeviceStatic()
                || mIsRunningOnTv || mIsRunningOnIoT;
        return !ENABLE_TASK_SNAPSHOTS || mIsRunningOnWear || mIsRunningOnTv || mIsRunningOnIoT;
    }

    private Rect minRect(Rect rect1, Rect rect2) {