summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-18 00:09:38 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-18 00:46:12 (GMT)
commit5f1bd903b1692898091f9d93330ee36a091b1655 (patch)
tree0822abbbfa0a5eda71b333555485fd21d6f54a68
parent4e40c7c27eca412a0aff82b0c7f699001ea63b75 (diff)
downloadandroid_packages_apps_PhoneCommon-5f1bd903b1692898091f9d93330ee36a091b1655.zip
android_packages_apps_PhoneCommon-5f1bd903b1692898091f9d93330ee36a091b1655.tar.gz
android_packages_apps_PhoneCommon-5f1bd903b1692898091f9d93330ee36a091b1655.tar.bz2
Show SIP call method in spinner and force update on resume
Change-Id: Icd22b9d20fc3a1e36aa5349830e775b696a46328 issue-id: CYNGNOS-2655
-rw-r--r--res/drawable/ic_dialer_sip_black_24dp.xml16
-rw-r--r--src-ambient/com/android/phone/common/incall/utils/CallMethodUtils.java15
2 files changed, 27 insertions, 4 deletions
diff --git a/res/drawable/ic_dialer_sip_black_24dp.xml b/res/drawable/ic_dialer_sip_black_24dp.xml
new file mode 100644
index 0000000..3bebc1e
--- /dev/null
+++ b/res/drawable/ic_dialer_sip_black_24dp.xml
@@ -0,0 +1,16 @@
+<!--
+ Icon obtained via http://google.github.io/material-design-icons/
+
+ This work is licensed under the Creative Commons Attribution 4.0 International License.
+ To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/
+ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M17,3h-1v5h1L17,3zM15,5h-2L13,4h2L15,3h-3v3h2v1h-2v1h3L15,5zM18,3v5h1L19,6h2L21,3h-3zM20,5h-1L19,4h1v1zM20,15.5c-1.25,0 -2.45,-0.2 -3.57,-0.57 -0.35,-0.11 -0.74,-0.03 -1.01,0.24l-2.2,2.2c-2.83,-1.44 -5.15,-3.75 -6.59,-6.59l2.2,-2.21c0.27,-0.26 0.35,-0.65 0.24,-1C8.7,6.45 8.5,5.25 8.5,4c0,-0.55 -0.45,-1 -1,-1L4,3c-0.55,0 -1,0.45 -1,1 0,9.39 7.61,17 17,17 0.55,0 1,-0.45 1,-1v-3.5c0,-0.55 -0.45,-1 -1,-1z"/>
+</vector>
diff --git a/src-ambient/com/android/phone/common/incall/utils/CallMethodUtils.java b/src-ambient/com/android/phone/common/incall/utils/CallMethodUtils.java
index e593cf8..dc61adf 100644
--- a/src-ambient/com/android/phone/common/incall/utils/CallMethodUtils.java
+++ b/src-ambient/com/android/phone/common/incall/utils/CallMethodUtils.java
@@ -17,6 +17,7 @@
package com.android.phone.common.incall.utils;
import android.content.Context;
+import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -128,10 +129,16 @@ public class CallMethodUtils {
getPhoneAccountColor(subMgr.getActiveSubscriptionInfo(callMethodInfo.mSubId));
callMethodInfo.mIsInCallProvider = false;
- final int simState = telephonyMgr.getSimState(callMethodInfo.mSlotId);
- if ((simState == TelephonyManager.SIM_STATE_ABSENT) ||
- (simState == TelephonyManager.SIM_STATE_UNKNOWN)) {
- return null;
+ // SIP accounts do not have SIM status and should be handled differently.
+ Uri address = phoneAccount.getAddress();
+ if (address != null && PhoneAccount.SCHEME_SIP.equals(address.getScheme())) {
+ callMethodInfo.mBrandIcon = context.getDrawable(R.drawable.ic_dialer_sip_black_24dp);
+ } else {
+ final int simState = telephonyMgr.getSimState(callMethodInfo.mSlotId);
+ if ((simState == TelephonyManager.SIM_STATE_ABSENT) ||
+ (simState == TelephonyManager.SIM_STATE_UNKNOWN)) {
+ return null;
+ }
}
return callMethodInfo;