diff --git a/Android.bp b/Android.bp index 28e51e7338958..d0bee2890fb76 100644 --- a/Android.bp +++ b/Android.bp @@ -429,8 +429,6 @@ java_library { "media/java/android/media/IMediaRouterService.aidl", "media/java/android/media/IMediaScannerListener.aidl", "media/java/android/media/IMediaScannerService.aidl", - "media/java/android/media/IMediaSession2.aidl", - "media/java/android/media/IMediaSession2Callback.aidl", "media/java/android/media/IPlaybackConfigDispatcher.aidl", "media/java/android/media/ISessionTokensListener.aidl", ":libaudioclient_aidl", diff --git a/media/java/android/media/IMediaSession2.aidl b/media/java/android/media/IMediaSession2.aidl deleted file mode 100644 index 6921056547a87..0000000000000 --- a/media/java/android/media/IMediaSession2.aidl +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2018 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.media.IMediaSession2Callback; -import android.os.Bundle; -import android.os.ResultReceiver; - -/** - * Interface to MediaSession2. Framework MUST only call oneway APIs. - * - * @hide - */ -oneway interface IMediaSession2 { - // TODO(jaewan): add onCommand() to send private command - // TODO(jaewan): Due to the nature of oneway calls, APIs can be called in out of order - // Add id for individual calls to address this. - - // TODO(jaewan): We may consider to add another binder just for the connection - // not to expose other methods to the controller whose connection wasn't accepted. - // But this would be enough for now because it's the same as existing - // MediaBrowser and MediaBrowserService. - void connect(String callingPackage, IMediaSession2Callback callback); - void release(IMediaSession2Callback caller); - - ////////////////////////////////////////////////////////////////////////////////////////////// - // send command - ////////////////////////////////////////////////////////////////////////////////////////////// - void sendCommand(IMediaSession2Callback caller, in Bundle command, in Bundle args); - void sendTransportControlCommand(IMediaSession2Callback caller, - int commandCode, in Bundle args); - void sendCustomCommand(IMediaSession2Callback caller, in Bundle command, in Bundle args, - in ResultReceiver receiver); - - ////////////////////////////////////////////////////////////////////////////////////////////// - // Get library service specific - ////////////////////////////////////////////////////////////////////////////////////////////// - void getBrowserRoot(IMediaSession2Callback callback, in Bundle rootHints); -} diff --git a/media/java/android/media/IMediaSession2Callback.aidl b/media/java/android/media/IMediaSession2Callback.aidl deleted file mode 100644 index ed1197edbd7b9..0000000000000 --- a/media/java/android/media/IMediaSession2Callback.aidl +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2018 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.os.Bundle; -import android.os.ResultReceiver; -import android.media.session.PlaybackState; -import android.media.IMediaSession2; - -/** - * Interface from MediaSession2 to MediaSession2Record. - *
- * Keep this interface oneway. Otherwise a malicious app may implement fake version of this,
- * and holds calls from session to make session owner(s) frozen.
- *
- * @hide
- */
-oneway interface IMediaSession2Callback {
- void onPlaybackStateChanged(in Bundle state);
- void onPlaylistParamsChanged(in Bundle params);
-
- /**
- * Called only when the controller is created with service's token.
- *
- * @param sessionBinder {@code null} if the connect is rejected or is disconnected. a session
- * binder if the connect is accepted.
- * @param commands initially allowed commands.
- */
- // TODO(jaewan): Also need to pass flags for allowed actions for permission check.
- // For example, a media can allow setRating only for whitelisted apps
- // it's better for controller to know such information in advance.
- // Follow-up TODO: Add similar functions to the session.
- // TODO(jaewan): Is term 'accepted/rejected' correct? For permission, 'grant' is used.
- void onConnectionChanged(IMediaSession2 sessionBinder, in Bundle commandGroup);
-
- void onCustomLayoutChanged(in List