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

Commit 6ff5a319 authored by Andrew Dodd's avatar Andrew Dodd Committed by Gerrit Code Review
Browse files

wifi: Allow Settings to retrieve country code (1/2)

This makes getCountryCode behave like getFrequencyBand

This allows Settings to get/set country code like
it can for frequency band.

Ported from cm-10.2, adjusted for 4.4
Settings part: http://review.cyanogenmod.org/54904

Change-Id: Id9f00d3a678642c6c142fd1511af820d729507a7
parent 33110a0b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -880,6 +880,15 @@ public final class WifiService extends IWifiManager.Stub {
        }
    }

    /**
     * Get the operational country code
     */
    public String getCountryCode() {
        enforceAccessPermission();
        return mWifiStateMachine.getCountryCode();
    }


    /**
     * Set the operational frequency band
     * @param band One of
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ interface IWifiManager

    void setCountryCode(String country, boolean persist);

    String getCountryCode();

    void setFrequencyBand(int band, boolean persist);

    int getFrequencyBand();
+12 −0
Original line number Diff line number Diff line
@@ -945,6 +945,18 @@ public class WifiManager {
        } catch (RemoteException e) { }
    }

    /**
     * Get the operational country code.
     * @hide
     */
    public String getCountryCode() {
        try {
            return mService.getCountryCode();
        } catch (RemoteException e) {
            return null;
        }
    }

    /**
     * Set the operational frequency band.
     * @param band  One of
+7 −0
Original line number Diff line number Diff line
@@ -1569,6 +1569,13 @@ public class WifiStateMachine extends StateMachine {
        return result;
    }

    /**
     * Returns the operational country code
     */
    public String getCountryCode() {
        return mLastSetCountryCode;
    }

    /**
     * Set the operational frequency band
     * @param band