diff options
9 files changed, 81 insertions, 27 deletions
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_roaming.xml b/packages/SystemUI/res/drawable/stat_sys_data_roaming.xml new file mode 100644 index 0000000..17c4b04 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_data_roaming.xml @@ -0,0 +1,22 @@ +<!-- +Copyright (C) 2014 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="4.25dp" + android:height="17dp" + android:viewportWidth="6.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M 2.8,18.8 l -1,0 0,3.1 -1.6,0 0,-8.5 2.7,0 c 0.9,0 1.5,0.2 2,0.7 0.5,0.5 0.7,1.1 0.7,1.9 0,0.6 -0.1,1.1 -0.3,1.5 -0.2,0.4 -0.5,0.6 -0.9,0.8 l 1.5,3.5 0,0.1 -1.8,0 -1.3,-3.1 z m -1,-1.4 1.1,0 C 3.3,17.4 3.5,17.3 3.7,17 3.9,16.7 4,16.5 4,16.1 4,15.7 3.9,15.3 3.7,15.1 3.5,14.9 3.3,14.7 2.9,14.7 l -1.1,0 0,2.7 z" /> + +</vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/mobile_signal_group.xml b/packages/SystemUI/res/layout/mobile_signal_group.xml index 6ae5cf3..f163b9b 100644 --- a/packages/SystemUI/res/layout/mobile_signal_group.xml +++ b/packages/SystemUI/res/layout/mobile_signal_group.xml @@ -24,24 +24,38 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" > - <com.android.systemui.statusbar.AnimatedImageView - android:theme="@style/DualToneLightTheme" - android:id="@+id/mobile_signal" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - systemui:hasOverlappingRendering="false" - /> - <com.android.systemui.statusbar.AnimatedImageView - android:theme="@style/DualToneDarkTheme" - android:id="@+id/mobile_signal_dark" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:alpha="0.0" - systemui:hasOverlappingRendering="false" - /> + <FrameLayout + android:paddingStart="3dp" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + > + <com.android.systemui.statusbar.AnimatedImageView + android:theme="@style/DualToneLightTheme" + android:id="@+id/mobile_signal" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + systemui:hasOverlappingRendering="false" + /> + <com.android.systemui.statusbar.AnimatedImageView + android:theme="@style/DualToneDarkTheme" + android:id="@+id/mobile_signal_dark" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:alpha="0.0" + systemui:hasOverlappingRendering="false" + /> + <ImageView + android:id="@+id/mobile_type" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + /> + </FrameLayout> + <ImageView - android:id="@+id/mobile_type" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - /> + android:id="@+id/mobile_roaming" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:visibility="gone" + android:src="@drawable/stat_sys_data_roaming" + /> </FrameLayout> diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java index e2c0a2d..f4602de 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -201,7 +201,7 @@ public class CellularTile extends QSTile<QSTile.SignalState> { @Override public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId) { + String description, boolean isWide, boolean showSeparateRoaming, int subId) { if (qsIcon == null) { // Not data sim, don't display. return; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index b0fc398..842d7a4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -217,7 +217,7 @@ public class SignalClusterView @Override public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId) { + String description, boolean isWide, boolean showRoamingIndicator, int subId) { PhoneState state = getState(subId); if (state == null) { return; @@ -228,6 +228,7 @@ public class SignalClusterView state.mMobileDescription = statusIcon.contentDescription; state.mMobileTypeDescription = typeContentDescription; state.mIsMobileTypeIconWide = statusType != 0 && isWide; + state.mShowRoamingIndicator = showRoamingIndicator; apply(); } @@ -478,9 +479,11 @@ public class SignalClusterView private int mMobileStrengthId = 0, mMobileTypeId = 0; private boolean mIsMobileTypeIconWide; private String mMobileDescription, mMobileTypeDescription; + private boolean mShowRoamingIndicator; private ViewGroup mMobileGroup; private ImageView mMobile, mMobileDark, mMobileType; + private ImageView mMobileRoaming; public PhoneState(int subId, Context context) { ViewGroup root = (ViewGroup) LayoutInflater.from(context) @@ -494,6 +497,7 @@ public class SignalClusterView mMobile = (ImageView) root.findViewById(R.id.mobile_signal); mMobileDark = (ImageView) root.findViewById(R.id.mobile_signal_dark); mMobileType = (ImageView) root.findViewById(R.id.mobile_type); + mMobileRoaming = (ImageView) root.findViewById(R.id.mobile_roaming); } public boolean apply(boolean isSecondaryIcon) { @@ -520,6 +524,7 @@ public class SignalClusterView mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription); mMobileGroup.setVisibility(View.VISIBLE); + mMobileRoaming.setVisibility(mShowRoamingIndicator ? View.VISIBLE : View.GONE); } else { mMobileGroup.setVisibility(View.GONE); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java index e618cb8..e7f65b4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java @@ -126,14 +126,15 @@ public class CallbackHandler extends Handler implements EmergencyListener, Signa public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon, 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 String description, final boolean isWide, final boolean showSeparateRoaming, + final int subId) { post(new Runnable() { @Override public void run() { for (SignalCallback signalCluster : mSignalCallbacks) { signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType, activityIn, activityOut, typeContentDescription, description, isWide, - subId); + showSeparateRoaming, subId); } } }); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java index 33df7a8..435787e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java @@ -19,6 +19,7 @@ import android.content.Context; import android.content.Intent; import android.net.NetworkCapabilities; import android.os.Looper; +import android.os.SystemProperties; import android.telephony.PhoneStateListener; import android.telephony.ServiceState; import android.telephony.SignalStrength; @@ -238,6 +239,7 @@ public class MobileSignalController extends SignalController< int typeIcon = showDataIcon ? icons.mDataType : 0; mCallbackHandler.setMobileDataIndicators(statusIcon, qsIcon, typeIcon, qsTypeIcon, activityIn, activityOut, dataContentDescription, description, icons.mIsWide, + mCurrentState.showSeparateRoaming, mSubscriptionInfo.getSubscriptionId()); } @@ -398,7 +400,12 @@ public class MobileSignalController extends SignalController< if (isCarrierNetworkChangeActive()) { mCurrentState.iconGroup = TelephonyIcons.CARRIER_NETWORK_CHANGE; } else if (isRoaming()) { - mCurrentState.iconGroup = TelephonyIcons.ROAMING; + mCurrentState.showSeparateRoaming = false; + if (SystemProperties.getBoolean("ro.config.always_show_roaming", false)) { + mCurrentState.showSeparateRoaming = true; + } else { + mCurrentState.iconGroup = TelephonyIcons.ROAMING; + } } if (isEmergencyOnly() != mCurrentState.isEmergency) { mCurrentState.isEmergency = isEmergencyOnly(); @@ -530,6 +537,7 @@ public class MobileSignalController extends SignalController< boolean airplaneMode; boolean carrierNetworkChangeMode; boolean isDefault; + boolean showSeparateRoaming; @Override public void copyFrom(State s) { @@ -543,6 +551,7 @@ public class MobileSignalController extends SignalController< isEmergency = state.isEmergency; airplaneMode = state.airplaneMode; carrierNetworkChangeMode = state.carrierNetworkChangeMode; + showSeparateRoaming = state.showSeparateRoaming; } @Override @@ -557,6 +566,7 @@ public class MobileSignalController extends SignalController< builder.append("isEmergency=").append(isEmergency).append(','); builder.append("airplaneMode=").append(airplaneMode).append(','); builder.append("carrierNetworkChangeMode=").append(carrierNetworkChangeMode); + builder.append("showSeparateRoaming=").append(showSeparateRoaming); } @Override @@ -569,7 +579,8 @@ public class MobileSignalController extends SignalController< && ((MobileState) o).isEmergency == isEmergency && ((MobileState) o).airplaneMode == airplaneMode && ((MobileState) o).carrierNetworkChangeMode == carrierNetworkChangeMode - && ((MobileState) o).isDefault == isDefault; + && ((MobileState) o).isDefault == isDefault + && ((MobileState) o).showSeparateRoaming == showSeparateRoaming; } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index 8023ea6..57b0dba 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -40,7 +40,7 @@ public interface NetworkController { void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId); + String description, boolean isWide, boolean showSeparateRoaming, int subId); void setSubs(List<SubscriptionInfo> subs); void setNoSims(boolean show); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java index dce889f..f13ef9f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java @@ -37,7 +37,7 @@ public class SignalCallbackAdapter implements SignalCallback { @Override public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId) { + String description, boolean isWide, boolean showSeparateRoaming, int subId) { } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java index 5e9447e..72e3a06 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java @@ -256,6 +256,7 @@ public abstract class SignalController<T extends SignalController.State, IconGroup iconGroup; int inetCondition; int rssi; // Only for logging. + boolean showSeparateRoaming; // Not used for comparison, just used for logging. long time; |