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

Commit 3ddc413b authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'LOHSapi' into oc-dev

* changes:
  WifiManager: expose base LOHS apis
  WifiManager: update API for LOHS
parents 8183328a 1668d973
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -26525,6 +26525,7 @@ package android.net.wifi {
    method public void setTdlsEnabled(java.net.InetAddress, boolean);
    method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean);
    method public boolean setWifiEnabled(boolean);
    method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
    method public boolean startScan();
    method public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
    method public int updateNetwork(android.net.wifi.WifiConfiguration);
@@ -26575,6 +26576,22 @@ package android.net.wifi {
    field public static final int WPS_WEP_PROHIBITED = 4; // 0x4
  }
  public static class WifiManager.LocalOnlyHotspotCallback {
    ctor public WifiManager.LocalOnlyHotspotCallback();
    method public void onFailed(int);
    method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
    method public void onStopped();
    field public static final int ERROR_GENERIC = 2; // 0x2
    field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
    field public static final int ERROR_NO_CHANNEL = 1; // 0x1
    field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
  }
  public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
    method public void close();
    method public android.net.wifi.WifiConfiguration getWifiConfiguration();
  }
  public class WifiManager.MulticastLock {
    method public void acquire();
    method public boolean isHeld();
+17 −0
Original line number Diff line number Diff line
@@ -29063,6 +29063,7 @@ package android.net.wifi {
    method public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
    method public boolean setWifiApEnabled(android.net.wifi.WifiConfiguration, boolean);
    method public boolean setWifiEnabled(boolean);
    method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
    method public deprecated boolean startLocationRestrictedScan(android.os.WorkSource);
    method public boolean startScan();
    method public boolean startScan(android.os.WorkSource);
@@ -29140,6 +29141,22 @@ package android.net.wifi {
    method public abstract void onSuccess();
  }
  public static class WifiManager.LocalOnlyHotspotCallback {
    ctor public WifiManager.LocalOnlyHotspotCallback();
    method public void onFailed(int);
    method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
    method public void onStopped();
    field public static final int ERROR_GENERIC = 2; // 0x2
    field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
    field public static final int ERROR_NO_CHANNEL = 1; // 0x1
    field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
  }
  public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
    method public void close();
    method public android.net.wifi.WifiConfiguration getWifiConfiguration();
  }
  public class WifiManager.MulticastLock {
    method public void acquire();
    method public boolean isHeld();
+17 −0
Original line number Diff line number Diff line
@@ -26633,6 +26633,7 @@ package android.net.wifi {
    method public void setTdlsEnabled(java.net.InetAddress, boolean);
    method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean);
    method public boolean setWifiEnabled(boolean);
    method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
    method public boolean startScan();
    method public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
    method public int updateNetwork(android.net.wifi.WifiConfiguration);
@@ -26683,6 +26684,22 @@ package android.net.wifi {
    field public static final int WPS_WEP_PROHIBITED = 4; // 0x4
  }
  public static class WifiManager.LocalOnlyHotspotCallback {
    ctor public WifiManager.LocalOnlyHotspotCallback();
    method public void onFailed(int);
    method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
    method public void onStopped();
    field public static final int ERROR_GENERIC = 2; // 0x2
    field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
    field public static final int ERROR_NO_CHANNEL = 1; // 0x1
    field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
  }
  public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
    method public void close();
    method public android.net.wifi.WifiConfiguration getWifiConfiguration();
  }
  public class WifiManager.MulticastLock {
    method public void acquire();
    method public boolean isHeld();
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ interface IWifiManager

    boolean stopSoftAp();

    WifiConfiguration startLocalOnlyHotspot(in Messenger messenger, in IBinder binder);
    int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder);

    void stopLocalOnlyHotspot();

+13 −16
Original line number Diff line number Diff line
@@ -478,7 +478,6 @@ public class WifiManager {
     */
    public static final int IFACE_IP_MODE_LOCAL_ONLY = 2;


    /**
     * Broadcast intent action indicating that a connection to the supplicant has
     * been established (and it is now possible
@@ -1850,8 +1849,9 @@ public class WifiManager {
     * Tethering to provide an upstream to another device, LocalOnlyHotspot will not start due to
     * an incompatible mode. The possible error codes include:
     * {@link LocalOnlyHotspotCallback#ERROR_NO_CHANNEL},
     * {@link LocalOnlyHotspotCallback#ERROR_GENERIC} and
     * {@link LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE}.
     * {@link LocalOnlyHotspotCallback#ERROR_GENERIC},
     * {@link LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE} and
     * {@link LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED}.
     * <p>
     * Internally, requests will be tracked to prevent the hotspot from being torn down while apps
     * are still using it.  The {@link LocalOnlyHotspotReservation} object passed in the  {@link
@@ -1882,8 +1882,6 @@ public class WifiManager {
     * operating status.
     * @param handler Handler to be used for callbacks.  If the caller passes a null Handler, the
     * main thread will be used.
     *
     * @hide
     */
    public void startLocalOnlyHotspot(LocalOnlyHotspotCallback callback,
            @Nullable Handler handler) {
@@ -1892,12 +1890,10 @@ public class WifiManager {
            LocalOnlyHotspotCallbackProxy proxy =
                    new LocalOnlyHotspotCallbackProxy(this, looper, callback);
            try {
                WifiConfiguration config = mService.startLocalOnlyHotspot(
                        proxy.getMessenger(), new Binder());
                if (config == null) {
                int returnCode = mService.startLocalOnlyHotspot(proxy.getMessenger(), new Binder());
                if (returnCode != LocalOnlyHotspotCallback.REQUEST_REGISTERED) {
                    // Send message to the proxy to make sure we call back on the correct thread
                    proxy.notifyFailed(
                            LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE);
                    proxy.notifyFailed(returnCode);
                    return;
                }
                mLOHSCallbackProxy = proxy;
@@ -2274,8 +2270,6 @@ public class WifiManager {
     * any further callbacks. If the LocalOnlyHotspot is stopped due to a
     * user triggered mode change, applications will be notified via the {@link
     * LocalOnlyHotspotCallback#onStopped()} callback.
     *
     * @hide
     */
    public class LocalOnlyHotspotReservation implements AutoCloseable {

@@ -2289,7 +2283,7 @@ public class WifiManager {
            mCloseGuard.open("close");
        }

        public WifiConfiguration getConfig() {
        public WifiConfiguration getWifiConfiguration() {
            return mConfig;
        }

@@ -2318,13 +2312,15 @@ public class WifiManager {

    /**
     * Callback class for applications to receive updates about the LocalOnlyHotspot status.
     *
     * @hide
     */
    public static class LocalOnlyHotspotCallback {
        /** @hide */
        public static final int REQUEST_REGISTERED = 0;

        public static final int ERROR_NO_CHANNEL = 1;
        public static final int ERROR_GENERIC = 2;
        public static final int ERROR_INCOMPATIBLE_MODE = 3;
        public static final int ERROR_TETHERING_DISALLOWED = 4;

        /** LocalOnlyHotspot start succeeded. */
        public void onStarted(LocalOnlyHotspotReservation reservation) {};
@@ -2345,7 +2341,8 @@ public class WifiManager {
         * {@link WifiManager#startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler)} again at
         * a later time.
         * <p>
         * @param reason The reason for failure could be one of: {@link #ERROR_INCOMPATIBLE_MODE},
         * @param reason The reason for failure could be one of: {@link
         * #ERROR_TETHERING_DISALLOWED}, {@link #ERROR_INCOMPATIBLE_MODE},
         * {@link #ERROR_NO_CHANNEL}, or {@link #ERROR_GENERIC}.
         */
        public void onFailed(int reason) { };
Loading