summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/res/res/values/config.xml2
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java27
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java26
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java4
9 files changed, 66 insertions, 6 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index f24d663ced16..097244d2a5a0 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -59,6 +59,7 @@
<item><xliff:g id="id">@string/status_bar_mobile</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_airplane</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_no_calling</xliff:g></item>
+ <item><xliff:g id="id">@string/status_bar_call_strength</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_battery</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_sensors_off</xliff:g></item>
</string-array>
@@ -96,6 +97,7 @@
<string translatable="false" name="status_bar_camera">camera</string>
<string translatable="false" name="status_bar_airplane">airplane</string>
<string translatable="false" name="status_bar_no_calling">no_calling</string>
+ <string translatable="false" name="status_bar_call_strength">call_strength</string>
<string translatable="false" name="status_bar_sensors_off">sensors_off</string>
<string translatable="false" name="status_bar_screen_record">screen_record</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 5715fabd3f24..1f5a26c69ecd 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2979,6 +2979,7 @@
<java-symbol type="string" name="status_bar_clock" />
<java-symbol type="string" name="status_bar_airplane" />
<java-symbol type="string" name="status_bar_no_calling" />
+ <java-symbol type="string" name="status_bar_call_strength" />
<java-symbol type="string" name="status_bar_mobile" />
<java-symbol type="string" name="status_bar_ethernet" />
<java-symbol type="string" name="status_bar_vpn" />
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 1eccfd8e7254..48c7b89f50c1 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 c22fec97db01..0c4bec2c2c65 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 89e701606c1a..93b83d3cbcbd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
@@ -74,6 +74,10 @@ public interface StatusBarIconController {
/**
* Display the no calling & SMS icons.
*/
+ void setCallStrengthIcons(String slot, List<CallIndicatorIconState> states);
+ /**
+ * Display the no calling & SMS icons.
+ */
void setNoCallingIcons(String slot, List<CallIndicatorIconState> states);
public void setIconVisibility(String slot, boolean b);
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 068ded32bbdb..75900a2bffa1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
@@ -224,6 +224,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<CallIndicatorIconState> 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
* @param states All of the no Calling & SMS icon states
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 4ca71f081c0e..af342dd31a76 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 b57d8766854e..3445826eefbe 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<CallIndicatorIconState> noCallingStates = new ArrayList<CallIndicatorIconState>();
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<CallIndicatorIconState> 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 64127b9d1e6e..8ad6271bfc7e 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
@@ -66,6 +66,10 @@ public class FakeStatusBarIconController extends BaseLeakChecker<IconManager>
}
@Override
+ public void setCallStrengthIcons(String slot, List<CallIndicatorIconState> states) {
+ }
+
+ @Override
public void setNoCallingIcons(String slot, List<CallIndicatorIconState> states) {
}