Remove separate light/dark animated vector drawables
Now that AnimatedVectorDrawables can use themed animations, SysUI no longer needs to track separate AVDs for the carrier network change icons. Bug: 21118142 Change-Id: Ifb6d7b5e7e3de85c10bc13183b4142fd2e6714b6
This commit is contained in:
@@ -23,16 +23,16 @@
|
||||
android:valueType="colorType">
|
||||
<keyframe
|
||||
android:fraction="0.0"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_fill"/>
|
||||
android:value="?attr/fillColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.32"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_fill"/>
|
||||
android:value="?attr/fillColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.33"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
<keyframe
|
||||
android:fraction="1.0"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
</propertyValuesHolder>
|
||||
|
||||
</objectAnimator>
|
||||
|
||||
@@ -23,22 +23,22 @@
|
||||
android:valueType="colorType">
|
||||
<keyframe
|
||||
android:fraction="0.0"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.32"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.33"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_fill"/>
|
||||
android:value="?attr/fillColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.66"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_fill"/>
|
||||
android:value="?attr/fillColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.67"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
<keyframe
|
||||
android:fraction="1.0"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
</propertyValuesHolder>
|
||||
|
||||
</objectAnimator>
|
||||
|
||||
@@ -23,16 +23,16 @@
|
||||
android:valueType="colorType">
|
||||
<keyframe
|
||||
android:fraction="0.0"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.66"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_background"/>
|
||||
android:value="?attr/backgroundColor"/>
|
||||
<keyframe
|
||||
android:fraction="0.67"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_fill"/>
|
||||
android:value="?attr/fillColor"/>
|
||||
<keyframe
|
||||
android:fraction="1.0"
|
||||
android:value="@color/light_mode_icon_color_dual_tone_fill"/>
|
||||
android:value="?attr/fillColor"/>
|
||||
</propertyValuesHolder>
|
||||
|
||||
</objectAnimator>
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2015 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.
|
||||
-->
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/linear_interpolator"
|
||||
android:duration="@integer/carrier_network_change_anim_time"
|
||||
android:repeatCount="-1">
|
||||
|
||||
<propertyValuesHolder
|
||||
android:propertyName="fillColor"
|
||||
android:valueType="colorType">
|
||||
<keyframe
|
||||
android:fraction="0.0"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_fill"/>
|
||||
<keyframe
|
||||
android:fraction="0.32"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_fill"/>
|
||||
<keyframe
|
||||
android:fraction="0.33"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
<keyframe
|
||||
android:fraction="1.0"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
</propertyValuesHolder>
|
||||
|
||||
</objectAnimator>
|
||||
@@ -1,44 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2015 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.
|
||||
-->
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/linear_interpolator"
|
||||
android:duration="@integer/carrier_network_change_anim_time"
|
||||
android:repeatCount="-1">
|
||||
|
||||
<propertyValuesHolder
|
||||
android:propertyName="fillColor"
|
||||
android:valueType="colorType">
|
||||
<keyframe
|
||||
android:fraction="0.0"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
<keyframe
|
||||
android:fraction="0.32"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
<keyframe
|
||||
android:fraction="0.33"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_fill"/>
|
||||
<keyframe
|
||||
android:fraction="0.66"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_fill"/>
|
||||
<keyframe
|
||||
android:fraction="0.67"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
<keyframe
|
||||
android:fraction="1.0"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
</propertyValuesHolder>
|
||||
|
||||
</objectAnimator>
|
||||
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2015 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.
|
||||
-->
|
||||
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/linear_interpolator"
|
||||
android:duration="@integer/carrier_network_change_anim_time"
|
||||
android:repeatCount="-1">
|
||||
|
||||
<propertyValuesHolder
|
||||
android:propertyName="fillColor"
|
||||
android:valueType="colorType">
|
||||
<keyframe
|
||||
android:fraction="0.0"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
<keyframe
|
||||
android:fraction="0.66"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_background"/>
|
||||
<keyframe
|
||||
android:fraction="0.67"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_fill"/>
|
||||
<keyframe
|
||||
android:fraction="1.0"
|
||||
android:value="@color/dark_mode_icon_color_dual_tone_fill"/>
|
||||
</propertyValuesHolder>
|
||||
|
||||
</objectAnimator>
|
||||
@@ -1,27 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2015 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.
|
||||
-->
|
||||
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/stat_sys_signal_carrier_network_change" >
|
||||
<target
|
||||
android:name="dot1"
|
||||
android:animation="@anim/ic_signal_dark_blink_1"/>
|
||||
<target
|
||||
android:name="dot2"
|
||||
android:animation="@anim/ic_signal_dark_blink_2"/>
|
||||
<target
|
||||
android:name="dot3"
|
||||
android:animation="@anim/ic_signal_dark_blink_3"/>
|
||||
</animated-vector>
|
||||
@@ -162,10 +162,9 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon,
|
||||
int darkStatusIcon, int statusType, int qsType, boolean activityIn,
|
||||
boolean activityOut, String typeContentDescription, String description,
|
||||
boolean isWide, int subId) {
|
||||
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
|
||||
int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
|
||||
String description, boolean isWide, int subId) {
|
||||
if (qsIcon == null) {
|
||||
// Not data sim, don't display.
|
||||
return;
|
||||
|
||||
@@ -180,13 +180,12 @@ public class SignalClusterView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int darkStatusIcon,
|
||||
int statusType, int qsType, boolean activityIn, boolean activityOut,
|
||||
String typeContentDescription, String description, boolean isWide, int subId) {
|
||||
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
|
||||
int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
|
||||
String description, boolean isWide, int subId) {
|
||||
PhoneState state = getOrInflateState(subId);
|
||||
state.mMobileVisible = statusIcon.visible;
|
||||
state.mMobileStrengthId = statusIcon.icon;
|
||||
state.mMobileDarkStrengthId = darkStatusIcon;
|
||||
state.mMobileTypeId = statusType;
|
||||
state.mMobileDescription = statusIcon.contentDescription;
|
||||
state.mMobileTypeDescription = typeContentDescription;
|
||||
@@ -426,7 +425,7 @@ public class SignalClusterView
|
||||
private class PhoneState {
|
||||
private final int mSubId;
|
||||
private boolean mMobileVisible = false;
|
||||
private int mMobileStrengthId = 0, mMobileDarkStrengthId = 0, mMobileTypeId = 0;
|
||||
private int mMobileStrengthId = 0, mMobileTypeId = 0;
|
||||
private boolean mIsMobileTypeIconWide;
|
||||
private String mMobileDescription, mMobileTypeDescription;
|
||||
|
||||
@@ -483,9 +482,8 @@ public class SignalClusterView
|
||||
mMobileDark.setPaddingRelative(mIsMobileTypeIconWide ? mWideTypeIconStartPadding : 0,
|
||||
0, 0, 0);
|
||||
|
||||
if (DEBUG) Log.d(TAG, String.format("mobile: %s sig=%d dark=%d typ=%d",
|
||||
(mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId,
|
||||
mMobileDarkStrengthId, mMobileTypeId));
|
||||
if (DEBUG) Log.d(TAG, String.format("mobile: %s sig=%d typ=%d",
|
||||
(mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId, mMobileTypeId));
|
||||
|
||||
mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE);
|
||||
|
||||
|
||||
@@ -124,17 +124,16 @@ public class CallbackHandler extends Handler implements EmergencyListener, Signa
|
||||
|
||||
@Override
|
||||
public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon,
|
||||
final int darkStatusIcon, final int statusType, final int qsType,
|
||||
final boolean activityIn, final boolean activityOut,
|
||||
final String typeContentDescription, final String description, final boolean isWide,
|
||||
final int subId) {
|
||||
final int statusType, final int qsType,final boolean activityIn,
|
||||
final boolean activityOut, final String typeContentDescription,
|
||||
final String description, final boolean isWide, final int subId) {
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (SignalCallback signalCluster : mSignalCallbacks) {
|
||||
signalCluster.setMobileDataIndicators(statusIcon, qsIcon, darkStatusIcon,
|
||||
statusType, qsType, activityIn, activityOut, typeContentDescription,
|
||||
description, isWide, subId);
|
||||
signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType,
|
||||
activityIn, activityOut, typeContentDescription, description, isWide,
|
||||
subId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -117,7 +117,7 @@ public class MobileSignalController extends SignalController<
|
||||
|
||||
public void setCarrierNetworkChangeMode(boolean carrierNetworkChangeMode) {
|
||||
mCurrentState.carrierNetworkChangeMode = carrierNetworkChangeMode;
|
||||
notifyListenersIfNecessary();
|
||||
updateTelephony();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,13 +220,9 @@ public class MobileSignalController extends SignalController<
|
||||
&& mCurrentState.activityOut;
|
||||
showDataIcon &= mCurrentState.isDefault;
|
||||
int typeIcon = showDataIcon ? icons.mDataType : 0;
|
||||
mCallbackHandler.setMobileDataIndicators(statusIcon, qsIcon, getCurrentDarkIconId(),
|
||||
typeIcon, qsTypeIcon, activityIn, activityOut, dataContentDescription, description,
|
||||
icons.mIsWide, mSubscriptionInfo.getSubscriptionId());
|
||||
}
|
||||
|
||||
private int getCurrentDarkIconId() {
|
||||
return getCurrentIconId(false /* light */);
|
||||
mCallbackHandler.setMobileDataIndicators(statusIcon, qsIcon, typeIcon, qsTypeIcon,
|
||||
activityIn, activityOut, dataContentDescription, description, icons.mIsWide,
|
||||
mSubscriptionInfo.getSubscriptionId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -478,17 +474,8 @@ public class MobileSignalController extends SignalController<
|
||||
int sbNullState, int qsNullState, int sbDiscState, int qsDiscState,
|
||||
int discContentDesc, int dataContentDesc, int dataType, boolean isWide,
|
||||
int qsDataType) {
|
||||
this(name, sbIcons, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState,
|
||||
sbDiscState, sbDiscState, qsDiscState, discContentDesc, dataContentDesc,
|
||||
dataType, isWide, qsDataType);
|
||||
}
|
||||
|
||||
public MobileIconGroup(String name, int[][] sbIcons, int[][] sbDarkIcons, int[][] qsIcons,
|
||||
int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState,
|
||||
int sbDarkDiscState, int qsDiscState, int discContentDesc, int dataContentDesc,
|
||||
int dataType, boolean isWide, int qsDataType) {
|
||||
super(name, sbIcons, sbDarkIcons, qsIcons, contentDesc, sbNullState, qsNullState,
|
||||
sbDiscState, sbDarkDiscState, qsDiscState, discContentDesc);
|
||||
super(name, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, sbDiscState,
|
||||
qsDiscState, discContentDesc);
|
||||
mDataContentDescription = dataContentDesc;
|
||||
mDataType = dataType;
|
||||
mIsWide = isWide;
|
||||
|
||||
@@ -38,9 +38,9 @@ public interface NetworkController {
|
||||
void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
|
||||
boolean activityIn, boolean activityOut, String description);
|
||||
|
||||
void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int darkStatusIcon,
|
||||
int statusType, int qsType, boolean activityIn, boolean activityOut,
|
||||
String typeContentDescription, String description, boolean isWide, int subId);
|
||||
void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
|
||||
int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
|
||||
String description, boolean isWide, int subId);
|
||||
void setSubs(List<SubscriptionInfo> subs);
|
||||
void setNoSims(boolean show);
|
||||
|
||||
|
||||
@@ -35,10 +35,9 @@ public class SignalCallbackAdapter implements SignalCallback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon,
|
||||
int darkStatusIcon, int statusType, int qsType, boolean activityIn,
|
||||
boolean activityOut, String typeContentDescription, String description,
|
||||
boolean isWide, int subId) {
|
||||
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
|
||||
int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
|
||||
String description, boolean isWide, int subId) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -133,22 +133,10 @@ public abstract class SignalController<T extends SignalController.State,
|
||||
* Gets the signal icon for SB based on current state of connected, enabled, and level.
|
||||
*/
|
||||
public int getCurrentIconId() {
|
||||
return getCurrentIconId(true /* light */);
|
||||
}
|
||||
|
||||
protected int getCurrentIconId(boolean light) {
|
||||
if (mCurrentState.connected) {
|
||||
if (light) {
|
||||
return getIcons().mSbIcons[mCurrentState.inetCondition][mCurrentState.level];
|
||||
} else {
|
||||
return getIcons().mSbDarkIcons[mCurrentState.inetCondition][mCurrentState.level];
|
||||
}
|
||||
return getIcons().mSbIcons[mCurrentState.inetCondition][mCurrentState.level];
|
||||
} else if (mCurrentState.enabled) {
|
||||
if (light) {
|
||||
return getIcons().mSbDiscState;
|
||||
} else {
|
||||
return getIcons().mSbDarkDiscState;
|
||||
}
|
||||
return getIcons().mSbDiscState;
|
||||
} else {
|
||||
return getIcons().mSbNullState;
|
||||
}
|
||||
@@ -229,13 +217,11 @@ public abstract class SignalController<T extends SignalController.State,
|
||||
*/
|
||||
static class IconGroup {
|
||||
final int[][] mSbIcons;
|
||||
final int[][] mSbDarkIcons;
|
||||
final int[][] mQsIcons;
|
||||
final int[] mContentDesc;
|
||||
final int mSbNullState;
|
||||
final int mQsNullState;
|
||||
final int mSbDiscState;
|
||||
final int mSbDarkDiscState;
|
||||
final int mQsDiscState;
|
||||
final int mDiscContentDesc;
|
||||
// For logging.
|
||||
@@ -244,22 +230,13 @@ public abstract class SignalController<T extends SignalController.State,
|
||||
public IconGroup(String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc,
|
||||
int sbNullState, int qsNullState, int sbDiscState, int qsDiscState,
|
||||
int discContentDesc) {
|
||||
this(name, sbIcons, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState,
|
||||
sbDiscState, sbDiscState, qsDiscState, discContentDesc);
|
||||
}
|
||||
|
||||
public IconGroup(String name, int[][] sbIcons, int[][] sbDarkIcons, int[][] qsIcons,
|
||||
int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState,
|
||||
int sbDarkDiscState, int qsDiscState, int discContentDesc) {
|
||||
mName = name;
|
||||
mSbIcons = sbIcons;
|
||||
mSbDarkIcons = sbDarkIcons;
|
||||
mQsIcons = qsIcons;
|
||||
mContentDesc = contentDesc;
|
||||
mSbNullState = sbNullState;
|
||||
mQsNullState = qsNullState;
|
||||
mSbDiscState = sbDiscState;
|
||||
mSbDarkDiscState = sbDarkDiscState;
|
||||
mQsDiscState = qsDiscState;
|
||||
mDiscContentDesc = discContentDesc;
|
||||
}
|
||||
|
||||
@@ -71,26 +71,17 @@ class TelephonyIcons {
|
||||
//CarrierNetworkChange
|
||||
static final int[][] TELEPHONY_CARRIER_NETWORK_CHANGE = {
|
||||
{ R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation },
|
||||
{ R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation }
|
||||
};
|
||||
|
||||
static final int[][] TELEPHONY_CARRIER_NETWORK_CHANGE_DARK = {
|
||||
{ R.drawable.stat_sys_signal_dark_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_dark_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_dark_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_dark_carrier_network_change_animation },
|
||||
{ R.drawable.stat_sys_signal_dark_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_dark_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_dark_carrier_network_change_animation,
|
||||
R.drawable.stat_sys_signal_dark_carrier_network_change_animation }
|
||||
};
|
||||
|
||||
static final int[][] QS_TELEPHONY_CARRIER_NETWORK_CHANGE = {
|
||||
{ R.drawable.ic_qs_signal_carrier_network_change_animation,
|
||||
R.drawable.ic_qs_signal_carrier_network_change_animation,
|
||||
@@ -216,8 +207,6 @@ class TelephonyIcons {
|
||||
static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x;
|
||||
static final int ICON_CARRIER_NETWORK_CHANGE =
|
||||
R.drawable.stat_sys_signal_carrier_network_change_animation;
|
||||
static final int ICON_CARRIER_NETWORK_CHANGE_DARK =
|
||||
R.drawable.stat_sys_signal_dark_carrier_network_change_animation;
|
||||
|
||||
static final int QS_ICON_LTE = R.drawable.ic_qs_signal_lte;
|
||||
static final int QS_ICON_3G = R.drawable.ic_qs_signal_3g;
|
||||
@@ -229,12 +218,10 @@ class TelephonyIcons {
|
||||
static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup(
|
||||
"CARRIER_NETWORK_CHANGE",
|
||||
TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE,
|
||||
TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE_DARK,
|
||||
TelephonyIcons.QS_TELEPHONY_CARRIER_NETWORK_CHANGE,
|
||||
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
|
||||
0, 0,
|
||||
TelephonyIcons.ICON_CARRIER_NETWORK_CHANGE,
|
||||
TelephonyIcons.ICON_CARRIER_NETWORK_CHANGE_DARK,
|
||||
TelephonyIcons.QS_ICON_CARRIER_NETWORK_CHANGE,
|
||||
AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
|
||||
R.string.accessibility_carrier_network_change_mode,
|
||||
|
||||
@@ -94,7 +94,6 @@ public class CallbackHandlerTest extends AndroidTestCase {
|
||||
public void testSignalCallback_setMobileDataIndicators() {
|
||||
IconState status = new IconState(true, 0, "");
|
||||
IconState qs = new IconState(true, 1, "");
|
||||
int dark = 2;
|
||||
boolean in = true;
|
||||
boolean out = true;
|
||||
String typeDescription = "Test 1";
|
||||
@@ -103,13 +102,12 @@ public class CallbackHandlerTest extends AndroidTestCase {
|
||||
int qsType = R.drawable.ic_qs_signal_1x;
|
||||
boolean wide = true;
|
||||
int subId = 5;
|
||||
mHandler.setMobileDataIndicators(status, qs, dark, type, qsType, in, out, typeDescription,
|
||||
mHandler.setMobileDataIndicators(status, qs, type, qsType, in, out, typeDescription,
|
||||
description, wide, subId);
|
||||
waitForCallbacks();
|
||||
|
||||
ArgumentCaptor<IconState> statusArg = ArgumentCaptor.forClass(IconState.class);
|
||||
ArgumentCaptor<IconState> qsArg = ArgumentCaptor.forClass(IconState.class);
|
||||
ArgumentCaptor<Integer> darkStrengthArg = ArgumentCaptor.forClass(Integer.class);
|
||||
ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
|
||||
ArgumentCaptor<Integer> qsTypeIconArg = ArgumentCaptor.forClass(Integer.class);
|
||||
ArgumentCaptor<Boolean> inArg = ArgumentCaptor.forClass(Boolean.class);
|
||||
@@ -118,13 +116,12 @@ public class CallbackHandlerTest extends AndroidTestCase {
|
||||
ArgumentCaptor<String> descArg = ArgumentCaptor.forClass(String.class);
|
||||
ArgumentCaptor<Boolean> wideArg = ArgumentCaptor.forClass(Boolean.class);
|
||||
ArgumentCaptor<Integer> subIdArg = ArgumentCaptor.forClass(Integer.class);
|
||||
Mockito.verify(mSignalCallback).setMobileDataIndicators(statusArg.capture(), qsArg.capture(),
|
||||
darkStrengthArg.capture(), typeIconArg.capture(), qsTypeIconArg.capture(),
|
||||
inArg.capture(), outArg.capture(), typeContentArg.capture(), descArg.capture(),
|
||||
wideArg.capture(), subIdArg.capture());
|
||||
Mockito.verify(mSignalCallback).setMobileDataIndicators(statusArg.capture(),
|
||||
qsArg.capture(), typeIconArg.capture(), qsTypeIconArg.capture(), inArg.capture(),
|
||||
outArg.capture(), typeContentArg.capture(), descArg.capture(), wideArg.capture(),
|
||||
subIdArg.capture());
|
||||
assertEquals(status, statusArg.getValue());
|
||||
assertEquals(qs, qsArg.getValue());
|
||||
assertEquals(dark, (int) darkStrengthArg.getValue());
|
||||
assertEquals(type, (int) typeIconArg.getValue());
|
||||
assertEquals(qsType, (int) qsTypeIconArg.getValue());
|
||||
assertEquals(in, (boolean) inArg.getValue());
|
||||
|
||||
@@ -258,7 +258,6 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
|
||||
ArgumentCaptor.forClass(IconState.class).capture(),
|
||||
iconArg.capture(),
|
||||
ArgumentCaptor.forClass(Integer.class).capture(),
|
||||
ArgumentCaptor.forClass(Integer.class).capture(),
|
||||
typeIconArg.capture(), dataInArg.capture(), dataOutArg.capture(),
|
||||
ArgumentCaptor.forClass(String.class).capture(),
|
||||
ArgumentCaptor.forClass(String.class).capture(),
|
||||
@@ -275,20 +274,14 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
|
||||
}
|
||||
|
||||
protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon) {
|
||||
verifyLastMobileDataIndicators(visible, icon, icon, typeIcon);
|
||||
}
|
||||
|
||||
protected void verifyLastMobileDataIndicators(boolean visible, int strengthIcon,
|
||||
int darkStrengthIcon, int typeIcon) {
|
||||
ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class);
|
||||
ArgumentCaptor<Integer> darkStrengthIconArg = ArgumentCaptor.forClass(Integer.class);
|
||||
ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
|
||||
|
||||
// TODO: Verify all fields.
|
||||
Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setMobileDataIndicators(
|
||||
iconArg.capture(),
|
||||
ArgumentCaptor.forClass(IconState.class).capture(),
|
||||
darkStrengthIconArg.capture(), typeIconArg.capture(),
|
||||
typeIconArg.capture(),
|
||||
ArgumentCaptor.forClass(Integer.class).capture(),
|
||||
ArgumentCaptor.forClass(Boolean.class).capture(),
|
||||
ArgumentCaptor.forClass(Boolean.class).capture(),
|
||||
@@ -298,9 +291,6 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
|
||||
ArgumentCaptor.forClass(Integer.class).capture());
|
||||
IconState iconState = iconArg.getValue();
|
||||
|
||||
assertEquals("Signal strength icon in status bar", strengthIcon, iconState.icon);
|
||||
assertEquals("Signal strength icon (dark mode) in status bar", darkStrengthIcon,
|
||||
(int) darkStrengthIconArg.getValue());
|
||||
assertEquals("Data icon in status bar", typeIcon, (int) typeIconArg.getValue());
|
||||
assertEquals("Visibility in status bar", visible, iconState.visible);
|
||||
}
|
||||
|
||||
@@ -438,7 +438,6 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
|
||||
// Out of service and carrier network change is true, show special indicator
|
||||
verifyLastMobileDataIndicators(true /* visible */,
|
||||
TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE[0][0] /* strengthIcon */,
|
||||
TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE_DARK[0][0] /* darkStrengthIcon */,
|
||||
0 /* typeIcon */);
|
||||
|
||||
// Revert back
|
||||
|
||||
Reference in New Issue
Block a user