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

Commit d1e6f656 authored by Sungsoo Lim's avatar Sungsoo Lim
Browse files

Handle remaining hidden API usages

There are several hidden API usages from Media 1.0 APIs.
To move Media 1.0 APIs into mainline module, this CL removes
the unnecesarry usages or makes them as system APIs.

Bug: 119539695
Test: pass MediaSessionTest and MediaControllerTest, and
      manually check whether SystemUI can control sessions.
Change-Id: I824113229964ad9b5785ecd488b5851b0dace626
parent 3a02bebb
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -3389,6 +3389,15 @@ package android.media {
    method @NonNull public android.media.TimedMetaData.Builder setTimedMetaData(long, @NonNull byte[]);
  }
  public abstract class VolumeProvider {
    method public void setCallback(android.media.VolumeProvider.Callback);
  }
  public abstract static class VolumeProvider.Callback {
    ctor public VolumeProvider.Callback();
    method public abstract void onVolumeChanged(android.media.VolumeProvider);
  }
}
package android.media.audiopolicy {
@@ -3564,6 +3573,10 @@ package android.media.session {
    method public void onSetMediaButtonEventDelegate(@NonNull android.media.session.MediaSessionEngine.MediaButtonEventDelegate);
  }
  public static final class MediaSession.Token implements android.os.Parcelable {
    method public android.media.session.ControllerLink getControllerLink();
  }
  public final class MediaSessionEngine implements java.lang.AutoCloseable {
    ctor public MediaSessionEngine(@NonNull android.content.Context, @NonNull android.media.session.SessionLink, @NonNull android.media.session.SessionCallbackLink, @NonNull android.media.session.MediaSessionEngine.CallbackStub, int);
    method public void close();
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package android.media;

import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.media.session.MediaSession;

import java.lang.annotation.Retention;
@@ -147,6 +148,7 @@ public abstract class VolumeProvider {
     * Sets a callback to receive volume changes.
     * @hide
     */
    @SystemApi
    public void setCallback(Callback callback) {
        mCallback = callback;
    }
@@ -155,6 +157,7 @@ public abstract class VolumeProvider {
     * Listens for changes to the volume.
     * @hide
     */
    @SystemApi
    public static abstract class Callback {
        public abstract void onVolumeChanged(VolumeProvider volumeProvider);
    }
+0 −6
Original line number Diff line number Diff line
@@ -315,12 +315,6 @@ public final class ControllerCallbackLink implements Parcelable {
        }

        private void ensureMediaControlPermission() {
            // Allow API calls from the System UI
            if (mContext.checkCallingPermission(android.Manifest.permission.STATUS_BAR_SERVICE)
                    == PackageManager.PERMISSION_GRANTED) {
                return;
            }

            // Check if it's system server or has MEDIA_CONTENT_CONTROL.
            // Note that system server doesn't have MEDIA_CONTENT_CONTROL, so we need extra
            // check here.
+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ public final class MediaSession {
         * @hide
         */
        @SystemApi
        ControllerLink getControllerLink() {
        public ControllerLink getControllerLink() {
            return mControllerLink;
        }

+0 −6
Original line number Diff line number Diff line
@@ -944,12 +944,6 @@ public final class SessionCallbackLink implements Parcelable {
        }

        private void ensureMediaControlPermission() {
            // Allow API calls from the System UI
            if (mContext.checkCallingPermission(android.Manifest.permission.STATUS_BAR_SERVICE)
                    == PackageManager.PERMISSION_GRANTED) {
                return;
            }

            // Check if it's system server or has MEDIA_CONTENT_CONTROL.
            // Note that system server doesn't have MEDIA_CONTENT_CONTROL, so we need extra
            // check here.