Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4404f4a2 authored by Benergy Meenan Ravuri's avatar Benergy Meenan Ravuri Committed by Linux Build Service Account
Browse files

IMS: Show VoWIFI icon based on IMS capabilities.

Extend the below APIs which will get the feature
values per subscription.
isWifCallingEnabled and isVTWifiCallingEnabled.

These APIs are used to show VoWIFI icon
based on IMS capabilities.

Change-Id: Ie997670682f926f9ba0f6f2589f0df502c88bece
CRs-Fixed: 998552
parent f2370e00
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
<!--
 Copyright (c) 2016, 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 android:height="12dp" android:viewportHeight="183.0"
    android:viewportWidth="649.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#FFFFFF" android:pathData="M86.1,132.6L122,13.4h36.4l-55.2,158.5h-34.1l-55,-158.5h36.3L86.1,132.6z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M161.3,111.9c0,-8.6 1.2,-16.5 3.7,-23.8s6.1,-13.7 10.8,-19c4.7,-5.3 10.5,-9.5 17.5,-12.6c6.9,-3 14.8,-4.6 23.7,-4.6c8.9,0 16.9,1.5 23.8,4.6s12.8,7.2 17.6,12.6c4.8,5.3 8.4,11.7 10.8,19c2.5,7.3 3.7,15.3 3.7,23.8v2.3c0,8.6 -1.2,16.6 -3.7,23.9s-6.1,13.6 -10.8,18.9c-4.8,5.3 -10.6,9.5 -17.5,12.5s-14.8,4.5 -23.7,4.5c-8.9,0 -16.9,-1.5 -23.8,-4.5s-12.8,-7.2 -17.5,-12.5c-4.8,-5.3 -8.4,-11.6 -10.8,-18.9c-2.5,-7.3 -3.7,-15.3 -3.7,-23.9v-2.3L161.3,111.9zM192.8,114.2c0,4.8 0.4,9.3 1.3,13.5s2.3,7.9 4.2,10.9c1.9,3.1 4.4,5.5 7.5,7.3s6.9,2.7 11.4,2.7c4.4,0 8.1,-0.9 11.2,-2.7s5.6,-4.3 7.6,-7.3c2,-3.1 3.4,-6.7 4.2,-10.9c0.9,-4.2 1.3,-8.7 1.3,-13.5v-2.3c0,-4.6 -0.4,-9.1 -1.3,-13.2c-0.9,-4.2 -2.3,-7.8 -4.2,-11c-2,-3.2 -4.5,-5.7 -7.6,-7.5c-3.1,-1.9 -6.9,-2.8 -11.3,-2.8s-8.1,0.9 -11.2,2.8c-3.1,1.8 -5.6,4.4 -7.5,7.5c-1.9,3.2 -3.3,6.8 -4.2,11c-0.9,4.2 -1.3,8.6 -1.3,13.2v2.3L192.8,114.2z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M327,145.6h69.3v26.2L294.4,171.8L294.4,13.4h32.7v132.2L327,145.6z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M512,39.8h-48.5v132h-32.7v-132h-47.9v-26.5L512,13.3L512,39.8z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M626,103.2h-62.7v42.5h73.6v26.2L530.7,171.9L530.7,13.4h106v26.5h-73.4v37.8L626,77.7L626,103.2z"/>
