Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87e73461 authored by Hyundo Moon's avatar Hyundo Moon
Browse files

Add MediaCommunicationManager#getVersion()

Bug: 179634039
Test: Passed test
Change-Id: I9413936558d809f7076c1d6ec11b2d4165089ad3
parent 4f5f93cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ package android.media {
  }

  public class MediaCommunicationManager {
    method @IntRange(from=1) public int getVersion();
  }

  public class MediaController2 implements java.lang.AutoCloseable {
+20 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package android.media;

import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.SystemService;
import android.content.Context;
@@ -30,6 +31,16 @@ import com.android.modules.utils.build.SdkLevel;
public class MediaCommunicationManager {
    private static final String TAG = "MediaCommunicationManager";

    /**
     * The manager version used from beginning.
     */
    private static final int VERSION_1 = 1;

    /**
     * Current manager version.
     */
    private static final int CURRENT_VERSION = VERSION_1;

    private final Context mContext;
    private final IMediaCommunicationService mService;

@@ -46,4 +57,11 @@ public class MediaCommunicationManager {
                        .getMediaCommunicationServiceRegisterer()
                        .get());
    }

    /**
     * Gets the version of this {@link MediaCommunicationManager}.
     */
    public @IntRange(from = 1) int getVersion() {
        return CURRENT_VERSION;
    }
}