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
diff --git a/api/current.txt b/api/current.txt
index c5dd181..e0fc76c 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -11609,6 +11609,7 @@
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 746dbab..af5798a 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 8b03bf7..ed9bea5 100644
--- a/data/sounds/AllAudio.mk
+++ b/data/sounds/AllAudio.mk
@@ -221,6 +221,7 @@
$(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 0000000..24935ad
--- /dev/null
+++ b/data/sounds/effects/KeypressInvalid.ogg
Binary files differ
diff --git a/data/sounds/effects/KeypressInvalid.wav b/data/sounds/effects/KeypressInvalid.wav
new file mode 100644
index 0000000..c4180e35
--- /dev/null
+++ b/data/sounds/effects/KeypressInvalid.wav
Binary files 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 0000000..24935ad
--- /dev/null
+++ b/data/sounds/effects/ogg/KeypressInvalid_120_48k.ogg
Binary files differ
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 3144e8a7..d88ed33 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1659,10 +1659,16 @@
* @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 @@
* {@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 @@
* {@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.