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