Remove isWide from MobileIconGroup am: 379fc8cd51

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15740839

Change-Id: I54bc81e342480bd9bd93902d85ccab61563c28d8
This commit is contained in:
Evan Laird
2021-09-24 23:32:21 +00:00
committed by Automerger Merge Worker
7 changed files with 77 additions and 65 deletions

View File

@@ -139,17 +139,15 @@ public class SignalIcon {
public static class MobileIconGroup extends IconGroup { public static class MobileIconGroup extends IconGroup {
public final int dataContentDescription; // mContentDescriptionDataType public final int dataContentDescription; // mContentDescriptionDataType
public final int dataType; public final int dataType;
public final boolean isWide;
public final int qsDataType; public final int qsDataType;
public MobileIconGroup(String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc, public MobileIconGroup(String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc,
int sbNullState, int qsNullState, int sbDiscState, int qsDiscState, int sbNullState, int qsNullState, int sbDiscState, int qsDiscState,
int discContentDesc, int dataContentDesc, int dataType, boolean isWide) { int discContentDesc, int dataContentDesc, int dataType) {
super(name, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, sbDiscState, super(name, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, sbDiscState,
qsDiscState, discContentDesc); qsDiscState, discContentDesc);
this.dataContentDescription = dataContentDesc; this.dataContentDescription = dataContentDesc;
this.dataType = dataType; this.dataType = dataType;
this.isWide = isWide;
this.qsDataType = dataType; // TODO: remove this field this.qsDataType = dataType; // TODO: remove this field
} }
} }

View File

@@ -50,178 +50,194 @@ public class TelephonyIcons {
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.carrier_network_change_mode, R.string.carrier_network_change_mode,
0, 0
false); );
public static final MobileIconGroup THREE_G = new MobileIconGroup( public static final MobileIconGroup THREE_G = new MobileIconGroup(
"3G", "3G",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_3g, R.string.data_connection_3g,
TelephonyIcons.ICON_3G, TelephonyIcons.ICON_3G
true); );
public static final MobileIconGroup WFC = new MobileIconGroup( public static final MobileIconGroup WFC = new MobileIconGroup(
"WFC", "WFC",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
0, 0, false); 0,
0);
public static final MobileIconGroup UNKNOWN = new MobileIconGroup( public static final MobileIconGroup UNKNOWN = new MobileIconGroup(
"Unknown", "Unknown",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
0, 0, false); 0,
0);
public static final MobileIconGroup E = new MobileIconGroup( public static final MobileIconGroup E = new MobileIconGroup(
"E", "E",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_edge, R.string.data_connection_edge,
TelephonyIcons.ICON_E, TelephonyIcons.ICON_E
false); );
public static final MobileIconGroup ONE_X = new MobileIconGroup( public static final MobileIconGroup ONE_X = new MobileIconGroup(
"1X", "1X",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_cdma, R.string.data_connection_cdma,
TelephonyIcons.ICON_1X, TelephonyIcons.ICON_1X
true); );
public static final MobileIconGroup G = new MobileIconGroup( public static final MobileIconGroup G = new MobileIconGroup(
"G", "G",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_gprs, R.string.data_connection_gprs,
TelephonyIcons.ICON_G, TelephonyIcons.ICON_G
false); );
public static final MobileIconGroup H = new MobileIconGroup( public static final MobileIconGroup H = new MobileIconGroup(
"H", "H",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_3_5g, R.string.data_connection_3_5g,
TelephonyIcons.ICON_H, TelephonyIcons.ICON_H
false); );
public static final MobileIconGroup H_PLUS = new MobileIconGroup( public static final MobileIconGroup H_PLUS = new MobileIconGroup(
"H+", "H+",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_3_5g_plus, R.string.data_connection_3_5g_plus,
TelephonyIcons.ICON_H_PLUS, TelephonyIcons.ICON_H_PLUS
false); );
public static final MobileIconGroup FOUR_G = new MobileIconGroup( public static final MobileIconGroup FOUR_G = new MobileIconGroup(
"4G", "4G",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_4g, R.string.data_connection_4g,
TelephonyIcons.ICON_4G, TelephonyIcons.ICON_4G
true); );
public static final MobileIconGroup FOUR_G_PLUS = new MobileIconGroup( public static final MobileIconGroup FOUR_G_PLUS = new MobileIconGroup(
"4G+", "4G+",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_4g_plus, R.string.data_connection_4g_plus,
TelephonyIcons.ICON_4G_PLUS, TelephonyIcons.ICON_4G_PLUS
true); );
public static final MobileIconGroup LTE = new MobileIconGroup( public static final MobileIconGroup LTE = new MobileIconGroup(
"LTE", "LTE",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_lte, R.string.data_connection_lte,
TelephonyIcons.ICON_LTE, TelephonyIcons.ICON_LTE
true); );
public static final MobileIconGroup LTE_PLUS = new MobileIconGroup( public static final MobileIconGroup LTE_PLUS = new MobileIconGroup(
"LTE+", "LTE+",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_lte_plus, R.string.data_connection_lte_plus,
TelephonyIcons.ICON_LTE_PLUS, TelephonyIcons.ICON_LTE_PLUS
true); );
public static final MobileIconGroup LTE_CA_5G_E = new MobileIconGroup( public static final MobileIconGroup LTE_CA_5G_E = new MobileIconGroup(
"5Ge", "5Ge",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_5ge_html, R.string.data_connection_5ge_html,
TelephonyIcons.ICON_5G_E, TelephonyIcons.ICON_5G_E
true); );
public static final MobileIconGroup NR_5G = new MobileIconGroup( public static final MobileIconGroup NR_5G = new MobileIconGroup(
"5G", "5G",
@@ -234,8 +250,8 @@ public class TelephonyIcons {
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_5g, R.string.data_connection_5g,
TelephonyIcons.ICON_5G, TelephonyIcons.ICON_5G
true); );
public static final MobileIconGroup NR_5G_PLUS = new MobileIconGroup( public static final MobileIconGroup NR_5G_PLUS = new MobileIconGroup(
"5G_PLUS", "5G_PLUS",
@@ -248,34 +264,36 @@ public class TelephonyIcons {
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_5g_plus, R.string.data_connection_5g_plus,
TelephonyIcons.ICON_5G_PLUS, TelephonyIcons.ICON_5G_PLUS
true); );
public static final MobileIconGroup DATA_DISABLED = new MobileIconGroup( public static final MobileIconGroup DATA_DISABLED = new MobileIconGroup(
"DataDisabled", "DataDisabled",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.cell_data_off_content_description, R.string.cell_data_off_content_description,
0, 0
false); );
public static final MobileIconGroup NOT_DEFAULT_DATA = new MobileIconGroup( public static final MobileIconGroup NOT_DEFAULT_DATA = new MobileIconGroup(
"NotDefaultData", "NotDefaultData",
null, null,
null, null,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
0, 0, 0,
0,
0, 0,
0, 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.not_default_data_content_description, R.string.not_default_data_content_description,
0, 0
false); );
public static final MobileIconGroup CARRIER_MERGED_WIFI = new MobileIconGroup( public static final MobileIconGroup CARRIER_MERGED_WIFI = new MobileIconGroup(
"CWF", "CWF",
@@ -288,8 +306,8 @@ public class TelephonyIcons {
/* qsDiscState= */ 0, /* qsDiscState= */ 0,
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
R.string.data_connection_carrier_wifi, R.string.data_connection_carrier_wifi,
TelephonyIcons.ICON_CWF, TelephonyIcons.ICON_CWF
/* isWide= */ true); );
// When adding a new MobileIconGround, check if the dataContentDescription has to be filtered // When adding a new MobileIconGround, check if the dataContentDescription has to be filtered
// in QSCarrier#hasValidTypeContentDescription // in QSCarrier#hasValidTypeContentDescription

View File

@@ -419,7 +419,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
MobileDataIndicators mobileDataIndicators = new MobileDataIndicators( MobileDataIndicators mobileDataIndicators = new MobileDataIndicators(
statusIcon, qsIcon, typeIcon, qsTypeIcon, statusIcon, qsIcon, typeIcon, qsTypeIcon,
activityIn, activityOut, dataContentDescription, dataContentDescriptionHtml, activityIn, activityOut, dataContentDescription, dataContentDescriptionHtml,
description, icons.isWide, mSubscriptionInfo.getSubscriptionId(), description, mSubscriptionInfo.getSubscriptionId(),
mCurrentState.roaming, showTriangle); mCurrentState.roaming, showTriangle);
callback.setMobileDataIndicators(mobileDataIndicators); callback.setMobileDataIndicators(mobileDataIndicators);
} else { } else {
@@ -464,7 +464,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
MobileDataIndicators mobileDataIndicators = new MobileDataIndicators( MobileDataIndicators mobileDataIndicators = new MobileDataIndicators(
statusIcon, qsIcon, typeIcon, qsTypeIcon, statusIcon, qsIcon, typeIcon, qsTypeIcon,
activityIn, activityOut, dataContentDescription, dataContentDescriptionHtml, activityIn, activityOut, dataContentDescription, dataContentDescriptionHtml,
description, icons.isWide, mSubscriptionInfo.getSubscriptionId(), description, mSubscriptionInfo.getSubscriptionId(),
mCurrentState.roaming, showTriangle); mCurrentState.roaming, showTriangle);
callback.setMobileDataIndicators(mobileDataIndicators); callback.setMobileDataIndicators(mobileDataIndicators);
} }

View File

@@ -101,7 +101,6 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
public CharSequence typeContentDescription; public CharSequence typeContentDescription;
public CharSequence typeContentDescriptionHtml; public CharSequence typeContentDescriptionHtml;
public CharSequence description; public CharSequence description;
public boolean isWide;
public int subId; public int subId;
public boolean roaming; public boolean roaming;
public boolean showTriangle; public boolean showTriangle;
@@ -109,7 +108,7 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
public MobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, public MobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
int qsType, boolean activityIn, boolean activityOut, int qsType, boolean activityIn, boolean activityOut,
CharSequence typeContentDescription, CharSequence typeContentDescriptionHtml, CharSequence typeContentDescription, CharSequence typeContentDescriptionHtml,
CharSequence description, boolean isWide, int subId, boolean roaming, CharSequence description, int subId, boolean roaming,
boolean showTriangle) { boolean showTriangle) {
this.statusIcon = statusIcon; this.statusIcon = statusIcon;
this.qsIcon = qsIcon; this.qsIcon = qsIcon;
@@ -120,7 +119,6 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
this.typeContentDescription = typeContentDescription; this.typeContentDescription = typeContentDescription;
this.typeContentDescriptionHtml = typeContentDescriptionHtml; this.typeContentDescriptionHtml = typeContentDescriptionHtml;
this.description = description; this.description = description;
this.isWide = isWide;
this.subId = subId; this.subId = subId;
this.roaming = roaming; this.roaming = roaming;
this.showTriangle = showTriangle; this.showTriangle = showTriangle;
@@ -138,7 +136,6 @@ public interface NetworkController extends CallbackController<SignalCallback>, D
.append(",typeContentDescription=").append(typeContentDescription) .append(",typeContentDescription=").append(typeContentDescription)
.append(",typeContentDescriptionHtml=").append(typeContentDescriptionHtml) .append(",typeContentDescriptionHtml=").append(typeContentDescriptionHtml)
.append(",description=").append(description) .append(",description=").append(description)
.append(",isWide=").append(isWide)
.append(",subId=").append(subId) .append(",subId=").append(subId)
.append(",roaming=").append(roaming) .append(",roaming=").append(roaming)
.append(",showTriangle=").append(showTriangle) .append(",showTriangle=").append(showTriangle)

View File

@@ -172,7 +172,7 @@ public class WifiSignalController extends
MobileDataIndicators mobileDataIndicators = new MobileDataIndicators( MobileDataIndicators mobileDataIndicators = new MobileDataIndicators(
statusIcon, qsIcon, typeIcon, qsTypeIcon, statusIcon, qsIcon, typeIcon, qsTypeIcon,
mCurrentState.activityIn, mCurrentState.activityOut, dataContentDescription, mCurrentState.activityIn, mCurrentState.activityOut, dataContentDescription,
dataContentDescriptionHtml, description, icons.isWide, dataContentDescriptionHtml, description,
mCurrentState.subId, /* roaming= */ false, /* showTriangle= */ true mCurrentState.subId, /* roaming= */ false, /* showTriangle= */ true
); );
callback.setMobileDataIndicators(mobileDataIndicators); callback.setMobileDataIndicators(mobileDataIndicators);

View File

@@ -232,7 +232,7 @@ public class QSCarrierGroupControllerTest extends LeakCheckedTest {
MobileDataIndicators indicators = new MobileDataIndicators( MobileDataIndicators indicators = new MobileDataIndicators(
mock(NetworkController.IconState.class), mock(NetworkController.IconState.class),
mock(NetworkController.IconState.class), mock(NetworkController.IconState.class),
0, 0, true, true, "", "", "", true, 0, true, true); 0, 0, true, true, "", "", "", 0, true, true);
mSignalCallback.setMobileDataIndicators(indicators); mSignalCallback.setMobileDataIndicators(indicators);
} }

