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

Commit f10bf290 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Remove Wifi Badges from platform." into oc-dev am: 09d06437...

Merge "Merge "Remove Wifi Badges from platform." into oc-dev am: 09d06437 am: 216f596c" into oc-dr1-dev-plus-aosp
parents e21b705f 01717460
Loading
Loading
Loading
Loading
+1 −36
Original line number Diff line number Diff line
@@ -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.
     *
     * <p>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);
        }
    }
}