From 370660915d9c12fab4c712f1be755ce03f724c3e Mon Sep 17 00:00:00 2001 From: Sundeep Ghuman Date: Mon, 31 Jul 2017 18:46:45 -0700 Subject: [PATCH] Fix broken robotests. In ag/2580164 AccessPoint.java made a reference to WifiTracker, which in term references WifiNetworkScoreCache. Since the Robolectric in the platform still has not been updated to support API 26 (Android O), this caused the test to break. By definining the class in the test package, the test can be fixed until proper Android O support is added to the robolectric prebuilts in the platform code. Bug: 64217019 Test: make -j40 RunSettingsLibRoboTests Change-Id: I6cfd5c17d1aba98d43cca4828058493960a7ff79 --- .../net/wifi/WifiNetworkScoreCache.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 packages/SettingsLib/tests/robotests/src/android/net/wifi/WifiNetworkScoreCache.java diff --git a/packages/SettingsLib/tests/robotests/src/android/net/wifi/WifiNetworkScoreCache.java b/packages/SettingsLib/tests/robotests/src/android/net/wifi/WifiNetworkScoreCache.java new file mode 100644 index 0000000000000..abccd8d7ed9e2 --- /dev/null +++ b/packages/SettingsLib/tests/robotests/src/android/net/wifi/WifiNetworkScoreCache.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2017 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.net.wifi; + +import android.content.Context; +import android.os.Handler; + +import java.util.List; + +/** + * Will be removed once robolectric is updated to O + */ +public class WifiNetworkScoreCache { + + public WifiNetworkScoreCache(Context context, WifiNetworkScoreCache.CacheListener listener) { + } + + public abstract static class CacheListener { + public CacheListener(Handler handler) { + } + + void post(List updatedNetworks) { + } + + public abstract void networkCacheUpdated(List updatedNetworks); + } +}