Merge "Merge "Remove upper left X icon on mobile signal." into pi-dev am: 62cfe60bce" into pi-dev-plus-aosp

am: 9633d9967d

Change-Id: Ibd51e2d7dfaebc0095b210af7bf711e39406abf6
This commit is contained in:
Amin Shaikh
2018-03-08 19:10:36 +00:00
committed by android-build-merger
6 changed files with 33 additions and 61 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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
);
}

View File

@@ -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);

View File

@@ -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