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

Commit e934da98 authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Add config_reducedTaskSnapshotScale

Add config_reducedTaskSnapshotScale to replace previously hardcoded
value of 0.5.

Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotCacheTest
Bug: 148092712
Change-Id: Ib414d244bda02544a52164aee64b73434d5e5631
parent e4a81f01
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2723,6 +2723,11 @@
    <!-- The amount to scale fullscreen snapshots for Overview and snapshot starting windows. -->
    <item name="config_fullTaskSnapshotScale" format="float" type="dimen">1.0</item>

    <!-- The amount to scale reduced scale snapshots for Overview and snapshot starting windows.
         Reduced scale snapshots are loaded before full screen snapshots to improve load times and
         minimize the chance the user will see an empty task card. -->
    <item name="config_reducedTaskSnapshotScale" format="float" type="dimen">0.5</item>

    <!-- Feature flag to store TaskSnapshot in 16 bit pixel format to save memory. -->
    <bool name="config_use16BitTaskSnapshotPixelFormat">false</bool>

+1 −0
Original line number Diff line number Diff line
@@ -357,6 +357,7 @@
  <java-symbol type="bool" name="config_enableNewAutoSelectNetworkUI"/>
  <java-symbol type="bool" name="config_disableUsbPermissionDialogs"/>
  <java-symbol type="dimen" name="config_fullTaskSnapshotScale" />
  <java-symbol type="dimen" name="config_reducedTaskSnapshotScale" />
  <java-symbol type="bool" name="config_use16BitTaskSnapshotPixelFormat" />
  <java-symbol type="bool" name="config_hasRecents" />
  <java-symbol type="string" name="config_recentsComponentName" />
+7 −3
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ class TaskSnapshotPersister {
    private static final String TAG = TAG_WITH_CLASS_NAME ? "TaskSnapshotPersister" : TAG_WM;
    private static final String SNAPSHOTS_DIRNAME = "snapshots";
    private static final String REDUCED_POSTFIX = "_reduced";
    private static final float REDUCED_SCALE = .5f;
    private static final float LOW_RAM_REDUCED_SCALE = .8f;
    static final boolean DISABLE_FULL_SIZED_BITMAPS = ActivityManager.isLowRamDeviceStatic();
    private static final long DELAY_MS = 100;
@@ -84,8 +83,13 @@ class TaskSnapshotPersister {

    TaskSnapshotPersister(WindowManagerService service, DirectoryResolver resolver) {
        mDirectoryResolver = resolver;
        mReducedScale = ActivityManager.isLowRamDeviceStatic()
                ? LOW_RAM_REDUCED_SCALE : REDUCED_SCALE;

        if (ActivityManager.isLowRamDeviceStatic()) {
            mReducedScale = LOW_RAM_REDUCED_SCALE;
        } else {
            mReducedScale = service.mContext.getResources().getFloat(
                    com.android.internal.R.dimen.config_reducedTaskSnapshotScale);
        }
        mUse16BitFormat = service.mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_use16BitTaskSnapshotPixelFormat);
    }