diff options
author | Tom Marshall <tdm.code@gmail.com> | 2013-04-01 20:31:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-04-13 05:37:07 -0700 |
commit | eacffc5bdc6d94083af93c82bf2c539a1a86fd9b (patch) | |
tree | bacf46a99fbde95192b29d9829cb09e83fc08b2c /src/java/com/android/internal/telephony | |
parent | e243626e34bcf7383cfcdc4e80d1a9d6176b0ede (diff) | |
download | frameworks_opt_telephony-eacffc5bdc6d94083af93c82bf2c539a1a86fd9b.zip frameworks_opt_telephony-eacffc5bdc6d94083af93c82bf2c539a1a86fd9b.tar.gz frameworks_opt_telephony-eacffc5bdc6d94083af93c82bf2c539a1a86fd9b.tar.bz2 |
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
Diffstat (limited to 'src/java/com/android/internal/telephony')
3 files changed, 15 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java index e36999e..9431b5a 100644 --- a/src/java/com/android/internal/telephony/RIL.java +++ b/src/java/com/android/internal/telephony/RIL.java @@ -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); diff --git a/src/java/com/android/internal/telephony/SamsungCDMAv6RIL.java b/src/java/com/android/internal/telephony/SamsungCDMAv6RIL.java index afa65d5..8ec6d5e 100644 --- a/src/java/com/android/internal/telephony/SamsungCDMAv6RIL.java +++ b/src/java/com/android/internal/telephony/SamsungCDMAv6RIL.java @@ -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) { diff --git a/src/java/com/android/internal/telephony/SamsungExynos3RIL.java b/src/java/com/android/internal/telephony/SamsungExynos3RIL.java index f7bd517..343bca8 100644 --- a/src/java/com/android/internal/telephony/SamsungExynos3RIL.java +++ b/src/java/com/android/internal/telephony/SamsungExynos3RIL.java @@ -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) { |