Files
frameworks_base/packages/SettingsLib/src/com/android/settingslib/SignalIcon.java
Evan Laird 1bb401dd88 Re-internalize MobileState and State from SettingsLib
ConnectivityState (nee State) lived in SettingsLib because of the fact
that MobileMappings needed the MobileIconGroup class, which lived inside
of SignalIcon.java. The whole thing is a bit messy, but this CL moves
the state objects back into the connectivity package where they belong.

Also move MobileState and WifiState into their own kotlin classes.

Bug: 197851948
Test: atest SystemUITests
Change-Id: I2997c66dbffb5e44b8f53b9020cdeb8b614cea3b
2021-11-08 18:11:36 +00:00

102 lines
3.1 KiB
Java

/*
* Copyright (C) 2020 The Android Open Source Project
*
* 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 com.android.settingslib;
/**
* Icons for SysUI and Settings.
*/
public class SignalIcon {
/**
* Holds icons for a given state. Arrays are generally indexed as inet
* state (full connectivity or not) first, and second dimension as
* signal strength.
*/
public static class IconGroup {
public final int[][] sbIcons;
public final int[][] qsIcons;
public final int[] contentDesc;
public final int sbNullState;
public final int qsNullState;
public final int sbDiscState;
public final int qsDiscState;
public final int discContentDesc;
// For logging.
public final String name;
public IconGroup(
String name,
int[][] sbIcons,
int[][] qsIcons,
int[] contentDesc,
int sbNullState,
int qsNullState,
int sbDiscState,
int qsDiscState,
int discContentDesc
) {
this.name = name;
this.sbIcons = sbIcons;
this.qsIcons = qsIcons;
this.contentDesc = contentDesc;
this.sbNullState = sbNullState;
this.qsNullState = qsNullState;
this.sbDiscState = sbDiscState;
this.qsDiscState = qsDiscState;
this.discContentDesc = discContentDesc;
}
@Override
public String toString() {
return "IconGroup(" + name + ")";
}
}
/**
* Holds icons for a given MobileState.
*/
public static class MobileIconGroup extends IconGroup {
public final int dataContentDescription; // mContentDescriptionDataType
public final int dataType;
public MobileIconGroup(
String name,
int[][] sbIcons,
int[][] qsIcons,
int[] contentDesc,
int sbNullState,
int qsNullState,
int sbDiscState,
int qsDiscState,
int discContentDesc,
int dataContentDesc,
int dataType
) {
super(name,
sbIcons,
qsIcons,
contentDesc,
sbNullState,
qsNullState,
sbDiscState,
qsDiscState,
discContentDesc);
this.dataContentDescription = dataContentDesc;
this.dataType = dataType;
}
}
}