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

Commit f05d5540 authored by Julian J. M's avatar Julian J. M
Browse files

Set mms app to foreground OOM adjustment only if enabled in settings

Change-Id: If1ce66297e07548c94e8e71b03b0fa4a19f0d94a
parent dd699a2c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2191,6 +2191,12 @@ public final class Settings {
         */
        public static final String LOCK_HOME_IN_MEMORY = "lock_home_in_memory";

        /**
         * Whether to keep the messaging app at a higher OOM adjustement
         * @hide
         */
        public static final String LOCK_MMS_IN_MEMORY = "lock_mms_in_memory";

        /**
         * HDPI Devices only:  Align battery percentage text in status bar icon  right (0), left (1), center (2)
         * right (0) is default
+3 −1
Original line number Diff line number Diff line
@@ -13838,7 +13838,9 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
        int adj;
        int schedGroup;
        int N;
        if ("com.android.mms".equals(app.processName)) {
        if ("com.android.mms".equals(app.processName) &&
            Settings.System.getInt(mContext.getContentResolver(),
            Settings.System.LOCK_MMS_IN_MEMORY, 1) == 1 ) {
            // MMS can die in situations of heavy memory pressure.
            // Always push it to the top.
            adj = FOREGROUND_APP_ADJ;