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

Commit c3ce09ee authored by Hyundo Moon's avatar Hyundo Moon
Browse files

Revert Media 1.0 API changes introduced for making 1.0 updatable

This CL reverts API changes which were introduced by below CLs:
 - "761c4759: AML: Make config_mediaMetadataBitmapMaxSize as @SystemApi"
 - "888b791f: Make AudioManager.FLAG_FROM_KEY as @SystemApi"
 - "3d1353aa: AML: Unhide KeyEvent.isMediaSessionKey()"

Bug: 128245348
Test: atest CtsMediaTestCases:android.media.cts.MediaSessionTest;
      atest CtsMediaTestCases:android.media.cts.MediaControllerTest;
      atest CtsMediaTestCases:android.media.cts.MediaBrowserTest;
Change-Id: I263a958bf340336f699adb28424241fd00e46e28
parent cb0da694
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -49185,7 +49185,6 @@ package android.view {
    method public final boolean isFunctionPressed();
    method public static final boolean isGamepadButton(int);
    method public final boolean isLongPress();
    method public static final boolean isMediaSessionKey(int);
    method public final boolean isMetaPressed();
    method public static boolean isModifierKey(int);
    method public final boolean isNumLockOn();
+0 −2
Original line number Diff line number Diff line
@@ -231,7 +231,6 @@ package android {
  }
  public static final class R.dimen {
    field public static final int config_mediaMetadataBitmapMaxSize = 17104904; // 0x1050008
    field public static final int config_restrictedIconSize = 17104903; // 0x1050007
  }
@@ -3483,7 +3482,6 @@ package android.media {
    field public static final int AUDIOFOCUS_FLAG_DELAY_OK = 1; // 0x1
    field public static final int AUDIOFOCUS_FLAG_LOCK = 4; // 0x4
    field public static final int AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS = 2; // 0x2
    field public static final int FLAG_FROM_KEY = 65536; // 0x10000
    field public static final int SUCCESS = 0; // 0x0
  }
+24 −22
Original line number Diff line number Diff line
@@ -1805,28 +1805,6 @@ public class KeyEvent extends InputEvent implements Parcelable {
        return isWakeKey(mKeyCode);
    }

    /**
     * Returns whether this key will be sent to the
     * {@link android.media.session.MediaSession.Callback} if not handled.
     */
    public static final boolean isMediaSessionKey(int keyCode) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_MEDIA_PLAY:
            case KeyEvent.KEYCODE_MEDIA_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
            case KeyEvent.KEYCODE_MUTE:
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MEDIA_STOP:
            case KeyEvent.KEYCODE_MEDIA_NEXT:
            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
            case KeyEvent.KEYCODE_MEDIA_REWIND:
            case KeyEvent.KEYCODE_MEDIA_RECORD:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
                return true;
        }
        return false;
    }

    /**
     * Returns true if the specified keycode is a gamepad button.
     * @return True if the keycode is a gamepad button, such as {@link #KEYCODE_BUTTON_A}.
@@ -1886,6 +1864,30 @@ public class KeyEvent extends InputEvent implements Parcelable {
        }
    }

    /**
     * Returns whether this key will be sent to the
     * {@link android.media.session.MediaSession.Callback} if not handled.
     *
     * @hide
     */
    public static final boolean isMediaSessionKey(int keyCode) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_MEDIA_PLAY:
            case KeyEvent.KEYCODE_MEDIA_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
            case KeyEvent.KEYCODE_MUTE:
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MEDIA_STOP:
            case KeyEvent.KEYCODE_MEDIA_NEXT:
            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
            case KeyEvent.KEYCODE_MEDIA_REWIND:
            case KeyEvent.KEYCODE_MEDIA_RECORD:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
                return true;
        }
        return false;
    }

    /** Is this a system key? System keys can not be used for menu shortcuts.
     * @hide
     */
+0 −2
Original line number Diff line number Diff line
@@ -3006,8 +3006,6 @@
    <public-group type="dimen" first-id="0x01050007">
        <!-- @hide @SystemApi -->
        <public name="config_restrictedIconSize" />
        <!-- @hide @SystemApi -->
        <public name="config_mediaMetadataBitmapMaxSize" />
    </public-group>

    <public-group type="color" first-id="0x0106001c">
+1 −2
Original line number Diff line number Diff line
@@ -553,8 +553,7 @@ public class AudioManager {
     * request is from a hardware key press. (e.g. {@link MediaController}).
     * @hide
     */
    @SystemApi
    public static final int FLAG_FROM_KEY = 1 << 16;
    public static final int FLAG_FROM_KEY = 1 << 12;

    // The iterator of TreeMap#entrySet() returns the entries in ascending key order.
    private static final TreeMap<Integer, String> FLAG_NAMES = new TreeMap<>();
Loading