</vector>
+37 −0
Original line number Diff line number Diff line
<!--
 Copyright (c) 2016, 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 android:height="12dp" android:viewportHeight="183.0"
    android:viewportWidth="713.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#FFFFFF" android:pathData="M84.5,132.3l35.9,-119.2h36.4l-55.2,158.5h-34.1l-55,-158.5h36.3L84.5,132.3z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M159.7,111.6c0,-8.6 1.2,-16.5 3.7,-23.8s6.1,-13.7 10.8,-19c4.7,-5.3 10.5,-9.5 17.5,-12.6c6.9,-3 14.8,-4.6 23.7,-4.6c8.9,0 16.9,1.5 23.8,4.6s12.8,7.2 17.6,12.6c4.8,5.3 8.4,11.7 10.8,19c2.5,7.3 3.7,15.3 3.7,23.8v2.3c0,8.6 -1.2,16.6 -3.7,23.9s-6.1,13.6 -10.8,18.9c-4.8,5.3 -10.6,9.5 -17.5,12.5s-14.8,4.5 -23.7,4.5c-8.9,0 -16.9,-1.5 -23.8,-4.5s-12.8,-7.2 -17.5,-12.5c-4.8,-5.3 -8.4,-11.6 -10.8,-18.9c-2.5,-7.3 -3.7,-15.3 -3.7,-23.9v-2.3L159.7,111.6zM191.2,113.9c0,4.8 0.4,9.3 1.3,13.5s2.3,7.9 4.2,10.9c1.9,3.1 4.4,5.5 7.5,7.3s6.9,2.7 11.4,2.7c4.4,0 8.1,-0.9 11.2,-2.7s5.6,-4.3 7.6,-7.3c2,-3.1 3.4,-6.7 4.2,-10.9c0.9,-4.2 1.3,-8.7 1.3,-13.5v-2.3c0,-4.6 -0.4,-9.1 -1.3,-13.2c-0.9,-4.2 -2.3,-7.8 -4.2,-11c-2,-3.2 -4.5,-5.7 -7.6,-7.5c-3.1,-1.9 -6.9,-2.8 -11.3,-2.8s-8.1,0.9 -11.2,2.8c-3.1,1.8 -5.6,4.4 -7.5,7.5c-1.9,3.2 -3.3,6.8 -4.2,11c-0.9,4.2 -1.3,8.6 -1.3,13.2v2.3L191.2,113.9z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M416.2,125.9l21.3,-112.8L470,13.1l-35.2,158.5h-32.9l-25.8,-106l-25.8,106h-32.9l-35.2,-158.5h32.5l21.4,112.5l26.1,-112.5h27.6L416.2,125.9z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M485.4,23.3c0,-4.7 1.6,-8.6 4.7,-11.6c3.2,-3 7.5,-4.6 12.9,-4.6c2.7,0 5.1,0.4 7.3,1.2c2.2,0.8 4,1.9 5.6,3.4c1.5,1.5 2.7,3.2 3.5,5.2s1.3,4.2 1.3,6.5c0,2.4 -0.4,4.6 -1.3,6.6c-0.8,2 -2,3.7 -3.5,5.2s-3.4,2.6 -5.6,3.4c-2.2,0.8 -4.6,1.2 -7.3,1.2s-5.1,-0.4 -7.3,-1.2c-2.2,-0.8 -4,-1.9 -5.6,-3.4c-1.5,-1.5 -2.7,-3.2 -3.5,-5.2C485.8,27.9 485.4,25.7 485.4,23.3zM518.8,171.6h-31.6L487.2,53.8h31.6L518.8,171.6z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M642.2,106.8h-62.7v64.8h-32.7L546.8,13.1L650,13.1v26.5h-70.5v40.9h62.7L642.2,106.8z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M666.6,23.3c0,-4.7 1.6,-8.6 4.7,-11.6c3.2,-3 7.5,-4.6 12.9,-4.6c2.7,0 5.1,0.4 7.3,1.2c2.2,0.8 4,1.9 5.6,3.4c1.5,1.5 2.7,3.2 3.5,5.2s1.3,4.2 1.3,6.5c0,2.4 -0.4,4.6 -1.3,6.6c-0.8,2 -2,3.7 -3.5,5.2s-3.4,2.6 -5.6,3.4c-2.2,0.8 -4.6,1.2 -7.3,1.2s-5.1,-0.4 -7.3,-1.2c-2.2,-0.8 -4,-1.9 -5.6,-3.4c-1.5,-1.5 -2.7,-3.2 -3.5,-5.2C667.1,27.9 666.6,25.7 666.6,23.3zM700.1,171.6h-31.6L668.5,53.8h31.6L700.1,171.6z"/>
