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

Commit 56afa3d5 authored by Peter Visontay's avatar Peter Visontay
Browse files

Log the CHANGE_WIFI_STATE App Op in WifiManager (client changes).

Test: Manually tested that the op is noted. Ran opt/net/wifi/tests/wifitests/runtests.sh and base/wifi/tests/runtests.sh. Manually tested that 'idle' mode is now handled correctly.
Bug: 63907873
Change-Id: I66b20cdaab0f93700cc3fb871ae888ae0a9be32b
parent 7b9a2c76
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -66,11 +66,11 @@ interface IWifiManager

    List<OsuProvider> getMatchingOsuProviders(in ScanResult scanResult);

    int addOrUpdateNetwork(in WifiConfiguration config);
    int addOrUpdateNetwork(in WifiConfiguration config, String packageName);

    boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config);
    boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config, String packageName);

    boolean removePasspointConfiguration(in String fqdn);
    boolean removePasspointConfiguration(in String fqdn, String packageName);

    List<PasspointConfiguration> getPasspointConfigurations();

@@ -80,21 +80,21 @@ interface IWifiManager

    void deauthenticateNetwork(long holdoff, boolean ess);

    boolean removeNetwork(int netId);
    boolean removeNetwork(int netId, String packageName);

    boolean enableNetwork(int netId, boolean disableOthers);
    boolean enableNetwork(int netId, boolean disableOthers, String packageName);

    boolean disableNetwork(int netId);
    boolean disableNetwork(int netId, String packageName);

    void startScan(in ScanSettings requested, in WorkSource ws, in String packageName);
    void startScan(in ScanSettings requested, in WorkSource ws, String packageName);

    List<ScanResult> getScanResults(String callingPackage);

    void disconnect();
    void disconnect(String packageName);

    void reconnect();
    void reconnect(String packageName);

    void reassociate();
    void reassociate(String packageName);

    WifiInfo getConnectionInfo(String callingPackage);

@@ -108,7 +108,7 @@ interface IWifiManager

    boolean isDualBandSupported();

    boolean saveConfiguration();
    boolean saveConfiguration(String packageName);

    DhcpInfo getDhcpInfo();

@@ -134,7 +134,7 @@ interface IWifiManager

    boolean stopSoftAp();

    int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, in String packageName);
    int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, String packageName);

    void stopLocalOnlyHotspot();

@@ -146,9 +146,9 @@ interface IWifiManager

    WifiConfiguration getWifiApConfiguration();

    void setWifiApConfiguration(in WifiConfiguration wifiConfig);
    void setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName);

    Messenger getWifiServiceMessenger();
    Messenger getWifiServiceMessenger(String packageName);

    void enableTdls(String remoteIPAddress, boolean enable);

@@ -165,9 +165,9 @@ interface IWifiManager

    void enableWifiConnectivityManager(boolean enabled);

    void disableEphemeralNetwork(String SSID);
    void disableEphemeralNetwork(String SSID, String packageName);

    void factoryReset();
    void factoryReset(String packageName);

    Network getCurrentNetwork();

+14 −14
Original line number Diff line number Diff line
@@ -1132,7 +1132,7 @@ public class WifiManager {
     */
    private int addOrUpdateNetwork(WifiConfiguration config) {
        try {
            return mService.addOrUpdateNetwork(config);
            return mService.addOrUpdateNetwork(config, mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -1153,7 +1153,7 @@ public class WifiManager {
     */
    public void addOrUpdatePasspointConfiguration(PasspointConfiguration config) {
        try {
            if (!mService.addOrUpdatePasspointConfiguration(config)) {
            if (!mService.addOrUpdatePasspointConfiguration(config, mContext.getOpPackageName())) {
                throw new IllegalArgumentException();
            }
        } catch (RemoteException e) {
@@ -1170,7 +1170,7 @@ public class WifiManager {
     */
    public void removePasspointConfiguration(String fqdn) {
        try {
            if (!mService.removePasspointConfiguration(fqdn)) {
            if (!mService.removePasspointConfiguration(fqdn, mContext.getOpPackageName())) {
                throw new IllegalArgumentException();
            }
        } catch (RemoteException e) {
@@ -1256,7 +1256,7 @@ public class WifiManager {
     */
    public boolean removeNetwork(int netId) {
        try {
            return mService.removeNetwork(netId);
            return mService.removeNetwork(netId, mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -1302,7 +1302,7 @@ public class WifiManager {

        boolean success;
        try {
            success = mService.enableNetwork(netId, attemptConnect);
            success = mService.enableNetwork(netId, attemptConnect, mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -1328,7 +1328,7 @@ public class WifiManager {
     */
    public boolean disableNetwork(int netId) {
        try {
            return mService.disableNetwork(netId);
            return mService.disableNetwork(netId, mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -1341,7 +1341,7 @@ public class WifiManager {
     */
    public boolean disconnect() {
        try {
            mService.disconnect();
            mService.disconnect(mContext.getOpPackageName());
            return true;
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
@@ -1356,7 +1356,7 @@ public class WifiManager {
     */
    public boolean reconnect() {
        try {
            mService.reconnect();
            mService.reconnect(mContext.getOpPackageName());
            return true;
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
@@ -1371,7 +1371,7 @@ public class WifiManager {
     */
    public boolean reassociate() {
        try {
            mService.reassociate();
            mService.reassociate(mContext.getOpPackageName());
            return true;
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
@@ -1701,7 +1701,7 @@ public class WifiManager {
    @Deprecated
    public boolean saveConfiguration() {
        try {
            return mService.saveConfiguration();
            return mService.saveConfiguration(mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -2136,7 +2136,7 @@ public class WifiManager {
    @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE)
    public boolean setWifiApConfiguration(WifiConfiguration wifiConfig) {
        try {
            mService.setWifiApConfiguration(wifiConfig);
            mService.setWifiApConfiguration(wifiConfig, mContext.getOpPackageName());
            return true;
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
@@ -3052,7 +3052,7 @@ public class WifiManager {
    public void disableEphemeralNetwork(String SSID) {
        if (SSID == null) throw new IllegalArgumentException("SSID cannot be null");
        try {
            mService.disableEphemeralNetwork(SSID);
            mService.disableEphemeralNetwork(SSID, mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -3093,7 +3093,7 @@ public class WifiManager {
     */
    public Messenger getWifiServiceMessenger() {
        try {
            return mService.getWifiServiceMessenger();
            return mService.getWifiServiceMessenger(mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -3619,7 +3619,7 @@ public class WifiManager {
     */
    public void factoryReset() {
        try {
            mService.factoryReset();
            mService.factoryReset(mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }