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

Commit 0b063188 authored by repo sync's avatar repo sync Committed by Android (Google) Code Review
Browse files

Merge "Set persistent property for SELinux enforcement on update." into jb-mr2-dev

parents bfdd2566 12566be4
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