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

Commit caf4f792 authored by wilsonshih's avatar wilsonshih
Browse files

Add a flag to control activity snapshot by default.

When the flag is enabled, system will capture activity snapshot for
close activity by default.

Bug: 259497289
Test: local override then verify activity snapshot is enabled.
Change-Id: I023ebd9dc5e2e29f3f79760c15ca3bf5de645c5d
parent 2559674d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -59,3 +59,11 @@ flag {
    bug: "309545085"
    is_fixed_read_only: true
}

flag {
    name: "activity_snapshot_by_default"
    namespace: "systemui"
    description: "Enable record activity snapshot by default"
    bug: "259497289"
    is_fixed_read_only: true
}
 No newline at end of file
+3 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.server.LocalServices;
import com.android.server.pm.UserManagerInternal;
import com.android.server.wm.BaseAppSnapshotPersister.PersistInfoProvider;
import com.android.window.flags.Flags;

import java.io.File;
import java.util.ArrayList;
@@ -121,7 +122,8 @@ class ActivitySnapshotController extends AbsAppSnapshotController<ActivityRecord

    // TODO remove when enabled
    static boolean isSnapshotEnabled() {
        return SystemProperties.getInt("persist.wm.debug.activity_screenshot", 0) != 0;
        return SystemProperties.getInt("persist.wm.debug.activity_screenshot", 0) != 0
                || Flags.activitySnapshotByDefault();
    }

    static PersistInfoProvider createPersistInfoProvider(