diff options
author | Justin Koh <justinkoh@google.com> | 2013-07-11 17:16:53 -0700 |
---|---|---|
committer | Justin Koh <justinkoh@google.com> | 2013-07-18 10:46:19 -0700 |
commit | cacfe69b6845dd1c1c8682f67c3c52ef35214b2c (patch) | |
tree | 59a27a3612efaa1038dc15e9e02f5a0d6eb59591 | |
parent | 5bc32b347f83099772fe5596615d88e4d0a7d813 (diff) |
Add FX_KEYPRESS_INVALID constant to AudioManager.
Add FX_KEYPRESS_INVALID constant to AudioManager. This is a sound which should
play if the user tries to click or press on an element which is disabled.
Change-Id: Idd8953abeddd1afb51f7f190f9fb612ef672defa
-rw-r--r-- | api/current.txt | 1 | ||||
-rw-r--r-- | core/res/res/xml/audio_assets.xml | 1 | ||||
-rw-r--r-- | data/sounds/AllAudio.mk | 1 | ||||
-rw-r--r-- | data/sounds/effects/KeypressInvalid.ogg | bin | 0 -> 9847 bytes | |||
-rw-r--r-- | data/sounds/effects/KeypressInvalid.wav | bin | 0 -> 16144 bytes | |||
-rw-r--r-- | data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg | bin | 0 -> 9847 bytes | |||
-rw-r--r-- | media/java/android/media/AudioManager.java | 10 |
7 files changed, 12 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index c5dd1811868e..e0fc76c7d3a8 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 746dbab6f7ab..af5798a33b32 100644 --- a/core/res/res/xml/audio_assets.xml +++ b/core/res/res/xml/audio_assets.xml @@ -34,5 +34,6 @@ <asset id="FX_KEYPRESS_SPACEBAR" file="KeypressSpacebar.ogg"/> <asset id="FX_KEYPRESS_DELETE" file="KeypressDelete.ogg"/> <asset id="FX_KEYPRESS_RETURN" file="KeypressReturn.ogg"/> + <asset id="FX_KEYPRESS_INVALID" file="KeypressInvalid.ogg"/> </group> </audio_assets> diff --git a/data/sounds/AllAudio.mk b/data/sounds/AllAudio.mk index 8b03bf7c2b29..ed9bea52cb82 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 Binary files differnew file mode 100644 index 000000000000..24935ad2e3ba --- /dev/null +++ b/data/sounds/effects/KeypressInvalid.ogg diff --git a/data/sounds/effects/KeypressInvalid.wav b/data/sounds/effects/KeypressInvalid.wav Binary files differnew file mode 100644 index 000000000000..c4180e35215c --- /dev/null +++ b/data/sounds/effects/KeypressInvalid.wav diff --git a/data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg b/data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg Binary files differnew file mode 100644 index 000000000000..24935ad2e3ba --- /dev/null +++ b/data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index 3144e8a7428e..d88ed33c8e75 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. |