diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index f24d663ced16b..097244d2a5a0c 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -59,6 +59,7 @@
- @string/status_bar_mobile
- @string/status_bar_airplane
- @string/status_bar_no_calling
+ - @string/status_bar_call_strength
- @string/status_bar_battery
- @string/status_bar_sensors_off
@@ -96,6 +97,7 @@
camera
airplane
no_calling
+ call_strength
sensors_off
screen_record
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 5715fabd3f245..1f5a26c69ecd9 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2979,6 +2979,7 @@
+
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
index 1eccfd8e72549..48c7b89f50c16 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
@@ -158,6 +158,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
mDarkIconManager.setShouldLog(true);
mBlockedIcons.add(getString(com.android.internal.R.string.status_bar_volume));
mBlockedIcons.add(getString(com.android.internal.R.string.status_bar_alarm_clock));
+ mBlockedIcons.add(getString(com.android.internal.R.string.status_bar_call_strength));
mDarkIconManager.setBlockList(mBlockedIcons);
Dependency.get(StatusBarIconController.class).addIconGroup(mDarkIconManager);
mSystemIconArea = mStatusBar.findViewById(R.id.system_icon_area);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index c22fec97db017..0c4bec2c2c65c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -200,6 +200,7 @@ public class KeyguardStatusBarView extends RelativeLayout implements
Resources r = getResources();
mBlockedIcons.add(r.getString(com.android.internal.R.string.status_bar_volume));
mBlockedIcons.add(r.getString(com.android.internal.R.string.status_bar_alarm_clock));
+ mBlockedIcons.add(r.getString(com.android.internal.R.string.status_bar_call_strength));
}
private void updateVisibilities() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
index 89e701606c1ae..93b83d3cbcbd6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
@@ -71,6 +71,10 @@ public interface StatusBarIconController {
void setSignalIcon(String slot, WifiIconState state);
/** */
void setMobileIcons(String slot, List states);
+ /**
+ * Display the no calling & SMS icons.
+ */
+ void setCallStrengthIcons(String slot, List states);
/**
* Display the no calling & SMS icons.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
index 068ded32bbdb4..75900a2bffa12 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
@@ -223,6 +223,33 @@ public class StatusBarIconControllerImpl extends StatusBarIconList implements Tu
}
}
+ /**
+ * Accept a list of CallIndicatorIconStates, and show the call strength icons.
+ * @param slot StatusBar slot for the call strength icons
+ * @param states All of the no Calling & SMS icon states
+ */
+ @Override
+ public void setCallStrengthIcons(String slot, List states) {
+ Slot callStrengthSlot = getSlot(slot);
+ int callStrengthSlotIndex = getSlotIndex(slot);
+ Collections.reverse(states);
+ for (CallIndicatorIconState state : states) {
+ if (!state.isNoCalling) {
+ StatusBarIconHolder holder = callStrengthSlot.getHolderForTag(state.subId);
+ if (holder == null) {
+ holder = StatusBarIconHolder.fromCallIndicatorState(mContext, state);
+ setIcon(callStrengthSlotIndex, holder);
+ } else {
+ holder.setIcon(new StatusBarIcon(UserHandle.SYSTEM, mContext.getPackageName(),
+ Icon.createWithResource(mContext, state.callStrengthResId), 0, 0,
+ state.callStrengthDescription));
+ setIcon(callStrengthSlotIndex, holder);
+ }
+ }
+ setIconVisibility(slot, !state.isNoCalling, state.subId);
+ }
+ }
+
/**
* Accept a list of CallIndicatorIconStates, and show the no calling icons.
* @param slot StatusBar slot for the no calling icons
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java
index 4ca71f081c0e8..af342dd31a764 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java
@@ -86,9 +86,11 @@ public class StatusBarIconHolder {
Context context,
CallIndicatorIconState state) {
StatusBarIconHolder holder = new StatusBarIconHolder();
+ int resId = state.isNoCalling ? state.noCallingResId : state.callStrengthResId;
+ String contentDescription = state.isNoCalling
+ ? state.noCallingDescription : state.callStrengthDescription;
holder.mIcon = new StatusBarIcon(UserHandle.SYSTEM, context.getPackageName(),
- Icon.createWithResource(context, state.noCallingResId),
- 0, 0, state.noCallingDescription);
+ Icon.createWithResource(context, resId), 0, 0, contentDescription);
holder.mTag = state.subId;
return holder;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
index b57d8766854ee..3445826eefbe8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
@@ -22,6 +22,7 @@ import android.telephony.SubscriptionInfo;
import android.util.ArraySet;
import android.util.Log;
+import com.android.settingslib.mobile.TelephonyIcons;
import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.NetworkController;
@@ -49,6 +50,7 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
private final String mSlotEthernet;
private final String mSlotVpn;
private final String mSlotNoCalling;
+ private final String mSlotCallStrength;
private final Context mContext;
private final StatusBarIconController mIconController;
@@ -82,6 +84,8 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
mSlotEthernet = mContext.getString(com.android.internal.R.string.status_bar_ethernet);
mSlotVpn = mContext.getString(com.android.internal.R.string.status_bar_vpn);
mSlotNoCalling = mContext.getString(com.android.internal.R.string.status_bar_no_calling);
+ mSlotCallStrength =
+ mContext.getString(com.android.internal.R.string.status_bar_call_strength);
mActivityEnabled = mContext.getResources().getBoolean(R.bool.config_showActivity);
mIconController = iconController;
@@ -207,9 +211,14 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
if (statusIcon.icon == R.drawable.ic_qs_no_calling_sms) {
state.isNoCalling = statusIcon.visible;
state.noCallingDescription = statusIcon.contentDescription;
- mIconController.setNoCallingIcons(mSlotNoCalling,
- CallIndicatorIconState.copyStates(mCallIndicatorStates));
+ } else {
+ state.callStrengthResId = statusIcon.icon;
+ state.callStrengthDescription = statusIcon.contentDescription;
}
+ mIconController.setCallStrengthIcons(mSlotCallStrength,
+ CallIndicatorIconState.copyStates(mCallIndicatorStates));
+ mIconController.setNoCallingIcons(mSlotNoCalling,
+ CallIndicatorIconState.copyStates(mCallIndicatorStates));
}
@Override
@@ -296,6 +305,7 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
mIconController.removeAllIconsForSlot(mSlotMobile);
mIconController.removeAllIconsForSlot(mSlotNoCalling);
+ mIconController.removeAllIconsForSlot(mSlotCallStrength);
mMobileStates.clear();
List noCallingStates = new ArrayList();
noCallingStates.addAll(mCallIndicatorStates);
@@ -410,12 +420,15 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
public static class CallIndicatorIconState {
public boolean isNoCalling;
public int noCallingResId;
+ public int callStrengthResId;
public int subId;
public String noCallingDescription;
+ public String callStrengthDescription;
private CallIndicatorIconState(int subId) {
this.subId = subId;
this.noCallingResId = R.drawable.ic_qs_no_calling_sms;
+ this.callStrengthResId = TelephonyIcons.MOBILE_CALL_STRENGTH_ICONS[0];
}
@Override
@@ -427,21 +440,26 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
CallIndicatorIconState that = (CallIndicatorIconState) o;
return isNoCalling == that.isNoCalling
&& noCallingResId == that.noCallingResId
+ && callStrengthResId == that.callStrengthResId
&& subId == that.subId
- && noCallingDescription == that.noCallingDescription;
+ && noCallingDescription == that.noCallingDescription
+ && callStrengthDescription == that.callStrengthDescription;
}
@Override
public int hashCode() {
- return Objects.hash(isNoCalling, noCallingResId, subId, noCallingDescription);
+ return Objects.hash(isNoCalling, noCallingResId,
+ callStrengthResId, subId, noCallingDescription, callStrengthDescription);
}
private void copyTo(CallIndicatorIconState other) {
other.isNoCalling = isNoCalling;
other.noCallingResId = noCallingResId;
+ other.callStrengthResId = callStrengthResId;
other.subId = subId;
other.noCallingDescription = noCallingDescription;
+ other.callStrengthDescription = callStrengthDescription;
}
private static List copyStates(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java b/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java
index 64127b9d1e6e1..8ad6271bfc7e8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java
@@ -65,6 +65,10 @@ public class FakeStatusBarIconController extends BaseLeakChecker
public void setMobileIcons(String slot, List states) {
}
+ @Override
+ public void setCallStrengthIcons(String slot, List states) {
+ }
+
@Override
public void setNoCallingIcons(String slot, List states) {
}