1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package android.net; 17 18 import android.annotation.IntDef; 19 import android.annotation.Nullable; 20 import android.content.res.Resources; 21 import android.graphics.Color; 22 import android.graphics.drawable.ColorDrawable; 23 import android.graphics.drawable.Drawable; 24 25 import java.lang.annotation.Retention; 26 import java.lang.annotation.RetentionPolicy; 27 28 /** 29 * Implementation for {@link android.net.NetworkBadging}. 30 * 31 * <p>Can be removed once Robolectric supports Android O. 32 */ 33 public class NetworkBadging { 34 @IntDef({BADGING_NONE, BADGING_SD, BADGING_HD, BADGING_4K}) 35 @Retention(RetentionPolicy.SOURCE) 36 public @interface Badging {} 37 38 public static final int BADGING_NONE = 0; 39 public static final int BADGING_SD = 10; 40 public static final int BADGING_HD = 20; 41 public static final int BADGING_4K = 30; 42 43 private static Drawable drawable; 44 45 public static Drawable getWifiIcon( 46 int signalLevel, @NetworkBadging.Badging int badging, @Nullable Resources.Theme theme) { 47 return new ColorDrawable(Color.GREEN); 48 } 49 } 50