From 19f64d084d00eda92e68705d627674ca026f85b8 Mon Sep 17 00:00:00 2001 From: Sundeep Ghuman Date: Tue, 6 Jun 2017 13:02:15 -0700 Subject: [PATCH] Remove Wifi Badges from platform. This change makes it impossible to return a badged wifi icon, even if scoring ui is enabled. It also prevents IAE from net badgecurve enums. Bug: b/35628911 Test: make -j40 Change-Id: I014f27e5c4e42075e7e62da7fffb9ecf38f6eb4c --- core/java/android/net/NetworkBadging.java | 37 +---------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/core/java/android/net/NetworkBadging.java b/core/java/android/net/NetworkBadging.java index 6de28b7146e86..c119b637140fa 100644 --- a/core/java/android/net/NetworkBadging.java +++ b/core/java/android/net/NetworkBadging.java @@ -66,15 +66,7 @@ public class NetworkBadging { */ @NonNull public static Drawable getWifiIcon( @IntRange(from=0, to=4) int signalLevel, @Badging int badging, @Nullable Theme theme) { - Resources resources = Resources.getSystem(); - if (badging == BADGING_NONE) { - return resources.getDrawable(getWifiSignalResource(signalLevel), theme); - } - Drawable[] layers = new Drawable[] { - resources.getDrawable(getBadgedWifiSignalResource(signalLevel), theme), - resources.getDrawable(getWifiBadgeResource(badging), theme) - }; - return new LayerDrawable(layers); + return Resources.getSystem().getDrawable(getWifiSignalResource(signalLevel), theme); } /** @@ -134,31 +126,4 @@ public class NetworkBadging { throw new IllegalArgumentException("Invalid signal level: " + signalLevel); } } - - /** - * Returns the wifi quality badge resource id for the the given badging balue. - * - *

This badge should be displayed with the badge signal resource retrieved from - * {@link #getBadgedWifiSignalResource(int)}. - * - * @param badging {@see NetworkBadging#Badging} from {@link ScoredNetwork#calculateBadge(int)}. - * @return the @DrawableRes for the icon or {@link View#NO_ID} for - * {@link NetworkBadging#BADGING_NONE} - * @throws IllegalArgumentException for an invalid badging value. - * @hide - */ - @DrawableRes private static int getWifiBadgeResource(@Badging int badging) { - switch (badging) { - case BADGING_NONE: - return View.NO_ID; - case BADGING_SD: - return com.android.internal.R.drawable.ic_signal_wifi_badged_sd; - case BADGING_HD: - return com.android.internal.R.drawable.ic_signal_wifi_badged_hd; - case BADGING_4K: - return com.android.internal.R.drawable.ic_signal_wifi_badged_4k; - default: - throw new IllegalArgumentException("No resource found for badge: " + badging); - } - } }