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

Commit 44dfd78b authored by Brett Chabot's avatar Brett Chabot
Browse files

Backport 'add config to disable snapshots'.

Bug: 201691826
Test: m
Merged-In: I83d9ab4a15a862ea220debdd8da8b3d5673da276
Merged-In: Ibdff22eda7be6c91e2872e5ac3ae8f2fe1e65b69
Change-Id: I4914876e4925284d55951d16e472654ee599c619
parent 3f8b9fe5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5049,4 +5049,7 @@

    <!-- the number of the max cached processes in the system. -->
    <integer name="config_customizedMaxCachedProcesses">32</integer>

    <!-- Whether this device should support taking app snapshots on closure -->
    <bool name="config_disableTaskSnapshots">false</bool>
</resources>
+4 −1
Original line number Diff line number Diff line
@@ -4426,4 +4426,7 @@
  <java-symbol type="bool" name="config_volumeShowRemoteSessions" />

  <java-symbol type="integer" name="config_customizedMaxCachedProcesses" />

  <java-symbol type="bool" name="config_disableTaskSnapshots" />

</resources>
+9 −1
Original line number Diff line number Diff line
@@ -118,6 +118,11 @@ class TaskSnapshotController {
     */
    private final boolean mIsRunningOnWear;

    /**
     * Flag indicating if device configuration has disabled app snapshots.
     */
    private final boolean mConfigDisableTaskSnapshots;

    TaskSnapshotController(WindowManagerService service) {
        mService = service;
        mPersister = new TaskSnapshotPersister(mService, Environment::getDataSystemCeDirectory);
@@ -131,6 +136,8 @@ class TaskSnapshotController {
            PackageManager.FEATURE_WATCH);
        mHighResTaskSnapshotScale = mService.mContext.getResources().getFloat(
                com.android.internal.R.dimen.config_highResTaskSnapshotScale);
        mConfigDisableTaskSnapshots = mService.mContext.getResources().getBoolean(
                            com.android.internal.R.bool.config_disableTaskSnapshots);
    }

    void systemReady() {
@@ -488,7 +495,8 @@ class TaskSnapshotController {
    }

    boolean shouldDisableSnapshots() {
        return mIsRunningOnWear || mIsRunningOnTv || mIsRunningOnIoT;
        return mIsRunningOnWear || mIsRunningOnTv || mIsRunningOnIoT
            || mConfigDisableTaskSnapshots;
    }

    /**