From 0ca45736f51ef12345c7065d5dec4176404b264d Mon Sep 17 00:00:00 2001 From: Ecco Park Date: Tue, 15 Jan 2019 17:16:58 -0800 Subject: 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 --- api/current.txt | 4 ++-- 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 getPasspointConfigurations(); + method public deprecated java.util.List getPasspointConfigurations(); method public java.util.List 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); - 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 getPasspointConfigurations() { try { return mService.getPasspointConfigurations(); -- cgit v1.2.3-59-g8ed1b