Telecom API updates (1/6)

Bug: 18292176

Change-Id: I060366234a5a60510c385dc837f2b7e79596eaf5
diff --git a/telecomm/java/android/telecom/AudioState.java b/telecomm/java/android/telecom/AudioState.java
index f78ce29..bd63e00 100644
--- a/telecomm/java/android/telecom/AudioState.java
+++ b/telecomm/java/android/telecom/AudioState.java
@@ -54,25 +54,25 @@
     public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET |
             ROUTE_SPEAKER;
 
-    /** True if the call is muted, false otherwise. */
-    public final boolean isMuted;
+    /** @hide */
+    @Deprecated public final boolean isMuted;
 
-    /** The current audio route being used. */
-    public final int route;
+    /** @hide */
+    @Deprecated public final int route;
 
-    /** Bit mask of all routes supported by this call. */
-    public final int supportedRouteMask;
+    /** @hide */
+    @Deprecated public final int supportedRouteMask;
 
-    public AudioState(boolean isMuted, int route, int supportedRouteMask) {
-        this.isMuted = isMuted;
+    public AudioState(boolean muted, int route, int supportedRouteMask) {
+        this.isMuted = muted;
         this.route = route;
         this.supportedRouteMask = supportedRouteMask;
     }
 
     public AudioState(AudioState state) {
-        isMuted = state.isMuted;
-        route = state.route;
-        supportedRouteMask = state.supportedRouteMask;
+        isMuted = state.isMuted();
+        route = state.getRoute();
+        supportedRouteMask = state.getSupportedRouteMask();
     }
 
     @Override
@@ -84,15 +84,17 @@
             return false;
         }
         AudioState state = (AudioState) obj;
-        return isMuted == state.isMuted && route == state.route &&
-                supportedRouteMask == state.supportedRouteMask;
+        return isMuted() == state.isMuted() && getRoute() == state.getRoute() &&
+                getSupportedRouteMask() == state.getSupportedRouteMask();
     }
 
     @Override
     public String toString() {
         return String.format(Locale.US,
                 "[AudioState isMuted: %b, route; %s, supportedRouteMask: %s]",
-                isMuted, audioRouteToString(route), audioRouteToString(supportedRouteMask));
+                isMuted,
+                audioRouteToString(route),
+                audioRouteToString(supportedRouteMask));
     }
 
     /** @hide */
@@ -162,4 +164,25 @@
         destination.writeInt(route);
         destination.writeInt(supportedRouteMask);
     }
+
+    /**
+     * @return {@code true} if the call is muted, false otherwise.
+     */
+    public boolean isMuted() {
+        return isMuted;
+    }
+
+    /**
+     * @return The current audio route being used.
+     */
+    public int getRoute() {
+        return route;
+    }
+
+    /**
+     * @return Bit mask of all routes supported by this call.
+     */
+    public int getSupportedRouteMask() {
+        return supportedRouteMask;
+    }
 }