diff --git a/packages/SystemUI/res/drawable/ic_swap_vert.xml b/packages/SystemUI/res/drawable/ic_swap_vert.xml new file mode 100644 index 0000000000000..eed79ffa4f2f7 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_swap_vert.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/mobile_signal_group.xml b/packages/SystemUI/res/layout/mobile_signal_group.xml index b8ed09ee1102a..3485b362480fa 100644 --- a/packages/SystemUI/res/layout/mobile_signal_group.xml +++ b/packages/SystemUI/res/layout/mobile_signal_group.xml @@ -16,7 +16,7 @@ ** limitations under the License. */ --> - - + diff --git a/packages/SystemUI/res/layout/qs_footer_impl.xml b/packages/SystemUI/res/layout/qs_footer_impl.xml index 9bf787012dd38..7500bc6a5d441 100644 --- a/packages/SystemUI/res/layout/qs_footer_impl.xml +++ b/packages/SystemUI/res/layout/qs_footer_impl.xml @@ -43,6 +43,14 @@ android:layout_gravity="center_vertical" android:gravity="end" > + + { final Resources r = mContext.getResources(); state.activityIn = cb.enabled && cb.activityIn; state.activityOut = cb.enabled && cb.activityOut; - state.isOverlayIconWide = cb.isDataTypeIconWide; - state.overlayIconId = cb.dataTypeIconId; - state.label = r.getString(R.string.mobile_data); - - final String signalContentDesc = cb.enabled && (cb.mobileSignalIconId > 0) - ? cb.signalContentDescription - : r.getString(R.string.accessibility_no_signal); boolean mobileDataEnabled = mDataController.isMobileDataSupported() && mDataController.isMobileDataEnabled(); state.value = mobileDataEnabled; - if (cb.noSim) { - state.contentDescription = state.label; - } else { - state.contentDescription = signalContentDesc + ", " + state.label; - } - state.expandedAccessibilityClassName = Switch.class.getName(); - state.value = mDataController.isMobileDataSupported() - && mDataController.isMobileDataEnabled(); - if (cb.noSim) { state.icon = ResourceIcon.get(R.drawable.ic_qs_no_sim); } else { - state.icon = new SignalIcon(cb.mobileSignalIconId); + state.icon = ResourceIcon.get(R.drawable.ic_swap_vert); } if (cb.noSim) { @@ -199,6 +180,7 @@ public class CellularTile extends QSTileImpl { state.state = Tile.STATE_INACTIVE; state.secondaryLabel = r.getString(R.string.cell_data_off); } + state.contentDescription = state.label + ", " + state.secondaryLabel; } private CharSequence getMobileDataDescription(CallbackInfo cb) { @@ -223,40 +205,18 @@ public class CellularTile extends QSTileImpl { return mController.hasMobileDataFeature(); } - // Remove the period from the network name - public static String removeTrailingPeriod(String string) { - if (string == null) return null; - final int length = string.length(); - if (string.endsWith(".")) { - return string.substring(0, length - 1); - } - return string; - } - private static final class CallbackInfo { boolean enabled; - boolean wifiEnabled; boolean airplaneModeEnabled; - int mobileSignalIconId; - String signalContentDescription; - int dataTypeIconId; String dataContentDescription; boolean activityIn; boolean activityOut; - String enabledDesc; boolean noSim; - boolean isDataTypeIconWide; boolean roaming; } private final class CellSignalCallback implements SignalCallback { private final CallbackInfo mInfo = new CallbackInfo(); - @Override - public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon, - boolean activityIn, boolean activityOut, String description, boolean isTransient) { - mInfo.wifiEnabled = enabled; - refreshState(mInfo); - } @Override public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, @@ -267,14 +227,9 @@ public class CellularTile extends QSTileImpl { return; } mInfo.enabled = qsIcon.visible; - mInfo.mobileSignalIconId = qsIcon.icon; - mInfo.signalContentDescription = qsIcon.contentDescription; - mInfo.dataTypeIconId = qsType; mInfo.dataContentDescription = typeContentDescription; mInfo.activityIn = activityIn; mInfo.activityOut = activityOut; - mInfo.enabledDesc = description; - mInfo.isDataTypeIconWide = qsType != 0 && isWide; mInfo.roaming = roaming; refreshState(mInfo); } @@ -282,16 +237,6 @@ public class CellularTile extends QSTileImpl { @Override public void setNoSims(boolean show, boolean simDetected) { mInfo.noSim = show; - if (mInfo.noSim) { - // Make sure signal gets cleared out when no sims. - mInfo.mobileSignalIconId = 0; - mInfo.dataTypeIconId = 0; - // Show a No SIMs description to avoid emergency calls message. - mInfo.enabled = true; - mInfo.enabledDesc = mContext.getString( - R.string.keyguard_missing_sim_message_short); - mInfo.signalContentDescription = mInfo.enabledDesc; - } refreshState(mInfo); }