Remove upper left X icon on mobile signal.
Use the signal drawable cutout to represent both data disabled and no
internet state. ag/3690757 displays the description of these icons ("No
internet" or "Mobile data off") in the secondary text of the mobile data
tile.
Bug: 72540392
Test: visual && runtest systemui
Change-Id: I806c41bc96420c42461c0a75b93a485f9a2186f7
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2016 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.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="24.0dp"
|
||||
android:viewportWidth="20.0"
|
||||
android:viewportHeight="40.0"
|
||||
android:tint="?android:attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M19.0,6.41L17.59,5.0 12.0,10.59 6.41,5.0 5.0,6.41 10.59,12.0 5.0,17.59 6.41,19.0 12.0,13.41 17.59,19.0 19.0,17.59 13.41,12.0z"/>
|
||||
</vector>
|
||||
@@ -1,25 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2016 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.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:autoMirrored="true"
|
||||
android:width="17.0dp"
|
||||
android:height="17.0dp"
|
||||
android:viewportWidth="40.0"
|
||||
android:viewportHeight="40.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M19.0,6.41L17.59,5.0 12.0,10.59 6.41,5.0 5.0,6.41 10.59,12.0 5.0,17.59 6.41,19.0 12.0,13.41 17.59,19.0 19.0,17.59 13.41,12.0z"/>
|
||||
</vector>
|
||||
@@ -251,8 +251,11 @@ public class MobileSignalController extends SignalController<
|
||||
if (mConfig.inflateSignalStrengths) {
|
||||
level++;
|
||||
}
|
||||
return SignalDrawable.getState(level, getNumLevels(),
|
||||
mCurrentState.inetCondition == 0);
|
||||
boolean dataDisabled = mCurrentState.userSetup
|
||||
&& mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED;
|
||||
boolean noInternet = mCurrentState.inetCondition == 0;
|
||||
boolean cutOut = dataDisabled || noInternet;
|
||||
return SignalDrawable.getState(level, getNumLevels(), cutOut);
|
||||
} else if (mCurrentState.enabled) {
|
||||
return SignalDrawable.getEmptyState(getNumLevels());
|
||||
} else {
|
||||
|
||||
@@ -44,10 +44,6 @@ class TelephonyIcons {
|
||||
static final int ICON_4G_PLUS = R.drawable.stat_sys_data_fully_connected_4g_plus;
|
||||
static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x;
|
||||
|
||||
static final int ICON_DATA_DISABLED = R.drawable.stat_sys_data_disabled;
|
||||
|
||||
static final int QS_ICON_DATA_DISABLED = R.drawable.ic_qs_data_disabled;
|
||||
|
||||
static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup(
|
||||
"CARRIER_NETWORK_CHANGE",
|
||||
null,
|
||||
@@ -232,9 +228,9 @@ class TelephonyIcons {
|
||||
0,
|
||||
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
|
||||
R.string.accessibility_cell_data_off,
|
||||
TelephonyIcons.ICON_DATA_DISABLED,
|
||||
0,
|
||||
false,
|
||||
TelephonyIcons.QS_ICON_DATA_DISABLED
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -353,6 +353,13 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
|
||||
|
||||
protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon,
|
||||
boolean qsVisible, int qsIcon, int qsTypeIcon, boolean dataIn, boolean dataOut) {
|
||||
verifyLastMobileDataIndicators(
|
||||
visible, icon, typeIcon, qsVisible, qsIcon, qsTypeIcon, dataIn, dataOut, false);
|
||||
}
|
||||
|
||||
protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon,
|
||||
boolean qsVisible, int qsIcon, int qsTypeIcon, boolean dataIn, boolean dataOut,
|
||||
boolean cutOut) {
|
||||
ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
|
||||
ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
|
||||
ArgumentCaptor<IconState> qsIconArg = ArgumentCaptor.forClass(IconState.class);
|
||||
@@ -372,7 +379,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
|
||||
IconState iconState = iconArg.getValue();
|
||||
|
||||
int state = SignalDrawable.getState(icon, SignalStrength.NUM_SIGNAL_STRENGTH_BINS,
|
||||
false);
|
||||
cutOut);
|
||||
assertEquals("Data icon in status bar", typeIcon, (int) typeIconArg.getValue());
|
||||
assertEquals("Signal icon in status bar", state, iconState.icon);
|
||||
assertEquals("Visibility in status bar", visible, iconState.visible);
|
||||
|
||||
@@ -110,6 +110,20 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
|
||||
TelephonyIcons.QS_DATA_4G);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoInternetIcon() {
|
||||
setupNetworkController();
|
||||
when(mMockTm.getDataEnabled(mSubId)).thenReturn(false);
|
||||
setupDefaultSignal();
|
||||
updateDataConnectionState(TelephonyManager.DATA_CONNECTED, 0);
|
||||
setConnectivity(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
|
||||
|
||||
// Verify that a SignalDrawable with a cut out is used to display data disabled.
|
||||
verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, 0,
|
||||
true, DEFAULT_QS_SIGNAL_STRENGTH, 0, false,
|
||||
false, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDataDisabledIcon() {
|
||||
setupNetworkController();
|
||||
@@ -118,8 +132,10 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
|
||||
updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0);
|
||||
setConnectivity(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
|
||||
|
||||
verifyDataIndicators(TelephonyIcons.ICON_DATA_DISABLED,
|
||||
TelephonyIcons.QS_ICON_DATA_DISABLED);
|
||||
// Verify that a SignalDrawable with a cut out is used to display data disabled.
|
||||
verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, 0,
|
||||
true, DEFAULT_QS_SIGNAL_STRENGTH, 0, false,
|
||||
false, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user