Loading apex/media/aidl/private/android/media/IMediaCommunicationService.aidl 0 → 100644 +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 { } apex/media/framework/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ java_library { static_libs: [ "exoplayer2-extractor", "mediatranscoding_aidl_interface-java", "modules-utils-build", ], jarjar_rules: "jarjar_rules.txt", Loading @@ -52,6 +53,7 @@ java_library { visibility: [ "//frameworks/av/apex:__subpackages__", "//frameworks/base", // For framework-all "//frameworks/base/apex/media/service", ], } Loading Loading @@ -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", } Loading apex/media/framework/api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading apex/media/framework/jarjar_rules.txt +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 apex/media/framework/java/android/media/MediaCommunicationManager.java 0 → 100644 +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
apex/media/aidl/private/android/media/IMediaCommunicationService.aidl 0 → 100644 +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 { }
apex/media/framework/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ java_library { static_libs: [ "exoplayer2-extractor", "mediatranscoding_aidl_interface-java", "modules-utils-build", ], jarjar_rules: "jarjar_rules.txt", Loading @@ -52,6 +53,7 @@ java_library { visibility: [ "//frameworks/av/apex:__subpackages__", "//frameworks/base", // For framework-all "//frameworks/base/apex/media/service", ], } Loading Loading @@ -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", } Loading
apex/media/framework/api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading
apex/media/framework/jarjar_rules.txt +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
apex/media/framework/java/android/media/MediaCommunicationManager.java 0 → 100644 +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()); } }