Show work missed call notification for sim call from work contacts
BUG=26082618
Change-Id: I7a4c74aecbc62b0e9c93abe29e0d551bb30ff982
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cdae003..89778b9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -30,6 +30,8 @@
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
+ <!-- Missed work call notification label, used when there's exactly one missed call [CHAR LIMIT=NONE] -->
+ <string name="notification_missedWorkCallTitle">Missed work call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 5971f7b..819ee02 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -1634,7 +1634,7 @@
Trace.endSection();
}
- CallerInfo getCallerInfo() {
+ public CallerInfo getCallerInfo() {
return mCallerInfo;
}
diff --git a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
index b650400..0188050 100644
--- a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
+++ b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
@@ -58,6 +58,8 @@
import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
+import com.android.internal.telephony.CallerInfo;
+
import java.lang.Override;
import java.lang.String;
import java.util.Locale;
@@ -224,8 +226,14 @@
// 1 missed call: <caller name || handle>
// More than 1 missed call: <number of calls> + "missed calls"
if (mMissedCallCount == 1) {
- titleResId = R.string.notification_missedCallTitle;
expandedText = getNameForCall(call);
+
+ CallerInfo ci = call.getCallerInfo();
+ if (ci != null && ci.userType == CallerInfo.USER_TYPE_WORK) {
+ titleResId = R.string.notification_missedWorkCallTitle;
+ } else {
+ titleResId = R.string.notification_missedCallTitle;
+ }
} else {
titleResId = R.string.notification_missedCallsTitle;
expandedText =