diff options
18 files changed, 69 insertions, 31 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 91ede5db5563..790a04023330 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -350,6 +350,7 @@ public class WebView extends AbsoluteLayout private ZoomManager mZoomManager; private Rect mGLRectViewport = new Rect(); + private boolean mGLViewportEmpty = false; /** * Transportation object for returning WebView across thread boundaries. @@ -4075,7 +4076,8 @@ public class WebView extends AbsoluteLayout } if (canvas.isHardwareAccelerated()) { - int functor = nativeGetDrawGLFunction(mGLRectViewport, getScale(), extras); + int functor = nativeGetDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport, + getScale(), extras); ((HardwareCanvas) canvas).callDrawGLFunction(functor); } else { DrawFilter df = null; @@ -5159,16 +5161,21 @@ public class WebView extends AbsoluteLayout void setGLRectViewport() { // Use the getGlobalVisibleRect() to get the intersection among the parents - getGlobalVisibleRect(mGLRectViewport); - - // Then need to invert the Y axis, just for GL - View rootView = getRootView(); - int rootViewHeight = rootView.getHeight(); - int savedWebViewBottom = mGLRectViewport.bottom; - mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight(); - mGLRectViewport.top = rootViewHeight - savedWebViewBottom; - - nativeUpdateDrawGLFunction(mGLRectViewport); + // visible == false means we're clipped - send a null rect down to indicate that + // we should not draw + boolean visible = getGlobalVisibleRect(mGLRectViewport); + if (visible) { + // Then need to invert the Y axis, just for GL + View rootView = getRootView(); + int rootViewHeight = rootView.getHeight(); + int savedWebViewBottom = mGLRectViewport.bottom; + mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight(); + mGLRectViewport.top = rootViewHeight - savedWebViewBottom; + mGLViewportEmpty = false; + } else { + mGLViewportEmpty = true; + } + nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport); } /** diff --git a/core/res/res/drawable-hdpi/stat_notify_chat.png b/core/res/res/drawable-hdpi/stat_notify_chat.png Binary files differindex b2e65c627380..9c713c8f2738 100644 --- a/core/res/res/drawable-hdpi/stat_notify_chat.png +++ b/core/res/res/drawable-hdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-mdpi/stat_notify_chat.png b/core/res/res/drawable-mdpi/stat_notify_chat.png Binary files differindex f98b032bcc4b..91b429008ef6 100644 --- a/core/res/res/drawable-mdpi/stat_notify_chat.png +++ b/core/res/res/drawable-mdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png Binary files differindex e936faceda63..8cc5535c21e1 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png Binary files differindex eb626df39878..4441ba20b86a 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png Binary files differindex d6bc7d30cddb..73891a387641 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png Binary files differindex 8c8f25dbc171..db68eeae3357 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png Binary files differindex 661cc2ff47b8..7af6921a84f1 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png Binary files differindex b2d71862c8cc..22adc672d9d2 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png Binary files differindex 36ab1ff76f47..c434d12449bf 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png Binary files differindex a14b3c7d0e7c..daf3b84fb413 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png Binary files differindex 81a66c112876..7b097b157d10 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png Binary files differindex a286ac611169..8daef7cbbe08 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp index 77917b3a793d..3e710dc4a7b3 100644 --- a/media/libstagefright/rtsp/ASessionDescription.cpp +++ b/media/libstagefright/rtsp/ASessionDescription.cpp @@ -254,26 +254,12 @@ bool ASessionDescription::getDurationUs(int64_t *durationUs) const { return false; } - if (value == "npt=now-" || value == "npt=0-") { - return false; - } - if (strncmp(value.c_str(), "npt=", 4)) { return false; } - const char *s = value.c_str() + 4; - char *end; - double from = strtod(s, &end); - - if (end == s || *end != '-') { - return false; - } - - s = end + 1; - double to = strtod(s, &end); - - if (end == s || *end != '\0' || to < from) { + float from, to; + if (!parseNTPRange(value.c_str() + 4, &from, &to)) { return false; } @@ -307,5 +293,39 @@ void ASessionDescription::ParseFormatDesc( } } +// static +bool ASessionDescription::parseNTPRange( + const char *s, float *npt1, float *npt2) { + if (s[0] == '-') { + return false; // no start time available. + } + + if (!strncmp("now", s, 3)) { + return false; // no absolute start time available + } + + char *end; + *npt1 = strtof(s, &end); + + if (end == s || *end != '-') { + // Failed to parse float or trailing "dash". + return false; + } + + s = end + 1; // skip the dash. + + if (!strncmp("now", s, 3)) { + return false; // no absolute end time available + } + + *npt2 = strtof(s, &end); + + if (end == s || *end != '\0') { + return false; + } + + return *npt2 > *npt1; +} + } // namespace android diff --git a/media/libstagefright/rtsp/ASessionDescription.h b/media/libstagefright/rtsp/ASessionDescription.h index a3fa79ed5a00..b4629834b68d 100644 --- a/media/libstagefright/rtsp/ASessionDescription.h +++ b/media/libstagefright/rtsp/ASessionDescription.h @@ -55,6 +55,14 @@ struct ASessionDescription : public RefBase { bool findAttribute(size_t index, const char *key, AString *value) const; + // parses strings of the form + // npt := npt-time "-" npt-time? | "-" npt-time + // npt-time := "now" | [0-9]+("." [0-9]*)? + // + // Returns true iff both "npt1" and "npt2" times were available, + // i.e. we have a fixed duration, otherwise this is live streaming. + static bool parseNTPRange(const char *s, float *npt1, float *npt2); + protected: virtual ~ASessionDescription(); diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index 9bb8c46453b0..306a9c1c260b 100644 --- a/media/libstagefright/rtsp/MyHandler.h +++ b/media/libstagefright/rtsp/MyHandler.h @@ -938,13 +938,11 @@ struct MyHandler : public AHandler { AString val; CHECK(GetAttribute(range.c_str(), "npt", &val)); - float npt1, npt2; - if (val == "now-" || val == "0-") { + float npt1, npt2; + if (!ASessionDescription::parseNTPRange(val.c_str(), &npt1, &npt2)) { // This is a live stream and therefore not seekable. return; - } else { - CHECK_EQ(sscanf(val.c_str(), "%f-%f", &npt1, &npt2), 2); } i = response->mHeaders.indexOfKey("rtp-info"); diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java index 19e7faeaeb88..a7f786664fec 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java @@ -1069,6 +1069,8 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { cdmaDataConnectionState = newCdmaDataConnectionState; networkType = newNetworkType; + // this new state has been applied - forget it until we get a new new state + newNetworkType = 0; newSS.setStateOutOfService(); // clean slate for next time diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java index c107d174919f..bb99e4564c1d 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java @@ -957,6 +957,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker { gprsState = newGPRSState; networkType = newNetworkType; + // this new state has been applied - forget it until we get a new new state + newNetworkType = 0; + newSS.setStateOutOfService(); // clean slate for next time |