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

Commit ad4ef007 authored by Jef Oliver's avatar Jef Oliver
Browse files

Merge ICS HEAD

parents a04560ea 6e42b6e5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1849,6 +1849,12 @@ public class Camera {
         */
        public static final String FLASH_MODE_TORCH = "torch";

        /**
         * Scene mode is off. (for some QCom)
         * @hide
         */
        public static final String SCENE_MODE_OFF = "off";

        /**
         * Scene mode is off.
         * @hide
+57 −6
Original line number Diff line number Diff line
@@ -402,6 +402,7 @@ status_t LPAPlayer::start(bool sourceAlreadyStarted) {
}

status_t LPAPlayer::seekTo(int64_t time_us) {
    Mutex::Autolock autoLock1(mSeekLock);
    Mutex::Autolock autoLock(mLock);
    LOGV("seekTo: time_us %ld", time_us);
    if ( mReachedEOS ) {
@@ -418,11 +419,28 @@ status_t LPAPlayer::seekTo(int64_t time_us) {
    LOGV("In seekTo(), mSeekTimeUs %lld",mSeekTimeUs);
    if (!bIsA2DPEnabled) {
        if(mIsDriverStarted) {
#ifndef QCOM_KERNEL_SUPPORT_LPA_PAUSE
            if (!isPaused) {
                if (ioctl(afd, AUDIO_PAUSE, 1) < 0) {
                    LOGE("Audio Pause failed");
                }
            }
#endif
            pthread_mutex_lock(&mem_response_mutex);
            pthread_mutex_lock(&mem_request_mutex);
            LOGV("Response queue size %d:", memBuffersResponseQueue.size());
            LOGV("Request queue size %d:", memBuffersRequestQueue.size());
            while (!memBuffersResponseQueue.empty()) {
                List<BuffersAllocated>::iterator it = memBuffersResponseQueue.begin();
                BuffersAllocated buf = *it;
                buf.bytesToWrite = 0;
                memBuffersRequestQueue.push_back(buf);
                memBuffersResponseQueue.erase(it);
            }
            LOGV("Response queue size %d:", memBuffersResponseQueue.size());
            LOGV("Request queue size %d:", memBuffersRequestQueue.size());
            pthread_mutex_unlock(&mem_request_mutex);
            pthread_mutex_unlock(&mem_response_mutex);
            if (ioctl(afd, AUDIO_FLUSH, 0) < 0) {
                LOGE("Audio Flush failed");
            }
@@ -741,10 +759,13 @@ void LPAPlayer::decoderThreadEntry() {

    audio_register_memory();
    while (1) {
        LOGV("mem_request_mutex locking: %d", __LINE__);
        pthread_mutex_lock(&mem_request_mutex);

        LOGV("mem_request_mutex locked: %d", __LINE__);
        if (killDecoderThread) {
            LOGV("mem_request_mutex unlocking: %d", __LINE__);
            pthread_mutex_unlock(&mem_request_mutex);
            LOGV("mem_request_mutex unlocked: %d", __LINE__);
            break;
        }

@@ -758,26 +779,35 @@ void LPAPlayer::decoderThreadEntry() {
                 mReachedEOS, bIsA2DPEnabled, mAudioSinkOpen, asyncReset, mIsDriverStarted);
            LOGV("decoderThreadEntry: waiting on decoder_cv");
            pthread_cond_wait(&decoder_cv, &mem_request_mutex);
            LOGV("mem_request_mutex unlocking: %d", __LINE__);
            pthread_mutex_unlock(&mem_request_mutex);
            LOGV("decoderThreadEntry: received a signal to wake up");
            LOGV("mem_request_mutex unlocked: %d", __LINE__);
            continue;
        }

        List<BuffersAllocated>::iterator it = memBuffersRequestQueue.begin();
        BuffersAllocated buf = *it;
        memBuffersRequestQueue.erase(it);
        LOGV("mem_request_mutex unlocking: %d", __LINE__);
        pthread_mutex_unlock(&mem_request_mutex);
        LOGV("mem_request_mutex unlocked: %d", __LINE__);

        //Queue the buffers back to Request queue
        if (mReachedEOS || (bIsA2DPEnabled && !mAudioSinkOpen) || asyncReset || a2dpDisconnectPause) {
            LOGV("%s: mReachedEOS %d bIsA2DPEnabled %d ", __func__, mReachedEOS, bIsA2DPEnabled);
            LOGV("mem_request_mutex locking: %d", __LINE__);
            pthread_mutex_lock(&mem_request_mutex);
            LOGV("mem_request_mutex locked: %d", __LINE__);
            memBuffersRequestQueue.push_back(buf);
            LOGV("mem_request_mutex unlocking: %d", __LINE__);
            pthread_mutex_unlock(&mem_request_mutex);
            LOGV("mem_request_mutex unlocked: %d", __LINE__);
        }
        //Queue up the buffers for writing either for A2DP or LPA Driver
        else {
            struct msm_audio_aio_buf aio_buf_local;
            Mutex::Autolock autoLock(mSeekLock);
            if(bIsA2DPEnabled && isPaused){
                pthread_mutex_lock(&mem_response_mutex);
                buf.bytesToWrite = 0;
@@ -815,9 +845,13 @@ void LPAPlayer::decoderThreadEntry() {
                    }
                } else {
                    /* Put the buffer back into requestQ */
                    LOGV("mem_request_mutex locking: %d", __LINE__);
                    pthread_mutex_lock(&mem_request_mutex);
                    LOGV("mem_request_mutex locked: %d", __LINE__);
                    memBuffersRequestQueue.push_back(buf);
                    LOGV("mem_request_mutex unlocking: %d", __LINE__);
                    pthread_mutex_unlock(&mem_request_mutex);
                    LOGV("mem_request_mutex unlocked: %d", __LINE__);
                    /* This is zero byte buffer - no need to put in response Q*/
                    if (mObserver && mReachedEOS && memBuffersResponseQueue.empty()) {
                        LOGV("Posting EOS event to AwesomePlayer");
@@ -934,6 +968,14 @@ void LPAPlayer::eventThreadEntry() {
                    if (it->memBuf == cur_pcmdec_event.event_payload.aio_buf.buf_addr) {
                        buf = *it;
                        memBuffersResponseQueue.erase(it);
                        // Post buffer to request Q
                        LOGV("mem_request_mutex locking: %d", __LINE__);
                        pthread_mutex_lock(&mem_request_mutex);
                        LOGV("mem_request_mutex locked: %d", __LINE__);
                        memBuffersRequestQueue.push_back(buf);
                        LOGV("mem_request_mutex unlocking: %d", __LINE__);
                        pthread_mutex_unlock(&mem_request_mutex);
                        LOGV("mem_request_mutex unlocked: %d", __LINE__);
                        break;
                    }
                }
@@ -972,11 +1014,6 @@ void LPAPlayer::eventThreadEntry() {

                pthread_mutex_unlock(&mem_response_mutex);

                // Post buffer to request Q
                pthread_mutex_lock(&mem_request_mutex);
                memBuffersRequestQueue.push_back(buf);
                pthread_mutex_unlock(&mem_request_mutex);

                pthread_cond_signal(&decoder_cv);
            }
            break;
@@ -1084,7 +1121,9 @@ void LPAPlayer::A2DPThreadEntry() {
            LOGV("A2DPThreadEntry:: received signal to wake up");
            // A2DP got disabled -- Queue up everything back to Request Queue
            if (!bIsA2DPEnabled) {
                LOGV("mem_request_mutex locking: %d", __LINE__);
                pthread_mutex_lock(&mem_request_mutex);
                LOGV("mem_request_mutex locked: %d", __LINE__);
                while (!memBuffersResponseQueue.empty()) {
                    LOGV("BUF transfer");
                    List<BuffersAllocated>::iterator it = memBuffersResponseQueue.begin();
@@ -1092,7 +1131,9 @@ void LPAPlayer::A2DPThreadEntry() {
                    memBuffersRequestQueue.push_back(buf);
                    memBuffersResponseQueue.erase(it);
                }
                LOGV("mem_request_mutex unlocking: %d", __LINE__);
                pthread_mutex_unlock(&mem_request_mutex);
                LOGV("mem_request_mutex unlocked: %d", __LINE__);
            }
            pthread_mutex_unlock(&mem_response_mutex);
        }
@@ -1176,10 +1217,14 @@ void LPAPlayer::A2DPThreadEntry() {
                LOGV("Posting EOS event to AwesomePlayer");
                mObserver->postAudioEOS();
            }
            LOGV("mem_request_mutex locking: %d", __LINE__);
            pthread_mutex_lock(&mem_request_mutex);
            LOGV("mem_request_mutex locked: %d", __LINE__);
            memBuffersRequestQueue.push_back(buf);
            if (killA2DPThread) {
                LOGV("mem_request_mutex unlocking: %d", __LINE__);
                pthread_mutex_unlock(&mem_request_mutex);
                LOGV("mem_request_mutex unlocked: %d", __LINE__);
                break;
            }
            //flush out old buffer
@@ -1195,7 +1240,9 @@ void LPAPlayer::A2DPThreadEntry() {
                }
                pthread_mutex_unlock(&mem_response_mutex);
            }
            LOGV("mem_request_mutex unlocking: %d", __LINE__);
            pthread_mutex_unlock(&mem_request_mutex);
            LOGV("mem_request_mutex unlocked: %d", __LINE__);
            // Signal decoder thread when a buffer is put back to request Q
            pthread_cond_signal(&decoder_cv);
        }
@@ -1555,10 +1602,14 @@ void LPAPlayer::requestAndWaitForDecoderThreadExit() {
    if (!decoderThreadAlive)
        return;

    LOGV("mem_request_mutex locking: %d", __LINE__);
    pthread_mutex_lock(&mem_request_mutex);
    LOGV("mem_request_mutex locked: %d", __LINE__);
    killDecoderThread = true;
    pthread_cond_signal(&decoder_cv);
    LOGV("mem_request_mutex unlocking: %d", __LINE__);
    pthread_mutex_unlock(&mem_request_mutex);
    LOGV("mem_request_mutex unlocked: %d", __LINE__);
    pthread_join(decoderThread,NULL);
    LOGV("decoder thread killed");

+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ public class AnimatedImageView extends ImageView {
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        mAttached = true;
        updateAnim();
    }

    @Override
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
                            mLockPatternUtils.checkPassword(entry)) {
                            mCallback.keyguardDone(true);
                            mCallback.reportSuccessfulUnlockAttempt();
                            KeyStore.getInstance().password(entry);
                    }
                }
            }
+13 −2
Original line number Diff line number Diff line
@@ -322,8 +322,19 @@ void CameraService::loadSound() {
    LOG1("CameraService::loadSound ref=%d", mSoundRef);
    if (mSoundRef++) return;

    char value[PROPERTY_VALUE_MAX];
    property_get("ro.camera.sound.disabled", value, "0");
    int systemMute = atoi(value);
    property_get("persist.sys.camera-mute", value, "0");
    int userMute = atoi(value);

    if(!systemMute && !userMute) {
        mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
        mSoundPlayer[SOUND_RECORDING] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
    } else {
        mSoundPlayer[SOUND_SHUTTER] = NULL;
        mSoundPlayer[SOUND_RECORDING] = NULL;
    }
}

void CameraService::releaseSound() {
Loading