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

Commit 69fd7bd6 authored by gcondra@google.com's avatar gcondra@google.com Committed by Android Git Automerger
Browse files

am bb393d68: am 0b063188: Merge "Set persistent property for SELinux...

am bb393d68: am 0b063188: Merge "Set persistent property for SELinux enforcement on update." into jb-mr2-dev

* commit 'bb393d68':
  Set persistent property for SELinux enforcement on update.
parents ac74c517 bb393d68
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -122,9 +122,16 @@ public class SELinuxPolicyInstallReceiver extends ConfigUpdateInstallReceiver {
    }

    private void setEnforcingMode(Context context) {
        boolean mode = Settings.Global.getInt(context.getContentResolver(),
            Settings.Global.SELINUX_STATUS, 0) == 1;
        SELinux.setSELinuxEnforce(mode);
        String mode = Settings.Global.getString(context.getContentResolver(),
            Settings.Global.SELINUX_STATUS);
        if (mode.equals("1")) {
            Slog.i(TAG, "Setting enforcing mode");
            SystemProperties.set("persist.selinux.enforcing", mode);
        } else if (mode.equals("0")) {
            Slog.i(TAG, "Tried to set permissive mode, ignoring");
        } else {
            Slog.e(TAG, "Got invalid enforcing mode: " + mode);
        }
    }

    @Override