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

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

Merge "getWifiActivityEnergyInfoAsync: throw NPE instead of IAE"

parents d40bc7af 47455642
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2625,8 +2625,8 @@ public class WifiManager {
    public void getWifiActivityEnergyInfoAsync(
            @NonNull @CallbackExecutor Executor executor,
            @NonNull OnWifiActivityEnergyInfoListener listener) {
        if (executor == null) throw new IllegalArgumentException("executor cannot be null");
        if (listener == null) throw new IllegalArgumentException("listener cannot be null");
        Objects.requireNonNull(executor, "executor cannot be null");
        Objects.requireNonNull(listener, "listener cannot be null");
        try {
            mService.getWifiActivityEnergyInfoAsync(
                    new OnWifiActivityEnergyInfoProxy(executor, listener));
+2 −2
Original line number Diff line number Diff line
@@ -1867,7 +1867,7 @@ public class WifiManagerTest {
     * Tests that passing a null Executor to {@link WifiManager#getWifiActivityEnergyInfoAsync}
     * throws an exception.
     */
    @Test(expected = IllegalArgumentException.class)
    @Test(expected = NullPointerException.class)
    public void testGetWifiActivityInfoNullExecutor() throws Exception {
        mWifiManager.getWifiActivityEnergyInfoAsync(null, mOnWifiActivityEnergyInfoListener);
    }
@@ -1876,7 +1876,7 @@ public class WifiManagerTest {
     * Tests that passing a null listener to {@link WifiManager#getWifiActivityEnergyInfoAsync}
     * throws an exception.
     */
    @Test(expected = IllegalArgumentException.class)
    @Test(expected = NullPointerException.class)
    public void testGetWifiActivityInfoNullListener() throws Exception {
        mWifiManager.getWifiActivityEnergyInfoAsync(mExecutor, null);
    }