diff options
author | Eric Laurent <elaurent@google.com> | 2014-05-16 12:19:25 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-05-16 15:50:42 -0700 |
commit | bc11a696f6856624de532a6830d5db9dbbe2384c (patch) | |
tree | cd84165dbc1161e62ebb3d4ff97a6ad78fd9472f /media/java | |
parent | 9d08a93b2dd378cdb66c35a1230d19f894481eab (diff) | |
download | frameworks_base-bc11a696f6856624de532a6830d5db9dbbe2384c.zip frameworks_base-bc11a696f6856624de532a6830d5db9dbbe2384c.tar.gz frameworks_base-bc11a696f6856624de532a6830d5db9dbbe2384c.tar.bz2 |
AudioSystem: native to JAVA status translation
Regroup status code translation from native to JAVA in AudioSystem.
The same codes will be used by AudioTrack, AudioRecord, AudioManager
and defined in a single place in AudioSystem.
Change-Id: I7d3f39f30e3bb8e53f33f4408bcb0672df8af42b
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioRecord.java | 12 | ||||
-rw-r--r-- | media/java/android/media/AudioSystem.java | 11 | ||||
-rw-r--r-- | media/java/android/media/AudioTrack.java | 12 |
3 files changed, 23 insertions, 12 deletions
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java index 384e120..d4e85c8 100644 --- a/media/java/android/media/AudioRecord.java +++ b/media/java/android/media/AudioRecord.java @@ -61,25 +61,25 @@ public class AudioRecord */ public static final int RECORDSTATE_RECORDING = 3;// matches SL_RECORDSTATE_RECORDING - // Error codes: - // to keep in sync with frameworks/base/core/jni/android_media_AudioRecord.cpp /** * Denotes a successful operation. */ - public static final int SUCCESS = 0; + public static final int SUCCESS = AudioSystem.SUCCESS; /** * Denotes a generic operation failure. */ - public static final int ERROR = -1; + public static final int ERROR = AudioSystem.ERROR; /** * Denotes a failure due to the use of an invalid value. */ - public static final int ERROR_BAD_VALUE = -2; + public static final int ERROR_BAD_VALUE = AudioSystem.BAD_VALUE; /** * Denotes a failure due to the improper use of a method. */ - public static final int ERROR_INVALID_OPERATION = -3; + public static final int ERROR_INVALID_OPERATION = AudioSystem.INVALID_OPERATION; + // Error codes: + // to keep in sync with frameworks/base/core/jni/android_media_AudioRecord.cpp private static final int AUDIORECORD_ERROR_SETUP_ZEROFRAMECOUNT = -16; private static final int AUDIORECORD_ERROR_SETUP_INVALIDCHANNELMASK = -17; private static final int AUDIORECORD_ERROR_SETUP_INVALIDFORMAT = -18; diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java index 327c10c..5ddb198 100644 --- a/media/java/android/media/AudioSystem.java +++ b/media/java/android/media/AudioSystem.java @@ -199,6 +199,17 @@ public class AudioSystem } } + /* + * Error codes used by public APIs (AudioTrack, AudioRecord, AudioManager ...) + * Must be kept in sync with frameworks/base/core/jni/android_media_AudioErrors.h + */ + public static final int SUCCESS = 0; + public static final int ERROR = -1; + public static final int BAD_VALUE = -2; + public static final int INVALID_OPERATION = -3; + public static final int PERMISSION_DENIED = -4; + public static final int NO_INIT = -5; + public static final int DEAD_OBJECT = -6; /* * AudioPolicyService methods diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java index 1a64cff..1baaaa4 100644 --- a/media/java/android/media/AudioTrack.java +++ b/media/java/android/media/AudioTrack.java @@ -125,25 +125,25 @@ public class AudioTrack */ public static final int STATE_NO_STATIC_DATA = 2; - // Error codes: - // to keep in sync with frameworks/base/core/jni/android_media_AudioTrack.cpp /** * Denotes a successful operation. */ - public static final int SUCCESS = 0; + public static final int SUCCESS = AudioSystem.SUCCESS; /** * Denotes a generic operation failure. */ - public static final int ERROR = -1; + public static final int ERROR = AudioSystem.ERROR; /** * Denotes a failure due to the use of an invalid value. */ - public static final int ERROR_BAD_VALUE = -2; + public static final int ERROR_BAD_VALUE = AudioSystem.BAD_VALUE; /** * Denotes a failure due to the improper use of a method. */ - public static final int ERROR_INVALID_OPERATION = -3; + public static final int ERROR_INVALID_OPERATION = AudioSystem.INVALID_OPERATION; + // Error codes: + // to keep in sync with frameworks/base/core/jni/android_media_AudioTrack.cpp private static final int ERROR_NATIVESETUP_AUDIOSYSTEM = -16; private static final int ERROR_NATIVESETUP_INVALIDCHANNELMASK = -17; private static final int ERROR_NATIVESETUP_INVALIDFORMAT = -18; |