Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55da000c authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am bb3bb57a: Merge change I524dc046 into eclair

Merge commit 'bb3bb57a' into eclair-plus-aosp

* commit 'bb3bb57a':
  Fix issue 2192673: Music Pausing Even when notifications are set to silent.
parents a615139d bb3bb57a
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -669,9 +669,15 @@ status_t CameraService::Client::startRecording()
    LOGD("startRecording (pid %d)", getCallingPid());

    if (mMediaPlayerBeep.get() != NULL) {
        // do not play record jingle if stream volume is 0
        // (typically because ringer mode is silent).
        int index;
        AudioSystem::getStreamVolumeIndex(AudioSystem::ENFORCED_AUDIBLE, &index);
        if (index != 0) {
            mMediaPlayerBeep->seekTo(0);
            mMediaPlayerBeep->start();
        }
    }

    mHardware->enableMsgType(CAMERA_MSG_VIDEO_FRAME);

@@ -888,9 +894,15 @@ void CameraService::Client::handleShutter(
{
    // Play shutter sound.
    if (mMediaPlayerClick.get() != NULL) {
        // do not play shutter sound if stream volume is 0
        // (typically because ringer mode is silent).
        int index;
        AudioSystem::getStreamVolumeIndex(AudioSystem::ENFORCED_AUDIBLE, &index);
        if (index != 0) {
            mMediaPlayerClick->seekTo(0);
            mMediaPlayerClick->start();
        }
    }

    // Screen goes black after the buffer is unregistered.
    if (mSurface != 0 && !mUseOverlay) {
+7 −1
Original line number Diff line number Diff line
@@ -63,11 +63,13 @@ public class Ringtone {
    private AssetFileDescriptor mAssetFileDescriptor;

    private int mStreamType = AudioManager.STREAM_RING;
    private AudioManager mAudioManager;

    private Context mContext;

    Ringtone(Context context) {
        mContext = context;
        mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
    }

    /**
@@ -215,9 +217,13 @@ public class Ringtone {
            }
        }
        if (mAudio != null) {
            // do not ringtones if stream volume is 0
            // (typically because ringer mode is silent).
            if (mAudioManager.getStreamVolume(mStreamType) != 0) {
                mAudio.start();
            }
        }
    }

    /**
     * Stops a playing ringtone.
+13 −8
Original line number Diff line number Diff line
@@ -704,6 +704,9 @@ class NotificationManagerService extends INotificationManager.Stub
                    && (!(old != null
                        && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
                    && mSystemReady) {

                final AudioManager audioManager = (AudioManager) mContext
                .getSystemService(Context.AUDIO_SERVICE);
                // sound
                final boolean useDefaultSound =
                    (notification.defaults & Notification.DEFAULT_SOUND) != 0; 
@@ -722,6 +725,9 @@ class NotificationManagerService extends INotificationManager.Stub
                        audioStreamType = DEFAULT_STREAM_TYPE;
                    }
                    mSoundNotification = r;
                    // do not play notifications if stream volume is 0
                    // (typically because ringer mode is silent).
                    if (audioManager.getStreamVolume(audioStreamType) != 0) {
                        long identity = Binder.clearCallingIdentity();
                        try {
                            mSound.play(mContext, uri, looping, audioStreamType);
@@ -730,10 +736,9 @@ class NotificationManagerService extends INotificationManager.Stub
                            Binder.restoreCallingIdentity(identity);
                        }
                    }
                }

                // vibrate
                final AudioManager audioManager = (AudioManager) mContext
                        .getSystemService(Context.AUDIO_SERVICE);
                final boolean useDefaultVibrate =
                    (notification.defaults & Notification.DEFAULT_VIBRATE) != 0; 
                if ((useDefaultVibrate || notification.vibrate != null)