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

Commit 069c6b50 authored by Brett Chabot's avatar Brett Chabot
Browse files

Backport 'add config to disable snapshots'.

Bug: 201691826
Test: m
Merged-In: I83d9ab4a15a862ea220debdd8da8b3d5673da276
Change-Id: Ibdff22eda7be6c91e2872e5ac3ae8f2fe1e65b69
parent 06844dd2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5276,4 +5276,7 @@
    <string name="config_work_badge_path_24" translatable="false">
        M20,6h-4L16,4c0,-1.11 -0.89,-2 -2,-2h-4c-1.11,0 -2,0.89 -2,2v2L4,6c-1.11,0 -1.99,0.89 -1.99,2L2,19c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,8c0,-1.11 -0.89,-2 -2,-2zM14,6h-4L10,4h4v2z
    </string>

    <!-- 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
@@ -4481,4 +4481,6 @@
  <java-symbol type="array" name="config_roundedCornerBottomRadiusAdjustmentArray" />
  <java-symbol type="bool" name="config_secondaryBuiltInDisplayIsRound" />
  <java-symbol type="array" name="config_builtInDisplayIsRoundArray" />
  <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() {
@@ -494,7 +501,8 @@ class TaskSnapshotController {
    }

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

    /**