From e450fe1a611e4dcf05046a6aa0df0bc8300cba61 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Tue, 14 Feb 2017 07:07:46 -0800 Subject: [HAL Device Manager] getSupportedIfaceTypes() mod to never return null Change the semantics of HalDeviceManager.getSupportedIfaceTypes so that it never returns null. It now always returns a Set - possibly an empty set. Cleaner than clients trying to figure out error conditions. Bug: 35101185 Test: unit tests (including new one for error) Change-Id: Icdff4192b3b7dc5901110e243a0a021a1593c01b --- .../src/com/android/server/wifi/HalDeviceManagerTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/HalDeviceManagerTest.java b/tests/wifitests/src/com/android/server/wifi/HalDeviceManagerTest.java index 0a1850cc1..4635f843b 100644 --- a/tests/wifitests/src/com/android/server/wifi/HalDeviceManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/HalDeviceManagerTest.java @@ -988,6 +988,18 @@ public class HalDeviceManagerTest { assertEquals(correctResults, results); } + /** + * Validate that when no chip info is found an empty list is returned. + */ + @Test + public void testGetSupportedIfaceTypesError() throws Exception { + // try API + Set results = mDut.getSupportedIfaceTypes(); + + // verify results + assertEquals(0, results.size()); + } + // utilities private void dumpDut(String prefix) { StringWriter sw = new StringWriter(); -- cgit v1.2.3