diff options
| author | 2019-01-15 17:16:58 -0800 | |
|---|---|---|
| committer | 2019-01-15 20:54:47 -0800 | |
| commit | 0ca45736f51ef12345c7065d5dec4176404b264d (patch) | |
| tree | 090a85d349015ea8bcdb98867769950f9fdd5398 | |
| parent | 4be2e3f81d3693bb2bbbbae88d216058854eaaa1 (diff) | |
passpoint: mark as @deprecated and add permissions
The list of passpoint APIs are currently defined as public API.
So, any app can call this API without any permission.
Since PasspointConfiguration has all information for user credential,
we should add a permission so that only permitted app is able to call those APIs.
Bug: 122918799
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I9530fcc11b0c4087e6b7bfd232cfff565dc06195
Signed-off-by: Ecco Park <eccopark@google.com>
| -rw-r--r-- | api/current.txt | 4 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/WifiManager.java | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/api/current.txt b/api/current.txt index b3618601e1be..a5996313a03f 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29787,7 +29787,7 @@ package android.net.wifi { method public android.net.wifi.WifiInfo getConnectionInfo(); method public android.net.DhcpInfo getDhcpInfo(); method public int getMaxNumberOfNetworkSuggestionsPerApp(); - method public java.util.List<android.net.wifi.hotspot2.PasspointConfiguration> getPasspointConfigurations(); + method public deprecated java.util.List<android.net.wifi.hotspot2.PasspointConfiguration> getPasspointConfigurations(); method public java.util.List<android.net.wifi.ScanResult> getScanResults(); method public int getWifiState(); method public boolean is5GHzBandSupported(); @@ -29807,7 +29807,7 @@ package android.net.wifi { method public deprecated boolean reconnect(); method public deprecated boolean removeNetwork(int); method public int removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>); - method public void removePasspointConfiguration(java.lang.String); + method public deprecated void removePasspointConfiguration(java.lang.String); method public deprecated boolean saveConfiguration(); method public void setTdlsEnabled(java.net.InetAddress, boolean); method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean); diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 559f4ad8264e..1c5f998dcecb 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -1727,7 +1727,13 @@ public class WifiManager { * @param fqdn The FQDN of the Passpoint configuration to be removed * @throws IllegalArgumentException if no configuration is associated with the given FQDN. * @throws UnsupportedOperationException if Passpoint is not enabled on the device. + * @deprecated This is no longer supported. */ + @Deprecated + @RequiresPermission(anyOf = { + android.Manifest.permission.NETWORK_SETTINGS, + android.Manifest.permission.NETWORK_SETUP_WIZARD + }) public void removePasspointConfiguration(String fqdn) { try { if (!mService.removePasspointConfiguration(fqdn, mContext.getOpPackageName())) { @@ -1745,7 +1751,13 @@ public class WifiManager { * * @return A list of {@link PasspointConfiguration} * @throws UnsupportedOperationException if Passpoint is not enabled on the device. + * @deprecated This is no longer supported. */ + @Deprecated + @RequiresPermission(anyOf = { + android.Manifest.permission.NETWORK_SETTINGS, + android.Manifest.permission.NETWORK_SETUP_WIZARD + }) public List<PasspointConfiguration> getPasspointConfigurations() { try { return mService.getPasspointConfigurations(); |