Turning Off Cell Radio When No Calls Are Received
I am trying to detect if any calls are presently being attended or the cell phone is ringing.If not, the cell radio should switch off.Since I am using telephony manager for the fir
Solution 1:
The reason you won't find it in the developer docs is that it is hidden. However, you may always find hidden methods in the Android Source Code.
Code reference: public boolean setRadioPower(boolean turnOn){}
If your phone is not rooted, or if you do not have system permission android.Manifest.permission.MODIFY_PHONE_STATE
, you won't be able to access this API.
However, if you do have those permissions, you can easily achieve this using the following code:
ITelephonyiTelephony= ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE));
try {
iTelephony.setRadioPower(true);
} catch (RemoteException e) {
e.printStackTrace();
}
Post a Comment for "Turning Off Cell Radio When No Calls Are Received"