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
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user