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

Commit cbc8aab5 authored by David Su's avatar David Su
Browse files

Expose ScanResult constructor for SettingsLibRoboTests

Expose ScanResult default constructor so that
SettingsLibRoboTests can construct a ScanResult
object in the desired state and parcel/unparcel it.

Bug: 138801922
Test: make RunSettingsLibRoboTests -j40
Change-Id: Ie57e0e20b1a9d9269d99cc020c3b259b39a35592
parent 6c00e387
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5806,6 +5806,7 @@ package android.net.wifi {
  }
  public class ScanResult implements android.os.Parcelable {
    ctor public ScanResult();
    field public static final int CIPHER_CCMP = 3; // 0x3
    field public static final int CIPHER_GCMP_256 = 4; // 0x4
    field public static final int CIPHER_NONE = 0; // 0x0
+14 −3
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;

import com.android.internal.annotations.VisibleForTesting;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -793,10 +795,19 @@ public class ScanResult implements Parcelable {
        }
    }

    /** empty scan result
    /**
     * Construct an empty scan result.
     *
     * {@hide}
     * */
     * Test code has a need to construct a ScanResult in a specific state.
     * (Note that mocking using Mockito does not work if the object needs to be parceled and
     * unparceled.)
     * Export a @SystemApi default constructor to allow tests to construct an empty ScanResult
     * object. The test can then directly set the fields it cares about.
     *
     * @hide
     */
    @SystemApi
    @VisibleForTesting
    public ScanResult() {
    }