Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/SystemUI/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ android_library {

libs: [
"telephony-common",
"ims-common",
],

kotlincflags: ["-Xjvm-default=enable"],
Expand Down Expand Up @@ -139,6 +140,7 @@ android_library {
"android.test.runner",
"telephony-common",
"android.test.base",
"ims-common",
],
kotlincflags: ["-Xjvm-default=enable"],
aaptflags: [
Expand All @@ -165,6 +167,7 @@ android_app {
},

libs: [
"ims-common",
"telephony-common",
],

Expand Down Expand Up @@ -196,6 +199,7 @@ android_app {
],
libs: [
"telephony-common",
"ims-common",
],

kotlincflags: ["-Xjvm-default=enable"],
Expand Down
19 changes: 19 additions & 0 deletions packages/SystemUI/res/drawable/ic_volte.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportWidth="40"
android:viewportHeight="56"
android:width="20dp"
android:height="24dp">
<group
android:scaleX="0.1"
android:scaleY="-0.1"
android:translateY="56">
<path
android:pathData="M77 402c-14 -15 -17 -40 -17 -129 0 -146 -4 -143 167 -143 167 0 163 -3 163 147 0 146 4 143 -167 143 -113 0 -132 -2 -146 -18zm62 -43l19 -31 16 31c14 26 36 42 36 26 0 -16 -46 -95 -55 -95 -9 0 -55 79 -55 95 0 16 23 0 39 -26zm135 5c20 -8 21 -48 1 -64 -32 -27 -82 23 -55 55 13 16 29 19 54 9zm-134 -138c0 -27 4 -35 20 -38 33 -5 23 -23 -12 -23 -32 0 -33 1 -36 48 -2 37 0 47 12 47 11 0 16 -10 16 -34zm120 24c0 -5 -7 -10 -15 -10 -11 0 -15 -11 -15 -40 0 -22 -4 -40 -10 -40 -5 0 -10 18 -10 40 0 28 -4 40 -14 40 -8 0 -18 5 -21 10 -4 6 12 10 39 10 25 0 46 -4 46 -10zm90 0c0 -5 -12 -10 -27 -11 -27 0 -27 -1 -5 -9 12 -5 22 -14 22 -20 0 -5 -10 -10 -22 -11l-23 -1 23 -6c35 -10 31 -27 -5 -30l-33 -3 0 50 0 51 35 0c19 0 35 -4 35 -10z"
android:fillColor="#FFFFFF" />
<path
android:pathData="M246 343c-11 -11 -6 -23 9 -23 8 0 15 4 15 9 0 13 -16 22 -24 14z"
android:fillColor="#FFFFFF" />
</group>
</vector>
50 changes: 50 additions & 0 deletions packages/SystemUI/res/drawable/ic_volte_no_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Copyright (c) 2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="14dp"
android:height="17dp"
android:viewportWidth="14"
android:viewportHeight="17">

<path
android:pathData="M 1.2 4 H 13.7 V 13.2 H 1.2 V 4 Z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M1.9,12.6V4h0.8v3.5h3.2V4h0.8v8.6H5.9v-4H2.7v4H1.9z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M8,12.6V4h2.1c0.5,0,0.8,0,1.1,0.1c0.4,0.1,0.7,0.3,0.9,0.6c0.3,0.4,0.6,0.9,0.7,1.5s0.2,1.3,0.2,2c0,0.7-0.1,1.2-0.2,1.7c-0.1,0.5-0.2,0.9-0.4,1.3S12.2,11.8,12,12s-0.4,0.3-0.7,0.4s-0.6,0.1-1,0.1H8zM8.8,11.6h1.3c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.4-0.3,0.5-0.4c0.2-0.3,0.3-0.6,0.4-1.1c0.1-0.5,0.2-1,0.2-1.7c0-0.9-0.1-1.6-0.3-2.1c-0.2-0.5-0.5-0.8-0.8-1C11,5.1,10.6,5,10.1,5H8.8V11.6z" />
<path
android:fillColor="#000000"
android:pathData="M 2 9 L 1 9 L 1 9 L 2 9 Z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M 0.5 9 H 13.5 V 10 H 0.5 V 9 Z" />
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal" >

<ImageView
android:id="@+id/mobile_volte"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:visibility="gone"
android:paddingEnd="2dp"/>
<FrameLayout
android:id="@+id/inout_container"
android:layout_height="17dp"
Expand Down
2 changes: 2 additions & 0 deletions packages/SystemUI/res/values/bools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
<resources>
<!-- Whether to show the user switcher in quick settings when only a single user is present. -->
<bool name="qs_show_user_switcher_for_single_user">false</bool>
<!-- Whether to show volte/ims icon in status bar -->
<bool name="config_display_volte">true</bool>
</resources>
1 change: 1 addition & 0 deletions packages/SystemUI/res/values/ext_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<string name="status_bar_camera">Camera</string>
<string name="status_bar_location">Location</string>
<string name="status_bar_microphone">Microphone</string>
<string name="status_bar_volte">VoLTE</string>

<!-- Screen pinning dialog description. (for devices without navbar) -->
<string name="screen_pinning_description_no_navbar">This keeps it in view until you unpin. Touch &amp; hold Back to unpin.</string>
Expand Down
5 changes: 5 additions & 0 deletions packages/SystemUI/res/xml/status_bar_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
android:key="location"
android:title="@string/status_bar_location" />

<com.android.systemui.tuner.TunerSwitch
android:key="show_volte_icon"
android:title="@string/status_bar_volte"
sysui:defValue="false" />

<!-- other weird signal stuff -->

<com.android.systemui.tuner.StatusBarSwitch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,10 @@ public void updateCarrierInfo(CarrierTextController.CarrierTextCallbackInfo info

@Override
public void setMobileDataIndicators(NetworkController.IconState statusIcon,
NetworkController.IconState qsIcon, int statusType,
int qsType, boolean activityIn, boolean activityOut,
CharSequence typeContentDescription,
CharSequence typeContentDescriptionHtml, CharSequence description,
boolean isWide, int subId, boolean roaming) {
NetworkController.IconState qsIcon, int statusType, int qsType,
boolean activityIn, boolean activityOut, int volteIcon,
CharSequence typeContentDescription, CharSequence typeContentDescriptionHtml,
CharSequence description, boolean isWide, int subId, boolean roaming) {
int slotIndex = getSlotIndex(subId);
if (slotIndex >= SIM_SLOTS) {
Log.w(TAG, "setMobileDataIndicators - slot: " + slotIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private final class CellSignalCallback implements SignalCallback {

@Override
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
int qsType, boolean activityIn, boolean activityOut,
int qsType, boolean activityIn, boolean activityOut, int volteIcon,
CharSequence typeContentDescription,
CharSequence typeContentDescriptionHtml, CharSequence description,
boolean isWide, int subId, boolean roaming) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
private int mVisibleState = -1;
private DualToneHandler mDualToneHandler;

private ImageView mVolte;

public static StatusBarMobileView fromContext(Context context, String slot) {
LayoutInflater inflater = LayoutInflater.from(context);
StatusBarMobileView v = (StatusBarMobileView)
Expand Down Expand Up @@ -109,6 +111,7 @@ private void init() {
mIn = findViewById(R.id.mobile_in);
mOut = findViewById(R.id.mobile_out);
mInoutContainer = findViewById(R.id.inout_container);
mVolte = findViewById(R.id.mobile_volte);

mMobileDrawable = new SignalDrawable(getContext());
mMobile.setImageDrawable(mMobileDrawable);
Expand Down Expand Up @@ -167,6 +170,12 @@ private void initViewState() {
mOut.setVisibility(mState.activityOut ? View.VISIBLE : View.GONE);
mInoutContainer.setVisibility((mState.activityIn || mState.activityOut)
? View.VISIBLE : View.GONE);
if (mState.volteId > 0) {
mVolte.setImageResource(mState.volteId);
mVolte.setVisibility(View.VISIBLE);
} else {
mVolte.setVisibility(View.GONE);
}
}

private boolean updateState(MobileIconState state) {
Expand Down Expand Up @@ -198,6 +207,15 @@ private boolean updateState(MobileIconState state) {
mInoutContainer.setVisibility((state.activityIn || state.activityOut)
? View.VISIBLE : View.GONE);

if (mState.volteId != state.volteId) {
if (state.volteId != 0) {
mVolte.setImageResource(state.volteId);
mVolte.setVisibility(View.VISIBLE);
} else {
mVolte.setVisibility(View.GONE);
}
}

needsLayout |= state.roaming != mState.roaming
|| state.activityIn != mState.activityIn
|| state.activityOut != mState.activityOut;
Expand All @@ -215,6 +233,7 @@ public void onDarkChanged(Rect area, float darkIntensity, int tint) {
mIn.setImageTintList(color);
mOut.setImageTintList(color);
mMobileType.setImageTintList(color);
mVolte.setImageTintList(color);
mMobileRoaming.setImageTintList(color);
mDotView.setDecorColor(tint);
mDotView.setIconColor(tint, false);
Expand All @@ -240,6 +259,7 @@ public void setStaticDrawableColor(int color) {
mIn.setImageTintList(list);
mOut.setImageTintList(list);
mMobileType.setImageTintList(list);
mVolte.setImageTintList(list);
mMobileRoaming.setImageTintList(list);
mDotView.setDecorColor(color);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState q
newState.contentDescription = statusIcon.contentDescription;

MobileIconState first = getFirstMobileState();
newState.signalSpacerVisible = first != null && first.typeId != 0;
newState.signalSpacerVisible = first != null && (first.typeId != 0 || first.volteId != 0);

updateWifiIconWithState(newState);
mWifiIconState = newState;
}

private void updateShowWifiSignalSpacer(WifiIconState state) {
MobileIconState first = getFirstMobileState();
state.signalSpacerVisible = first != null && first.typeId != 0;
state.signalSpacerVisible = first != null && (first.typeId != 0 || first.volteId != 0);
}

private void updateWifiIconWithState(WifiIconState state) {
Expand All @@ -177,7 +177,7 @@ private void updateWifiIconWithState(WifiIconState state) {

@Override
public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
int qsType, boolean activityIn, boolean activityOut,
int qsType, boolean activityIn, boolean activityOut, int volteIcon,
CharSequence typeContentDescription,
CharSequence typeContentDescriptionHtml, CharSequence description,
boolean isWide, int subId, boolean roaming) {
Expand All @@ -186,8 +186,9 @@ public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int
return;
}

// Visibility of the data type indicator changed
boolean typeChanged = statusType != state.typeId && (statusType == 0 || state.typeId == 0);
// Visibility of the data type indicator changed or volteIcon changed
boolean typeChanged = (statusType != state.typeId && (statusType == 0 || state.typeId == 0))
|| (volteIcon != state.volteId && (volteIcon == 0 || state.volteId == 0));

state.visible = statusIcon.visible && !mBlockMobile;
state.strengthId = statusIcon.icon;
Expand All @@ -197,6 +198,7 @@ public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int
state.roaming = roaming;
state.activityIn = activityIn && mActivityEnabled;
state.activityOut = activityOut && mActivityEnabled;
state.volteId = volteIcon;

// Always send a copy to maintain value type semantics
mIconController.setMobileIcons(mSlotMobile, MobileIconState.copyStates(mMobileStates));
Expand Down Expand Up @@ -390,6 +392,7 @@ public static class MobileIconState extends SignalIconState {
public boolean roaming;
public boolean needsLeadingPadding;
public CharSequence typeContentDescription;
public int volteId;

private MobileIconState(int subId) {
super();
Expand All @@ -410,7 +413,8 @@ public boolean equals(Object o) {
typeId == that.typeId &&
roaming == that.roaming &&
needsLeadingPadding == that.needsLeadingPadding &&
Objects.equals(typeContentDescription, that.typeContentDescription);
Objects.equals(typeContentDescription, that.typeContentDescription) &&
volteId == that.volteId;
}

@Override
Expand All @@ -435,6 +439,7 @@ public void copyTo(MobileIconState other) {
other.roaming = roaming;
other.needsLeadingPadding = needsLeadingPadding;
other.typeContentDescription = typeContentDescription;
other.volteId = volteId;
}

private static List<MobileIconState> copyStates(List<MobileIconState> inStates) {
Expand All @@ -450,7 +455,8 @@ private static List<MobileIconState> copyStates(List<MobileIconState> inStates)

@Override public String toString() {
return "MobileIconState(subId=" + subId + ", strengthId=" + strengthId + ", roaming="
+ roaming + ", typeId=" + typeId + ", visible=" + visible + ")";
+ roaming + ", typeId=" + typeId + ", volteId=" + volteId
+ ", visible=" + visible + ")";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ public void setWifiIndicators(final boolean enabled, final IconState statusIcon,
@Override
public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon,
final int statusType, final int qsType, final boolean activityIn,
final boolean activityOut, final CharSequence typeContentDescription,
final boolean activityOut, final int volteIcon,
final CharSequence typeContentDescription,
CharSequence typeContentDescriptionHtml, final CharSequence description,
final boolean isWide, final int subId, boolean roaming) {
post(() -> {
for (SignalCallback signalCluster : mSignalCallbacks) {
signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType,
activityIn, activityOut, typeContentDescription,
activityIn, activityOut, volteIcon, typeContentDescription,
typeContentDescriptionHtml, description, isWide, subId, roaming);
}
});
Expand Down
Loading