merge in mnc-dr-ryu-release history after reset to mnc-dr-dev
diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java
index 0f0a456..fc8977b 100644
--- a/src/com/android/server/telecom/TelecomServiceImpl.java
+++ b/src/com/android/server/telecom/TelecomServiceImpl.java
@@ -228,7 +228,7 @@
                             .getAllPhoneAccounts();
                     List<PhoneAccount> profilePhoneAccounts = new ArrayList<>(
                             allPhoneAccounts.size());
-                    for (PhoneAccount phoneAccount : profilePhoneAccounts) {
+                    for (PhoneAccount phoneAccount : allPhoneAccounts) {
                         if (isVisibleToCaller(phoneAccount)) {
                             profilePhoneAccounts.add(phoneAccount);
                         }
diff --git a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
index ba97304..b4392ae 100644
--- a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
+++ b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
@@ -204,9 +204,11 @@
                         mContext.getString(R.string.notification_missedCall_call_back),
                         createCallBackPendingIntent(handleUri));
 
-                builder.addAction(R.drawable.ic_message_24dp,
-                        mContext.getString(R.string.notification_missedCall_message),
-                        createSendSmsFromNotificationPendingIntent(handleUri));
+                if (canRespondViaSms(call)) {
+                    builder.addAction(R.drawable.ic_message_24dp,
+                            mContext.getString(R.string.notification_missedCall_message),
+                            createSendSmsFromNotificationPendingIntent(handleUri));
+                }
             }
 
             Bitmap photoIcon = call.getPhotoIcon();
@@ -366,6 +368,12 @@
         notification.defaults |= Notification.DEFAULT_LIGHTS;
     }
 
+    private boolean canRespondViaSms(Call call) {
+        // Only allow respond-via-sms for "tel:" calls.
+        return call.getHandle() != null &&
+                PhoneAccount.SCHEME_TEL.equals(call.getHandle().getScheme());
+    }
+
     /**
      * Adds the missed call notification on startup if there are unread missed calls.
      */