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

Commit eacffc5b authored by Tom Marshall's avatar Tom Marshall Committed by Gerrit Code Review
Browse files

Allow disabling radio with property persist.ril.enable.

This can be useful for phone with no active service.  It saves battery
and prevents unwanted communication with cell carriers.

Change-Id: I61ad66ee49384a53667066f426aedac1ab7d5d73
parent e243626e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1433,6 +1433,11 @@ public class RIL extends BaseCommands implements CommandsInterface {

    public void
    setRadioPower(boolean on, Message result) {
        boolean allow = SystemProperties.getBoolean("persist.ril.enable", true);
        if (!allow) {
            return;
        }

        RILRequest rr = RILRequest.obtain(RIL_REQUEST_RADIO_POWER, result);

        rr.mp.writeInt(1);
+5 −0
Original line number Diff line number Diff line
@@ -100,6 +100,11 @@ public class SamsungCDMAv6RIL extends RIL implements CommandsInterface {
    @Override
    public void
    setRadioPower(boolean on, Message result) {
        boolean allow = SystemProperties.getBoolean("persist.ril.enable", true);
        if (!allow) {
            return;
        }

        RILRequest rr = RILRequest.obtain(RIL_REQUEST_RADIO_POWER, result);

        if (on) {
+5 −0
Original line number Diff line number Diff line
@@ -89,6 +89,11 @@ public class SamsungExynos3RIL extends RIL implements CommandsInterface {
    @Override
    public void
    setRadioPower(boolean on, Message result) {
        boolean allow = SystemProperties.getBoolean("persist.ril.enable", true);
        if (!allow) {
            return;
        }

        RILRequest rr = RILRequest.obtain(RIL_REQUEST_RADIO_POWER, result);

        if (on) {