apps/phone: CDMA voicemail support
David Krause [Tue, 2 Jun 2009 09:13:01 +0000 (04:13 -0500)]
Depends on change 76, which includes the necessary framework support

res/values/strings.xml
src/com/android/phone/NotificationMgr.java
src/com/android/phone/PhoneInterfaceManager.java

index 2edfb84..c57c9f9 100755 (executable)
     <string name="notification_on_hold">On hold</string>
     <!-- Label for the "Voicemail" notification item, when expanded. -->
     <string name="notification_voicemail_title">New voicemail</string>
+    <!-- Label for the expanded "Voicemail" notification item,
+         including a count of messages. -->
+    <string name="notification_voicemail_title_count">New voicemail (<xliff:g id="count">%d</xliff:g>)</string>
     <!-- Message displayed in the "Voicemail" notification item, allowing the user
          to dial the indicated number. -->
     <string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
index b96e71c..9be35db 100644 (file)
@@ -800,6 +800,13 @@ public class NotificationMgr implements CallerInfoAsyncQuery.OnQueryCompleteList
                 }
             }
 
+            if (mPhone.getPhoneName().equals("CDMA")) {
+                String finalTitle;
+                int vmCount = mPhone.getVoiceMessageCount();
+                String titleFormat = mContext.getString(R.string.notification_voicemail_title_count);
+                notificationTitle = String.format(titleFormat, vmCount);
+            }
+
             String notificationText;
             if (TextUtils.isEmpty(vmNumber)) {
                 notificationText = mContext.getString(
index 176afcb..a034628 100644 (file)
@@ -647,13 +647,12 @@ public class PhoneInterfaceManager extends ITelephony.Stub {
     public String getCdmaEriText() {
         return mPhone.getCdmaEriText();
     }
-    
+
     /**
      * Returns the unread count of voicemails
      */
-   public int getCountVoiceMessages() {
-       // TODO(Moto): implement
-       return 0;
-   }
+    public int getVoiceMessageCount() {
+        return mPhone.getVoiceMessageCount();
+    }
 
 }