diff --git a/api/current.txt b/api/current.txt index c5dd1811868e9..e0fc76c7d3a8d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -11609,6 +11609,7 @@ package android.media { field public static final int FX_FOCUS_NAVIGATION_RIGHT = 4; // 0x4 field public static final int FX_FOCUS_NAVIGATION_UP = 1; // 0x1 field public static final int FX_KEYPRESS_DELETE = 7; // 0x7 + field public static final int FX_KEYPRESS_INVALID = 9; // 0x9 field public static final int FX_KEYPRESS_RETURN = 8; // 0x8 field public static final int FX_KEYPRESS_SPACEBAR = 6; // 0x6 field public static final int FX_KEYPRESS_STANDARD = 5; // 0x5 diff --git a/core/res/res/xml/audio_assets.xml b/core/res/res/xml/audio_assets.xml index 746dbab6f7ab4..af5798a33b327 100644 --- a/core/res/res/xml/audio_assets.xml +++ b/core/res/res/xml/audio_assets.xml @@ -34,5 +34,6 @@ + diff --git a/data/sounds/AllAudio.mk b/data/sounds/AllAudio.mk index 8b03bf7c2b294..ed9bea52cb825 100644 --- a/data/sounds/AllAudio.mk +++ b/data/sounds/AllAudio.mk @@ -221,6 +221,7 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/effects/ogg/KeypressReturn_120_48k.ogg:system/media/audio/ui/KeypressReturn.ogg \ $(LOCAL_PATH)/effects/ogg/KeypressSpacebar_120_48k.ogg:system/media/audio/ui/KeypressSpacebar.ogg \ $(LOCAL_PATH)/effects/ogg/KeypressStandard_120_48k.ogg:system/media/audio/ui/KeypressStandard.ogg \ + $(LOCAL_PATH)/effects/ogg/KeypressInvalid_120_48k.ogg:system/media/audio/ui/KeypressInvalid.ogg \ $(LOCAL_PATH)/effects/ogg/Lock.ogg:system/media/audio/ui/Lock.ogg \ $(LOCAL_PATH)/effects/ogg/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \ $(LOCAL_PATH)/effects/ogg/Undock.ogg:system/media/audio/ui/Undock.ogg \ diff --git a/data/sounds/effects/KeypressInvalid.ogg b/data/sounds/effects/KeypressInvalid.ogg new file mode 100644 index 0000000000000..24935ad2e3baf Binary files /dev/null and b/data/sounds/effects/KeypressInvalid.ogg differ diff --git a/data/sounds/effects/KeypressInvalid.wav b/data/sounds/effects/KeypressInvalid.wav new file mode 100644 index 0000000000000..c4180e35215cc Binary files /dev/null and b/data/sounds/effects/KeypressInvalid.wav differ diff --git a/data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg b/data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg new file mode 100644 index 0000000000000..24935ad2e3baf Binary files /dev/null and b/data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg differ diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index 3144e8a7428e4..d88ed33c8e75b 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -1659,10 +1659,16 @@ public class AudioManager { * @see #playSoundEffect(int) */ public static final int FX_KEYPRESS_RETURN = 8; + + /** + * Invalid keypress sound + * @see #playSoundEffect(int) + */ + public static final int FX_KEYPRESS_INVALID = 9; /** * @hide Number of sound effects */ - public static final int NUM_SOUND_EFFECTS = 9; + public static final int NUM_SOUND_EFFECTS = 10; /** * Plays a sound effect (Key clicks, lid open/close...) @@ -1676,6 +1682,7 @@ public class AudioManager { * {@link #FX_KEYPRESS_SPACEBAR}, * {@link #FX_KEYPRESS_DELETE}, * {@link #FX_KEYPRESS_RETURN}, + * {@link #FX_KEYPRESS_INVALID}, * NOTE: This version uses the UI settings to determine * whether sounds are heard or not. */ @@ -1708,6 +1715,7 @@ public class AudioManager { * {@link #FX_KEYPRESS_SPACEBAR}, * {@link #FX_KEYPRESS_DELETE}, * {@link #FX_KEYPRESS_RETURN}, + * {@link #FX_KEYPRESS_INVALID}, * @param volume Sound effect volume. * The volume value is a raw scalar so UI controls should be scaled logarithmically. * If a volume of -1 is specified, the AudioManager.STREAM_MUSIC stream volume minus 3dB will be used.