Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run full explicit GC in SystemUI and system_server after locking
Browse files Browse the repository at this point in the history
ART has special support for System.gc() and Android already uses this to
purge memory after unlocking. It makes sense to purge as much as we can
when locking too.
thestinger committed Feb 2, 2024
1 parent 3e773e4 commit 434a169
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -2769,6 +2769,9 @@ private void handleShow(Bundle options) {
userActivity();
mUpdateMonitor.setKeyguardGoingAway(false);
mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(false);
System.gc();
System.runFinalization();
System.gc();
mShowKeyguardWakeLock.release();
}
mKeyguardDisplayManager.show();
Original file line number Diff line number Diff line change
@@ -97,6 +97,12 @@ public void onShowingStateChanged(boolean showing, int userId) {
ExtSettings.DENY_NEW_USB_TRANSIENT_ENABLE :
ExtSettings.DENY_NEW_USB_TRANSIENT_DISABLE);
}

if (showing) {
System.gc();
System.runFinalization();
System.gc();
}
}

@Override // Binder interface

0 comments on commit 434a169

Please sign in to comment.