diff options
author | Jason Monk <jmonk@google.com> | 2014-09-30 09:29:34 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2014-09-30 10:05:46 -0400 |
commit | 1cd44e3ab4c413df05a0281fc80dc35fdc932746 (patch) | |
tree | fd0c4188272b11d1c3146e731df2b1d058e38545 /packages | |
parent | 51a400eb440c89fb06a47371bb7b026f00edb09c (diff) | |
download | frameworks_base-1cd44e3ab4c413df05a0281fc80dc35fdc932746.zip frameworks_base-1cd44e3ab4c413df05a0281fc80dc35fdc932746.tar.gz frameworks_base-1cd44e3ab4c413df05a0281fc80dc35fdc932746.tar.bz2 |
Pull roaming from mServiceState for consistency
Also consolidate roaming logic while here, to make it easier to
maintain.
Bug: 17514906
Bug: 17619763
Change-Id: I8efabdecc26722ff6ac70d715f3befaae989abdc
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index 79d769a..3625997 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -646,19 +646,10 @@ public class NetworkControllerImpl extends BroadcastReceiver mLastSignalLevel = iconLevel = mSignalStrength.getLevel(); } - if (isCdma()) { - if (isCdmaEri()) { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; - } else { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; - } + if (isRoaming()) { + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; } else { - // Though mPhone is a Manager, this call is not an IPC - if (mPhone.isNetworkRoaming()) { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; - } else { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; - } + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; } mPhoneSignalIconId = iconList[iconLevel]; mQSPhoneSignalIconId = @@ -811,14 +802,9 @@ public class NetworkControllerImpl extends BroadcastReceiver } } - if (isCdma()) { - if (isCdmaEri()) { - mDataTypeIconId = TelephonyIcons.ROAMING_ICON; - mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; - } - } else if (mPhone.isNetworkRoaming()) { - mDataTypeIconId = TelephonyIcons.ROAMING_ICON; - mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; + if (isRoaming()) { + mDataTypeIconId = TelephonyIcons.ROAMING_ICON; + mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; } } @@ -836,6 +822,14 @@ public class NetworkControllerImpl extends BroadcastReceiver return false; } + private boolean isRoaming() { + if (isCdma()) { + return isCdmaEri(); + } else { + return mServiceState != null && mServiceState.getRoaming(); + } + } + private final void updateDataIcon() { int iconId; boolean visible = true; @@ -1233,12 +1227,7 @@ public class NetworkControllerImpl extends BroadcastReceiver mDataTypeIconId = 0; mQSDataTypeIconId = 0; - if (isCdma()) { - if (isCdmaEri()) { - mDataTypeIconId = TelephonyIcons.ROAMING_ICON; - mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; - } - } else if (mPhone.isNetworkRoaming()) { + if (isRoaming()) { mDataTypeIconId = TelephonyIcons.ROAMING_ICON; mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition]; } |