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

Commit 0c525378 authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge "[WIFI] Trigger WiFi recovery mode"

parents cf453637 ac1a7a3e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -495,6 +495,7 @@ package android.net.wifi {
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerSoftApCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.SoftApCallback);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerTrafficStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.TrafficStateCallback);
    method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void removeOnWifiUsabilityStatsListener(@NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_AIRPLANE_MODE) public void restartWifiSubsystem(@Nullable String);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreBackupData(@NonNull byte[]);
    method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public android.net.wifi.SoftApConfiguration restoreSoftApBackupData(@NonNull byte[]);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreSupplicantBackupData(@NonNull byte[], @NonNull byte[]);
+2 −0
Original line number Diff line number Diff line
@@ -300,4 +300,6 @@ interface IWifiManager
    void setCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged, boolean enabled);

    boolean isCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged);

    void restartWifiSubsystem(String reason);
}
+31 −0
Original line number Diff line number Diff line
@@ -3040,6 +3040,37 @@ public class WifiManager {
        }
    }

    /**
     * Restart the Wi-Fi subsystem.
     *
     * Restarts the Wi-Fi subsystem - effectively disabling it and re-enabling it. All existing
     * Access Point (AP) associations are torn down, all Soft APs are disabled, Wi-Fi Direct and
     * Wi-Fi Aware are disabled.
     *
     * The state of the system after restart is not guaranteed to match its state before the API is
     * called - for instance the device may associate to a different Access Point (AP), and tethered
     * hotspots may or may not be restored.
     *
     * @param reason If non-null, requests a bug report and attaches the reason string to it. A bug
     *               report may still not be generated based on framework criteria - for instance,
     *               build type or throttling. The WiFi subsystem is restarted whether or not a bug
     *               report is requested or generated.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.NETWORK_AIRPLANE_MODE)
    public void restartWifiSubsystem(@Nullable String reason) {
        if (!SdkLevel.isAtLeastS()) {
            throw new UnsupportedOperationException();
        }
        try {
            mService.restartWifiSubsystem(reason);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Gets the Wi-Fi enabled state.
     * @return One of {@link #WIFI_STATE_DISABLED},