OSDN Git Service

Add functions to update on conference changes.
authorAndrew Lee <anwlee@google.com>
Thu, 16 Oct 2014 22:39:30 +0000 (15:39 -0700)
committerAndrew Lee <anwlee@google.com>
Fri, 17 Oct 2014 17:38:02 +0000 (10:38 -0700)
+ Add onConferenceChanged() to Connection, so that the Connection can
make act on changes to the conference.
+ Add a utility function to PhoneCapabilities to remove a capability
from a PhoneCapabilities bitmask. Figure this abstracts some bit
logic away to make things more readable.

Bug: 17429707
Change-Id: I0c97731a95dd6573488cd10f094a63abe2428bce

api/current.txt
telecomm/java/android/telecom/Connection.java
telecomm/java/android/telecom/PhoneCapabilities.java

index a9bcf74..f0cb3c8 100644 (file)
@@ -28114,6 +28114,7 @@ package android.telecom {
     method public void onAbort();
     method public void onAnswer();
     method public void onAudioStateChanged(android.telecom.AudioState);
+    method public void onConferenceChanged();
     method public void onDisconnect();
     method public void onHold();
     method public void onPlayDtmfTone(char);
index 51f193f..44fa157 100644 (file)
@@ -911,6 +911,7 @@ public abstract class Connection {
             mConference = conference;
             if (mConnectionService != null && mConnectionService.containsConference(conference)) {
                 fireConferenceChanged();
+                onConferenceChanged();
             }
             return true;
         }
@@ -1009,6 +1010,11 @@ public abstract class Connection {
      */
     public void onPostDialContinue(boolean proceed) {}
 
+    /**
+     * Notifies this Connection that the conference which is set on it has changed.
+     */
+    public void onConferenceChanged() {}
+
     static String toLogSafePhoneNumber(String number) {
         // For unknown number, log empty string.
         if (number == null) {
index c7d9014..9c67503 100644 (file)
@@ -103,6 +103,17 @@ public final class PhoneCapabilities {
         return (capabilities & capability) != 0;
     }
 
+    /**
+     * Removes the specified capability from the set of capabilities and returns the new set.
+     * @param capabilities The set of capabilities.
+     * @param capability The capability to remove from the set.
+     * @return The set of capabilities, with the capability removed.
+     * @hide
+     */
+    public static int remove(int capabilities, int capability) {
+        return capabilities & ~capability;
+    }
+
     public static String toString(int capabilities) {
         StringBuilder builder = new StringBuilder();
         builder.append("[Capabilities:");