Commit 7af9f020 by bachinger Committed by Marc Baechinger

Add a constant for the legacy controller version

PiperOrigin-RevId: 451857459
parent 581c6b54
......@@ -317,7 +317,7 @@ import java.util.concurrent.atomic.AtomicReference;
public ControllerInfo createControllerInfo(RemoteUserInfo remoteUserInfo) {
return new ControllerInfo(
remoteUserInfo,
/* controllerVersion= */ 0,
ControllerInfo.LEGACY_CONTROLLER_VERSION,
getMediaSessionManager().isTrustedForMediaControl(remoteUserInfo),
new BrowserLegacyCb(remoteUserInfo),
/* connectionHints= */ Bundle.EMPTY);
......
......@@ -322,6 +322,9 @@ public class MediaSession {
/** Information of a {@link MediaController} or a {@link MediaBrowser}. */
public static final class ControllerInfo {
/** The {@linkplain #getControllerVersion() controller version} of legacy controllers. */
public static final int LEGACY_CONTROLLER_VERSION = 0;
private final RemoteUserInfo remoteUserInfo;
private final int controllerVersion;
private final boolean isTrusted;
......@@ -454,7 +457,7 @@ public class MediaSession {
/* uid= */ RemoteUserInfo.UNKNOWN_UID);
return new ControllerInfo(
legacyRemoteUserInfo,
/* controllerVersion= */ 0,
ControllerInfo.LEGACY_CONTROLLER_VERSION,
/* trusted= */ false,
/* cb= */ null,
/* connectionHints= */ Bundle.EMPTY);
......
......@@ -709,7 +709,7 @@ import org.checkerframework.checker.initialization.qual.Initialized;
controller =
new ControllerInfo(
remoteUserInfo,
/* controllerVersion= */ 0,
ControllerInfo.LEGACY_CONTROLLER_VERSION,
sessionManager.isTrustedForMediaControl(remoteUserInfo),
controllerCb,
/* connectionHints= */ Bundle.EMPTY);
......
......@@ -95,7 +95,7 @@ import java.util.concurrent.atomic.AtomicReference;
public ControllerInfo createControllerInfo(RemoteUserInfo info) {
return new ControllerInfo(
info,
/* controllerVersion= */ 0,
ControllerInfo.LEGACY_CONTROLLER_VERSION,
manager.isTrustedForMediaControl(info),
/* cb= */ null,
/* connectionHints= */ Bundle.EMPTY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment