Merge "Do not allow file:// access when it is disabled. Do not merge." into ics-mr1
diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd
index 76b2516..62ebfee 100644
--- a/docs/html/guide/developing/device.jd
+++ b/docs/html/guide/developing/device.jd
@@ -252,6 +252,10 @@
<td><code>0FCE</code></td>
</tr>
<tr>
+ <td>Teleepoch</td>
+ <td><code>2340</code></td>
+ </tr>
+ <tr>
<td>Toshiba</td>
<td><code>0930</code></td>
</tr>
diff --git a/docs/html/sdk/oem-usb.jd b/docs/html/sdk/oem-usb.jd
index e4d2af8..b81be71 100644
--- a/docs/html/sdk/oem-usb.jd
+++ b/docs/html/sdk/oem-usb.jd
@@ -88,7 +88,7 @@
</tr>
<tr><td>Huawei</td> <td><a
-href="http://www.huaweidevice.com/worldwide/downloadCenter.do?method=list&flay=software&directoryId=20&treeId=0">http://www.huaweidevice.com/worldwide/downloadCenter.do?method=list&flay=software&directoryId=20&treeId=0</a></td>
+href="http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index">http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index</a></td>
</tr>
<tr><td>KT Tech</td> <td><a
@@ -122,7 +122,13 @@
</tr><tr><td>SK Telesys</td> <td><a
href="http://www.sk-w.com/service/wDownload/wDownload.jsp">http://www.sk-w.com/service/wDownload/wDownload.jsp</a></td></tr><tr>
<td>Sony Ericsson</td> <td><a
-href="http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en">http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en</a></td></tr><tr>
+href="http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en">http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en</a></td></tr>
+
+<tr><td>Teleepoch</td> <td><a
+href="http://www.teleepoch.com/android.html">http://www.teleepoch.com/android.html</a></td>
+</tr>
+
+<tr>
<td>ZTE</td> <td><a
href="http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442">http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442</a></td></tr>
</table>
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index e9ac3f9..060a632 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2111,7 +2111,15 @@
if (t->sampleRate() == (int)mSampleRate) {
minFrames = mFrameCount;
} else {
- minFrames = (mFrameCount * t->sampleRate()) / mSampleRate + 1;
+ // +1 for rounding and +1 for additional sample needed for interpolation
+ minFrames = (mFrameCount * t->sampleRate()) / mSampleRate + 1 + 1;
+ // add frames already consumed but not yet released by the resampler
+ // because cblk->framesReady() will include these frames
+ minFrames += mAudioMixer->getUnreleasedFrames(track->name());
+ // the minimum track buffer size is normally twice the number of frames necessary
+ // to fill one buffer and the resampler should not leave more than one buffer worth
+ // of unreleased frames after each pass, but just in case...
+ LOG_ASSERT(minFrames <= cblk->frameCount);
}
}
if ((cblk->framesReady() >= minFrames) && track->isReady() &&
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 6e9319d..1200f75 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -331,6 +331,23 @@
}
}
+size_t AudioMixer::track_t::getUnreleasedFrames()
+{
+ if (resampler != NULL) {
+ return resampler->getUnreleasedFrames();
+ }
+ return 0;
+}
+
+size_t AudioMixer::getUnreleasedFrames(int name)
+{
+ name -= TRACK0;
+ if (uint32_t(name) < MAX_NUM_TRACKS) {
+ track_t& track(mState.tracks[name]);
+ return track.getUnreleasedFrames();
+ }
+ return 0;
+}
status_t AudioMixer::setBufferProvider(AudioBufferProvider* buffer)
{
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 75c9170..0137185 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -91,6 +91,8 @@
static void ditherAndClamp(int32_t* out, int32_t const *sums, size_t c);
+ size_t getUnreleasedFrames(int name);
+
private:
enum {
@@ -167,6 +169,7 @@
bool doesResample() const;
void resetResampler();
void adjustVolumeRamp(bool aux);
+ size_t getUnreleasedFrames();
};
// pad to 32-bytes to fill cache line
diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h
index 9f06c1c..ffa690a 100644
--- a/services/audioflinger/AudioResampler.h
+++ b/services/audioflinger/AudioResampler.h
@@ -54,6 +54,7 @@
AudioBufferProvider* provider) = 0;
virtual void reset();
+ virtual size_t getUnreleasedFrames() { return mInputIndex; }
protected:
// number of bits for phase fraction - 30 bits allows nearly 2x downsampling