summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioService.java59
-rw-r--r--media/jni/android_media_MediaRecorder.cpp2
-rw-r--r--media/jni/audioeffect/android_media_Visualizer.cpp2
3 files changed, 29 insertions, 34 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 1c10422..f8688da 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1841,22 +1841,12 @@ public class AudioService extends IAudioService.Stub {
}
public void setRingerModeExternal(int ringerMode, String caller) {
- final long identity = Binder.clearCallingIdentity();
- try {
- setRingerMode(ringerMode, caller, true /*external*/);
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
+ setRingerMode(ringerMode, caller, true /*external*/);
}
public void setRingerModeInternal(int ringerMode, String caller) {
enforceSelfOrSystemUI("setRingerModeInternal");
- final long identity = Binder.clearCallingIdentity();
- try {
- setRingerMode(ringerMode, caller, false /*external*/);
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
+ setRingerMode(ringerMode, caller, false /*external*/);
}
private void setRingerMode(int ringerMode, String caller, boolean external) {
@@ -1870,28 +1860,33 @@ public class AudioService extends IAudioService.Stub {
if ((ringerMode == AudioManager.RINGER_MODE_VIBRATE) && !mHasVibrator) {
ringerMode = AudioManager.RINGER_MODE_SILENT;
}
- synchronized (mSettingsLock) {
- final int ringerModeInternal = getRingerModeInternal();
- final int ringerModeExternal = getRingerModeExternal();
- if (external) {
- setRingerModeExt(ringerMode);
- if (mRingerModeDelegate != null) {
- ringerMode = mRingerModeDelegate.onSetRingerModeExternal(ringerModeExternal,
- ringerMode, caller, ringerModeInternal);
- }
- if (ringerMode != ringerModeInternal) {
- setRingerModeInt(ringerMode, true /*persist*/);
- }
- } else /*internal*/ {
- if (ringerMode != ringerModeInternal) {
- setRingerModeInt(ringerMode, true /*persist*/);
- }
- if (mRingerModeDelegate != null) {
- ringerMode = mRingerModeDelegate.onSetRingerModeInternal(ringerModeInternal,
- ringerMode, caller, ringerModeExternal);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ synchronized (mSettingsLock) {
+ final int ringerModeInternal = getRingerModeInternal();
+ final int ringerModeExternal = getRingerModeExternal();
+ if (external) {
+ setRingerModeExt(ringerMode);
+ if (mRingerModeDelegate != null) {
+ ringerMode = mRingerModeDelegate.onSetRingerModeExternal(ringerModeExternal,
+ ringerMode, caller, ringerModeInternal);
+ }
+ if (ringerMode != ringerModeInternal) {
+ setRingerModeInt(ringerMode, true /*persist*/);
+ }
+ } else /*internal*/ {
+ if (ringerMode != ringerModeInternal) {
+ setRingerModeInt(ringerMode, true /*persist*/);
+ }
+ if (mRingerModeDelegate != null) {
+ ringerMode = mRingerModeDelegate.onSetRingerModeInternal(ringerModeInternal,
+ ringerMode, caller, ringerModeExternal);
+ }
+ setRingerModeExt(ringerMode);
}
- setRingerModeExt(ringerMode);
}
+ } finally {
+ Binder.restoreCallingIdentity(identity);
}
}
diff --git a/media/jni/android_media_MediaRecorder.cpp b/media/jni/android_media_MediaRecorder.cpp
index 3b1b1d7..e9c80a0 100644
--- a/media/jni/android_media_MediaRecorder.cpp
+++ b/media/jni/android_media_MediaRecorder.cpp
@@ -102,7 +102,7 @@ void JNIMediaRecorderListener::notify(int msg, int ext1, int ext2)
ALOGV("JNIMediaRecorderListener::notify");
JNIEnv *env = AndroidRuntime::getJNIEnv();
- env->CallStaticVoidMethod(mClass, fields.post_event, mObject, msg, ext1, ext2, 0);
+ env->CallStaticVoidMethod(mClass, fields.post_event, mObject, msg, ext1, ext2, NULL);
}
// ----------------------------------------------------------------------------
diff --git a/media/jni/audioeffect/android_media_Visualizer.cpp b/media/jni/audioeffect/android_media_Visualizer.cpp
index 8463d94..b59a541 100644
--- a/media/jni/audioeffect/android_media_Visualizer.cpp
+++ b/media/jni/audioeffect/android_media_Visualizer.cpp
@@ -329,7 +329,7 @@ static void android_media_visualizer_effect_callback(int32_t event,
fields.midPostNativeEvent,
callbackInfo->visualizer_ref,
NATIVE_EVENT_SERVER_DIED,
- 0, 0, 0);
+ 0, 0, NULL);
}
}