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

Commit 3c38ee43 authored by Roshan Pius's avatar Roshan Pius
Browse files

WifiManager: Network request match callback registration

Add and Implement the new network request match callback register/unregister
@hide methods to be used by settings UI.

Note: This uses the same pattern used for other callbacks to settings
like traffic state change, softap.

Bug: 113878056
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: Ia4964759c6b10790dda0fc61a41c4d95dab904c9
parent 99cfe09f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -592,6 +592,8 @@ java_defaults {
        "telephony/java/com/android/internal/telephony/euicc/ISetDefaultSmdpAddressCallback.aidl",
        "telephony/java/com/android/internal/telephony/euicc/ISetNicknameCallback.aidl",
        "telephony/java/com/android/internal/telephony/euicc/ISwitchToProfileCallback.aidl",
        "wifi/java/android/net/wifi/INetworkRequestMatchCallback.aidl",
        "wifi/java/android/net/wifi/INetworkRequestUserSelectionCallback.aidl",
        "wifi/java/android/net/wifi/ISoftApCallback.aidl",
        "wifi/java/android/net/wifi/ITrafficStateCallback.aidl",
        "wifi/java/android/net/wifi/IWifiManager.aidl",
+14 −0
Original line number Diff line number Diff line
@@ -3594,8 +3594,10 @@ package android.net.wifi {
    method public boolean isPortableHotspotSupported();
    method public boolean isWifiApEnabled();
    method public boolean isWifiScannerSupported();
    method public void registerNetworkRequestMatchCallback(android.net.wifi.WifiManager.NetworkRequestMatchCallback, android.os.Handler);
    method public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
    method public boolean startScan(android.os.WorkSource);
    method public void unregisterNetworkRequestMatchCallback(android.net.wifi.WifiManager.NetworkRequestMatchCallback);
    field public static final int CHANGE_REASON_ADDED = 0; // 0x0
    field public static final int CHANGE_REASON_CONFIG_CHANGE = 2; // 0x2
    field public static final int CHANGE_REASON_REMOVED = 1; // 0x1
@@ -3623,6 +3625,18 @@ package android.net.wifi {
    method public abstract void onSuccess();
  }

  public static abstract interface WifiManager.NetworkRequestMatchCallback {
    method public abstract void onMatch(java.util.List<android.net.wifi.WifiConfiguration>);
    method public abstract void onUserSelectionCallbackRegistration(android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback);
    method public abstract void onUserSelectionConnectFailure(android.net.wifi.WifiConfiguration);
    method public abstract void onUserSelectionConnectSuccess(android.net.wifi.WifiConfiguration);
  }

  public static abstract interface WifiManager.NetworkRequestUserSelectionCallback {
    method public abstract void reject();
    method public abstract void select(android.net.wifi.WifiConfiguration);
  }

  public class WifiNetworkConnectionStatistics implements android.os.Parcelable {
    ctor public WifiNetworkConnectionStatistics(int, int);
    ctor public WifiNetworkConnectionStatistics();
+36 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.wifi;

import android.net.wifi.INetworkRequestUserSelectionCallback;
import android.net.wifi.WifiConfiguration;

/**
 * Interface for network request match callback.
 *
 * @hide
 */
oneway interface INetworkRequestMatchCallback
{
   void onUserSelectionCallbackRegistration(in INetworkRequestUserSelectionCallback userSelectionCallback);

   void onMatch(in List<WifiConfiguration> wificonfigurations);

   void onUserSelectionConnectSuccess(in WifiConfiguration wificonfiguration);

   void onUserSelectionConnectFailure(in WifiConfiguration wificonfiguration);
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.wifi;

import android.net.wifi.WifiConfiguration;

/**
 * Interface for providing user selection in response to
 * network request match callback.
 * @hide
 */
oneway interface INetworkRequestUserSelectionCallback
{
   void select(in WifiConfiguration wificonfiguration);

   void reject();
}
+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.net.wifi.hotspot2.IProvisioningCallback;

import android.net.DhcpInfo;
import android.net.Network;
import android.net.wifi.INetworkRequestMatchCallback;
import android.net.wifi.ISoftApCallback;
import android.net.wifi.ITrafficStateCallback;
import android.net.wifi.PasspointManagementObjectDefinition;
@@ -185,5 +186,9 @@ interface IWifiManager
    void registerTrafficStateCallback(in IBinder binder, in ITrafficStateCallback callback, int callbackIdentifier);

    void unregisterTrafficStateCallback(int callbackIdentifier);

    void registerNetworkRequestMatchCallback(in IBinder binder, in INetworkRequestMatchCallback callback, int callbackIdentifier);

    void unregisterNetworkRequestMatchCallback(int callbackIdentifier);
}
Loading