Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
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.
  • Loading branch information
thestinger committed Feb 5, 2024
1 parent 4297405 commit 38c4009
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38c4009

Please sign in to comment.