Merge "Remove upper left X icon on mobile signal." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
62cfe60bce
@@ -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) {
|
if (mConfig.inflateSignalStrengths) {
|
||||||
level++;
|
level++;
|
||||||
}
|
}
|
||||||
return SignalDrawable.getState(level, getNumLevels(),
|
boolean dataDisabled = mCurrentState.userSetup
|
||||||
mCurrentState.inetCondition == 0);
|
&& mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED;
|
||||||
|
boolean noInternet = mCurrentState.inetCondition == 0;
|
||||||
|
boolean cutOut = dataDisabled || noInternet;
|
||||||
|
return SignalDrawable.getState(level, getNumLevels(), cutOut);
|
||||||
} else if (mCurrentState.enabled) {
|
} else if (mCurrentState.enabled) {
|
||||||
return SignalDrawable.getEmptyState(getNumLevels());
|
return SignalDrawable.getEmptyState(getNumLevels());
|
||||||
} else {
|
} 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_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_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(
|
static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup(
|
||||||
"CARRIER_NETWORK_CHANGE",
|
"CARRIER_NETWORK_CHANGE",
|
||||||
null,
|
null,
|
||||||
@@ -232,9 +228,9 @@ class TelephonyIcons {
|
|||||||
0,
|
0,
|
||||||
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
|
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
|
||||||
R.string.accessibility_cell_data_off,
|
R.string.accessibility_cell_data_off,
|
||||||
TelephonyIcons.ICON_DATA_DISABLED,
|
0,
|
||||||
false,
|
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,
|
protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon,
|
||||||
boolean qsVisible, int qsIcon, int qsTypeIcon, boolean dataIn, boolean dataOut) {
|
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<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
|
||||||
ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
|
ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
|
||||||
ArgumentCaptor<IconState> qsIconArg = ArgumentCaptor.forClass(IconState.class);
|
ArgumentCaptor<IconState> qsIconArg = ArgumentCaptor.forClass(IconState.class);
|
||||||
@@ -372,7 +379,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
|
|||||||
IconState iconState = iconArg.getValue();
|
IconState iconState = iconArg.getValue();
|
||||||
|
|
||||||
int state = SignalDrawable.getState(icon, SignalStrength.NUM_SIGNAL_STRENGTH_BINS,
|
int state = SignalDrawable.getState(icon, SignalStrength.NUM_SIGNAL_STRENGTH_BINS,
|
||||||
false);
|
cutOut);
|
||||||
assertEquals("Data icon in status bar", typeIcon, (int) typeIconArg.getValue());
|
assertEquals("Data icon in status bar", typeIcon, (int) typeIconArg.getValue());
|
||||||
assertEquals("Signal icon in status bar", state, iconState.icon);
|
assertEquals("Signal icon in status bar", state, iconState.icon);
|
||||||
assertEquals("Visibility in status bar", visible, iconState.visible);
|
assertEquals("Visibility in status bar", visible, iconState.visible);
|
||||||
|
|||||||
@@ -110,6 +110,20 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
|
|||||||
TelephonyIcons.QS_DATA_4G);
|
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
|
@Test
|
||||||
public void testDataDisabledIcon() {
|
public void testDataDisabledIcon() {
|
||||||
setupNetworkController();
|
setupNetworkController();
|
||||||
@@ -118,8 +132,10 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
|
|||||||
updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0);
|
updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0);
|
||||||
setConnectivity(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
|
setConnectivity(NetworkCapabilities.TRANSPORT_CELLULAR, false, false);
|
||||||
|
|
||||||
verifyDataIndicators(TelephonyIcons.ICON_DATA_DISABLED,
|
// Verify that a SignalDrawable with a cut out is used to display data disabled.
|
||||||
TelephonyIcons.QS_ICON_DATA_DISABLED);
|
verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, 0,
|
||||||
|
true, DEFAULT_QS_SIGNAL_STRENGTH, 0, false,
|
||||||
|
false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user