1 /* 2 * Copyright (C) 2020 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 com.android.settingslib; 17 18 /** 19 * Icons for SysUI and Settings. 20 */ 21 public class SignalIcon { 22 23 /** 24 * Holds icons for a given state. Arrays are generally indexed as inet 25 * state (full connectivity or not) first, and second dimension as 26 * signal strength. 27 */ 28 public static class IconGroup { 29 public final int[][] sbIcons; 30 public final int[][] qsIcons; 31 public final int[] contentDesc; 32 public final int sbNullState; 33 public final int qsNullState; 34 public final int sbDiscState; 35 public final int qsDiscState; 36 public final int discContentDesc; 37 // For logging. 38 public final String name; 39 IconGroup( String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState, int qsDiscState, int discContentDesc )40 public IconGroup( 41 String name, 42 int[][] sbIcons, 43 int[][] qsIcons, 44 int[] contentDesc, 45 int sbNullState, 46 int qsNullState, 47 int sbDiscState, 48 int qsDiscState, 49 int discContentDesc 50 ) { 51 this.name = name; 52 this.sbIcons = sbIcons; 53 this.qsIcons = qsIcons; 54 this.contentDesc = contentDesc; 55 this.sbNullState = sbNullState; 56 this.qsNullState = qsNullState; 57 this.sbDiscState = sbDiscState; 58 this.qsDiscState = qsDiscState; 59 this.discContentDesc = discContentDesc; 60 } 61 62 @Override toString()63 public String toString() { 64 return "IconGroup(" + name + ")"; 65 } 66 } 67 68 /** 69 * Holds icons for a given MobileState. 70 */ 71 public static class MobileIconGroup extends IconGroup { 72 public final int dataContentDescription; // mContentDescriptionDataType 73 public final int dataType; 74 MobileIconGroup( String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState, int qsDiscState, int discContentDesc, int dataContentDesc, int dataType )75 public MobileIconGroup( 76 String name, 77 int[][] sbIcons, 78 int[][] qsIcons, 79 int[] contentDesc, 80 int sbNullState, 81 int qsNullState, 82 int sbDiscState, 83 int qsDiscState, 84 int discContentDesc, 85 int dataContentDesc, 86 int dataType 87 ) { 88 super(name, 89 sbIcons, 90 qsIcons, 91 contentDesc, 92 sbNullState, 93 qsNullState, 94 sbDiscState, 95 qsDiscState, 96 discContentDesc); 97 this.dataContentDescription = dataContentDesc; 98 this.dataType = dataType; 99 } 100 } 101 } 102