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

Commit 264bd605 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add config param to disable app snapshots."

parents 87676023 fb257c22
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5074,4 +5074,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>
+2 −0
Original line number Diff line number Diff line
@@ -4440,4 +4440,6 @@
  <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;
    }

    /**