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

Commit 099e51c7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Lower SMS background importance" into main

parents 8dcf2e21 221b19e9
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -312,3 +312,14 @@ flag {
        purpose: PURPOSE_BUGFIX
        purpose: PURPOSE_BUGFIX
    }
    }
}
}

flag {
    name: "lower_sms_oom_importance"
    namespace: "backstage_power"
    description: "Lower messaging app process oom importance to PERCEPTIBLE_APP_ADJ + 1."
    bug: "372511805"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+10 −3
Original line number Original line Diff line number Diff line
@@ -102,9 +102,16 @@ public class AppBindingConstants {


        boolean smsServiceEnabled = parser.getBoolean(SMS_SERVICE_ENABLED_KEY, true);
        boolean smsServiceEnabled = parser.getBoolean(SMS_SERVICE_ENABLED_KEY, true);


        int smsAppBindFlags = parser.getInt(
        int smsAppBindFlags;
        if (com.android.server.am.Flags.lowerSmsOomImportance()) {
            smsAppBindFlags = parser.getInt(
                    SMS_APP_BIND_FLAGS_KEY,
                    Context.BIND_ALMOST_PERCEPTIBLE | Context.BIND_FOREGROUND_SERVICE);
        } else {
            smsAppBindFlags = parser.getInt(
                    SMS_APP_BIND_FLAGS_KEY,
                    SMS_APP_BIND_FLAGS_KEY,
                    Context.BIND_NOT_VISIBLE | Context.BIND_FOREGROUND_SERVICE);
                    Context.BIND_NOT_VISIBLE | Context.BIND_FOREGROUND_SERVICE);
        }


        long serviceStableConnectionThresholdSec = parser.getLong(
        long serviceStableConnectionThresholdSec = parser.getLong(
                SERVICE_STABLE_CONNECTION_THRESHOLD_SEC_KEY, TimeUnit.MINUTES.toSeconds(2));
                SERVICE_STABLE_CONNECTION_THRESHOLD_SEC_KEY, TimeUnit.MINUTES.toSeconds(2));