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

Commit 0ca45736 authored by Ecco Park's avatar Ecco Park
Browse files

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: default avatarEcco Park <eccopark@google.com>
parent 4be2e3f8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+12 −0
Original line number Diff line number Diff line
@@ -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();