Merge "Make APIs that dispatch KeyEvent as system service @SystemApi"
This commit is contained in:
committed by
Android (Google) Code Review
commit
4cf6f1faea
@@ -46,6 +46,13 @@ package android.media.session {
|
||||
field public static final int FLAG_EXCLUSIVE_GLOBAL_PRIORITY = 65536; // 0x10000
|
||||
}
|
||||
|
||||
public final class MediaSessionManager {
|
||||
method public void dispatchMediaKeyEventAsSystemService(@NonNull android.view.KeyEvent);
|
||||
method public boolean dispatchMediaKeyEventAsSystemService(@NonNull android.media.session.MediaSession.Token, @NonNull android.view.KeyEvent);
|
||||
method public void dispatchVolumeKeyEventAsSystemService(@NonNull android.view.KeyEvent, int);
|
||||
method public void dispatchVolumeKeyEventAsSystemService(@NonNull android.media.session.MediaSession.Token, @NonNull android.view.KeyEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.net {
|
||||
|
||||
@@ -523,7 +523,8 @@ public final class MediaSessionManager {
|
||||
* @param keyEvent The KeyEvent to send.
|
||||
* @hide
|
||||
*/
|
||||
public void dispatchMediaKeyEventAsSystemService(KeyEvent keyEvent) {
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public void dispatchMediaKeyEventAsSystemService(@NonNull KeyEvent keyEvent) {
|
||||
dispatchMediaKeyEventInternal(true, keyEvent, false);
|
||||
}
|
||||
|
||||
@@ -548,6 +549,7 @@ public final class MediaSessionManager {
|
||||
* @return {@code true} if the event was sent to the session, {@code false} otherwise
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public boolean dispatchMediaKeyEventAsSystemService(@NonNull MediaSession.Token sessionToken,
|
||||
@NonNull KeyEvent keyEvent) {
|
||||
if (sessionToken == null) {
|
||||
@@ -586,10 +588,15 @@ public final class MediaSessionManager {
|
||||
* Should be only called by the {@link com.android.internal.policy.PhoneWindow} or
|
||||
* {@link android.view.FallbackEventHandler} when the foreground activity didn't consume the key
|
||||
* from the hardware devices.
|
||||
* <p>
|
||||
* Valid stream types include {@link AudioManager.PublicStreamTypes} and
|
||||
* {@link AudioManager#USE_DEFAULT_STREAM_TYPE}.
|
||||
*
|
||||
* @param keyEvent The KeyEvent to send.
|
||||
* @param keyEvent volume key event
|
||||
* @param streamType type of stream
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public void dispatchVolumeKeyEventAsSystemService(@NonNull KeyEvent keyEvent, int streamType) {
|
||||
dispatchVolumeKeyEventInternal(true, keyEvent, streamType, false);
|
||||
}
|
||||
@@ -614,6 +621,7 @@ public final class MediaSessionManager {
|
||||
* @param keyEvent volume key event
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public void dispatchVolumeKeyEventAsSystemService(@NonNull MediaSession.Token sessionToken,
|
||||
@NonNull KeyEvent keyEvent) {
|
||||
if (sessionToken == null) {
|
||||
|
||||
@@ -46,6 +46,13 @@ package android.media.session {
|
||||
field public static final int FLAG_EXCLUSIVE_GLOBAL_PRIORITY = 65536; // 0x10000
|
||||
}
|
||||
|
||||
public final class MediaSessionManager {
|
||||
method public void dispatchMediaKeyEventAsSystemService(@NonNull android.view.KeyEvent);
|
||||
method public boolean dispatchMediaKeyEventAsSystemService(@NonNull android.media.session.MediaSession.Token, @NonNull android.view.KeyEvent);
|
||||
method public void dispatchVolumeKeyEventAsSystemService(@NonNull android.view.KeyEvent, int);
|
||||
method public void dispatchVolumeKeyEventAsSystemService(@NonNull android.media.session.MediaSession.Token, @NonNull android.view.KeyEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.os {
|
||||
|
||||
Reference in New Issue
Block a user