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

Commit fb257c22 authored by Brett Chabot's avatar Brett Chabot
Browse files

Add config param to disable app snapshots.

There is an upcoming 'slim' emulator image which aims to reduce
resource consumption when running headless tests, largely by
disabling GL draw calls and allocations. App snapshots result in GL
draw calls, so its desirable to have ability to turn these off by
default in the slim image.

Bug: 188559292
Test: launch emulator, manually verify snapshots
Change-Id: I83d9ab4a15a862ea220debdd8da8b3d5673da276
parent 856db9e3
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;
    }

    /**