If both cookies have null values, use the name difference.
Change-Id: Idee9763a14dd559f136ee8b1eea9abaf265d15a1
diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java
index 379b425..427ce76 100644
--- a/core/java/android/webkit/CookieManager.java
+++ b/core/java/android/webkit/CookieManager.java
@@ -219,7 +219,11 @@
// If cookie2 has a null value, it should come later in
// the list.
if (cookie2.value == null) {
- return -1;
+ // If both cookies have null values, fall back to using the name
+ // difference.
+ if (cookie1.value != null) {
+ return -1;
+ }
} else if (cookie1.value == null) {
// Now we know that cookie2 does not have a null value, if
// cookie1 has a null value, place it later in the list.