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

Commit 0a5d73b3 authored by Les Lee's avatar Les Lee
Browse files

mock wifi (nl80211-framework#2): new constructor for mocking WifiNl80211Manager

To mock WifiNl80211Manager, it requires to have a new constructor to
inject the mocked IWificond binder for mocking WifiNl80211Manager
instance.

Bug: 251763354
Test: Manual test
Change-Id: I427696a26d611a9405fba1f478acef0ac6755b27
parent 533e83f2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9313,6 +9313,7 @@ package android.net.wifi.nl80211 {
  }
  public class WifiNl80211Manager {
    ctor public WifiNl80211Manager(@NonNull android.content.Context, @NonNull android.os.IBinder);
    method public void abortScan(@NonNull String);
    method public void enableVerboseLogging(boolean);
    method @NonNull public int[] getChannelsMhzForBand(int);
+15 −0
Original line number Diff line number Diff line
@@ -393,6 +393,21 @@ public class WifiNl80211Manager {
        mEventHandler = new Handler(context.getMainLooper());
    }

    /**
     * Construct WifiNl80211Manager with giving context and binder which is an interface of
     * IWificond.
     *
     * @param context Android context.
     * @param binder a binder of IWificond.
     */
    public WifiNl80211Manager(@NonNull Context context, @NonNull IBinder binder) {
        this(context);
        mWificond = IWificond.Stub.asInterface(binder);
        if (mWificond == null) {
            Log.e(TAG, "Failed to get reference to wificond");
        }
    }

    /** @hide */
    @VisibleForTesting
    public WifiNl80211Manager(Context context, IWificond wificond) {