Merge "Fix the build"
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index f09e29d..dbcea71 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -742,7 +742,8 @@
             url = url.replaceFirst(ANDROID_ASSET, "");
             try {
                 AssetManager assets = mContext.getAssets();
-                return assets.open(url, AssetManager.ACCESS_STREAMING);
+                Uri uri = Uri.parse(url);
+                return assets.open(uri.getPath(), AssetManager.ACCESS_STREAMING);
             } catch (IOException e) {
                 return null;
             }
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index fc08cc5..60dd55c 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -29,8 +29,8 @@
 import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
-
 import com.android.internal.R;
+import android.widget.RemoteViews.RemoteView;
 
 import java.lang.reflect.Array;
 import java.util.ArrayList;
@@ -146,6 +146,7 @@
  * @attr ref android.R.styleable#GridLayout_rowOrderPreserved
  * @attr ref android.R.styleable#GridLayout_columnOrderPreserved
  */
+@RemoteView
 public class GridLayout extends ViewGroup {
 
     // Public constants
@@ -234,7 +235,6 @@
 
     final Axis horizontalAxis = new Axis(true);
     final Axis verticalAxis = new Axis(false);
-    boolean layoutParamsValid = false;
     int orientation = DEFAULT_ORIENTATION;
     boolean useDefaultMargins = DEFAULT_USE_DEFAULT_MARGINS;
     int alignmentMode = DEFAULT_ALIGNMENT_MODE;
@@ -713,12 +713,10 @@
 
             minor = minor + minorSpan;
         }
-        lastLayoutParamsHashCode = computeLayoutParamsHashCode();
-        invalidateStructure();
     }
 
     private void invalidateStructure() {
-        layoutParamsValid = false;
+        lastLayoutParamsHashCode = UNINITIALIZED_HASH;
         horizontalAxis.invalidateStructure();
         verticalAxis.invalidateStructure();
         // This can end up being done twice. Better twice than not at all.
@@ -742,10 +740,6 @@
     }
 
     final LayoutParams getLayoutParams(View c) {
-        if (!layoutParamsValid) {
-            validateLayoutParams();
-            layoutParamsValid = true;
-        }
         return (LayoutParams) c.getLayoutParams();
     }
 
@@ -874,20 +868,22 @@
         return result;
     }
 
-    private void checkForLayoutParamsModification() {
-        int layoutParamsHashCode = computeLayoutParamsHashCode();
-        if (lastLayoutParamsHashCode != UNINITIALIZED_HASH &&
-                lastLayoutParamsHashCode != layoutParamsHashCode) {
-            invalidateStructure();
+    private void consistencyCheck() {
+        if (lastLayoutParamsHashCode == UNINITIALIZED_HASH) {
+            validateLayoutParams();
+            lastLayoutParamsHashCode = computeLayoutParamsHashCode();
+        } else if (lastLayoutParamsHashCode != computeLayoutParamsHashCode()) {
             Log.w(TAG, "The fields of some layout parameters were modified in between layout " +
                     "operations. Check the javadoc for GridLayout.LayoutParams#rowSpec.");
+            invalidateStructure();
+            consistencyCheck();
         }
     }
 
     // Measurement
 
     private void measureChildWithMargins2(View child, int parentWidthSpec, int parentHeightSpec,
-                                          int childWidth, int childHeight) {
+            int childWidth, int childHeight) {
         int childWidthSpec = getChildMeasureSpec(parentWidthSpec,
                 mPaddingLeft + mPaddingRight + getTotalMargin(child, true), childWidth);
         int childHeightSpec = getChildMeasureSpec(parentHeightSpec,
@@ -923,7 +919,7 @@
 
     @Override
     protected void onMeasure(int widthSpec, int heightSpec) {
-        checkForLayoutParamsModification();
+        consistencyCheck();
 
         /** If we have been called by {@link View#measure(int, int)}, one of width or height
          *  is  likely to have changed. We must invalidate if so. */
@@ -993,7 +989,7 @@
      */
     @Override
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        checkForLayoutParamsModification();
+        consistencyCheck();
 
         int targetWidth = right - left;
         int targetHeight = bottom - top;
@@ -1250,7 +1246,7 @@
         }
 
         private void include(List<Arc> arcs, Interval key, MutableInt size,
-                             boolean ignoreIfAlreadyPresent) {
+                boolean ignoreIfAlreadyPresent) {
             /*
             Remove self referential links.
             These appear:
@@ -1429,8 +1425,8 @@
                 int dst = arc.span.max;
                 int value = arc.value.value;
                 result.append((src < dst) ?
-                        var + dst + " - " + var + src + " > " + value :
-                        var + src + " - " + var + dst + " < " + -value);
+                        var + dst + "-" + var + src + ">=" + value :
+                        var + src + "-" + var + dst + "<=" + -value);
 
             }
             return result.toString();