App close auto shred not working [Tablet] (#34702)

Fixed the `On App Closed` auto-shred option to trigger only when the app
is fully closed, not when the user switches apps or presses the Home
button.

Resolves: https://github.com/brave/brave-browser/issues/53441
---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
This commit is contained in:
vadims
2026-03-16 17:25:06 +01:00
committed by GitHub
parent 37b711adcf
commit 270588d928
13 changed files with 163 additions and 110 deletions
@@ -1098,12 +1098,6 @@ public abstract class BraveActivity extends ChromeActivity
ApplicationStatus.registerApplicationStateListener(mApplicationStateListener);
}
Profile profile = getCurrentProfile();
if (profile != null) {
// Triggers notification of current app state on Android.
BraveFirstPartyStorageCleanerUtils.triggerCurrentAppStateNotification(profile);
}
super.onStartWithNative();
}
@@ -3031,4 +3025,14 @@ public abstract class BraveActivity extends ChromeActivity
}
}
}
@Override
public void onTabStateInitializedHandler() {
Profile profile = getCurrentProfile();
if (profile != null) {
// Triggers current app state notification to make sure the first-party storage cleanup
// is scheduled on startup if needed.
BraveFirstPartyStorageCleanerUtils.triggerCurrentAppStateNotification(profile);
}
}
}