indianpoptart / RadioControl

An app that auto toggles wifi and cell radio for maximum battery life
https://nikhilp.org/radiocontrol
GNU General Public License v3.0
16 stars 7 forks source link

Change code snippet #40

Closed indianpoptart closed 7 years ago

indianpoptart commented 7 years ago

Change code snippet found in WifiReceiver.java:

public int getCellStatus(Context c){
        TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);
        List<CellInfo> cellInfoList = tm.getAllCellInfo();
        int z = 0;
        //This means cell is off
        if(cellInfoList.isEmpty()){
            z = 1;
        }
        return z;
}

To this:

 public boolean hasCellStatus(Context context){
        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        return tm.getAllCellInfo().size() > 0;
    }
indianpoptart commented 7 years ago

Done in v4.1-beta8