Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -7407,6 +7407,14 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
*/
public static final String POCKET_JUDGE = "pocket_judge";

/**
* Whether to reclaim memory by killing cached apps shortly after screen on.
* 0 = disabled
* 1 = enabled
* @hide
*/
public static final String SCREEN_ON_MEMORY_RECLAIM = "screen_on_memory_reclaim";

/**
* Whether to show heads up only for dialer and sms apps
* @hide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8247,6 +8247,10 @@ private void toggleRingerModes() {
}

private void releaseMemoryAtScreenOn() {
if (Settings.System.getIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_ON_MEMORY_RECLAIM, 1, UserHandle.USER_CURRENT) == 0) {
return;
}
long currentTime = System.currentTimeMillis();
if (lastMemoryReleaseTime == 0L || currentTime - lastMemoryReleaseTime > MEMORY_RELEASE_INTERVAL_MS) {
try {
Expand Down