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

Commit f69cb966 authored by Hyundo Moon's avatar Hyundo Moon Committed by Automerger Merge Worker
Browse files

Merge "Add a new system service: MediaCommunicationService" into sc-dev am: 66680402

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13406019

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ided4cfa286b6769de1d98f53c9b2e25bf4b906a8
parents 077b02fc 66680402
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
/**
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.media;

/** {@hide} */
interface IMediaCommunicationService {
}
+3 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ java_library {
    static_libs: [
        "exoplayer2-extractor",
        "mediatranscoding_aidl_interface-java",
        "modules-utils-build",
    ],
    jarjar_rules: "jarjar_rules.txt",

@@ -52,6 +53,7 @@ java_library {
    visibility: [
        "//frameworks/av/apex:__subpackages__",
        "//frameworks/base", // For framework-all
        "//frameworks/base/apex/media/service",
    ],
}

@@ -80,6 +82,7 @@ filegroup {
        "java/android/media/Session2CommandGroup.java",
        "java/android/media/Session2Link.java",
        "java/android/media/Session2Token.java",
        "java/android/media/MediaCommunicationManager.java",
    ],
    path: "java",
}
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@ package android.media {
    ctor public ApplicationMediaCapabilities.FormatNotFoundException(@NonNull String);
  }

  public class MediaCommunicationManager {
  }

  public class MediaController2 implements java.lang.AutoCloseable {
    method public void cancelSessionCommand(@NonNull Object);
    method public void close();
+1 −0
Original line number Diff line number Diff line
rule com.android.modules.utils.** android.media.internal.utils.@1
rule com.google.android.exoplayer2.** android.media.internal.exo.@1
+49 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.media;

import android.annotation.NonNull;
import android.annotation.SystemService;
import android.content.Context;

import com.android.modules.utils.build.SdkLevel;

/**
 * Provides support for interacting with {@link android.media.MediaSession2 MediaSession2s}
 * that applications have published to express their ongoing media playback state.
 */
// TODO: Add notifySession2Created() and sendMessage().
@SystemService(Context.MEDIA_COMMUNICATION_SERVICE)
public class MediaCommunicationManager {
    private static final String TAG = "MediaCommunicationManager";

    private final Context mContext;
    private final IMediaCommunicationService mService;

    /**
     * @hide
     */
    public MediaCommunicationManager(@NonNull Context context) {
        if (!SdkLevel.isAtLeastS()) {
            throw new UnsupportedOperationException("Android version must be S or greater.");
        }
        mContext = context;
        mService = IMediaCommunicationService.Stub.asInterface(
                MediaFrameworkInitializer.getMediaServiceManager()
                .getMediaCommunicationServiceRegisterer()
                .get());
    }
}
Loading