Registration of a RemoteController may succeed only if: - the caller has the MEDIA_CONTENT_CONTROL permission, - or if the RemoteController.OnClientUpdateListener it registers if one of the enabled notification listeners. For using the "enabled notification listener" functionality, the CL involved: - making OnClientUpdateListener an interface so a 3rd-party application may have its implementation extend NotificationListenerService, which is required for a listener to be enabled by the user. - add the concept of "enabled" status in an IRemoteControlDisplay, so a RemoteController (which encapsulates the IRemoteControlDisplay implementation) may be registered, but later temporarily disabled by the user, as a result of a user action in the security settings, or a user switch. - making MediaFocusControl, the component tied to AudioService, monitor changes in enabled notification listeners, and act upon enable/disable changes. Bug 8209392 Change-Id: Ia8dfa2156c65668b2b0d4ae92048005912652d84
62 lines
2.5 KiB
Plaintext
62 lines
2.5 KiB
Plaintext
/* Copyright (C) 2011 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.graphics.Bitmap;
|
|
import android.media.IRemoteControlDisplay;
|
|
import android.media.Rating;
|
|
|
|
/**
|
|
* @hide
|
|
* Interface registered by AudioManager to notify a source of remote control information
|
|
* that information is requested to be displayed on the remote control (through
|
|
* IRemoteControlDisplay).
|
|
* {@see AudioManager#registerRemoteControlClient(RemoteControlClient)}.
|
|
*/
|
|
oneway interface IRemoteControlClient
|
|
{
|
|
/**
|
|
* Notifies a remote control client that information for the given generation ID is
|
|
* requested. If the flags contains
|
|
* {@link RemoteControlClient#FLAG_INFORMATION_REQUESTED_ALBUM_ART} then the width and height
|
|
* parameters are valid.
|
|
* @param generationId
|
|
* @param infoFlags
|
|
* FIXME: is infoFlags required? since the RCC pushes info, this might always be called
|
|
* with RC_INFO_ALL
|
|
*/
|
|
void onInformationRequested(int generationId, int infoFlags);
|
|
|
|
/**
|
|
* Notifies a remote control client that information for the given generation ID is
|
|
* requested for the given IRemoteControlDisplay alone.
|
|
* @param rcd the display to which current info should be sent
|
|
*/
|
|
void informationRequestForDisplay(IRemoteControlDisplay rcd, int w, int h);
|
|
|
|
/**
|
|
* Sets the generation counter of the current client that is displayed on the remote control.
|
|
*/
|
|
void setCurrentClientGenerationId(int clientGeneration);
|
|
|
|
void plugRemoteControlDisplay(IRemoteControlDisplay rcd, int w, int h);
|
|
void unplugRemoteControlDisplay(IRemoteControlDisplay rcd);
|
|
void setBitmapSizeForDisplay(IRemoteControlDisplay rcd, int w, int h);
|
|
void setWantsSyncForDisplay(IRemoteControlDisplay rcd, boolean wantsSync);
|
|
void enableRemoteControlDisplay(IRemoteControlDisplay rcd, boolean enabled);
|
|
void seekTo(int clientGeneration, long timeMs);
|
|
void updateMetadata(int clientGeneration, int key, in Rating value);
|
|
} |