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

Commit 80139bfc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move TestAccessPointBuilder." into oc-dr1-dev

parents f56b5778 ce6b0b25
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -26,9 +26,9 @@ import android.os.Bundle;
/**
* Build and return a valid AccessPoint.
*
* Only intended for testing the AccessPoint class;
* AccessPoints were designed to only be populated
* by the mechanisms of scan results and wifi configurations.
* Only intended for testing the AccessPoint class or creating Access points to be used in testing
* applications. AccessPoints were designed to only be populated by the mechanisms of scan results
* and wifi configurations.
*/
public class TestAccessPointBuilder {
    // match the private values in WifiManager
@@ -42,6 +42,7 @@ public class TestAccessPointBuilder {
    private NetworkInfo mNetworkInfo = null;
    private String mFqdn = null;
    private String mProviderFriendlyName = null;
    private int mSecurity = AccessPoint.SECURITY_NONE;
    private WifiConfiguration mWifiConfig;
    private WifiInfo mWifiInfo;

@@ -67,6 +68,8 @@ public class TestAccessPointBuilder {
        if (mProviderFriendlyName != null) {
            bundle.putString(AccessPoint.KEY_PROVIDER_FRIENDLY_NAME, mProviderFriendlyName);
        }
        bundle.putInt(AccessPoint.KEY_SECURITY, mSecurity);

        AccessPoint ap = new AccessPoint(mContext, bundle);
        ap.setRssi(mRssi);
        return ap;
@@ -141,6 +144,11 @@ public class TestAccessPointBuilder {
        return this;
    }

    public TestAccessPointBuilder setSecurity(int security) {
        mSecurity = security;
        return this;
    }

    public TestAccessPointBuilder setSsid(String newSsid) {
        ssid = newSsid;
        return this;