diff options
Diffstat (limited to 'telecomm/java/android/telecom/AudioState.java')
| -rw-r--r-- | telecomm/java/android/telecom/AudioState.java | 51 |
1 files changed, 37 insertions, 14 deletions
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 final class AudioState implements Parcelable { 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 @@ public final class AudioState implements Parcelable { 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 @@ public final class AudioState implements Parcelable { 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; + } } |