View File

@@ -124,7 +124,7 @@ public class CallbackHandlerTest extends SysuiTestCase {
boolean roaming = true; boolean roaming = true;
MobileDataIndicators indicators = new MobileDataIndicators( MobileDataIndicators indicators = new MobileDataIndicators(
status, qs, type, qsType, in, out, typeDescription, status, qs, type, qsType, in, out, typeDescription,
typeDescriptionHtml, description, wide, subId, roaming, true); typeDescriptionHtml, description, subId, roaming, true);
mHandler.setMobileDataIndicators(indicators); mHandler.setMobileDataIndicators(indicators);
waitForCallbacks(); waitForCallbacks();
@@ -142,7 +142,6 @@ public class CallbackHandlerTest extends SysuiTestCase {
assertEquals(typeDescription, expected.typeContentDescription); assertEquals(typeDescription, expected.typeContentDescription);
assertEquals(typeDescriptionHtml, expected.typeContentDescriptionHtml); assertEquals(typeDescriptionHtml, expected.typeContentDescriptionHtml);
assertEquals(description, expected.description); assertEquals(description, expected.description);
assertEquals(wide, expected.isWide);
assertEquals(subId, expected.subId); assertEquals(subId, expected.subId);
assertTrue(expected.roaming); assertTrue(expected.roaming);
assertTrue(expected.showTriangle); assertTrue(expected.showTriangle);