diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 2 | ||||
| -rw-r--r-- | core/java/android/net/http/HttpResponseCache.java | 15 | ||||
| -rw-r--r-- | core/java/android/util/SparseArray.java | 18 |
3 files changed, 19 insertions, 16 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 2b15afd..4881d14 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -431,7 +431,7 @@ public class InputMethodService extends AbstractInputMethodService { } } // If user uses hard keyboard, IME button should always be shown. - boolean showing = onEvaluateInputViewShown(); + boolean showing = isInputViewShown(); mImm.setImeWindowStatus(mToken, IME_ACTIVE | (showing ? IME_VISIBLE : 0), mBackDisposition); if (resultReceiver != null) { diff --git a/core/java/android/net/http/HttpResponseCache.java b/core/java/android/net/http/HttpResponseCache.java index 73f3d7c..4e986a9 100644 --- a/core/java/android/net/http/HttpResponseCache.java +++ b/core/java/android/net/http/HttpResponseCache.java @@ -17,21 +17,21 @@ package android.net.http; import android.content.Context; +import com.android.okhttp.OkResponseCache; +import com.android.okhttp.ResponseSource; +import com.android.okhttp.internal.DiskLruCache; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.net.CacheRequest; import java.net.CacheResponse; -import java.net.ExtendedResponseCache; import java.net.HttpURLConnection; import java.net.ResponseCache; -import java.net.ResponseSource; import java.net.URI; import java.net.URLConnection; import java.util.List; import java.util.Map; import javax.net.ssl.HttpsURLConnection; -import libcore.io.DiskLruCache; import libcore.io.IoUtils; import org.apache.http.impl.client.DefaultHttpClient; @@ -152,12 +152,12 @@ import org.apache.http.impl.client.DefaultHttpClient; * }}</pre> */ public final class HttpResponseCache extends ResponseCache - implements Closeable, ExtendedResponseCache { + implements Closeable, OkResponseCache { - private final libcore.net.http.HttpResponseCache delegate; + private final com.android.okhttp.internal.http.HttpResponseCache delegate; private HttpResponseCache(File directory, long maxSize) throws IOException { - this.delegate = new libcore.net.http.HttpResponseCache(directory, maxSize); + this.delegate = new com.android.okhttp.internal.http.HttpResponseCache(directory, maxSize); } /** @@ -274,7 +274,8 @@ public final class HttpResponseCache extends ResponseCache } /** @hide */ - @Override public void update(CacheResponse conditionalCacheHit, HttpURLConnection connection) { + @Override public void update(CacheResponse conditionalCacheHit, HttpURLConnection connection) + throws IOException { delegate.update(conditionalCacheHit, connection); } diff --git a/core/java/android/util/SparseArray.java b/core/java/android/util/SparseArray.java index 366abd3..7e8fee5 100644 --- a/core/java/android/util/SparseArray.java +++ b/core/java/android/util/SparseArray.java @@ -118,7 +118,7 @@ public class SparseArray<E> implements Cloneable { mGarbage = true; } } - + private void gc() { // Log.e("SparseArray", "gc start with " + mSize); @@ -214,7 +214,7 @@ public class SparseArray<E> implements Cloneable { /** * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this - * SparseArray stores. + * SparseArray stores. */ public int keyAt(int index) { if (mGarbage) { @@ -223,11 +223,11 @@ public class SparseArray<E> implements Cloneable { return mKeys[index]; } - + /** * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this - * SparseArray stores. + * SparseArray stores. */ @SuppressWarnings("unchecked") public E valueAt(int index) { @@ -241,7 +241,7 @@ public class SparseArray<E> implements Cloneable { /** * Given an index in the range <code>0...size()-1</code>, sets a new * value for the <code>index</code>th key-value mapping that this - * SparseArray stores. + * SparseArray stores. */ public void setValueAt(int index, E value) { if (mGarbage) { @@ -250,7 +250,7 @@ public class SparseArray<E> implements Cloneable { mValues[index] = value; } - + /** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified @@ -268,9 +268,11 @@ public class SparseArray<E> implements Cloneable { * Returns an index for which {@link #valueAt} would return the * specified key, or a negative number if no keys map to the * specified value. - * Beware that this is a linear search, unlike lookups by key, + * <p>Beware that this is a linear search, unlike lookups by key, * and that multiple keys can map to the same value and this will * find only one of them. + * <p>Note also that unlike most collections' {@code indexOf} methods, + * this method compares values using {@code ==} rather than {@code equals}. */ public int indexOfValue(E value) { if (mGarbage) { @@ -332,7 +334,7 @@ public class SparseArray<E> implements Cloneable { mValues[pos] = value; mSize = pos + 1; } - + private static int binarySearch(int[] a, int start, int len, int key) { int high = start + len, low = start - 1, guess; |
