Merge "MediaRouter2: s/transferrable/transferable/g"
diff --git a/api/current.txt b/api/current.txt
index 8394416..3b34995 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -27044,7 +27044,7 @@
method @NonNull public String getId();
method @NonNull public java.util.List<android.media.MediaRoute2Info> getSelectableRoutes();
method @NonNull public java.util.List<android.media.MediaRoute2Info> getSelectedRoutes();
- method @NonNull public java.util.List<android.media.MediaRoute2Info> getTransferrableRoutes();
+ method @NonNull public java.util.List<android.media.MediaRoute2Info> getTransferableRoutes();
method public int getVolume();
method public int getVolumeHandling();
method public int getVolumeMax();
@@ -27445,7 +27445,7 @@
method @NonNull public String getId();
method @NonNull public java.util.List<java.lang.String> getSelectableRoutes();
method @NonNull public java.util.List<java.lang.String> getSelectedRoutes();
- method @NonNull public java.util.List<java.lang.String> getTransferrableRoutes();
+ method @NonNull public java.util.List<java.lang.String> getTransferableRoutes();
method public int getVolume();
method public int getVolumeHandling();
method public int getVolumeMax();
@@ -27459,16 +27459,16 @@
method @NonNull public android.media.RoutingSessionInfo.Builder addDeselectableRoute(@NonNull String);
method @NonNull public android.media.RoutingSessionInfo.Builder addSelectableRoute(@NonNull String);
method @NonNull public android.media.RoutingSessionInfo.Builder addSelectedRoute(@NonNull String);
- method @NonNull public android.media.RoutingSessionInfo.Builder addTransferrableRoute(@NonNull String);
+ method @NonNull public android.media.RoutingSessionInfo.Builder addTransferableRoute(@NonNull String);
method @NonNull public android.media.RoutingSessionInfo build();
method @NonNull public android.media.RoutingSessionInfo.Builder clearDeselectableRoutes();
method @NonNull public android.media.RoutingSessionInfo.Builder clearSelectableRoutes();
method @NonNull public android.media.RoutingSessionInfo.Builder clearSelectedRoutes();
- method @NonNull public android.media.RoutingSessionInfo.Builder clearTransferrableRoutes();
+ method @NonNull public android.media.RoutingSessionInfo.Builder clearTransferableRoutes();
method @NonNull public android.media.RoutingSessionInfo.Builder removeDeselectableRoute(@NonNull String);
method @NonNull public android.media.RoutingSessionInfo.Builder removeSelectableRoute(@NonNull String);
method @NonNull public android.media.RoutingSessionInfo.Builder removeSelectedRoute(@NonNull String);
- method @NonNull public android.media.RoutingSessionInfo.Builder removeTransferrableRoute(@NonNull String);
+ method @NonNull public android.media.RoutingSessionInfo.Builder removeTransferableRoute(@NonNull String);
method @NonNull public android.media.RoutingSessionInfo.Builder setControlHints(@Nullable android.os.Bundle);
method @NonNull public android.media.RoutingSessionInfo.Builder setVolume(int);
method @NonNull public android.media.RoutingSessionInfo.Builder setVolumeHandling(int);
diff --git a/media/java/android/media/MediaRouter2.java b/media/java/android/media/MediaRouter2.java
index 0e6ade5..2178393 100644
--- a/media/java/android/media/MediaRouter2.java
+++ b/media/java/android/media/MediaRouter2.java
@@ -875,12 +875,12 @@
}
/**
- * @return the unmodifiable list of transferrable routes for the session.
+ * @return the unmodifiable list of transferable routes for the session.
*/
@NonNull
- public List<MediaRoute2Info> getTransferrableRoutes() {
+ public List<MediaRoute2Info> getTransferableRoutes() {
synchronized (mControllerLock) {
- return getRoutesWithIdsLocked(mSessionInfo.getTransferrableRoutes());
+ return getRoutesWithIdsLocked(mSessionInfo.getTransferableRoutes());
}
}
@@ -1033,12 +1033,12 @@
* all of the following conditions:
* <ul>
* <li>ID should not be included in {@link #getSelectedRoutes()}</li>
- * <li>ID should be included in {@link #getTransferrableRoutes()}</li>
+ * <li>ID should be included in {@link #getTransferableRoutes()}</li>
* </ul>
* If the route doesn't meet any of above conditions, it will be ignored.
*
* @see #getSelectedRoutes()
- * @see #getTransferrableRoutes()
+ * @see #getTransferableRoutes()
* @see RoutingControllerCallback#onControllerUpdated
*/
public void transferToRoute(@NonNull MediaRoute2Info route) {
@@ -1057,9 +1057,9 @@
return;
}
- List<MediaRoute2Info> transferrableRoutes = getTransferrableRoutes();
- if (!checkRouteListContainsRouteId(transferrableRoutes, route.getId())) {
- Log.w(TAG, "Ignoring transferring to a non-transferrable route=" + route);
+ List<MediaRoute2Info> transferableRoutes = getTransferableRoutes();
+ if (!checkRouteListContainsRouteId(transferableRoutes, route.getId())) {
+ Log.w(TAG, "Ignoring transferring to a non-transferable route=" + route);
return;
}
@@ -1156,7 +1156,7 @@
.map(MediaRoute2Info::getId).collect(Collectors.toList());
List<String> deselectableRoutes = getDeselectableRoutes().stream()
.map(MediaRoute2Info::getId).collect(Collectors.toList());
- List<String> transferrableRoutes = getTransferrableRoutes().stream()
+ List<String> transferableRoutes = getTransferableRoutes().stream()
.map(MediaRoute2Info::getId).collect(Collectors.toList());
StringBuilder result = new StringBuilder()
@@ -1171,8 +1171,8 @@
.append(", deselectableRoutes={")
.append(deselectableRoutes)
.append("}")
- .append(", transferrableRoutes={")
- .append(transferrableRoutes)
+ .append(", transferableRoutes={")
+ .append(transferableRoutes)
.append("}")
.append(" }");
return result.toString();
diff --git a/media/java/android/media/MediaRouter2Manager.java b/media/java/android/media/MediaRouter2Manager.java
index 5ce291c..4801d44 100644
--- a/media/java/android/media/MediaRouter2Manager.java
+++ b/media/java/android/media/MediaRouter2Manager.java
@@ -259,7 +259,7 @@
/**
* Selects media route for the specified package name.
*
- * If the given route is {@link RoutingController#getTransferrableRoutes() a transferrable
+ * If the given route is {@link RoutingController#getTransferableRoutes() a transferable
* route} of a routing session of the application, the session will be transferred to
* the route. If not, a new routing session will be created.
*
@@ -274,7 +274,7 @@
//TODO: instead of release all controllers, add an API to specify controllers that
// should be released (or is the system controller).
for (RoutingSessionInfo sessionInfo : getRoutingSessions(packageName)) {
- if (!transferred && sessionInfo.getTransferrableRoutes().contains(route.getId())) {
+ if (!transferred && sessionInfo.getTransferableRoutes().contains(route.getId())) {
new RoutingController(sessionInfo).transferToRoute(route);
transferred = true;
} else if (!sessionInfo.isSystemSession()) {
@@ -543,13 +543,13 @@
}
/**
- * @return the unmodifiable list of transferrable routes for the session.
+ * @return the unmodifiable list of transferable routes for the session.
*/
@NonNull
- public List<MediaRoute2Info> getTransferrableRoutes() {
+ public List<MediaRoute2Info> getTransferableRoutes() {
List<String> routeIds;
synchronized (mControllerLock) {
- routeIds = mSessionInfo.getTransferrableRoutes();
+ routeIds = mSessionInfo.getTransferableRoutes();
}
return getRoutesWithIds(routeIds);
}
@@ -643,12 +643,12 @@
* all of the following conditions:
* <ul>
* <li>ID should not be included in {@link #getSelectedRoutes()}</li>
- * <li>ID should be included in {@link #getTransferrableRoutes()}</li>
+ * <li>ID should be included in {@link #getTransferableRoutes()}</li>
* </ul>
* If the route doesn't meet any of above conditions, it will be ignored.
*
* @see #getSelectedRoutes()
- * @see #getTransferrableRoutes()
+ * @see #getTransferableRoutes()
*/
public void transferToRoute(@NonNull MediaRoute2Info route) {
Objects.requireNonNull(route, "route must not be null");
@@ -663,8 +663,8 @@
return;
}
- if (!sessionInfo.getTransferrableRoutes().contains(route.getId())) {
- Log.w(TAG, "Ignoring transferring to a non-transferrable route=" + route);
+ if (!sessionInfo.getTransferableRoutes().contains(route.getId())) {
+ Log.w(TAG, "Ignoring transferring to a non-transferable route=" + route);
return;
}
diff --git a/media/java/android/media/RoutingSessionInfo.java b/media/java/android/media/RoutingSessionInfo.java
index 0d4e666..19a46ce 100644
--- a/media/java/android/media/RoutingSessionInfo.java
+++ b/media/java/android/media/RoutingSessionInfo.java
@@ -55,7 +55,7 @@
final List<String> mSelectedRoutes;
final List<String> mSelectableRoutes;
final List<String> mDeselectableRoutes;
- final List<String> mTransferrableRoutes;
+ final List<String> mTransferableRoutes;
final int mVolumeHandling;
final int mVolumeMax;
@@ -79,8 +79,8 @@
convertToUniqueRouteIds(builder.mSelectableRoutes));
mDeselectableRoutes = Collections.unmodifiableList(
convertToUniqueRouteIds(builder.mDeselectableRoutes));
- mTransferrableRoutes = Collections.unmodifiableList(
- convertToUniqueRouteIds(builder.mTransferrableRoutes));
+ mTransferableRoutes = Collections.unmodifiableList(
+ convertToUniqueRouteIds(builder.mTransferableRoutes));
mVolumeHandling = builder.mVolumeHandling;
mVolumeMax = builder.mVolumeMax;
@@ -100,7 +100,7 @@
mSelectedRoutes = ensureList(src.createStringArrayList());
mSelectableRoutes = ensureList(src.createStringArrayList());
mDeselectableRoutes = ensureList(src.createStringArrayList());
- mTransferrableRoutes = ensureList(src.createStringArrayList());
+ mTransferableRoutes = ensureList(src.createStringArrayList());
mVolumeHandling = src.readInt();
mVolumeMax = src.readInt();
@@ -193,11 +193,11 @@
}
/**
- * Gets the list of ids of transferrable routes for the session.
+ * Gets the list of ids of transferable routes for the session.
*/
@NonNull
- public List<String> getTransferrableRoutes() {
- return mTransferrableRoutes;
+ public List<String> getTransferableRoutes() {
+ return mTransferableRoutes;
}
/**
@@ -260,7 +260,7 @@
dest.writeStringList(mSelectedRoutes);
dest.writeStringList(mSelectableRoutes);
dest.writeStringList(mDeselectableRoutes);
- dest.writeStringList(mTransferrableRoutes);
+ dest.writeStringList(mTransferableRoutes);
dest.writeInt(mVolumeHandling);
dest.writeInt(mVolumeMax);
dest.writeInt(mVolume);
@@ -284,7 +284,7 @@
&& Objects.equals(mSelectedRoutes, other.mSelectedRoutes)
&& Objects.equals(mSelectableRoutes, other.mSelectableRoutes)
&& Objects.equals(mDeselectableRoutes, other.mDeselectableRoutes)
- && Objects.equals(mTransferrableRoutes, other.mTransferrableRoutes)
+ && Objects.equals(mTransferableRoutes, other.mTransferableRoutes)
&& (mVolumeHandling == other.mVolumeHandling)
&& (mVolumeMax == other.mVolumeMax)
&& (mVolume == other.mVolume);
@@ -293,7 +293,7 @@
@Override
public int hashCode() {
return Objects.hash(mId, mClientPackageName, mProviderId,
- mSelectedRoutes, mSelectableRoutes, mDeselectableRoutes, mTransferrableRoutes,
+ mSelectedRoutes, mSelectableRoutes, mDeselectableRoutes, mTransferableRoutes,
mVolumeMax, mVolumeHandling, mVolume);
}
@@ -311,8 +311,8 @@
.append(", deselectableRoutes={")
.append(String.join(",", mDeselectableRoutes))
.append("}")
- .append(", transferrableRoutes={")
- .append(String.join(",", mTransferrableRoutes))
+ .append(", transferableRoutes={")
+ .append(String.join(",", mTransferableRoutes))
.append("}")
.append(", volumeHandling=").append(getVolumeHandling())
.append(", volumeMax=").append(getVolumeMax())
@@ -350,7 +350,7 @@
final List<String> mSelectedRoutes;
final List<String> mSelectableRoutes;
final List<String> mDeselectableRoutes;
- final List<String> mTransferrableRoutes;
+ final List<String> mTransferableRoutes;
int mVolumeHandling = MediaRoute2Info.PLAYBACK_VOLUME_FIXED;
int mVolumeMax;
int mVolume;
@@ -381,7 +381,7 @@
mSelectedRoutes = new ArrayList<>();
mSelectableRoutes = new ArrayList<>();
mDeselectableRoutes = new ArrayList<>();
- mTransferrableRoutes = new ArrayList<>();
+ mTransferableRoutes = new ArrayList<>();
}
/**
@@ -400,7 +400,7 @@
mSelectedRoutes = new ArrayList<>(sessionInfo.mSelectedRoutes);
mSelectableRoutes = new ArrayList<>(sessionInfo.mSelectableRoutes);
mDeselectableRoutes = new ArrayList<>(sessionInfo.mDeselectableRoutes);
- mTransferrableRoutes = new ArrayList<>(sessionInfo.mTransferrableRoutes);
+ mTransferableRoutes = new ArrayList<>(sessionInfo.mTransferableRoutes);
mVolumeHandling = sessionInfo.mVolumeHandling;
mVolumeMax = sessionInfo.mVolumeMax;
@@ -524,35 +524,35 @@
}
/**
- * Clears the transferrable routes.
+ * Clears the transferable routes.
*/
@NonNull
- public Builder clearTransferrableRoutes() {
- mTransferrableRoutes.clear();
+ public Builder clearTransferableRoutes() {
+ mTransferableRoutes.clear();
return this;
}
/**
- * Adds a route to the transferrable routes. The {@code routeId} must not be empty.
+ * Adds a route to the transferable routes. The {@code routeId} must not be empty.
*/
@NonNull
- public Builder addTransferrableRoute(@NonNull String routeId) {
+ public Builder addTransferableRoute(@NonNull String routeId) {
if (TextUtils.isEmpty(routeId)) {
throw new IllegalArgumentException("routeId must not be empty");
}
- mTransferrableRoutes.add(routeId);
+ mTransferableRoutes.add(routeId);
return this;
}
/**
- * Removes a route from the transferrable routes. The {@code routeId} must not be empty.
+ * Removes a route from the transferable routes. The {@code routeId} must not be empty.
*/
@NonNull
- public Builder removeTransferrableRoute(@NonNull String routeId) {
+ public Builder removeTransferableRoute(@NonNull String routeId) {
if (TextUtils.isEmpty(routeId)) {
throw new IllegalArgumentException("routeId must not be empty");
}
- mTransferrableRoutes.remove(routeId);
+ mTransferableRoutes.remove(routeId);
return this;
}
diff --git a/media/tests/MediaRouter/src/com/android/mediaroutertest/SampleMediaRoute2ProviderService.java b/media/tests/MediaRouter/src/com/android/mediaroutertest/SampleMediaRoute2ProviderService.java
index 267927f..f1dcf3d 100644
--- a/media/tests/MediaRouter/src/com/android/mediaroutertest/SampleMediaRoute2ProviderService.java
+++ b/media/tests/MediaRouter/src/com/android/mediaroutertest/SampleMediaRoute2ProviderService.java
@@ -191,7 +191,7 @@
RoutingSessionInfo sessionInfo = new RoutingSessionInfo.Builder(sessionId, packageName)
.addSelectedRoute(routeId)
.addSelectableRoute(ROUTE_ID4_TO_SELECT_AND_DESELECT)
- .addTransferrableRoute(ROUTE_ID5_TO_TRANSFER_TO)
+ .addTransferableRoute(ROUTE_ID5_TO_TRANSFER_TO)
.setVolumeHandling(PLAYBACK_VOLUME_VARIABLE)
.setVolumeMax(SESSION_VOLUME_MAX)
.setVolume(SESSION_VOLUME_INITIAL)
@@ -300,7 +300,7 @@
.clearSelectedRoutes()
.addSelectedRoute(routeId)
.removeDeselectableRoute(routeId)
- .removeTransferrableRoute(routeId)
+ .removeTransferableRoute(routeId)
.build();
notifySessionUpdated(newSessionInfo);
publishRoutes();
diff --git a/services/core/java/com/android/server/media/SystemMediaRoute2Provider.java b/services/core/java/com/android/server/media/SystemMediaRoute2Provider.java
index 18383c4..ae11c70 100644
--- a/services/core/java/com/android/server/media/SystemMediaRoute2Provider.java
+++ b/services/core/java/com/android/server/media/SystemMediaRoute2Provider.java
@@ -257,12 +257,12 @@
builder.addSelectedRoute(mSelectedRouteId);
if (!TextUtils.isEmpty(activeBtDeviceAddress)) {
- builder.addTransferrableRoute(mDefaultRoute.getId());
+ builder.addTransferableRoute(mDefaultRoute.getId());
}
for (MediaRoute2Info route : mBluetoothRoutes) {
if (!TextUtils.equals(mSelectedRouteId, route.getId())) {
- builder.addTransferrableRoute(route.getId());
+ builder.addTransferableRoute(route.getId());
}
}