</vector>
+9 −0
Original line number Diff line number Diff line
@@ -44,6 +44,15 @@
        android:layout_marginEnd="5dp"
        android:visibility="gone"
        />
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="2dp"
        android:layout_gravity="start|bottom"
        android:layout_marginEnd="2dp"
        android:id="@+id/volte_vowifi"
        android:visibility="gone"
        />
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
+8 −0
Original line number Diff line number Diff line
@@ -52,6 +52,14 @@
            android:alpha="0.0"
            />
    </FrameLayout>
     <ImageView android:id="@+id/ims_over_wifi"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_marginLeft="2dp"
        android:layout_gravity="start|bottom"
        android:layout_marginRight="2dp"
        android:src="@drawable/vowifi"
        />
    <FrameLayout
        android:id="@+id/wifi_combo"
        android:layout_height="wrap_content"
+36 −4
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.graphics.drawable.Animatable;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.ArraySet;
import android.util.AttributeSet;
import android.util.Log;
@@ -71,6 +73,7 @@ public class SignalClusterView
    private int mEthernetIconId = 0;
    private int mLastEthernetIconId = -1;
    private boolean mWifiVisible = false;
    private boolean mImsOverWifi = false;
    private int mWifiStrengthId = 0, mWifiActivityId = 0;
    private int mLastWifiStrengthId = -1, mLastWifiActivityId = -1;
    private boolean mIsAirplaneMode = false;
@@ -87,7 +90,8 @@ public class SignalClusterView

    ViewGroup mEthernetGroup, mWifiGroup;
    View mNoSimsCombo;
    ImageView mVpn, mEthernet, mWifi, mAirplane, mNoSims, mEthernetDark, mWifiDark, mNoSimsDark;
    ImageView mVpn, mEthernet, mWifi, mAirplane,
                mNoSims, mEthernetDark, mWifiDark, mNoSimsDark, mImsOverWifiImageView;
    ImageView mWifiActivity;
    View mWifiAirplaneSpacer;
    View mWifiSignalSpacer;
@@ -183,6 +187,7 @@ public class SignalClusterView
        mAirplane       = (ImageView) findViewById(R.id.airplane);
        mNoSims         = (ImageView) findViewById(R.id.no_sims);
        mNoSimsDark     = (ImageView) findViewById(R.id.no_sims_dark);
        mImsOverWifiImageView    = (ImageView) findViewById(R.id.ims_over_wifi);
        mNoSimsCombo    =             findViewById(R.id.no_sims_combo);
        mWifiAirplaneSpacer =         findViewById(R.id.wifi_airplane_spacer);
        mWifiSignalSpacer =           findViewById(R.id.wifi_signal_spacer);
@@ -236,6 +241,7 @@ public class SignalClusterView
        mWifi           = null;
        mWifiActivity   = null;
        mAirplane       = null;
        mImsOverWifiImageView    = null;
        mMobileSignalGroup.removeAllViews();
        TunerService.get(mContext).removeTunable(this);
        mSC.removeCallback(this);
@@ -303,13 +309,15 @@ public class SignalClusterView
            int qsType, boolean activityIn, boolean activityOut, int dataActivityId,
            int mobileActivityId, int stackedDataId, int stackedVoiceId,
            String typeContentDescription, String description, boolean isWide, int subId,
            int dataNetworkTypeInRoamingId, int embmsIconId) {
            int dataNetworkTypeInRoamingId, int embmsIconId, int imsIconId, boolean isImsOverWifi) {
        PhoneState state = getState(subId);
        if (state == null) {
            return;
        }
        state.mDataNetworkTypeInRoamingId = dataNetworkTypeInRoamingId;
        state.mMobileEmbmsId = embmsIconId;
        state.mMobileImsId = imsIconId;
        mImsOverWifi = isImsOverWifi;
        this.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType, activityIn,
                activityOut, dataActivityId, mobileActivityId, stackedDataId,
                stackedVoiceId, typeContentDescription, description, isWide, subId);
