summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/content/Context.java2
-rw-r--r--core/java/android/view/HardwareRenderer.java26
-rw-r--r--core/java/android/widget/GridView.java13
-rw-r--r--core/jni/AndroidRuntime.cpp8
-rw-r--r--core/jni/android/graphics/BitmapFactory.cpp10
-rw-r--r--core/jni/android/graphics/Typeface.cpp8
-rw-r--r--core/jni/android/graphics/Utils.cpp8
-rw-r--r--core/jni/android/graphics/Utils.h2
-rw-r--r--core/jni/android_util_AssetManager.cpp2
-rw-r--r--core/res/res/values/styles.xml2
-rw-r--r--core/tests/coretests/src/android/webkit/AccessibilityInjectorTest.java2
11 files changed, 48 insertions, 35 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index b27f4cf..7ca6270 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -145,7 +145,7 @@ public abstract class Context {
* tied to the lifetime of the process rather than the current component.
*
* <p>Consider for example how this interacts with
- * {@ #registerReceiver(BroadcastReceiver, IntentFilter)}:
+ * {@link #registerReceiver(BroadcastReceiver, IntentFilter)}:
* <ul>
* <li> <p>If used from an Activity context, the receiver is being registered
* within that activity. This means that you are expected to unregister
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 0e294f7..5bb8c50 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -184,7 +184,7 @@ public abstract class HardwareRenderer {
}
/**
- * Indicates whether hardware acceleration is currently request but not
+ * Indicates whether hardware acceleration is currently requested but not
* necessarily enabled yet.
*
* @return True to request hardware acceleration, false otherwise.
@@ -275,19 +275,22 @@ public abstract class HardwareRenderer {
if (error != EGL10.EGL_SUCCESS) {
// something bad has happened revert to
// normal rendering.
- destroy(true);
- if (error != EGL11.EGL_CONTEXT_LOST) {
- // we'll try again if it was context lost
- setRequested(false);
- } else {
- Log.w(LOG_TAG, "Mountain View, we've had a problem here. "
- + "Switching back to software rendering.");
- }
+ fallback(error != EGL11.EGL_CONTEXT_LOST);
Log.w(LOG_TAG, "EGL error: " + getEGLErrorString(error));
}
}
}
+ private void fallback(boolean fallback) {
+ destroy(true);
+ if (fallback) {
+ // we'll try again if it was context lost
+ setRequested(false);
+ Log.w(LOG_TAG, "Mountain View, we've had a problem here. "
+ + "Switching back to software rendering.");
+ }
+ }
+
@Override
boolean initialize(SurfaceHolder holder) {
if (isRequested() && !isEnabled()) {
@@ -509,8 +512,9 @@ public abstract class HardwareRenderer {
if (sEgl.eglGetCurrentContext() != sEglContext ||
sEgl.eglGetCurrentSurface(EGL10.EGL_DRAW) != mEglSurface) {
if (!sEgl.eglMakeCurrent(sEglDisplay, mEglSurface, mEglSurface, sEglContext)) {
- throw new RuntimeException("eglMakeCurrent failed "
- + getEGLErrorString(sEgl.eglGetError()));
+ fallback(true);
+ Log.e(LOG_TAG, "eglMakeCurrent failed " +
+ getEGLErrorString(sEgl.eglGetError()));
}
}
}
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index 84bc5f2..df01da7 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -889,10 +889,11 @@ public class GridView extends AbsListView {
return sel;
}
- private void determineColumns(int availableSpace) {
+ private boolean determineColumns(int availableSpace) {
final int requestedHorizontalSpacing = mRequestedHorizontalSpacing;
final int stretchMode = mStretchMode;
final int requestedColumnWidth = mRequestedColumnWidth;
+ boolean didNotInitiallyFit = false;
if (mRequestedNumColumns == AUTO_FIT) {
if (requestedColumnWidth > 0) {
@@ -922,6 +923,11 @@ public class GridView extends AbsListView {
default:
int spaceLeftOver = availableSpace - (mNumColumns * requestedColumnWidth) -
((mNumColumns - 1) * requestedHorizontalSpacing);
+
+ if (spaceLeftOver < 0) {
+ didNotInitiallyFit = true;
+ }
+
switch (stretchMode) {
case STRETCH_COLUMN_WIDTH:
// Stretch the columns
@@ -954,6 +960,7 @@ public class GridView extends AbsListView {
break;
}
+ return didNotInitiallyFit;
}
@Override
@@ -976,7 +983,7 @@ public class GridView extends AbsListView {
}
int childWidth = widthSize - mListPadding.left - mListPadding.right;
- determineColumns(childWidth);
+ boolean didNotInitiallyFit = determineColumns(childWidth);
int childHeight = 0;
int childState = 0;
@@ -1035,7 +1042,7 @@ public class GridView extends AbsListView {
int ourSize = (mRequestedNumColumns*mColumnWidth)
+ ((mRequestedNumColumns-1)*mHorizontalSpacing)
+ mListPadding.left + mListPadding.right;
- if (ourSize > widthSize) {
+ if (ourSize > widthSize || didNotInitiallyFit) {
widthSize |= MEASURED_STATE_TOO_SMALL;
}
}
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 98bdb52..07505a5 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -626,14 +626,16 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
mOptions.add(opt);
//options[curOpt++].optionString = "-verbose:class";
+ /*
+ * The default starting and maximum size of the heap. Larger
+ * values should be specified in a product property override.
+ */
strcpy(heapstartsizeOptsBuf, "-Xms");
- property_get("dalvik.vm.heapstartsize", heapstartsizeOptsBuf+4, "2m");
+ property_get("dalvik.vm.heapstartsize", heapstartsizeOptsBuf+4, "4m");
opt.optionString = heapstartsizeOptsBuf;
mOptions.add(opt);
-
strcpy(heapsizeOptsBuf, "-Xmx");
property_get("dalvik.vm.heapsize", heapsizeOptsBuf+4, "16m");
- //LOGI("Heap size: %s", heapsizeOptsBuf);
opt.optionString = heapsizeOptsBuf;
mOptions.add(opt);
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index e72e2b6..b9c93b8 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -322,12 +322,12 @@ static jobject nativeDecodeStream(JNIEnv* env, jobject clazz,
}
static ssize_t getFDSize(int fd) {
- off_t curr = ::lseek(fd, 0, SEEK_CUR);
+ off64_t curr = ::lseek64(fd, 0, SEEK_CUR);
if (curr < 0) {
return 0;
}
size_t size = ::lseek(fd, 0, SEEK_END);
- ::lseek(fd, curr, SEEK_SET);
+ ::lseek64(fd, curr, SEEK_SET);
return size;
}
@@ -374,8 +374,8 @@ static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz,
*/
static SkStream* copyAssetToStream(Asset* asset) {
// if we could "ref/reopen" the asset, we may not need to copy it here
- off_t size = asset->seek(0, SEEK_SET);
- if ((off_t)-1 == size) {
+ off64_t size = asset->seek(0, SEEK_SET);
+ if ((off64_t)-1 == size) {
SkDebugf("---- copyAsset: asset rewind failed\n");
return NULL;
}
@@ -388,7 +388,7 @@ static SkStream* copyAssetToStream(Asset* asset) {
SkStream* stream = new SkMemoryStream(size);
void* data = const_cast<void*>(stream->getMemoryBase());
- off_t len = asset->read(data, size);
+ off64_t len = asset->read(data, size);
if (len != size) {
SkDebugf("---- copyAsset: asset->read(%d) returned %d\n", size, len);
delete stream;
diff --git a/core/jni/android/graphics/Typeface.cpp b/core/jni/android/graphics/Typeface.cpp
index 1fe72e6..53a5c0a 100644
--- a/core/jni/android/graphics/Typeface.cpp
+++ b/core/jni/android/graphics/Typeface.cpp
@@ -72,8 +72,8 @@ public:
virtual bool rewind()
{
- off_t pos = fAsset->seek(0, SEEK_SET);
- return pos != (off_t)-1;
+ off64_t pos = fAsset->seek(0, SEEK_SET);
+ return pos != (off64_t)-1;
}
virtual size_t read(void* buffer, size_t size)
@@ -88,10 +88,10 @@ public:
// asset->seek returns new total offset
// we want to return amount that was skipped
- off_t oldOffset = fAsset->seek(0, SEEK_CUR);
+ off64_t oldOffset = fAsset->seek(0, SEEK_CUR);
if (-1 == oldOffset)
return 0;
- off_t newOffset = fAsset->seek(size, SEEK_CUR);
+ off64_t newOffset = fAsset->seek(size, SEEK_CUR);
if (-1 == newOffset)
return 0;
diff --git a/core/jni/android/graphics/Utils.cpp b/core/jni/android/graphics/Utils.cpp
index b6ead19..cf6977e 100644
--- a/core/jni/android/graphics/Utils.cpp
+++ b/core/jni/android/graphics/Utils.cpp
@@ -20,8 +20,8 @@
using namespace android;
bool AssetStreamAdaptor::rewind() {
- off_t pos = fAsset->seek(0, SEEK_SET);
- if (pos == (off_t)-1) {
+ off64_t pos = fAsset->seek(0, SEEK_SET);
+ if (pos == (off64_t)-1) {
SkDebugf("----- fAsset->seek(rewind) failed\n");
return false;
}
@@ -38,12 +38,12 @@ size_t AssetStreamAdaptor::read(void* buffer, size_t size) {
// asset->seek returns new total offset
// we want to return amount that was skipped
- off_t oldOffset = fAsset->seek(0, SEEK_CUR);
+ off64_t oldOffset = fAsset->seek(0, SEEK_CUR);
if (-1 == oldOffset) {
SkDebugf("---- fAsset->seek(oldOffset) failed\n");
return 0;
}
- off_t newOffset = fAsset->seek(size, SEEK_CUR);
+ off64_t newOffset = fAsset->seek(size, SEEK_CUR);
if (-1 == newOffset) {
SkDebugf("---- fAsset->seek(%d) failed\n", size);
return 0;
diff --git a/core/jni/android/graphics/Utils.h b/core/jni/android/graphics/Utils.h
index 2de41a1..9a7a697 100644
--- a/core/jni/android/graphics/Utils.h
+++ b/core/jni/android/graphics/Utils.h
@@ -51,7 +51,7 @@ public:
}
private:
int fFD;
- off_t fCurr;
+ off64_t fCurr;
};
jobject nullObjectReturn(const char msg[]);
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 2528db1..619a293 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -149,7 +149,7 @@ static jint android_content_AssetManager_openAsset(JNIEnv* env, jobject clazz,
static jobject returnParcelFileDescriptor(JNIEnv* env, Asset* a, jlongArray outOffsets)
{
- off_t startOffset, length;
+ off64_t startOffset, length;
int fd = a->openFileDescriptor(&startOffset, &length);
delete a;
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 8d7556f..743169a 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -251,7 +251,7 @@
<style name="Widget.AbsListView">
<item name="android:scrollbars">vertical</item>
- <item name="android:fadingEdge">none</item>
+ <item name="android:fadingEdge">vertical</item>
</style>
<style name="Widget.GestureOverlayView">
diff --git a/core/tests/coretests/src/android/webkit/AccessibilityInjectorTest.java b/core/tests/coretests/src/android/webkit/AccessibilityInjectorTest.java
index 9c9d9fe..955f5e8 100644
--- a/core/tests/coretests/src/android/webkit/AccessibilityInjectorTest.java
+++ b/core/tests/coretests/src/android/webkit/AccessibilityInjectorTest.java
@@ -45,7 +45,7 @@ public class AccessibilityInjectorTest extends AndroidTestCase {
private static final long TIMEOUT_WAIT_FOR_SELECTION_STRING = 1000;
/** The timeout to wait for accessibility and the mock service to be enabled. */
- private static final long TIMEOUT_ENABLE_ACCESSIBILITY_AND_MOCK_SERVICE = 500;
+ private static final long TIMEOUT_ENABLE_ACCESSIBILITY_AND_MOCK_SERVICE = 1000;
/** The count of tests to detect when to shut down the service. */
private static final int TEST_CASE_COUNT = 8;