@@ -324,6 +332,17 @@ public class SignalClusterView
        apply();
    }

    private boolean getImsOverWifiStatus(int subId) {
        TelephonyManager tm =
                (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
        if (tm != null
                && (tm.isVoWifiCallingAvailableForSubscriber(subId)
                || tm.isVideoTelephonyWifiCallingAvailableForSubscriber(subId))) {
            return true;
        }
        return false;
    }

    @Override
    public void setNoSims(boolean show) {
        mNoSimsVisible = show && !mBlockMobile;
@@ -349,9 +368,12 @@ public class SignalClusterView
            mMobileSignalGroup.removeAllViews();
        }
        final int n = subs.size();
        boolean imsOverWiFi = false;
        for (int i = 0; i < n; i++) {
            inflatePhoneState(subs.get(i).getSubscriptionId());
            imsOverWiFi |= getImsOverWifiStatus(subs.get(i).getSubscriptionId());
        }
        mImsOverWifi = imsOverWiFi;
        if (isAttachedToWindow()) {
            applyIconTint();
        }
@@ -572,6 +594,12 @@ public class SignalClusterView
            mAirplane.setVisibility(View.GONE);
        }

        if (mImsOverWifi){
            mImsOverWifiImageView.setVisibility(View.VISIBLE);
        } else {
            mImsOverWifiImageView.setVisibility(View.GONE);
        }

        if (mIsAirplaneMode && mWifiVisible) {
            mWifiAirplaneSpacer.setVisibility(View.VISIBLE);
        } else {
@@ -661,10 +689,10 @@ public class SignalClusterView

        private ViewGroup mMobileGroup;
        private ImageView mMobile, mMobileDark, mMobileType, mRoaming, mDataNetworkTypeInRoaming,
                mMobileEmbms;
                mMobileEmbms, mMobileIms;

        private int mDataActivityId = 0, mMobileActivityId = 0, mDataNetworkTypeInRoamingId =0,
                mMobileEmbmsId = 0;
                mMobileEmbmsId = 0, mMobileImsId = 0;

        private int mStackedDataId = 0, mStackedVoiceId = 0;
        private ImageView mDataActivity, mMobileActivity, mStackedData, mStackedVoice;
@@ -683,6 +711,7 @@ public class SignalClusterView
            mMobileDark     = (ImageView) root.findViewById(R.id.mobile_signal_dark);
            mMobileType     = (ImageView) root.findViewById(R.id.mobile_type);
            mMobileActivity = (ImageView) root.findViewById(R.id.mobile_inout);
            mMobileIms      = (ImageView) root.findViewById(R.id.volte_vowifi);

            mDataNetworkTypeInRoaming = (ImageView) root
                    .findViewById(R.id.dataNetwork_type_in_roaming);
@@ -729,6 +758,7 @@ public class SignalClusterView
                mMobileEmbms.setImageResource(mMobileEmbmsId);

                mDataNetworkTypeInRoaming.setImageResource(mDataNetworkTypeInRoamingId);
                mMobileIms.setImageResource(mMobileImsId);

                if (mStackedDataId != 0 && mStackedVoiceId != 0) {
                    mStackedData.setImageResource(mStackedDataId);
@@ -768,6 +798,8 @@ public class SignalClusterView
            mDataNetworkTypeInRoaming.setVisibility(mDataNetworkTypeInRoamingId != 0 ? View.VISIBLE
                    : View.GONE);
            mMobileEmbms.setVisibility(mMobileEmbmsId != 0 ? View.VISIBLE : View.GONE);
            mMobileIms.setVisibility(mMobileImsId != 0 ? View.VISIBLE : View.GONE);

            return mMobileVisible;
        }

Loading